|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
edu.utk.cs.icl.rest.swing.DisplayItem
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 |
| ClientNode | NA | NA | NA | NA | NA |
| ServerNode | NA | NA | NA | NA | NA |
| Image | UP | 1.0f | NA | 0.5f | 0.2f/0.075f |
| ImageIcon | UP | 1.0f | NA | 0.5f | 0.2f/0.075f |
| Line2D | UP | 1.0f | Color.blue | 0.5f | 0.15f/.1f |
| QuadCurve2D | UP | 1.0f | Color.blue | 0.5f | 0.15f/.1f |
| String | UP | 1.0f | Color.blue | 0.5f | 0.15f/.1f |
| RoundedRectangle2D.Double | UP | 1.0f | Color.blue | 0.5f | 0.2f/.1f |
| 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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int STOP
public static final int DOWN
public static final int UP
public static final int BOTH
| Constructor Detail |
public DisplayItem(Object object,
DisplayItemInterface elI)
elI - Required Class implementing DisplayItemInterfaceobject - The object to paint.
public DisplayItem(Object object,
Color paint,
DisplayItemInterface elI)
elI - Required Class implementing DisplayItemInterfaceobject - The object to paint.paint - Color of the object
public DisplayItem(Object object,
float elStep,
DisplayItemInterface elI)
elI - Required Class implementing DisplayItemInterfaceobject - The object to paint.elStep - fading step of the object
public DisplayItem(Object object,
Color paint,
BasicStroke elStroke,
DisplayItemInterface elI)
elI - Required Class implementing DisplayItemInterfaceobject - The object to paint.paint - Color of the objectelStroke - stroke used to paint the object
public DisplayItem(Object object,
Color paint,
float elStep,
DisplayItemInterface elI)
elI - Required Class implementing DisplayItemInterfaceobject - The object to paint.paint - Color of the objectelStep - fading step of the object
public DisplayItem(Object object,
Color paint,
BasicStroke elStroke,
float elStep,
DisplayItemInterface elI)
elI - Required Class implementing DisplayItemInterfaceobject - The object to paint.paint - Color of the objectelStroke - stroke used to paint the objectelStep - fading step of the objectDisplayItem
public DisplayItem(Object object,
Color paint,
BasicStroke elStroke,
float elStep,
boolean useStatic,
DisplayItemInterface elI)
useStatic - Unused variableelI - Required Class implementing DisplayItemInterfaceobject - The object to paint.paint - Color of the objectelStroke - stroke used to paint the objectelStep - fading step of the objectDisplayItem| Method Detail |
public void setAlpha(float fTmp)
fTmp - Float between 0.0f and 1.0f representing the alpha for this object.public float getAlpha()
public void setAlphaDirection(int iTmp)
iTmp - DisplayItem.DOWN, DisplayItem.STOP, DisplayItem.UP are the only excepted valuespublic int getAlphaDirection()
DOWN,
STOP,
UPpublic float getAlphaStatus()
public void setBasicStrokeType(BasicStroke basicType)
basicType - New value of property bsType.public BasicStroke getBasicStrokeType()
public void setBorderHeight(int borderHeight)
borderHeight - New value of property borderHeight.public int getBorderHeight()
public void setBorderWidth(int borderWidth)
borderWidth - New value of property borderWidth.public int getBorderWidth()
public void setBrightness(int Percentage)
Percentage - Value to increase/decrease the brightness. Values greater then 100 will increase
the brightness. Values less then 100 will decrease the brightness.public void setColor(Color newColor)
newColor - New color for the forgroundpublic Color getColor()
public void setDOWNAction(int elInt)
elInt - Either STOP or UP
public void setDimensions(int width,
int height)
width - Width of the itemheight - Height of the itempublic Icon getDisabledIcon()
public void setDynamicSize(boolean dynamicSize)
dynamicSize - New value of property dynamicSize.public boolean isDynamicSize()
public void setElParent(DisplayItemInterface elParent)
elParent - New value of property elParent.public DisplayItemInterface getElParent()
public void setFSleepVal(float fSleepVal)
fSleepVal - New value of property fSleepVal.public float getFSleepVal()
public void setFilled(boolean filled)
filled - New value of property filled.public boolean isFilled()
public void setHorizontalAlignment(int horizontalAlignment)
horizontalAlignment - New value of property horizontalAlignment.public int getHorizontalAlignment()
public void setHorizontalTextPosition(int horizontalTextPosition)
horizontalTextPosition - New value of property horizontalTextPosition.public int getHorizontalTextPosition()
public void setIconTextGap(int iconTextGap)
iconTextGap - New value of property iconTextGap.public int getIconTextGap()
public Object getItem()
public void setMaxAlpha(float elAlpha)
elAlpha - Value between 0.0f and 1.0fpublic void setMinAlpha(float elAlpha)
elAlpha - Value between 0.0f and 1.0fpublic void setNewImage(boolean newImage)
newImage - New value of property newImage.public boolean isNewImage()
public void setObject(Object object)
object - New object to paint. For support objects see top of page.DisplayItempublic void setPainting(boolean toWhat)
toWhat - Wether it is painting or not.public boolean getPainting()
public boolean getPaintingFinished()
public void setSaturation(double s)
s - Value betwee 0 and 1000public void setStep(float elFloat)
elFloat - Value to set the stepsetStep(float elFloat, int iWhich)
public void setStep(float elFloat,
int iWhich)
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.public void setUI(DisplayItemUI ui)
ui - the DisplayItemUI L&F objectUIDefaults.getUI(javax.swing.JComponent)public DisplayItemUI getUI()
public String getUIClassID()
JComponent.getUIClassID(),
UIDefaults.getUI(javax.swing.JComponent)public void setUPAction(int elInt)
elInt - Either DOWN or STOPpublic void setVerticalAlignment(int verticalAlignment)
verticalAlignment - New value of property verticalAlignment.public int getVerticalAlignment()
public void setVerticalTextPosition(int verticalTextPosition)
verticalTextPosition - New value of property verticalTextPosition.public int getVerticalTextPosition()
public void setVisible(boolean elVisible)
elVisible - True to fade in, False to fade out.public boolean getVisible()
public void setXY(int tmpX,
int tmpY)
tmpX - X coordinatetmpY - Y coordinatepublic void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenere - Eventpublic void finishRepaint()
public void requestRepaint()
public void updateUI()
JComponent.updateUI()protected void fadeMe()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||