< prev index next >

src/java.desktop/share/classes/javax/swing/plaf/metal/MetalSplitPaneDivider.java

Print this page




 168                                             if (buffer[j-1][i-1] == 0) {
 169                                                     // Nothing needs
 170                                                     // to be drawn
 171                                                     continue;
 172                                             }
 173                                             else {
 174                                                     // Set the color from the
 175                                                     // color map
 176                                                     g.setColor(
 177                                                     colors[buffer[j-1][i-1]]);
 178                                             }
 179                                             // Draw a pixel
 180                                             g.drawLine(j, i, j, i);
 181                                     }
 182                             }
 183                     }
 184                 }
 185             }
 186 
 187             // Don't want the button to participate in focus traversable.

 188             public boolean isFocusTraversable() {
 189                 return false;
 190             }
 191         };
 192         b.setRequestFocusEnabled(false);
 193         b.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
 194         b.setFocusPainted(false);
 195         b.setBorderPainted(false);
 196         maybeMakeButtonOpaque(b);
 197         return b;
 198     }
 199 
 200     /**
 201      * If necessary <code>c</code> is made opaque.
 202      */
 203     private void maybeMakeButtonOpaque(JComponent c) {
 204         Object opaque = UIManager.get("SplitPane.oneTouchButtonsOpaque");
 205         if (opaque != null) {
 206             c.setOpaque(((Boolean)opaque).booleanValue());
 207         }


 277                                             if (buffer[j-1][i-1] == 0) {
 278                                                     // Nothing needs
 279                                                     // to be drawn
 280                                                     continue;
 281                                             }
 282                                             else {
 283                                                     // Set the color from the
 284                                                     // color map
 285                                                     g.setColor(
 286                                                     colors[buffer[j-1][i-1]]);
 287                                             }
 288                                             // Draw a pixel
 289                                             g.drawLine(j, i, j, i);
 290                                     }
 291                             }
 292                     }
 293                 }
 294             }
 295 
 296             // Don't want the button to participate in focus traversable.

 297             public boolean isFocusTraversable() {
 298                 return false;
 299             }
 300         };
 301         b.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
 302         b.setFocusPainted(false);
 303         b.setBorderPainted(false);
 304         b.setRequestFocusEnabled(false);
 305         maybeMakeButtonOpaque(b);
 306         return b;
 307     }
 308 
 309     /**
 310      * Used to layout a MetalSplitPaneDivider. Layout for the divider
 311      * involves appropriately moving the left/right buttons around.
 312      * <p>
 313      * This class should be treated as a &quot;protected&quot; inner class.
 314      * Instantiate it only within subclasses of MetalSplitPaneDivider.
 315      */
 316     public class MetalDividerLayout implements LayoutManager {




 168                                             if (buffer[j-1][i-1] == 0) {
 169                                                     // Nothing needs
 170                                                     // to be drawn
 171                                                     continue;
 172                                             }
 173                                             else {
 174                                                     // Set the color from the
 175                                                     // color map
 176                                                     g.setColor(
 177                                                     colors[buffer[j-1][i-1]]);
 178                                             }
 179                                             // Draw a pixel
 180                                             g.drawLine(j, i, j, i);
 181                                     }
 182                             }
 183                     }
 184                 }
 185             }
 186 
 187             // Don't want the button to participate in focus traversable.
 188             @SuppressWarnings("deprecation")
 189             public boolean isFocusTraversable() {
 190                 return false;
 191             }
 192         };
 193         b.setRequestFocusEnabled(false);
 194         b.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
 195         b.setFocusPainted(false);
 196         b.setBorderPainted(false);
 197         maybeMakeButtonOpaque(b);
 198         return b;
 199     }
 200 
 201     /**
 202      * If necessary <code>c</code> is made opaque.
 203      */
 204     private void maybeMakeButtonOpaque(JComponent c) {
 205         Object opaque = UIManager.get("SplitPane.oneTouchButtonsOpaque");
 206         if (opaque != null) {
 207             c.setOpaque(((Boolean)opaque).booleanValue());
 208         }


 278                                             if (buffer[j-1][i-1] == 0) {
 279                                                     // Nothing needs
 280                                                     // to be drawn
 281                                                     continue;
 282                                             }
 283                                             else {
 284                                                     // Set the color from the
 285                                                     // color map
 286                                                     g.setColor(
 287                                                     colors[buffer[j-1][i-1]]);
 288                                             }
 289                                             // Draw a pixel
 290                                             g.drawLine(j, i, j, i);
 291                                     }
 292                             }
 293                     }
 294                 }
 295             }
 296 
 297             // Don't want the button to participate in focus traversable.
 298             @SuppressWarnings("deprecation")
 299             public boolean isFocusTraversable() {
 300                 return false;
 301             }
 302         };
 303         b.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
 304         b.setFocusPainted(false);
 305         b.setBorderPainted(false);
 306         b.setRequestFocusEnabled(false);
 307         maybeMakeButtonOpaque(b);
 308         return b;
 309     }
 310 
 311     /**
 312      * Used to layout a MetalSplitPaneDivider. Layout for the divider
 313      * involves appropriately moving the left/right buttons around.
 314      * <p>
 315      * This class should be treated as a &quot;protected&quot; inner class.
 316      * Instantiate it only within subclasses of MetalSplitPaneDivider.
 317      */
 318     public class MetalDividerLayout implements LayoutManager {


< prev index next >