@@ -50,7 +50,7 @@ abstract public class EditorToolbar extends JPanel {
5050
5151 protected EditorButton runButton ;
5252 protected EditorButton stopButton ;
53- protected EditorButton currentButton ;
53+ // protected EditorButton currentButton;
5454
5555 protected Box box ;
5656 protected JLabel label ;
@@ -96,14 +96,20 @@ public void actionPerformed(ActionEvent e) {
9696
9797 box = Box .createHorizontalBox ();
9898 box .add (Box .createHorizontalStrut (Editor .LEFT_GUTTER ));
99+
99100 box .add (runButton );
101+ box .add (Box .createHorizontalStrut (GAP ));
102+ box .add (stopButton );
100103
101104 box .add (Box .createHorizontalStrut (LABEL_GAP ));
102105 label = new JLabel ();
103- label .setFont (mode .getFont ("toolbar.sketch .font" ));
104- label .setForeground (mode .getColor ("toolbar.sketch .color" ));
106+ label .setFont (mode .getFont ("toolbar.rollover .font" ));
107+ label .setForeground (mode .getColor ("toolbar.rollover .color" ));
105108 box .add (label );
106- currentButton = runButton ;
109+ // currentButton = runButton;
110+
111+ runButton .setRolloverLabel (label );
112+ stopButton .setRolloverLabel (label );
107113
108114 box .add (Box .createHorizontalGlue ());
109115 addModeButtons (box );
@@ -125,9 +131,9 @@ public void actionPerformed(ActionEvent e) {
125131// }
126132
127133
128- public void setText (String text ) {
129- label .setText (text );
130- }
134+ // public void setText(String text) {
135+ // label.setText(text);
136+ // }
131137
132138
133139 public void paintComponent (Graphics g ) {
@@ -152,22 +158,22 @@ public void addGap(Box box) {
152158// }
153159
154160
155- protected void swapButton (EditorButton replacement ) {
156- if (currentButton != replacement ) {
157- box .remove (currentButton );
158- box .add (replacement , 1 ); // has to go after the strut
159- box .revalidate ();
160- box .repaint (); // may be needed
161- currentButton = replacement ;
162- }
163- }
161+ // protected void swapButton(EditorButton replacement) {
162+ // if (currentButton != replacement) {
163+ // box.remove(currentButton);
164+ // box.add(replacement, 1); // has to go after the strut
165+ // box.revalidate();
166+ // box.repaint(); // may be needed
167+ // currentButton = replacement;
168+ // }
169+ // }
164170
165171
166172 public void activateRun () {
167- //runButton.setPressed(true);
168- // Rectangle bounds = runButton.getBounds();
169- // remove(runButton);
170- swapButton (stopButton );
173+ // //runButton.setPressed(true);
174+ //// Rectangle bounds = runButton.getBounds();
175+ //// remove(runButton);
176+ // swapButton(stopButton);
171177 }
172178
173179
@@ -181,7 +187,7 @@ public void activateStop() {
181187
182188
183189 public void deactivateStop () {
184- swapButton (runButton );
190+ // swapButton(runButton);
185191 }
186192
187193
@@ -218,14 +224,16 @@ class ModeSelector extends JPanel {
218224
219225 final int MODE_GAP_WIDTH = 13 ;
220226 final int ARROW_GAP_WIDTH = 6 ;
221- final int ARROW_WIDTH = 8 ;
222- final int ARROW_TOP = 21 ;
223- final int ARROW_BOTTOM = 29 ;
227+ final int ARROW_WIDTH = 6 ;
228+ final int ARROW_TOP = 15 ;
229+ final int ARROW_BOTTOM = 21 ;
224230
225231 int [] triangleX = new int [3 ];
226232 int [] triangleY = new int [] { ARROW_TOP , ARROW_TOP , ARROW_BOTTOM };
227233
228- Image background ;
234+ // Image background;
235+ Color backgroundColor ;
236+
229237
230238 @ SuppressWarnings ("deprecation" )
231239 public ModeSelector () {
@@ -243,7 +251,8 @@ public void mousePressed(MouseEvent event) {
243251 }
244252 });
245253
246- background = mode .getGradient ("reversed" , 100 , EditorButton .DIM );
254+ //background = mode.getGradient("reversed", 100, EditorButton.DIM);
255+ backgroundColor = mode .getColor ("mode.background.color" );
247256 }
248257
249258 @ Override
@@ -276,10 +285,12 @@ public void paintComponent(Graphics screen) {
276285 FontMetrics metrics = g .getFontMetrics ();
277286 titleWidth = metrics .stringWidth (title );
278287
279- g .drawImage (background , 0 , 0 , width , height , this );
288+ //g.drawImage(background, 0, 0, width, height, this);
289+ g .setColor (backgroundColor );
290+ g .fillRect (0 , 0 , width , height );
280291
281292 g .setColor (titleColor );
282- g .drawString (title , MODE_GAP_WIDTH , (height + titleAscent ) / 2 );
293+ g .drawString (title . toUpperCase () , MODE_GAP_WIDTH , (height + titleAscent ) / 2 );
283294
284295 int x = MODE_GAP_WIDTH + titleWidth + ARROW_GAP_WIDTH ;
285296 triangleX [0 ] = x ;
0 commit comments