edu.neu.ccs.gui
Class JPTComponent

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byedu.neu.ccs.gui.JPTComponent
All Implemented Interfaces:
ImageObserver, JPTConstants, MenuContainer, Serializable, SupportsPropertyChange, SwingConstants
Direct Known Subclasses:
PaintableComponent, PaintSwatch

public abstract class JPTComponent
extends JComponent
implements JPTConstants, SupportsPropertyChange

The abstract class JPTComponent extends JComponent in order to support property change and add mouse and key adapters.

Specifically, this class:

As of 2.5.0, convenience methods were added to add borders based on the methods in class Borders.

Since:
2.3
Version:
2.5.0
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  PropertyChangeForwardingListener forwardingListener
          The forwarding listener for this JPTComponent object to implement the interface SupportsPropertyChange.
private  KeyActionAdapter keyActionAdapter
          The key action adapter.
private  MouseActionAdapter mouseActionAdapter
          The mouse action adapter.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface edu.neu.ccs.util.JPTConstants
ABOVE, ALIGNMENT, BELOW, BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, FONT, INPUT_PROPERTIES, MANDATORY, OPTIONAL, ORIENTATION, TOP_LEFT, TOP_RIGHT, VALUE
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JPTComponent()
           
 
Method Summary
 Border addBorder(Border border)
          Adds the given border as an outer wrapper around the current border of the component.
 void addForwardingListener(Object object)
          Add the forwarding listener as a property change listener for the given object if the object supports property change.
 void addPropertyChangeListeners(PropertyChangeListener[] listeners)
          Add all items in the given PropertyChangeListener array to the listener list.
 void addPropertyChangeListeners(String propertyName, PropertyChangeListener[] listeners)
          Add all items in the given PropertyChangeListener array to the listener list for a specific property.
 void bevelBorderLowered()
          Adds a default lowered bevel border.
 void bevelBorderLowered(Color highlight, Color shadow)
          Adds a lowered bevel border with the given highlight and shadow colors.
 void bevelBorderLowered(Color highlightOuter, Color highlightInner, Color shadowInner, Color shadowOuter)
          Adds a lowered bevel border with the given colors.
 void bevelBorderLowered(int levels, Color highlight, Color shadow)
          Adds a lowered bevel border with the given parameters.
 void bevelBorderLowered(int levels, Color highlightOuter, Color highlightInner, Color shadowInner, Color shadowOuter)
          Adds a lowered bevel border with the given parameters.
 void bevelBorderRaised()
          Adds a raised bevel border.
 void bevelBorderRaised(Color highlight, Color shadow)
          Adds a raised bevel border with the given highlight and shadow colors.
 void bevelBorderRaised(Color highlightOuter, Color highlightInner, Color shadowInner, Color shadowOuter)
          Adds a raised bevel border with the given colors.
 void bevelBorderRaised(int levels, Color highlight, Color shadow)
          Adds a raised bevel border with the given parameters.
 void bevelBorderRaised(int levels, Color highlightOuter, Color highlightInner, Color shadowInner, Color shadowOuter)
          Adds a raised bevel border with the given parameters.
 void emptyBorder(int thickness)
          Adds an empty border with the given thickness.
 void emptyBorder(int vgap, int hgap)
          Adds an empty border with the given gaps.
 void emptyBorder(int top, int left, int bottom, int right)
          Adds an empty border with the given parameters.
 void etchBorderLowered()
          Adds a default lowered etch border.
 void etchBorderLowered(Color highlight, Color shadow)
          Adds a lowered etch border with the given highlight and shadow colors.
 void etchBorderLowered(int levels, Color highlight, Color shadow)
          Adds a lowered etch border with the given parameters.
 void etchBorderRaised()
          Adds a default raised etch border.
 void etchBorderRaised(Color highlight, Color shadow)
          Adds a raised etch border with the given highlight and shadow colors.
 void etchBorderRaised(int levels, Color highlight, Color shadow)
          Adds a raised etch border with the given parameters.
 void firePropertyChange(PropertyChangeEvent evt)
          Fire an existing PropertyChangeEvent to any registered listeners.
 void firePropertyChange(String propertyName, Object oldValue, Object newValue)
          Report a bound property update to any registered listeners.
 JPTFrame frame()
          Frame this panel in a JPTFrame and open the frame; return the frame constructed.
 JPTFrame frame(int location)
          Frame this panel in a JPTFrame and open the frame; use the given location which should be either CENTER or one of the standard constants for one of the eight compass directions; return the frame constructed.
 JPTFrame frame(String title)
          Frame this panel in a JPTFrame and open the frame; use the given title for the frame; return the frame constructed.
 JPTFrame frame(String title, Insets insets)
          Frame this panel in a JPTFrame and open the frame; use the given title for the frame; use the given insets to inset the frame in the screen; return the frame constructed.
 JPTFrame frame(String title, int location)
          Frame this panel in a JPTFrame and open the frame; use the given title for the frame; use the given location which should be either CENTER or one of the standard constants for one of the eight compass directions; return the frame constructed.
 JPTFrame frame(String title, int location, Insets insets)
          Frame this panel in a JPTFrame and open the frame; use the given title for the frame; use the given location which should be either CENTER or one of the standard constants for one of the eight compass directions; use the given insets to inset the frame in the screen; return the frame constructed.
 GeneralDialog generalDialog(Object[][] actionData)
          Place this panel in a modal general dialog and open the dialog; use the action data to define the dialog buttons; return the dialog constructed.
 GeneralDialog generalDialog(Object[][] actionData, Object defaultAction)
          Place this panel in a modal general dialog and open the dialog; use the action data to define the dialog buttons; use the default action object to define the default button; return the dialog constructed.
 GeneralDialog generalDialog(String title, Object[][] actionData)
          Place this panel in a modal general dialog and open the dialog; use the given title for the dialog; use the action data to define the dialog buttons; return the dialog constructed.
 GeneralDialog generalDialog(String title, Object[][] actionData, Object defaultAction)
          Place this panel in a modal general dialog and open the dialog; use the given title for the dialog; use the action data to define the dialog buttons; use the default action object to define the default button; return the dialog constructed.
 PropertyChangeForwardingListener getForwardingListener()
          Returns the PropertyChangeForwardingListener that will forward the property change events it receives to this object.
 KeyActionAdapter getKeyActionAdapter()
          Returns this component's key action adapter.
 MouseActionAdapter getMouseActionAdapter()
          Returns this component's mouse action adapter.
 boolean hasListeners(String propertyName)
          Check if there are any listeners for a specific property.
 void lineBorder()
          Adds a line border with the color black.
 void lineBorder(Color color)
          Adds a line border with the given color.
 void lineBorder(Color color, int thickness)
          Adds a line border with the given color and thickness.
 void matteBorder(int thickness, Color color)
          Adds a matte border with the given thickness and color.
 void matteBorder(int thickness, Icon tileicon)
          Adds a matte border with the given thickness and tileicon.
 void matteBorder(int vgap, int hgap, Color color)
          Adds a matte border with the given gaps and color.
 void matteBorder(int vgap, int hgap, Icon tileicon)
          Adds a matte border with the given gaps and tileicon.
 void matteBorder(int top, int left, int bottom, int right, Color color)
          Adds a matte border with the given parameters.
 void matteBorder(int top, int left, int bottom, int right, Icon tileicon)
          Adds a matte border with the given parameters.
 GeneralDialog OKCancelDialog()
          Place this panel in a modal OK-Cancel dialog and open the dialog; return the dialog constructed.
 GeneralDialog OKCancelDialog(String title)
          Place this panel in a modal OK-Cancel dialog and open the dialog; use the given title for the dialog; return the dialog constructed.
 GeneralDialog OKDialog()
          Place this panel in a modal OK dialog and open the dialog; return the dialog constructed.
 GeneralDialog OKDialog(String title)
          Place this panel in a modal OK dialog and open the dialog; use the given title for the dialog; return the dialog constructed.
 void refreshComponent()
          Refreshes the component by repacking the parent window.
 void removeAndAddForwardingListener(Object oldobject, Object newobject)
          Remove the forwarding listener as a property change listener for the old object if the old object supports property change and add the forwarding listener as a property change listener for the new object if the new object supports property change.
 Border removeBorder()
          Removes the current border and returns it.
 void removeForwardingListener(Object object)
          Remove the forwarding listener as a property change listener for the given object if the object supports property change.
 void setDeepBackground(Color c)
          Sets the background of this object to the given color; then sets the background of each component within this object to the same color using setDeepBackground recursively for each component that happens to extend DisplayPanel or JPTComponent.
 void setDeepBackground(Color c, Class type)
          Sets the background of all components in the hierarchy of this object that are instances of the given class.
 void titleBorder(String t, int hPosition, int vPosition, Border base, Font font, Color fontcolor)
          Adds a title border with the given parameters.
 GeneralDialog YesNoCancelDialog()
          Place this panel in a modal Yes-No-Cancel dialog and open the dialog; return the dialog constructed.
 GeneralDialog YesNoCancelDialog(String title)
          Place this panel in a modal Yes-No-Cancel dialog and open the dialog; use the given title for the dialog; return the dialog constructed.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.neu.ccs.gui.SupportsPropertyChange
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
 

Field Detail

forwardingListener

private PropertyChangeForwardingListener forwardingListener

The forwarding listener for this JPTComponent object to implement the interface SupportsPropertyChange.

See Also:
getForwardingListener()

keyActionAdapter

private KeyActionAdapter keyActionAdapter
The key action adapter.


mouseActionAdapter

private MouseActionAdapter mouseActionAdapter
The mouse action adapter.

Constructor Detail

JPTComponent

public JPTComponent()
Method Detail

addPropertyChangeListeners

public final void addPropertyChangeListeners(PropertyChangeListener[] listeners)
Add all items in the given PropertyChangeListener array to the listener list. These items are registered for all properties.

Specified by:
addPropertyChangeListeners in interface SupportsPropertyChange
Parameters:
listeners - the PropertyChangeListener array to be added

addPropertyChangeListeners

public final void addPropertyChangeListeners(String propertyName,
                                             PropertyChangeListener[] listeners)
Add all items in the given PropertyChangeListener array to the listener list for a specific property. These items will be invoked only when a call on firePropertyChange names that specific property.

Specified by:
addPropertyChangeListeners in interface SupportsPropertyChange
Parameters:
listeners - the PropertyChangeListener array to be added

hasListeners

public final boolean hasListeners(String propertyName)
Check if there are any listeners for a specific property.

Specified by:
hasListeners in interface SupportsPropertyChange
Parameters:
propertyName - the name of the property to check
Returns:
whether or not there are any listeners for a specific property

firePropertyChange

public final void firePropertyChange(String propertyName,
                                     Object oldValue,
                                     Object newValue)

Report a bound property update to any registered listeners.

No event is fired if the old and new values are equal and non-null.

In order to implement SupportsPropertyChange, this method makes public a method that is declared protected in JComponent.

Specified by:
firePropertyChange in interface SupportsPropertyChange
Parameters:
propertyName - the programmatic name of the property that was changed
oldValue - the old value of the property
newValue - the new value of the property

firePropertyChange

public final void firePropertyChange(PropertyChangeEvent evt)

Fire an existing PropertyChangeEvent to any registered listeners.

No event is fired if the given event's old and new values are equal and non-null.

Specified by:
firePropertyChange in interface SupportsPropertyChange
Parameters:
evt - the PropertyChangeEvent object

getForwardingListener

public final PropertyChangeForwardingListener getForwardingListener()
Returns the PropertyChangeForwardingListener that will forward the property change events it receives to this object.

Specified by:
getForwardingListener in interface SupportsPropertyChange
Returns:
the forwarding listener

addForwardingListener

public final void addForwardingListener(Object object)
Add the forwarding listener as a property change listener for the given object if the object supports property change.

Specified by:
addForwardingListener in interface SupportsPropertyChange
Parameters:
object - the object that should add the forwarding listener

removeForwardingListener

public final void removeForwardingListener(Object object)
Remove the forwarding listener as a property change listener for the given object if the object supports property change.

Specified by:
removeForwardingListener in interface SupportsPropertyChange
Parameters:
object - the object that should remove the forwarding listener

removeAndAddForwardingListener

public final void removeAndAddForwardingListener(Object oldobject,
                                                 Object newobject)
Remove the forwarding listener as a property change listener for the old object if the old object supports property change and add the forwarding listener as a property change listener for the new object if the new object supports property change.

Specified by:
removeAndAddForwardingListener in interface SupportsPropertyChange
Parameters:
oldobject - the old object that should remove the forwarding listener
newobject - the new object that should add the forwarding listener

getKeyActionAdapter

public final KeyActionAdapter getKeyActionAdapter()
Returns this component's key action adapter.

Returns:
this component's key action adapter

getMouseActionAdapter

public final MouseActionAdapter getMouseActionAdapter()
Returns this component's mouse action adapter.

Returns:
this component's mouse action adapter

addBorder

public Border addBorder(Border border)

Adds the given border as an outer wrapper around the current border of the component.

If the current border is null, then sets the given border as the border.

Does nothing if the given border is null.

Returns the final border of the component

Parameters:
border - the border to add as a wrapper

removeBorder

public Border removeBorder()

Removes the current border and returns it.


emptyBorder

public void emptyBorder(int thickness)

Adds an empty border with the given thickness.

Parameters:
thickness - the border thickness

emptyBorder

public void emptyBorder(int vgap,
                        int hgap)

Adds an empty border with the given gaps.

Parameters:
vgap - the border vertical gap: top and bottom
hgap - the border horizontal gap: left and right

emptyBorder

public void emptyBorder(int top,
                        int left,
                        int bottom,
                        int right)

Adds an empty border with the given parameters.

Parameters:
top - the border top
left - the border left
bottom - the border bottom
right - the border right

matteBorder

public void matteBorder(int thickness,
                        Color color)

Adds a matte border with the given thickness and color.

If the color is null, it is set to the color Color.black.

Parameters:
thickness - the border thickness
color - the border color

matteBorder

public void matteBorder(int vgap,
                        int hgap,
                        Color color)

Adds a matte border with the given gaps and color.

If the color is null, it is set to the color Color.black.

Parameters:
vgap - the border vertical gap: top and bottom
hgap - the border horizontal gap: left and right
color - the border color

matteBorder

public void matteBorder(int top,
                        int left,
                        int bottom,
                        int right,
                        Color color)

Adds a matte border with the given parameters.

If the color is null, it is set to the color Color.black.

Parameters:
top - the border top
left - the border left
bottom - the border bottom
right - the border right
color - the border color

matteBorder

public void matteBorder(int thickness,
                        Icon tileicon)

Adds a matte border with the given thickness and tileicon.

If the tileicon is null, it is replaced by the color Color.black.

Parameters:
thickness - the border thickness
tileicon - the border tileicon

matteBorder

public void matteBorder(int vgap,
                        int hgap,
                        Icon tileicon)

Adds a matte border with the given gaps and tileicon.

If the tileicon is null, it is replaced by the color Color.black.

Parameters:
vgap - the border vertical gap: top and bottom
hgap - the border horizontal gap: left and right
tileicon - the border tileicon

matteBorder

public void matteBorder(int top,
                        int left,
                        int bottom,
                        int right,
                        Icon tileicon)

Adds a matte border with the given parameters.

If the tileicon is null, it is replaced by the color Color.black.

Parameters:
top - the border top
left - the border left
bottom - the border bottom
right - the border right
tileicon - the border tileicon

lineBorder

public void lineBorder()

Adds a line border with the color black.


lineBorder

public void lineBorder(Color color)

Adds a line border with the given color.

If the color is null, it is set to the color Color.black.

Parameters:
color - the border color

lineBorder

public void lineBorder(Color color,
                       int thickness)

Adds a line border with the given color and thickness.

If the color is null, it is set to the color Color.black.

Note that the effect of this method is the same as:

   matteBorder(thickness, color);

but the parameters are in the opposite order.

Parameters:
color - the border color
thickness - the border thickness

etchBorderLowered

public void etchBorderLowered()

Adds a default lowered etch border.


etchBorderLowered

public void etchBorderLowered(Color highlight,
                              Color shadow)

Adds a lowered etch border with the given highlight and shadow colors.

Parameters:
highlight - the highlight color
shadow - the shadow color

etchBorderLowered

public void etchBorderLowered(int levels,
                              Color highlight,
                              Color shadow)

Adds a lowered etch border with the given parameters.

Parameters:
levels - the number of levels in each color band
highlight - the highlight color
shadow - the shadow color

etchBorderRaised

public void etchBorderRaised()

Adds a default raised etch border.


etchBorderRaised

public void etchBorderRaised(Color highlight,
                             Color shadow)

Adds a raised etch border with the given highlight and shadow colors.

Parameters:
highlight - the highlight color
shadow - the shadow color

etchBorderRaised

public void etchBorderRaised(int levels,
                             Color highlight,
                             Color shadow)

Adds a raised etch border with the given parameters.

Parameters:
levels - the number of levels in each color band
highlight - the highlight color
shadow - the shadow color

bevelBorderLowered

public void bevelBorderLowered()

Adds a default lowered bevel border.


bevelBorderLowered

public void bevelBorderLowered(Color highlight,
                               Color shadow)

Adds a lowered bevel border with the given highlight and shadow colors.

Parameters:
highlight - the highlight color
shadow - the shadow color

bevelBorderLowered

public void bevelBorderLowered(Color highlightOuter,
                               Color highlightInner,
                               Color shadowInner,
                               Color shadowOuter)

Adds a lowered bevel border with the given colors.

The parameter order outer-inner-inner-outer is different from that used in the Java class BorderFactory for similar methods.

Parameters:
highlightOuter - the outer highlight color
highlightInner - the inner highlight color
shadowInner - the inner shadow color
shadowOuter - the outer shadow color

bevelBorderLowered

public void bevelBorderLowered(int levels,
                               Color highlight,
                               Color shadow)

Adds a lowered bevel border with the given parameters.

Parameters:
levels - the thickness of each edge
highlight - the highlight color
shadow - the shadow color

bevelBorderLowered

public void bevelBorderLowered(int levels,
                               Color highlightOuter,
                               Color highlightInner,
                               Color shadowInner,
                               Color shadowOuter)

Adds a lowered bevel border with the given parameters.

The parameter order outer-inner-inner-outer is different from that used in the Java class BorderFactory for similar methods.

Parameters:
levels - the thickness of each edge
highlightOuter - the outer highlight color
highlightInner - the inner highlight color
shadowInner - the inner shadow color
shadowOuter - the outer shadow color

bevelBorderRaised

public void bevelBorderRaised()

Adds a raised bevel border.


bevelBorderRaised

public void bevelBorderRaised(Color highlight,
                              Color shadow)

Adds a raised bevel border with the given highlight and shadow colors.

Parameters:
highlight - the highlight color
shadow - the shadow color

bevelBorderRaised

public void bevelBorderRaised(Color highlightOuter,
                              Color highlightInner,
                              Color shadowInner,
                              Color shadowOuter)

Adds a raised bevel border with the given colors.

The parameter order outer-inner-inner-outer is different from that used in the Java class BorderFactory for similar methods.

Parameters:
highlightOuter - the outer highlight color
highlightInner - the inner highlight color
shadowInner - the inner shadow color
shadowOuter - the outer shadow color

bevelBorderRaised

public void bevelBorderRaised(int levels,
                              Color highlight,
                              Color shadow)

Adds a raised bevel border with the given parameters.

Parameters:
levels - the thickness of each edge
highlight - the highlight color
shadow - the shadow color

bevelBorderRaised

public void bevelBorderRaised(int levels,
                              Color highlightOuter,
                              Color highlightInner,
                              Color shadowInner,
                              Color shadowOuter)

Adds a raised bevel border with the given parameters.

The parameter order outer-inner-inner-outer is different from that used in the Java class BorderFactory for similar methods.

Parameters:
levels - the thickness of each edge
highlightOuter - the outer highlight color
highlightInner - the inner highlight color
shadowInner - the inner shadow color
shadowOuter - the outer shadow color

titleBorder

public void titleBorder(String t,
                        int hPosition,
                        int vPosition,
                        Border base,
                        Font font,
                        Color fontcolor)

Adds a title border with the given parameters.

If t is null, it is set to an empty string.

The valid values for hPosition are:

The valid values for vPosition are:

If either hPosition or vPosition are invalid, they are set to the corresponding default.

A title is inserted into an existing border. If the base is non-null that border is used; otherwise a default line border is used.

The font and fontcolor may be supplied or left as null to accept defaults.

Parameters:
t - the title string
hPosition - the horizontal position
vPosition - the vertical position
base - the base border in which to place the title
font - the title font
fontcolor - the title font color

setDeepBackground

public void setDeepBackground(Color c)
Sets the background of this object to the given color; then sets the background of each component within this object to the same color using setDeepBackground recursively for each component that happens to extend DisplayPanel or JPTComponent.

Parameters:
c - the background color

setDeepBackground

public void setDeepBackground(Color c,
                              Class type)

Sets the background of all components in the hierarchy of this object that are instances of the given class.

The background of the object itself will be set only if it is an instance of the given class.

The hierarchy is determined recursively as entities in instances of either DisplayPanel or JPTComponent.

Parameters:
c - the background color
type - the class whose objects should change

frame

public JPTFrame frame()

Frame this panel in a JPTFrame and open the frame; return the frame constructed.

Returns:
the frame constructed
Since:
2.3.5

frame

public JPTFrame frame(int location)

Frame this panel in a JPTFrame and open the frame; use the given location which should be either CENTER or one of the standard constants for one of the eight compass directions; return the frame constructed.

Parameters:
location - the constant representing the frame location
Returns:
the frame constructed
Since:
2.3.5

frame

public JPTFrame frame(String title)

Frame this panel in a JPTFrame and open the frame; use the given title for the frame; return the frame constructed.

Parameters:
title - the title for the frame
Returns:
the frame constructed
Since:
2.3.5

frame

public JPTFrame frame(String title,
                      int location)

Frame this panel in a JPTFrame and open the frame; use the given title for the frame; use the given location which should be either CENTER or one of the standard constants for one of the eight compass directions; return the frame constructed.

Parameters:
title - the title for the frame
location - the constant representing the frame location
Returns:
the frame constructed
Since:
2.3.5

frame

public JPTFrame frame(String title,
                      Insets insets)

Frame this panel in a JPTFrame and open the frame; use the given title for the frame; use the given insets to inset the frame in the screen; return the frame constructed.

Parameters:
title - the title for the frame
insets - the screen insets to use to adjust the location
Returns:
the frame constructed
Since:
2.3.5

frame

public JPTFrame frame(String title,
                      int location,
                      Insets insets)

Frame this panel in a JPTFrame and open the frame; use the given title for the frame; use the given location which should be either CENTER or one of the standard constants for one of the eight compass directions; use the given insets to inset the frame in the screen; return the frame constructed.

Parameters:
title - the title for the frame
location - the constant representing the frame location
insets - the screen insets to use to adjust the location
Returns:
the frame constructed
Since:
2.3.5

OKDialog

public GeneralDialog OKDialog()

Place this panel in a modal OK dialog and open the dialog; return the dialog constructed.

Returns:
the dialog constructed
Since:
2.3.5

OKDialog

public GeneralDialog OKDialog(String title)

Place this panel in a modal OK dialog and open the dialog; use the given title for the dialog; return the dialog constructed.

Parameters:
title - the title for the dialog
Returns:
the dialog constructed
Since:
2.3.5

OKCancelDialog

public GeneralDialog OKCancelDialog()

Place this panel in a modal OK-Cancel dialog and open the dialog; return the dialog constructed.

Returns:
the dialog constructed
Since:
2.3.5

OKCancelDialog

public GeneralDialog OKCancelDialog(String title)

Place this panel in a modal OK-Cancel dialog and open the dialog; use the given title for the dialog; return the dialog constructed.

Parameters:
title - the title for the dialog
Returns:
the dialog constructed
Since:
2.3.5

YesNoCancelDialog

public GeneralDialog YesNoCancelDialog()

Place this panel in a modal Yes-No-Cancel dialog and open the dialog; return the dialog constructed.

Returns:
the dialog constructed
Since:
2.3.5

YesNoCancelDialog

public GeneralDialog YesNoCancelDialog(String title)

Place this panel in a modal Yes-No-Cancel dialog and open the dialog; use the given title for the dialog; return the dialog constructed.

Parameters:
title - the title for the dialog
Returns:
the dialog constructed
Since:
2.3.5

generalDialog

public GeneralDialog generalDialog(Object[][] actionData)

Place this panel in a modal general dialog and open the dialog; use the action data to define the dialog buttons; return the dialog constructed.

The parameter actionData is an Object[][] array that specifies each dialog Action in one of the following ways:

If the option parameter is specified, it must be one of the following values that will determine what is done to the dialog when the action is finished:

If the option parameter is not specified, it is taken to be DialogAction.AUTO_CLOSE.

Parameters:
actionData - the action data
Returns:
the dialog constructed
Since:
2.3.5

generalDialog

public GeneralDialog generalDialog(Object[][] actionData,
                                   Object defaultAction)

Place this panel in a modal general dialog and open the dialog; use the action data to define the dialog buttons; use the default action object to define the default button; return the dialog constructed.

The parameter actionData is an Object[][] array that specifies each dialog Action in one of the following ways:

If the option parameter is specified, it must be one of the following values that will determine what is done to the dialog when the action is finished:

If the option parameter is not specified, it is taken to be DialogAction.AUTO_CLOSE.

The Object supplied for the default action must either be an Action or a name that is supplied in the action data. If the parameter is null, no default action is set.

Parameters:
actionData - the action data
defaultAction - the default action
Returns:
the dialog constructed
Since:
2.3.5

generalDialog

public GeneralDialog generalDialog(String title,
                                   Object[][] actionData)

Place this panel in a modal general dialog and open the dialog; use the given title for the dialog; use the action data to define the dialog buttons; return the dialog constructed.

The parameter actionData is an Object[][] array that specifies each dialog Action in one of the following ways:

If the option parameter is specified, it must be one of the following values that will determine what is done to the dialog when the action is finished:

If the option parameter is not specified, it is taken to be DialogAction.AUTO_CLOSE.

Parameters:
title - the title for the dialog
actionData - the action data
Returns:
the dialog constructed
Since:
2.3.5

generalDialog

public GeneralDialog generalDialog(String title,
                                   Object[][] actionData,
                                   Object defaultAction)

Place this panel in a modal general dialog and open the dialog; use the given title for the dialog; use the action data to define the dialog buttons; use the default action object to define the default button; return the dialog constructed.

The parameter actionData is an Object[][] array that specifies each dialog Action in one of the following ways:

If the option parameter is specified, it must be one of the following values that will determine what is done to the dialog when the action is finished:

If the option parameter is not specified, it is taken to be DialogAction.AUTO_CLOSE.

The Object supplied for the default action must either be an Action or a name that is supplied in the action data. If the parameter is null, no default action is set.

Parameters:
title - the title for the dialog
actionData - the action data
defaultAction - the default action
Returns:
the dialog constructed
Since:
2.3.5

refreshComponent

public void refreshComponent()
Refreshes the component by repacking the parent window.