edu.utk.cs.icl.rest.swing
Class DisplayItem

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byedu.utk.cs.icl.rest.swing.DisplayItem
All Implemented Interfaces:
ActionListener, EventListener, ImageObserver, MenuContainer, Serializable, SwingConstants

public class DisplayItem
extends JComponent
implements SwingConstants, ActionListener

DisplayItem is the core component of the display API used to control the items painted on any of the Panels(mainly however the globalCanvas). The functionality of this class is through the simplification of tasks such as adjusting image saturation, brightness, fading paintable object in and out, etc. The objects supported by this class are listed in the table below with their default values listed below.

Supported DisplayItems and their default values
Object:AlphaDirection:Brightness:Color:Stroke:Step:UP/DOWN
ClientNodeNANANANANA
ServerNodeNANANANANA
ImageUP1.0fNA0.5f0.2f/0.075f
ImageIconUP1.0fNA0.5f0.2f/0.075f
Line2DUP1.0fColor.blue0.5f0.15f/.1f
QuadCurve2DUP1.0fColor.blue0.5f0.15f/.1f
StringUP1.0fColor.blue0.5f0.15f/.1f
RoundedRectangle2D.DoubleUP1.0fColor.blue0.5f0.2f/.1f

Since:
1.0
Version:
$Revision: 1.14 $ $Date: 2005/01/31 19:14:54 $
Author:
Eric Meek (meek@cs.utk.edu)
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
static int BOTH
          Used to modify the attributes of the objects fading up and down actions.
static int DOWN
          Flag used to either get or set the fading direction to DOWN
static int STOP
          Stops an object in it's current state.
static int UP
          Flag used to either get or set the fading direction to UP
 
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.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
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
DisplayItem(Object object, Color paint, BasicStroke elStroke, DisplayItemInterface elI)
          Create a DisplayItem of the given object, color and stroke.
DisplayItem(Object object, Color paint, BasicStroke elStroke, float elStep, boolean useStatic, DisplayItemInterface elI)
          Create a DisplayItem of the given object, color, stroke and step.
DisplayItem(Object object, Color paint, BasicStroke elStroke, float elStep, DisplayItemInterface elI)
          Create a DisplayItem of the given object, color, stroke and step.
DisplayItem(Object object, Color paint, DisplayItemInterface elI)
          Create a DisplayItem of the given object and the given color.
DisplayItem(Object object, Color paint, float elStep, DisplayItemInterface elI)
          Create a DisplayItem of the given object, color and step.
DisplayItem(Object object, DisplayItemInterface elI)
          Create a DisplayItem of the given object.
DisplayItem(Object object, float elStep, DisplayItemInterface elI)
          Create a DisplayItem of the given object and the given step value.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Handle actionPerformed
protected  void fadeMe()
          Setup the display item correctly
 void finishRepaint()
          Decrement the repaint counter and if necessary stop the repaint thread
 float getAlpha()
          Getter for property alpha.
 int getAlphaDirection()
          Returns the direction this object is fading.
 float getAlphaStatus()
          Get the alpha value of this object.
 BasicStroke getBasicStrokeType()
          Getter for property bsType.
 int getBorderHeight()
          Getter for property borderHeight.
 int getBorderWidth()
          Getter for property borderWidth.
 Color getColor()
          Gets the color of this display item
 Icon getDisabledIcon()
          Returns the value of the disabledIcon property if it's been set, If it hasn't been set and the value of the icon property is an ImageIcon, we compute a "grayed out" version of the icon and update the disabledIcon property with that.
 DisplayItemInterface getElParent()
          Getter for property elParent.
 float getFSleepVal()
          Getter for property fSleepVal.
 int getHorizontalAlignment()
          Getter for property horizontalAlignment.
 int getHorizontalTextPosition()
          Getter for property horizontalTextPosition.
 int getIconTextGap()
          Getter for property iconTextGap.
 Object getItem()
          Returns the object in it's curret state.
 boolean getPainting()
          Returns if this object is being painted
 boolean getPaintingFinished()
          Returns if this object is being painted
 DisplayItemUI getUI()
          Returns the L&F object that renders this component.
 String getUIClassID()
          Returns a string that specifies the name of the l&f class that renders this component.
 int getVerticalAlignment()
          Getter for property verticalAlignment.
 int getVerticalTextPosition()
          Getter for property verticalTextPosition.
 boolean getVisible()
          Returns if this object is visible, e.g. alpha value greater then 0.
 boolean isDynamicSize()
          Getter for property dynamicSize.
 boolean isFilled()
          Getter for property filled.
 boolean isNewImage()
          Getter for property newImage.
 void requestRepaint()
          Increment the repaint counter and if necessary create and start a new reapaint thread
 void setAlpha(float fTmp)
          Set the alpha value for this object
 void setAlphaDirection(int iTmp)
          Set the direction to fade this object.
 void setBasicStrokeType(BasicStroke basicType)
          Setter for property bsType.
 void setBorderHeight(int borderHeight)
          Setter for property borderHeight.
 void setBorderWidth(int borderWidth)
          Setter for property borderWidth.
 void setBrightness(int Percentage)
          Set the brightness of the current object.
 void setColor(Color newColor)
          Set the color of this object.
 void setDimensions(int width, int height)
          Sets new dimensions for the DisplayItem
 void setDOWNAction(int elInt)
          Set the default action once the minAlpha has been reached, e.g. if an object fades all the way out and the down action is set to UP, the object will begin to fade back in.
 void setDynamicSize(boolean dynamicSize)
          Setter for property dynamicSize.
 void setElParent(DisplayItemInterface elParent)
          Setter for property elParent.
 void setFilled(boolean filled)
          Setter for property filled.
 void setFSleepVal(float fSleepVal)
          Setter for property fSleepVal.
 void setHorizontalAlignment(int horizontalAlignment)
          Setter for property horizontalAlignment.
 void setHorizontalTextPosition(int horizontalTextPosition)
          Setter for property horizontalTextPosition.
 void setIconTextGap(int iconTextGap)
          Setter for property iconTextGap.
 void setMaxAlpha(float elAlpha)
          Sets the max alpha value to fade an object.
 void setMinAlpha(float elAlpha)
          Sets the min alpha value to fade an object.
 void setNewImage(boolean newImage)
          Setter for property newImage.
 void setObject(Object object)
          Changes the object being painted.
 void setPainting(boolean toWhat)
          Set if this object is being painted.
 void setSaturation(double s)
          setSaturation allow for control of the saturation value on objects supported by this class.
 void setStep(float elFloat)
          Sets both the up and down step to the value supplied
 void setStep(float elFloat, int iWhich)
          Controls how fast the object should fade in and out.
 void setUI(DisplayItemUI ui)
          Sets the L&F object that renders this component.
 void setUPAction(int elInt)
          Set the default action once the maxAlpha has been reached, e.g. if an object fades all the way in and the up action is set to DOWN, the object will begin to fade out.
 void setVerticalAlignment(int verticalAlignment)
          Setter for property verticalAlignment.
 void setVerticalTextPosition(int verticalTextPosition)
          Setter for property verticalTextPosition.
 void setVisible(boolean elVisible)
          Changes the visibility of the object safely, i.e. the object doesn't just disappear but fades.
 void setXY(int tmpX, int tmpY)
          Set the x and y coordinates of the object
 void updateUI()
          Resets the UI property to a value from the current look and feel.
 
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, 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, 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, unregisterKeyboardAction, update
 
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
 

Field Detail

STOP

public static final int STOP
Stops an object in it's current state. That is, the object doesn't fade up or down but stays at the current alpha level.

See Also:
Constant Field Values

DOWN

public static final int DOWN
Flag used to either get or set the fading direction to DOWN

See Also:
Constant Field Values

UP

public static final int UP
Flag used to either get or set the fading direction to UP

See Also:
Constant Field Values

BOTH

public static final int BOTH
Used to modify the attributes of the objects fading up and down actions.

See Also:
Constant Field Values
Constructor Detail

DisplayItem

public DisplayItem(Object object,
                   DisplayItemInterface elI)
Create a DisplayItem of the given object. The default values are:

Parameters:
elI - Required Class implementing DisplayItemInterface
object - The object to paint.

DisplayItem

public DisplayItem(Object object,
                   Color paint,
                   DisplayItemInterface elI)
Create a DisplayItem of the given object and the given color. The default values are:

Parameters:
elI - Required Class implementing DisplayItemInterface
object - The object to paint.
paint - Color of the object

DisplayItem

public DisplayItem(Object object,
                   float elStep,
                   DisplayItemInterface elI)
Create a DisplayItem of the given object and the given step value. The default values are:

Parameters:
elI - Required Class implementing DisplayItemInterface
object - The object to paint.
elStep - fading step of the object

DisplayItem

public DisplayItem(Object object,
                   Color paint,
                   BasicStroke elStroke,
                   DisplayItemInterface elI)
Create a DisplayItem of the given object, color and stroke. The default values are:

Parameters:
elI - Required Class implementing DisplayItemInterface
object - The object to paint.
paint - Color of the object
elStroke - stroke used to paint the object

DisplayItem

public DisplayItem(Object object,
                   Color paint,
                   float elStep,
                   DisplayItemInterface elI)
Create a DisplayItem of the given object, color and step. The default values are:

Parameters:
elI - Required Class implementing DisplayItemInterface
object - The object to paint.
paint - Color of the object
elStep - fading step of the object

DisplayItem

public DisplayItem(Object object,
                   Color paint,
                   BasicStroke elStroke,
                   float elStep,
                   DisplayItemInterface elI)
Create a DisplayItem of the given object, color, stroke and step. This constructor support several types of objects. Each object has default which can be over written though the use of this constructor. For more information on what objects this class supports see the main description.

Parameters:
elI - Required Class implementing DisplayItemInterface
object - The object to paint.
paint - Color of the object
elStroke - stroke used to paint the object
elStep - fading step of the object
See Also:
DisplayItem

DisplayItem

public DisplayItem(Object object,
                   Color paint,
                   BasicStroke elStroke,
                   float elStep,
                   boolean useStatic,
                   DisplayItemInterface elI)
Create a DisplayItem of the given object, color, stroke and step. This constructor support several types of objects. Each object has default which can be over written though the use of this constructor. For more information on what objects this class supports see the main description.

Parameters:
useStatic - Unused variable
elI - Required Class implementing DisplayItemInterface
object - The object to paint.
paint - Color of the object
elStroke - stroke used to paint the object
elStep - fading step of the object
See Also:
DisplayItem
Method Detail

setAlpha

public void setAlpha(float fTmp)
Set the alpha value for this object

Parameters:
fTmp - Float between 0.0f and 1.0f representing the alpha for this object.

getAlpha

public float getAlpha()
Getter for property alpha.

Returns:
Value of property alpha.

setAlphaDirection

public void setAlphaDirection(int iTmp)
Set the direction to fade this object.

Parameters:
iTmp - DisplayItem.DOWN, DisplayItem.STOP, DisplayItem.UP are the only excepted values

getAlphaDirection

public int getAlphaDirection()
Returns the direction this object is fading.

Returns:
Returns one of the static integers used to signify the direction.
See Also:
DOWN, STOP, UP

getAlphaStatus

public float getAlphaStatus()
Get the alpha value of this object.

Returns:
Current alpha value for this object

setBasicStrokeType

public void setBasicStrokeType(BasicStroke basicType)
Setter for property bsType.

Parameters:
basicType - New value of property bsType.

getBasicStrokeType

public BasicStroke getBasicStrokeType()
Getter for property bsType.

Returns:
Value of property bsType.

setBorderHeight

public void setBorderHeight(int borderHeight)
Setter for property borderHeight.

Parameters:
borderHeight - New value of property borderHeight.

getBorderHeight

public int getBorderHeight()
Getter for property borderHeight.

Returns:
Value of property borderHeight.

setBorderWidth

public void setBorderWidth(int borderWidth)
Setter for property borderWidth.

Parameters:
borderWidth - New value of property borderWidth.

getBorderWidth

public int getBorderWidth()
Getter for property borderWidth.

Returns:
Value of property borderWidth.

setBrightness

public void setBrightness(int Percentage)
Set the brightness of the current object. Similar to setHighlight however this method accepts a value to increase/decrease the brightness.

Parameters:
Percentage - Value to increase/decrease the brightness. Values greater then 100 will increase the brightness. Values less then 100 will decrease the brightness.

setColor

public void setColor(Color newColor)
Set the color of this object.

Parameters:
newColor - New color for the forground

getColor

public Color getColor()
Gets the color of this display item

Returns:
Color of the displayitem

setDOWNAction

public void setDOWNAction(int elInt)
Set the default action once the minAlpha has been reached, e.g. if an object fades all the way out and the down action is set to UP, the object will begin to fade back in.

Parameters:
elInt - Either STOP or UP

setDimensions

public void setDimensions(int width,
                          int height)
Sets new dimensions for the DisplayItem

Parameters:
width - Width of the item
height - Height of the item

getDisabledIcon

public Icon getDisabledIcon()
Returns the value of the disabledIcon property if it's been set, If it hasn't been set and the value of the icon property is an ImageIcon, we compute a "grayed out" version of the icon and update the disabledIcon property with that.

Returns:
The value of the disabledIcon property.

setDynamicSize

public void setDynamicSize(boolean dynamicSize)
Setter for property dynamicSize.

Parameters:
dynamicSize - New value of property dynamicSize.

isDynamicSize

public boolean isDynamicSize()
Getter for property dynamicSize.

Returns:
Value of property dynamicSize.

setElParent

public void setElParent(DisplayItemInterface elParent)
Setter for property elParent.

Parameters:
elParent - New value of property elParent.

getElParent

public DisplayItemInterface getElParent()
Getter for property elParent.

Returns:
Value of property elParent.

setFSleepVal

public void setFSleepVal(float fSleepVal)
Setter for property fSleepVal.

Parameters:
fSleepVal - New value of property fSleepVal.

getFSleepVal

public float getFSleepVal()
Getter for property fSleepVal.

Returns:
Value of property fSleepVal.

setFilled

public void setFilled(boolean filled)
Setter for property filled.

Parameters:
filled - New value of property filled.

isFilled

public boolean isFilled()
Getter for property filled.

Returns:
Value of property filled.

setHorizontalAlignment

public void setHorizontalAlignment(int horizontalAlignment)
Setter for property horizontalAlignment.

Parameters:
horizontalAlignment - New value of property horizontalAlignment.

getHorizontalAlignment

public int getHorizontalAlignment()
Getter for property horizontalAlignment.

Returns:
Value of property horizontalAlignment.

setHorizontalTextPosition

public void setHorizontalTextPosition(int horizontalTextPosition)
Setter for property horizontalTextPosition.

Parameters:
horizontalTextPosition - New value of property horizontalTextPosition.

getHorizontalTextPosition

public int getHorizontalTextPosition()
Getter for property horizontalTextPosition.

Returns:
Value of property horizontalTextPosition.

setIconTextGap

public void setIconTextGap(int iconTextGap)
Setter for property iconTextGap.

Parameters:
iconTextGap - New value of property iconTextGap.

getIconTextGap

public int getIconTextGap()
Getter for property iconTextGap.

Returns:
Value of property iconTextGap.

getItem

public Object getItem()
Returns the object in it's curret state. So if an image has been desaturated, the returned image will also be desaturated.

Returns:
The object being painted

setMaxAlpha

public void setMaxAlpha(float elAlpha)
Sets the max alpha value to fade an object. Will either set the alpha direction to UP or DOWN depending if the new max alpha is greater or less the the current alpha value. Usefull for making objects semi-transparent.

Parameters:
elAlpha - Value between 0.0f and 1.0f

setMinAlpha

public void setMinAlpha(float elAlpha)
Sets the min alpha value to fade an object. Will either set the alpha direction to UP or DOWN depending if the new min alpha is greater or less the the current alpha value. Usefull for making objects semi-transparent.

Parameters:
elAlpha - Value between 0.0f and 1.0f

setNewImage

public void setNewImage(boolean newImage)
Setter for property newImage.

Parameters:
newImage - New value of property newImage.

isNewImage

public boolean isNewImage()
Getter for property newImage.

Returns:
Value of property newImage.

setObject

public void setObject(Object object)
Changes the object being painted.

Parameters:
object - New object to paint. For support objects see top of page.
See Also:
DisplayItem

setPainting

public void setPainting(boolean toWhat)
Set if this object is being painted. If setting to true, the visibility of the object will also change to true.

Parameters:
toWhat - Wether it is painting or not.

getPainting

public boolean getPainting()
Returns if this object is being painted

Returns:
Painting value

getPaintingFinished

public boolean getPaintingFinished()
Returns if this object is being painted

Returns:
Painting value

setSaturation

public void setSaturation(double s)
setSaturation allow for control of the saturation value on objects supported by this class. It is very useful for visualizing such things as workload, bandwith, etc.

Parameters:
s - Value betwee 0 and 1000

setStep

public void setStep(float elFloat)
Sets both the up and down step to the value supplied

Parameters:
elFloat - Value to set the step
See Also:
setStep(float elFloat, int iWhich)

setStep

public void setStep(float elFloat,
                    int iWhich)
Controls how fast the object should fade in and out.

Parameters:
elFloat - Number of steps to take while fading. Values must be between 0.0f and 1.0f.
iWhich - Which step to change UP, DOWN or BOTH.

setUI

public void setUI(DisplayItemUI ui)
Sets the L&F object that renders this component.

Parameters:
ui - the DisplayItemUI L&F object
See Also:
UIDefaults.getUI(javax.swing.JComponent)

getUI

public DisplayItemUI getUI()
Returns the L&F object that renders this component.

Returns:
LabelUI object

getUIClassID

public String getUIClassID()
Returns a string that specifies the name of the l&f class that renders this component.

Returns:
String "DisplayItemUI"
See Also:
JComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)

setUPAction

public void setUPAction(int elInt)
Set the default action once the maxAlpha has been reached, e.g. if an object fades all the way in and the up action is set to DOWN, the object will begin to fade out.

Parameters:
elInt - Either DOWN or STOP

setVerticalAlignment

public void setVerticalAlignment(int verticalAlignment)
Setter for property verticalAlignment.

Parameters:
verticalAlignment - New value of property verticalAlignment.

getVerticalAlignment

public int getVerticalAlignment()
Getter for property verticalAlignment.

Returns:
Value of property verticalAlignment.

setVerticalTextPosition

public void setVerticalTextPosition(int verticalTextPosition)
Setter for property verticalTextPosition.

Parameters:
verticalTextPosition - New value of property verticalTextPosition.

getVerticalTextPosition

public int getVerticalTextPosition()
Getter for property verticalTextPosition.

Returns:
Value of property verticalTextPosition.

setVisible

public void setVisible(boolean elVisible)
Changes the visibility of the object safely, i.e. the object doesn't just disappear but fades.

Parameters:
elVisible - True to fade in, False to fade out.

getVisible

public boolean getVisible()
Returns if this object is visible, e.g. alpha value greater then 0.

Returns:
The visiblity of the object

setXY

public void setXY(int tmpX,
                  int tmpY)
Set the x and y coordinates of the object

Parameters:
tmpX - X coordinate
tmpY - Y coordinate

actionPerformed

public void actionPerformed(ActionEvent e)
Handle actionPerformed

Specified by:
actionPerformed in interface ActionListener
Parameters:
e - Event

finishRepaint

public void finishRepaint()
Decrement the repaint counter and if necessary stop the repaint thread


requestRepaint

public void requestRepaint()
Increment the repaint counter and if necessary create and start a new reapaint thread


updateUI

public void updateUI()
Resets the UI property to a value from the current look and feel.

See Also:
JComponent.updateUI()

fadeMe

protected void fadeMe()
Setup the display item correctly