templates.utils
Interface EntityIcon

All Superinterfaces:
javax.swing.Icon
All Known Implementing Classes:
SimpleIcon

public interface EntityIcon
extends javax.swing.Icon

Interface for the icons used to represent components in a template design.

Author:
Lenko Grigorov

Field Summary
static int BOX_DISTANCE
          The minimal width and height of the icon in pixels.
 
Method Summary
 EntityIcon clone()
          Create a clone of this icon.
 java.awt.Color getColor()
          Retrieve the background color of the icon.
 java.lang.String getTag()
          Retrieve the text rendered inside the icon.
 boolean isFlagged()
          Check if the icon is "flagged".
 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 interface javax.swing.Icon
getIconHeight, getIconWidth, paintIcon
 

Field Detail

BOX_DISTANCE

static final int BOX_DISTANCE
The minimal width and height of the icon in pixels.

See Also:
Constant Field Values
Method Detail

clone

EntityIcon clone()
Create a clone of this icon.

Returns:
the clone of this icon

setIsModule

void setIsModule(boolean b)
Specify the type of icon to be painted.

Parameters:
b - specify true for an icon for template components of type module, specify false for an icon for template components of type channel

paintIcon

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.

Parameters:
g - the graphics context where the icon has to be rendered
x - the location of the icon on the horizontal axis
y - the location of the icon on the vertical axis
color - the color to be used for the border of the icon

setColor

void setColor(java.awt.Color color)
Set the background color of the icon.

Parameters:
color - the new background color of the icon

getColor

java.awt.Color getColor()
Retrieve the background color of the icon.

Returns:
the background color of the icon

setFlagged

void setFlagged(boolean b)
Specify if the icon has to be "flagged".

Parameters:
b - specify true if the icon has to be "flagged", specify false otherwise

isFlagged

boolean isFlagged()
Check if the icon is "flagged".

Returns:
true if the icon is "flagged"; false otherwise

getTag

java.lang.String getTag()
Retrieve the text rendered inside the icon.

Returns:
the text rendered inside the icon