com.jaxfront.swing.ui.tools
Class CollapsibleTitleBorder

java.lang.Object
  extended by javax.swing.border.AbstractBorder
      extended by javax.swing.border.TitledBorder
          extended by com.jaxfront.swing.ui.tools.CollapsibleTitleBorder
All Implemented Interfaces:
java.io.Serializable, javax.swing.border.Border

public class CollapsibleTitleBorder
extends javax.swing.border.TitledBorder

This class is the border of a OptionalPanel. It can visualise check box, arrow down or arrow up image, an image for new and an image for delete. Note that with the check box all components in the optioanl panel could be enabled or disabled, with the arrows the optional panel could be fade in or out and with new or delete a recursive view could be created or deleted.

Version:
1.60
See Also:
Serialized Form

Field Summary
static int ABOVE_BOTTOM
           
static int ABOVE_TOP
           
static int BELOW_BOTTOM
           
static int BELOW_TOP
           
static int BOTTOM
           
static int CENTER
           
static int DEFAULT_JUSTIFICATION
           
static int DEFAULT_POSITION
           
static int LEFT
           
static int RIGHT
           
static int TOP
           
 
Constructor Summary
CollapsibleTitleBorder(javax.swing.border.Border border)
          Creates a OptionalTitledBorder instance with the specified border and an empty title.
CollapsibleTitleBorder(javax.swing.border.Border border, java.lang.String title)
          Creates a OptionalTitleBorder instance with the specified border and title.
CollapsibleTitleBorder(javax.swing.border.Border border, java.lang.String title, int titleJustification, int titlePosition)
          Creates a OptionalTitleBorder instance with the specified border, title, title-justification, and title-position.
CollapsibleTitleBorder(javax.swing.border.Border border, java.lang.String title, int titleJustification, int titlePosition, java.awt.Font titleFont)
          Creates a OptionalTitleBorder instance with the specified border, title, title-justification, title-position, and title-font.
CollapsibleTitleBorder(javax.swing.border.Border border, java.lang.String title, int titleJustification, int titlePosition, java.awt.Font titleFont, java.awt.Color titleColor)
          Creates a OptionalTitleBorder instance with the specified border, title, title-justification, title-position, title-font, and title-color.
CollapsibleTitleBorder(java.lang.String title)
          Creates a OptionalTitleBorder instance.
CollapsibleTitleBorder(java.lang.String title, boolean isRecursive)
          Creates a OptionalTitleBorder instance for a recursive view.
CollapsibleTitleBorder(java.lang.String title, boolean isRecursive, float captionIndent)
          Creates a OptionalTitleBorder instance for a recursive view.
 
Method Summary
 boolean isChecked()
           
 boolean isEnabled()
          Determines whether this component is enabled.
 boolean isInCheckBox(java.awt.Point p)
          Returns true if the point is in the check box rectangle which hide the childs or show the childs.
 boolean isInDeleteBox(java.awt.Point p)
          Returns true if the point is in the delete check box rectangle to delete the recursive view.
 boolean isInNewBox(java.awt.Point p)
          Returns true if the point is in the new check box rectangle to create a new recursive view
 boolean isInOptionalCheckBox(java.awt.Point p)
          Returns true if the point is in the optional check box rectangle which enable or disable the childs.
 boolean isInTitelBox(java.awt.Point p)
          Returns true if the point is in the titel check box rectangle which contains the text.
 boolean isOptional()
          Returns true if the visualizer in the optional panel is optional.
 boolean isOptionalBoxChecked()
          Returns true if the check box to enable or disable the childs is checked.
 void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
          Paints the border for the specified component with the specified position and size.
 void setChecked(boolean checked)
          Sets the arrow to be displayed when the border is optional.
 void setEnabled(boolean enabled)
          Enables or disables this component, depending on the value of the parameter b.
 void setOptional(boolean optional)
          Sets the border optional or not.
 void setOptionalBoxChecked(boolean checked)
          Sets the optional check box checked or not.
 void setUseOptionalCheckBox(boolean checked)
          Sets the use the optional check box.
 boolean useOptionalCheckBox()
          Returns true if the optional check box is use.
 
Methods inherited from class javax.swing.border.TitledBorder
getBorder, getBorderInsets, getBorderInsets, getMinimumSize, getTitle, getTitleColor, getTitleFont, getTitleJustification, getTitlePosition, isBorderOpaque, setBorder, setTitle, setTitleColor, setTitleFont, setTitleJustification, setTitlePosition
 
Methods inherited from class javax.swing.border.AbstractBorder
getInteriorRectangle, getInteriorRectangle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_POSITION

public static final int DEFAULT_POSITION
See Also:
Constant Field Values

ABOVE_TOP

public static final int ABOVE_TOP
See Also:
Constant Field Values

TOP

public static final int TOP
See Also:
Constant Field Values

BELOW_TOP

public static final int BELOW_TOP
See Also:
Constant Field Values

ABOVE_BOTTOM

public static final int ABOVE_BOTTOM
See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
See Also:
Constant Field Values

BELOW_BOTTOM

public static final int BELOW_BOTTOM
See Also:
Constant Field Values

DEFAULT_JUSTIFICATION

public static final int DEFAULT_JUSTIFICATION
See Also:
Constant Field Values

LEFT

public static final int LEFT
See Also:
Constant Field Values

CENTER

public static final int CENTER
See Also:
Constant Field Values

RIGHT

public static final int RIGHT
See Also:
Constant Field Values
Constructor Detail

CollapsibleTitleBorder

public CollapsibleTitleBorder(java.lang.String title)
Creates a OptionalTitleBorder instance.

Parameters:
title - the title the border should display

CollapsibleTitleBorder

public CollapsibleTitleBorder(java.lang.String title,
                              boolean isRecursive)
Creates a OptionalTitleBorder instance for a recursive view.

Parameters:
title - the title the border should display

CollapsibleTitleBorder

public CollapsibleTitleBorder(java.lang.String title,
                              boolean isRecursive,
                              float captionIndent)
Creates a OptionalTitleBorder instance for a recursive view.

Parameters:
title - the title the border should display

CollapsibleTitleBorder

public CollapsibleTitleBorder(javax.swing.border.Border border)
Creates a OptionalTitledBorder instance with the specified border and an empty title.

Parameters:
border - the border

CollapsibleTitleBorder

public CollapsibleTitleBorder(javax.swing.border.Border border,
                              java.lang.String title)
Creates a OptionalTitleBorder instance with the specified border and title.

Parameters:
border - the border
title - the title the border should display

CollapsibleTitleBorder

public CollapsibleTitleBorder(javax.swing.border.Border border,
                              java.lang.String title,
                              int titleJustification,
                              int titlePosition)
Creates a OptionalTitleBorder instance with the specified border, title, title-justification, and title-position.

Parameters:
border - the border
title - the title the border should display
titleJustification - the justification for the title
titlePosition - the position for the title

CollapsibleTitleBorder

public CollapsibleTitleBorder(javax.swing.border.Border border,
                              java.lang.String title,
                              int titleJustification,
                              int titlePosition,
                              java.awt.Font titleFont)
Creates a OptionalTitleBorder instance with the specified border, title, title-justification, title-position, and title-font.

Parameters:
border - the border
title - the title the border should display
titleJustification - the justification for the title
titlePosition - the position for the title
titleFont - the font for rendering the title

CollapsibleTitleBorder

public CollapsibleTitleBorder(javax.swing.border.Border border,
                              java.lang.String title,
                              int titleJustification,
                              int titlePosition,
                              java.awt.Font titleFont,
                              java.awt.Color titleColor)
Creates a OptionalTitleBorder instance with the specified border, title, title-justification, title-position, title-font, and title-color.

Parameters:
border - the border
title - the title the border should display
titleJustification - the justification for the title
titlePosition - the position for the title
titleFont - the font of the title
titleColor - the color of the title
Method Detail

isEnabled

public boolean isEnabled()
Determines whether this component is enabled. An enabled component can respond to user input and generate events. Components are enabled initially by default. A component may be enabled or disabled by calling its setEnabled method.

Returns:
true if the component is enabled; false otherwise.
See Also:
setEnabled(boolean)

isInCheckBox

public boolean isInCheckBox(java.awt.Point p)
Returns true if the point is in the check box rectangle which hide the childs or show the childs.

Returns:
true if the point is in the check box

isInDeleteBox

public boolean isInDeleteBox(java.awt.Point p)
Returns true if the point is in the delete check box rectangle to delete the recursive view.

Returns:
true if the point is in the check box

isInNewBox

public boolean isInNewBox(java.awt.Point p)
Returns true if the point is in the new check box rectangle to create a new recursive view

Returns:
true if the point is in the check box

isInOptionalCheckBox

public boolean isInOptionalCheckBox(java.awt.Point p)
Returns true if the point is in the optional check box rectangle which enable or disable the childs.

Returns:
true if the point is in the check box

isInTitelBox

public boolean isInTitelBox(java.awt.Point p)
Returns true if the point is in the titel check box rectangle which contains the text.

Returns:
true if the point is in the check box

isOptional

public boolean isOptional()
Returns true if the visualizer in the optional panel is optional.

Returns:
true if is optioanl
See Also:
#setOptioanl(boolean)

isOptionalBoxChecked

public boolean isOptionalBoxChecked()
Returns true if the check box to enable or disable the childs is checked.

Returns:
true if the optional box is checked
See Also:
setOptionalBoxChecked(boolean)

paintBorder

public void paintBorder(java.awt.Component c,
                        java.awt.Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
Paints the border for the specified component with the specified position and size.

Specified by:
paintBorder in interface javax.swing.border.Border
Overrides:
paintBorder in class javax.swing.border.TitledBorder
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

setChecked

public void setChecked(boolean checked)
Sets the arrow to be displayed when the border is optional.

Parameters:
checked - if true the arrow down would be displayed.

isChecked

public boolean isChecked()

setEnabled

public void setEnabled(boolean enabled)
Enables or disables this component, depending on the value of the parameter b. An enabled component can respond to user input and generate events. Components are enabled initially by default.

Parameters:
b - If true, this component is enabled; otherwise this component is disabled.
See Also:
isEnabled()

setOptional

public void setOptional(boolean optional)
Sets the border optional or not. If the border is optional it draws an arrow which can be used to show the children or not.

Parameters:
optional - if true the border is optional
See Also:
isOptional()

setOptionalBoxChecked

public void setOptionalBoxChecked(boolean checked)
Sets the optional check box checked or not.

Parameters:
checked - if true the optional check box is checked
See Also:
isOptionalBoxChecked()

setUseOptionalCheckBox

public void setUseOptionalCheckBox(boolean checked)
Sets the use the optional check box.

Parameters:
checked - if true the optional check box are showing
See Also:
useOptionalCheckBox()

useOptionalCheckBox

public boolean useOptionalCheckBox()
Returns true if the optional check box is use.

Returns:
true if the optional check box is use.
See Also:
#setUseOptionalCheckBox()