org.jdesktop.swingx.plaf.basic
Class BasicTaskPaneUI.PaneBorder

java.lang.Object
  extended by org.jdesktop.swingx.plaf.basic.BasicTaskPaneUI.PaneBorder
All Implemented Interfaces:
Border, UIResource
Enclosing class:
BasicTaskPaneUI

protected class BasicTaskPaneUI.PaneBorder
extends Object
implements Border, UIResource

The border of the taskpane group paints the "text", the "icon", the "expanded" status and the "special" type.


Field Summary
protected  Color borderColor
           
protected  JLabel label
           
protected  Color specialTitleBackground
           
protected  Color specialTitleForeground
           
protected  Color specialTitleOver
           
protected  Color titleBackgroundGradientEnd
           
protected  Color titleBackgroundGradientStart
           
protected  Color titleForeground
           
protected  Color titleOver
           
 
Constructor Summary
BasicTaskPaneUI.PaneBorder()
          Creates new instance of individual pane border.
 
Method Summary
protected  void configureLabel(JXTaskPane group)
          Configures label for the group using its title, font, icon and orientation.
 Insets getBorderInsets(Component c)
          Returns the insets of the border.
protected  Color getPaintColor(JXTaskPane group)
          Gets current paint color.
 Dimension getPreferredSize(JXTaskPane group)
          Calculates the preferred border size, its size so all its content fits.
 boolean isBorderOpaque()
          Overwritten to always return true to speed up painting.
protected  boolean isMouseOverBorder()
          Default implementation returns false.
 void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          Paints the border for the specified component with the specified position and size.
protected  void paintChevronControls(JXTaskPane group, Graphics g, int x, int y, int width, int height)
          Paints controls for the group.
protected  void paintExpandedControls(JXTaskPane group, Graphics g, int x, int y, int width, int height)
          Paints expanded controls.
protected  void paintFocus(Graphics g, Color paintColor, int x, int y, int width, int height)
          Paints focused group.
protected  void paintOvalAroundControls(JXTaskPane group, Graphics g, int x, int y, int width, int height)
          Paints oval 'border' area around the control itself.
protected  void paintRectAroundControls(JXTaskPane group, Graphics g, int x, int y, int width, int height, Color highColor, Color lowColor)
          Paints oval 'border' area around the control itself.
protected  void paintTitle(JXTaskPane group, Graphics g, Color textColor, int x, int y, int width, int height)
          Paints current group title.
protected  void paintTitleBackground(JXTaskPane group, Graphics g)
          Paints background of the title.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

borderColor

protected Color borderColor

titleForeground

protected Color titleForeground

specialTitleBackground

protected Color specialTitleBackground

specialTitleForeground

protected Color specialTitleForeground

titleBackgroundGradientStart

protected Color titleBackgroundGradientStart

titleBackgroundGradientEnd

protected Color titleBackgroundGradientEnd

titleOver

protected Color titleOver

specialTitleOver

protected Color specialTitleOver

label

protected JLabel label
Constructor Detail

BasicTaskPaneUI.PaneBorder

public BasicTaskPaneUI.PaneBorder()
Creates new instance of individual pane border.

Method Detail

getBorderInsets

public Insets getBorderInsets(Component c)
Description copied from interface: javax.swing.border.Border
Returns the insets of the border.

Specified by:
getBorderInsets in interface Border
Parameters:
c - the component for which this border insets value applies

isBorderOpaque

public boolean isBorderOpaque()
Overwritten to always return true to speed up painting. Don't use transparent borders unless providing UI delegate that provides proper return value when calling this method.

Specified by:
isBorderOpaque in interface Border
See Also:
Border.isBorderOpaque()

getPreferredSize

public Dimension getPreferredSize(JXTaskPane group)
Calculates the preferred border size, its size so all its content fits.

Parameters:
group - Selected group.

paintTitleBackground

protected void paintTitleBackground(JXTaskPane group,
                                    Graphics g)
Paints background of the title. This may differ based on properties of the group.

Parameters:
group - Selected group.
g - Target graphics.

paintTitle

protected void paintTitle(JXTaskPane group,
                          Graphics g,
                          Color textColor,
                          int x,
                          int y,
                          int width,
                          int height)
Paints current group title.

Parameters:
group - Selected group.
g - Target graphics.
textColor - Title color.
x - X coordinate of the top left corner.
y - Y coordinate of the top left corner.
width - Width of the box.
height - Height of the box.

configureLabel

protected void configureLabel(JXTaskPane group)
Configures label for the group using its title, font, icon and orientation.

Parameters:
group - Selected group.

paintExpandedControls

protected void paintExpandedControls(JXTaskPane group,
                                     Graphics g,
                                     int x,
                                     int y,
                                     int width,
                                     int height)
Paints expanded controls. Default implementation does nothing.

Parameters:
group - Expanded group.
g - Target graphics.
x - X coordinate of the top left corner.
y - Y coordinate of the top left corner.
width - Width of the box.
height - Height of the box.

getPaintColor

protected Color getPaintColor(JXTaskPane group)
Gets current paint color.

Parameters:
group - Selected group.
Returns:
Color to be used for painting provided group.

paintBorder

public void paintBorder(Component c,
                        Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
Description copied from interface: javax.swing.border.Border
Paints the border for the specified component with the specified position and size.

Specified by:
paintBorder in interface Border
Parameters:
c - the component for which this border is being painted
g - the paint graphics
x - the x position of the painted border
y - the y position of the painted border
width - the width of the painted border
height - the height of the painted border

paintRectAroundControls

protected void paintRectAroundControls(JXTaskPane group,
                                       Graphics g,
                                       int x,
                                       int y,
                                       int width,
                                       int height,
                                       Color highColor,
                                       Color lowColor)
Paints oval 'border' area around the control itself.

Parameters:
group - Expanded group.
g - Target graphics.
x - X coordinate of the top left corner.
y - Y coordinate of the top left corner.
width - Width of the box.
height - Height of the box.

paintOvalAroundControls

protected void paintOvalAroundControls(JXTaskPane group,
                                       Graphics g,
                                       int x,
                                       int y,
                                       int width,
                                       int height)
Paints oval 'border' area around the control itself.

Parameters:
group - Expanded group.
g - Target graphics.
x - X coordinate of the top left corner.
y - Y coordinate of the top left corner.
width - Width of the box.
height - Height of the box.

paintChevronControls

protected void paintChevronControls(JXTaskPane group,
                                    Graphics g,
                                    int x,
                                    int y,
                                    int width,
                                    int height)
Paints controls for the group.

Parameters:
group - Expanded group.
g - Target graphics.
x - X coordinate of the top left corner.
y - Y coordinate of the top left corner.
width - Width of the box.
height - Height of the box.

paintFocus

protected void paintFocus(Graphics g,
                          Color paintColor,
                          int x,
                          int y,
                          int width,
                          int height)
Paints focused group.

Parameters:
g - Target graphics.
paintColor - Focused group color.
x - X coordinate of the top left corner.
y - Y coordinate of the top left corner.
width - Width of the box.
height - Height of the box.

isMouseOverBorder

protected boolean isMouseOverBorder()
Default implementation returns false.

Returns:
true if this border wants to display things differently when the mouse is over it