com.jaxfront.swing.ui.tools
Class FunctionalGraphics

java.lang.Object
  extended by com.jaxfront.swing.ui.tools.FunctionalGraphics
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener

public class FunctionalGraphics
extends java.lang.Object
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

Field Summary
 int _height
           
 int _imageXOffset
           
 int _imageYOffset
           
 int _width
           
static int ABOVE_BOTTOM
          Position the title above the border's bottom line.
static int ABOVE_TOP
          Position the title above the border's top line.
static int BELOW_BOTTOM
          Position the title below the border's bottom line.
static int BELOW_TOP
          Position the title below the border's top line.
static int BOTTOM
          Position the title in the middle of the border's bottom line.
static int CENTER
          Position title text in the center of the border line.
static int DEFAULT_JUSTIFICATION
          Use the default justification for the title text.
static int DEFAULT_POSITION
          Use the default vertical orientation for the title text.
static int LEADING
          Position title text at the left side of the border line for left to right orientation, at the right side of the border line for right to left orientation.
static int LEFT
          Position title text at the left side of the border line.
static int RIGHT
          Position title text at the right side of the border line.
static int TOP
          Position the title in the middle of the border's top line.
static int TRAILING
          Position title text at the right side of the border line for left to right orientation, at the left side of the border line for right to left orientation.
 
Constructor Summary
FunctionalGraphics(java.awt.Component parent)
           
FunctionalGraphics(java.awt.Component parent, java.lang.String text)
           
 
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)
           
 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)
           
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()
           
 java.awt.Dimension getSize()
           
 int getTextInsetHorizontal()
           
 javax.swing.Action getTitleAction(int mouseButton)
           
 java.lang.String getToolTipText()
           
 java.lang.String getToolTipText(java.awt.event.MouseEvent e)
           
 boolean isEnabled()
           
 boolean isInTitelBox(java.awt.Point p)
          Returns true if the point is in the titel check box rectangle which contains the text.
 boolean istVisible(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 paint(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 paint(java.awt.Graphics g, int x, int y, int width, int height, java.lang.String text, java.awt.Point textLocation)
           
 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 setText(java.lang.String text)
           
 void setTitleAction(javax.swing.Action titleAction, int mouseButton)
           
 void setToolTipText(java.lang.String toolTipText)
           
 void setVisible(java.lang.String borderActionName, boolean isActive)
           
 void toggleActionSet(BorderActionSet aSet, boolean toogle)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_imageYOffset

public int _imageYOffset

_imageXOffset

public int _imageXOffset

_width

public int _width

_height

public int _height

DEFAULT_POSITION

public static final int DEFAULT_POSITION
Use the default vertical orientation for the title text.

See Also:
Constant Field Values

ABOVE_TOP

public static final int ABOVE_TOP
Position the title above the border's top line.

See Also:
Constant Field Values

TOP

public static final int TOP
Position the title in the middle of the border's top line.

See Also:
Constant Field Values

BELOW_TOP

public static final int BELOW_TOP
Position the title below the border's top line.

See Also:
Constant Field Values

ABOVE_BOTTOM

public static final int ABOVE_BOTTOM
Position the title above the border's bottom line.

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
Position the title in the middle of the border's bottom line.

See Also:
Constant Field Values

BELOW_BOTTOM

public static final int BELOW_BOTTOM
Position the title below the border's bottom line.

See Also:
Constant Field Values

DEFAULT_JUSTIFICATION

public static final int DEFAULT_JUSTIFICATION
Use the default justification for the title text.

See Also:
Constant Field Values

LEFT

public static final int LEFT
Position title text at the left side of the border line.

See Also:
Constant Field Values

CENTER

public static final int CENTER
Position title text in the center of the border line.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Position title text at the right side of the border line.

See Also:
Constant Field Values

LEADING

public static final int LEADING
Position title text at the left side of the border line for left to right orientation, at the right side of the border line for right to left orientation.

See Also:
Constant Field Values

TRAILING

public static final int TRAILING
Position title text at the right side of the border line for left to right orientation, at the left side of the border line for right to left orientation.

See Also:
Constant Field Values
Constructor Detail

FunctionalGraphics

public FunctionalGraphics(java.awt.Component parent)

FunctionalGraphics

public FunctionalGraphics(java.awt.Component parent,
                          java.lang.String text)
Method Detail

resetAllActions

public void resetAllActions()

getActionInRange

public BorderActionSet getActionInRange(java.awt.Point p)

paint

public void paint(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.

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

getTextInsetHorizontal

public int getTextInsetHorizontal()

paint

public void paint(java.awt.Graphics g,
                  int x,
                  int y,
                  int width,
                  int height,
                  java.lang.String text,
                  java.awt.Point textLocation)

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

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)

calculateActionAreaDimension

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

getActionAreaX

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

getSize

public java.awt.Dimension getSize()

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.

setText

public void setText(java.lang.String text)

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)

istVisible

public boolean istVisible(java.lang.String borderActionName)

getTitleAction

public javax.swing.Action getTitleAction(int mouseButton)

getLastMouseLocation

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

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