|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttemplates.diagram.SimpleIcon
public class SimpleIcon
Simple implementation of the EntityIcon interface. The icon is either
rectangular or oval (depending on the type of rendered component), with
uniform background, containing the "tag" of the component.
| Field Summary | |
|---|---|
protected java.awt.Color |
bgColor
Background color of the icon. |
protected int |
deltaX
The displacement of the text inside the icon, in the X direction. |
protected int |
deltaY
The displacement of the text inside the icon, in the Y direction. |
protected static java.awt.Stroke |
FAT_LINE_STROKE
Line stroke for the border of the icon. |
protected java.awt.Color |
fgColor
Color of the text inside the icon (if any). |
protected boolean |
flag
Is the icon "flagged". |
protected int |
flaggedDeltaX
The displacement of the text inside the icon when it is "flagged", in the X direction. |
protected int |
flaggedDeltaY
The displacement of the text inside the icon when it is "flagged", in the Y direction. |
protected int |
flaggedH
Height of the icon when it is "flagged". |
protected java.lang.String |
flaggedTag
Text inside the icon when it is "flagged". |
protected int |
flaggedW
Width of the icon when it is "flagged". |
protected int |
h
Height of the icon. |
protected boolean |
isModule
Does the icon represent a module ( true) or a
channel (false). |
protected static int |
SPACING
Space to be added between the icon border and the text inside the icon (if any), in pixels. |
protected java.lang.String |
tag
Text inside the icon. |
protected int |
w
Width of the icon. |
| Fields inherited from interface templates.utils.EntityIcon |
|---|
BOX_DISTANCE |
| Constructor Summary | |
|---|---|
SimpleIcon()
Construct a simple icon with default attributes. |
|
SimpleIcon(java.lang.String tag,
java.awt.Color color,
java.awt.Graphics context)
Construct a simple icon with the given parameters. |
|
| Method Summary | |
|---|---|
SimpleIcon |
clone()
Create a clone of this icon. |
java.awt.Color |
getColor()
Retrieve the background color of the icon. |
int |
getIconHeight()
|
int |
getIconWidth()
|
java.lang.String |
getTag()
Retrieve the text rendered inside the icon. |
boolean |
isFlagged()
Check if the icon is "flagged". |
void |
paintIcon(java.awt.Component arg0,
java.awt.Graphics g,
int x,
int y)
|
void |
paintIcon(java.awt.Graphics g,
int x,
int y,
java.awt.Color color)
Render the icon in the given graphics context according to the given parameters. |
void |
setColor(java.awt.Color color)
Set the background color of the icon. |
void |
setFlagged(boolean b)
Specify if the icon has to be "flagged". |
void |
setIsModule(boolean b)
Specify the type of icon to be painted. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.awt.Stroke FAT_LINE_STROKE
protected static final int SPACING
protected java.awt.Color bgColor
protected java.awt.Color fgColor
protected java.lang.String tag
protected java.lang.String flaggedTag
protected int w
protected int flaggedW
protected int h
protected int flaggedH
protected int deltaY
protected int flaggedDeltaY
protected int deltaX
protected int flaggedDeltaX
protected boolean isModule
true) or a
channel (false).
protected boolean flag
| Constructor Detail |
|---|
public SimpleIcon(java.lang.String tag,
java.awt.Color color,
java.awt.Graphics context)
tag - the text inside the icon (can be the empty string)color - the background color of the iconcontext - the graphical context to be used for font metrics informationpublic SimpleIcon()
| Method Detail |
|---|
public int getIconHeight()
getIconHeight in interface javax.swing.Iconpublic int getIconWidth()
getIconWidth in interface javax.swing.Icon
public void paintIcon(java.awt.Component arg0,
java.awt.Graphics g,
int x,
int y)
paintIcon in interface javax.swing.Icon
public void paintIcon(java.awt.Graphics g,
int x,
int y,
java.awt.Color color)
EntityIcon
paintIcon in interface EntityIcong - the graphics context where the icon has to be renderedx - the location of the icon on the horizontal axisy - the location of the icon on the vertical axiscolor - the color to be used for the border of the iconpublic SimpleIcon clone()
EntityIcon
clone in interface EntityIconclone in class java.lang.Objectpublic void setIsModule(boolean b)
EntityIcon
setIsModule in interface EntityIconb - specify true for an icon for template components
of type module, specify false for an icon for
template components of type channelpublic java.awt.Color getColor()
EntityIcon
getColor in interface EntityIconpublic boolean isFlagged()
EntityIcon
isFlagged in interface EntityIcontrue if the icon is "flagged"; false
otherwisepublic void setColor(java.awt.Color color)
EntityIcon
setColor in interface EntityIconcolor - the new background color of the iconpublic void setFlagged(boolean b)
EntityIcon
setFlagged in interface EntityIconb - specify true if the icon has to be "flagged",
specify false otherwisepublic java.lang.String getTag()
EntityIcon
getTag in interface EntityIcon
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||