All Packages Class Hierarchy This Package Previous Next Index
Class com.sgi.sysadm.ui.ResourceBasedIconRenderer
java.lang.Object
|
+----com.sgi.sysadm.ui.GenericItemRenderer
|
+----com.sgi.sysadm.ui.IconRenderer
|
+----com.sgi.sysadm.ui.ResourceBasedIconRenderer
- public class ResourceBasedIconRenderer
- extends IconRenderer
An icon renderer that renders using resources. This class supports
both FTR icons and .gif icons
- See Also:
- FtrIcon
-
BLINK_ATTRS
- A resource <name>.blinkAttr is a string array that gives
the names of Attributes in the Item.
-
BLINK_VALUES
- A resource <name>.blinkValue is a string array that gives
the values of Attributes that an Item may have.
-
DEFAULT_ICON
- A resource <name>.icon is a string that
specifies the icon to display if ICON_BASED_ON was not
specified, or if the value of ICON_BASED_ON's attribute is not
one of the values for which a particular icon has been
defined via the ICON property.
-
ICON
- A resource <name>.icon.<Attribute's
value> is a string that gives the name of the icon to
display if <Attribute's value> matches
the value of the attribute specified in ICON_BASED_ON.
-
ICON_BASED_ON
-
A resource <name>.iconBasedOn is a
string that specifies which Attribute the icon appearance
will be based on.
-
ICON_MODIFIERS
-
A resource <name>.iconModifiers is a
string array that specifies which Attributes of the Item the
icon's appearance
will be based on.
-
ResourceBasedIconRenderer(String, ResourceStack, HostContext)
- Construct a ResourceBasedIconRenderer for a particular
Category.
-
addIconListener(String, Object, int, int, RenderedObjectListener)
- Adds a RenderedObjectListener to the renderer
-
createIcon(Item, int, int, Object)
- Create an icon.
-
removeIconListener(String, RenderedObjectListener)
- Removes an RenderedObjectListener
ICON_MODIFIERS
public static final String ICON_MODIFIERS
- A resource <name>.iconModifiers is a
string array that specifies which Attributes of the Item the
icon's appearance
will be based on. The Attributes specified will be passed to
the set method of FtrIcon.
- See Also:
- set
ICON_BASED_ON
public static final String ICON_BASED_ON
- A resource <name>.iconBasedOn is a
string that specifies which Attribute the icon appearance
will be based on.
DEFAULT_ICON
public static final String DEFAULT_ICON
- A resource <name>.icon is a string that
specifies the icon to display if ICON_BASED_ON was not
specified, or if the value of ICON_BASED_ON's attribute is not
one of the values for which a particular icon has been
defined via the ICON property. The value of this resource can
either be the package qualified class
name of an FtrIcon or a classpath relative pathname to an image
file.
ICON
public static final String ICON
- A resource <name>.icon.<Attribute's
value> is a string that gives the name of the icon to
display if <Attribute's value> matches
the value of the attribute specified in ICON_BASED_ON. The
value of this resource can either be the package qualified class
name of an FtrIcon or a classpath relative pathname to an image
file.
BLINK_ATTRS
public static final String BLINK_ATTRS
- A resource <name>.blinkAttr is a string array that gives
the names of Attributes in the Item. If the value any of the
Attributes named in the array matches the corresponding string
in the BLINK_VALUES array, then then icon will blink.
For example, to blink if the Attribute "State" is "error"
add the following resources:
com.sgi.mypackage.category.myCategory.blinkAttr0 = State
com.sgi.mypackage.category.myCategory.blinkValue0 = error
To blink if the Attribute "State" is "error" or
"unknown", add the following resources:
com.sgi.mypackage.category.myCategory.blinkAttr0 = State
com.sgi.mypackage.category.myCategory.blinkAttr1 = State
com.sgi.mypackage.category.myCategory.blinkValue0 = error
com.sgi.mypackage.category.myCategory.blinkValue1 = unknown
To blink if Attribute "State" is "error" or Attribute
"Location" is "unknown", add the following resources:
com.sgi.mypackage.category.myCategory.blinkAttr0 = State
com.sgi.mypackage.category.myCategory.blinkAttr1 = Location
com.sgi.mypackage.category.myCategory.blinkValue0 = error
com.sgi.mypackage.category.myCategory.blinkValue1 = unknown
BLINK_VALUES
public static final String BLINK_VALUES
- A resource <name>.blinkValue is a string array that gives
the values of Attributes that an Item may have. If the values
of any of the Attributes named in the BLINK_ATTRS array match
the corresponding strings in the BLINK_ATTRS array, then then
icon will blink. See BLINK_ATTRS for more information.
- See Also:
- BLINK_ATTRS
ResourceBasedIconRenderer
public ResourceBasedIconRenderer(String fullCategoryName,
ResourceStack rs,
HostContext hc)
- Construct a ResourceBasedIconRenderer for a particular
Category.
- Parameters:
- fullCategoryName - The package qualified name of the
Category
- rs - The ResourceStack to use to look up the properties
- hc - The HostContext to use to get Categories.
addIconListener
public void addIconListener(String itemSelector,
Object context,
int iconWidth,
int iconHeight,
RenderedObjectListener listener)
- Adds a RenderedObjectListener to the renderer
- Overrides:
- addIconListener in class IconRenderer
removeIconListener
public void removeIconListener(String itemSelector,
RenderedObjectListener listener)
- Removes an RenderedObjectListener
- Overrides:
- removeIconListener in class IconRenderer
createIcon
protected Icon createIcon(Item item,
int width,
int height,
Object context)
- Create an icon. First try to create an FtrIcon; if that
doesn't work, try to create an ImageIcon.
- Parameters:
- item - The item
- width - The width of the Icon to create, in pixels
- height - The height of the Icon to create, in pixels
- context - The context to use. See GenericItemRenderer for
a description of the context.
- Returns:
- Icon corresponding to the item
- Overrides:
- createIcon in class IconRenderer
- See Also:
- GenericItemRenderer
All Packages Class Hierarchy This Package Previous Next Index