Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.swing.plaf.basic
Class BasicBorders.SplitPaneBorder  view BasicBorders.SplitPaneBorder download BasicBorders.SplitPaneBorder.java

java.lang.Object
  extended byjavax.swing.plaf.basic.BasicBorders.SplitPaneBorder
All Implemented Interfaces:
javax.swing.border.Border, javax.swing.plaf.UIResource
Enclosing class:
BasicBorders

public static class BasicBorders.SplitPaneBorder
extends java.lang.Object
implements javax.swing.border.Border, javax.swing.plaf.UIResource

A border for JSplitPanes in the Basic look and feel. The divider in the middle of the JSplitPane has its own border class, of which an instance can be obtained with BasicBorders.getSplitPaneDividerBorder() 55 .

[A screen shot for JSplitPane.HORIZONTAL_SPLIT]

[A screen shot for JSplitPane.VERTICAL_SPLIT]

In contrast to the other borders of the Basic look and feel, this class is not serializable. While this might be unintended, GNU Classpath follows the specification in order to be fully compatible with the Sun reference implementation.

In the Sun JDK, the bottom edge of the divider also gets painted if the orientation of the enclosed JSplitPane is JSplitPane.VERTICAL_SPLIT (at least in versions 1.3.1 and 1.4.1). GNU Classpath does not replicate this bug. A report has been filed with Sun (bug ID 4885629).

Note that the bottom left pixel of the border has a different color depending on the orientation of the enclosed JSplitPane. Although this is visually inconsistent, Classpath replicates the appearance of the Sun reference implementation. A bug report has been filed with Sun (review ID 188774).


Field Summary
protected  java.awt.Color highlight
          The color for drawing the bottom and right edges of the border.
protected  java.awt.Color shadow
          The color for drawing the top and left edges of the border.
private static int SUPPRESS_BOTTOM
          Indicates that the bottom edge shall be not be painted by paintRect(java.awt.Graphics, int, boolean, int, int, java.awt.Rectangle) 55 .
private static int SUPPRESS_LEFT
          Indicates that the left edge shall be not be painted by paintRect(java.awt.Graphics, int, boolean, int, int, java.awt.Rectangle) 55 .
private static int SUPPRESS_RIGHT
          Indicates that the right edge shall be not be painted by paintRect(java.awt.Graphics, int, boolean, int, int, java.awt.Rectangle) 55 .
private static int SUPPRESS_TOP
          Indicates that the top edge shall be not be painted by paintRect(java.awt.Graphics, int, boolean, int, int, java.awt.Rectangle) 55 .
 
Constructor Summary
BasicBorders.SplitPaneBorder(java.awt.Color highlight, java.awt.Color shadow)
          Constructs a new border for drawing a JSplitPane in the Basic look and feel.
 
Method Summary
 java.awt.Insets getBorderInsets(java.awt.Component c)
          Measures the width of this border.
 boolean isBorderOpaque()
          Determines whether this border fills every pixel in its area when painting.
 void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
          Paints the border around a JSplitPane.
private  void paintRect(java.awt.Graphics g, int suppress, boolean shadeBottomLeftPixel, int x, int y, java.awt.Rectangle rect)
          Paints a border around a child of a JSplitPane, omitting some of the edges.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUPPRESS_TOP

private static final int SUPPRESS_TOP
Indicates that the top edge shall be not be painted by paintRect(java.awt.Graphics, int, boolean, int, int, java.awt.Rectangle) 55 .

See Also:
Constant Field Values

SUPPRESS_LEFT

private static final int SUPPRESS_LEFT
Indicates that the left edge shall be not be painted by paintRect(java.awt.Graphics, int, boolean, int, int, java.awt.Rectangle) 55 .

See Also:
Constant Field Values

SUPPRESS_BOTTOM

private static final int SUPPRESS_BOTTOM
Indicates that the bottom edge shall be not be painted by paintRect(java.awt.Graphics, int, boolean, int, int, java.awt.Rectangle) 55 .

See Also:
Constant Field Values

SUPPRESS_RIGHT

private static final int SUPPRESS_RIGHT
Indicates that the right edge shall be not be painted by paintRect(java.awt.Graphics, int, boolean, int, int, java.awt.Rectangle) 55 .

See Also:
Constant Field Values

highlight

protected java.awt.Color highlight
The color for drawing the bottom and right edges of the border.


shadow

protected java.awt.Color shadow
The color for drawing the top and left edges of the border.

Constructor Detail

BasicBorders.SplitPaneBorder

public BasicBorders.SplitPaneBorder(java.awt.Color highlight,
                                    java.awt.Color shadow)
Constructs a new border for drawing a JSplitPane in the Basic look and feel. The divider in the middle of the JSplitPane has its own border class, SplitPaneDividerBorder.

Method Detail

paintBorder

public void paintBorder(java.awt.Component c,
                        java.awt.Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
Paints the border around a JSplitPane.

[A screen shot for JSplitPane.HORIZONTAL_SPLIT]

[A screen shot for JSplitPane.VERTICAL_SPLIT]

Specified by:
paintBorder in interface javax.swing.border.Border

paintRect

private void paintRect(java.awt.Graphics g,
                       int suppress,
                       boolean shadeBottomLeftPixel,
                       int x,
                       int y,
                       java.awt.Rectangle rect)
Paints a border around a child of a JSplitPane, omitting some of the edges.


getBorderInsets

public java.awt.Insets getBorderInsets(java.awt.Component c)
Measures the width of this border.

Specified by:
getBorderInsets in interface javax.swing.border.Border

isBorderOpaque

public boolean isBorderOpaque()
Determines whether this border fills every pixel in its area when painting.

Specified by:
isBorderOpaque in interface javax.swing.border.Border