com.jaxfront.swing.ui.tools
Class FunctionalTitleBorder

java.lang.Object
  extended by javax.swing.border.AbstractBorder
      extended by com.jaxfront.swing.ui.tools.TitledBorder
          extended by com.jaxfront.swing.ui.tools.FunctionalTitleBorder
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable, java.util.EventListener, javax.swing.border.Border

public class FunctionalTitleBorder
extends TitledBorder
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener

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 _imageXOffset
           
 
Fields inherited from class com.jaxfront.swing.ui.tools.TitledBorder
ABOVE_BOTTOM, ABOVE_TOP, BELOW_BOTTOM, BELOW_TOP, BOTTOM, CENTER, DEFAULT_JUSTIFICATION, DEFAULT_POSITION, LEADING, LEFT, RIGHT, TOP, TRAILING
 
Constructor Summary
FunctionalTitleBorder(javax.swing.border.Border aBorder)
          Creates a OptionalTitledBorder instance with the specified border and an empty title.
FunctionalTitleBorder(javax.swing.border.Border aBorder, java.lang.String borderTitle)
          Creates a OptionalTitleBorder instance with the specified border and title.
FunctionalTitleBorder(javax.swing.border.Border newBorder, java.lang.String borderTitle, int aTitleJustification, int aTitlePosition)
          Creates a OptionalTitleBorder instance with the specified border, title, title-justification, and title-position.
FunctionalTitleBorder(javax.swing.border.Border newBorder, java.lang.String borderTitle, int aTitleJustification, int aTitlePosition, java.awt.Font aTitleFont)
          Creates a OptionalTitleBorder instance with the specified border, title, title-justification, title-position, and title-font.
FunctionalTitleBorder(javax.swing.border.Border newBorder, java.lang.String borderTitle, int aTitleJustification, int aTitlePosition, java.awt.Font aTitleFont, java.awt.Color aTitleColor)
          Creates a OptionalTitleBorder instance with the specified border, title, title-justification, title-position, title-font, and title-color.
FunctionalTitleBorder(java.lang.String borderTitle)
          Creates a OptionalTitleBorder instance.
FunctionalTitleBorder(java.lang.String borderTitle, java.awt.Component parent)
           
 
Method Summary
 BorderActionSet addBorderAction(javax.swing.Action mainAction, javax.swing.Action inverseAction, java.awt.Image actionImageShadowed, java.awt.Image inverseActionImageShadowed, int alignment)
           
 BorderActionSet addBorderAction(javax.swing.Action mainAction, javax.swing.Action inverseAction, int alignment)
           
 BorderActionSet addBorderAction(javax.swing.Action mainAction, int alignment)
           
 void addBorderAction(BorderActionSet aSet)
           
 void addBorderAction(BorderActionSet aSet, int alignment)
           
 BorderActionSet addBorderAction(java.lang.String name, javax.swing.Action mainAction, javax.swing.Action inverseAction, java.awt.Image mainImage, java.awt.Image inverseImage, java.awt.Image actionImageShadowed, java.awt.Image inverseActionImageShadowed, java.lang.String toolTipText, int alignment)
           
 BorderActionSet addBorderAction(java.lang.String name, javax.swing.Action mainAction, javax.swing.Action inverseAction, java.awt.Image mainImage, java.awt.Image inverseImage, java.lang.String toolTipText, int alignment)
           
 BorderActionSet addBorderAction(java.lang.String name, javax.swing.Action mainAction, java.awt.Image mainImage, java.awt.Image actionImageShadowed, java.lang.String toolTipText, int alignment)
           
 BorderActionSet addBorderAction(java.lang.String name, javax.swing.Action mainAction, java.awt.Image mainImage, java.lang.String toolTipText, int alignment)
           
 BorderActionSet addBorderActionSeparator(java.awt.Image mainImage, int alignment)
           
 BorderActionSet addBorderActionSeparator(int alignment)
           
static java.awt.Dimension calculateActionAreaDimension(java.util.Vector actionSets)
           
static javax.swing.ImageIcon createDisabledIcon(javax.swing.ImageIcon icon)
           
 void doAction(java.lang.Object source, java.lang.String borderActionSetName)
           
 void doAction(java.lang.Object source, java.lang.String borderActionSetName, boolean useInverse)
           
static int getActionAreaX(java.util.Vector actionSets)
           
 BorderActionSet getActionInRange(java.awt.Point p)
           
 BorderActionSet getBorderAction(java.lang.String name)
           
static java.awt.Point getLastMouseLocation()
           
 java.util.Vector getRegisteredBorderActions()
           
 java.awt.Component getRootComponent()
           
 javax.swing.Action getTitleAction(int mouseButton)
           
 java.lang.String getToolTipText()
           
 java.lang.String getToolTipText(java.awt.event.MouseEvent e)
           
 boolean isEnabled()
           
 boolean isVisible(java.lang.String borderActionName)
           
static void main(java.lang.String[] args)
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 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 release()
           
 void removeBorderAction(BorderActionSet aSet)
           
 void removeBorderAction(java.lang.String name)
           
 void resetAllActions()
           
 void setEnabled(boolean enabled)
          Enables or disables this component, depending on the value of the parameter b.
 void setRootComponent(java.awt.Component rootComponent)
           
 void setTitleAction(javax.swing.Action titleAction, int mouseButton)
           
 void setToolTipText(java.lang.String toolTipText)
           
 void setVisible(boolean visible)
           
 void setVisible(java.lang.String borderActionName, boolean isActive)
           
 void toggleActionSet(BorderActionSet aSet, boolean toogle)
           
 
Methods inherited from class com.jaxfront.swing.ui.tools.TitledBorder
getBorder, getBorderInsets, getBorderInsets, getMinimumSize, getTitle, getTitleColor, getTitleFont, getTitleJustification, getTitlePosition, isBorderOpaque, isInTitelBox, setBorder, setCaptionIndent, 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

_imageXOffset

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

FunctionalTitleBorder

public FunctionalTitleBorder(java.lang.String borderTitle)
Creates a OptionalTitleBorder instance.

Parameters:
title - the title the border should display

FunctionalTitleBorder

public FunctionalTitleBorder(java.lang.String borderTitle,
                             java.awt.Component parent)

FunctionalTitleBorder

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

Parameters:
border - the border

FunctionalTitleBorder

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

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

FunctionalTitleBorder

public FunctionalTitleBorder(javax.swing.border.Border newBorder,
                             java.lang.String borderTitle,
                             int aTitleJustification,
                             int aTitlePosition)
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

FunctionalTitleBorder

public FunctionalTitleBorder(javax.swing.border.Border newBorder,
                             java.lang.String borderTitle,
                             int aTitleJustification,
                             int aTitlePosition,
                             java.awt.Font aTitleFont)
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

FunctionalTitleBorder

public FunctionalTitleBorder(javax.swing.border.Border newBorder,
                             java.lang.String borderTitle,
                             int aTitleJustification,
                             int aTitlePosition,
                             java.awt.Font aTitleFont,
                             java.awt.Color aTitleColor)
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

resetAllActions

public void resetAllActions()

getActionInRange

public BorderActionSet getActionInRange(java.awt.Point p)

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 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

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()

isEnabled

public boolean isEnabled()

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

doAction

public void doAction(java.lang.Object source,
                     java.lang.String borderActionSetName)

doAction

public void doAction(java.lang.Object source,
                     java.lang.String borderActionSetName,
                     boolean useInverse)

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

main

public static void main(java.lang.String[] args)

getRegisteredBorderActions

public java.util.Vector getRegisteredBorderActions()
Returns:
Returns the _registeredBorderActions.

addBorderAction

public void addBorderAction(BorderActionSet aSet)

addBorderAction

public void addBorderAction(BorderActionSet aSet,
                            int alignment)

calculateActionAreaDimension

public static final java.awt.Dimension calculateActionAreaDimension(java.util.Vector actionSets)

getActionAreaX

public static final int getActionAreaX(java.util.Vector actionSets)

setRootComponent

public void setRootComponent(java.awt.Component rootComponent)
Parameters:
_rootComponent - The _rootComponent to set.

getRootComponent

public java.awt.Component getRootComponent()
Returns:
Returns the _rootComponent.

addBorderAction

public BorderActionSet addBorderAction(java.lang.String name,
                                       javax.swing.Action mainAction,
                                       javax.swing.Action inverseAction,
                                       java.awt.Image mainImage,
                                       java.awt.Image inverseImage,
                                       java.awt.Image actionImageShadowed,
                                       java.awt.Image inverseActionImageShadowed,
                                       java.lang.String toolTipText,
                                       int alignment)

addBorderActionSeparator

public BorderActionSet addBorderActionSeparator(java.awt.Image mainImage,
                                                int alignment)

addBorderActionSeparator

public BorderActionSet addBorderActionSeparator(int alignment)

addBorderAction

public BorderActionSet addBorderAction(java.lang.String name,
                                       javax.swing.Action mainAction,
                                       java.awt.Image mainImage,
                                       java.awt.Image actionImageShadowed,
                                       java.lang.String toolTipText,
                                       int alignment)

addBorderAction

public BorderActionSet addBorderAction(java.lang.String name,
                                       javax.swing.Action mainAction,
                                       java.awt.Image mainImage,
                                       java.lang.String toolTipText,
                                       int alignment)

addBorderAction

public BorderActionSet addBorderAction(javax.swing.Action mainAction,
                                       int alignment)

addBorderAction

public BorderActionSet addBorderAction(javax.swing.Action mainAction,
                                       javax.swing.Action inverseAction,
                                       java.awt.Image actionImageShadowed,
                                       java.awt.Image inverseActionImageShadowed,
                                       int alignment)

addBorderAction

public BorderActionSet addBorderAction(javax.swing.Action mainAction,
                                       javax.swing.Action inverseAction,
                                       int alignment)

addBorderAction

public BorderActionSet addBorderAction(java.lang.String name,
                                       javax.swing.Action mainAction,
                                       javax.swing.Action inverseAction,
                                       java.awt.Image mainImage,
                                       java.awt.Image inverseImage,
                                       java.lang.String toolTipText,
                                       int alignment)

removeBorderAction

public void removeBorderAction(java.lang.String name)

getBorderAction

public BorderActionSet getBorderAction(java.lang.String name)

removeBorderAction

public void removeBorderAction(BorderActionSet aSet)

toggleActionSet

public void toggleActionSet(BorderActionSet aSet,
                            boolean toogle)

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

getToolTipText

public java.lang.String getToolTipText(java.awt.event.MouseEvent e)
See Also:
JComponent.getToolTipText(java.awt.event.MouseEvent)

setToolTipText

public void setToolTipText(java.lang.String toolTipText)
Parameters:
_bubbleHelpText - The _bubbleHelpText to set.

getToolTipText

public java.lang.String getToolTipText()
Returns:
Returns the _bubbleHelpText.

release

public void release()

setTitleAction

public void setTitleAction(javax.swing.Action titleAction,
                           int mouseButton)
Parameters:
titleAction - The titleAction to set.

createDisabledIcon

public static javax.swing.ImageIcon createDisabledIcon(javax.swing.ImageIcon icon)

setVisible

public void setVisible(java.lang.String borderActionName,
                       boolean isActive)

setVisible

public void setVisible(boolean visible)

isVisible

public boolean isVisible(java.lang.String borderActionName)

getTitleAction

public javax.swing.Action getTitleAction(int mouseButton)

getLastMouseLocation

public static java.awt.Point getLastMouseLocation()
Returns:
Returns the _lastMouseLoc.