pl.edu.agh.cast.figure.icons
Class AbstractNodeIconFactory
java.lang.Object
pl.edu.agh.cast.figure.icons.AbstractNodeIconFactory
- All Implemented Interfaces:
- INodeIconFactory
- Direct Known Subclasses:
- CoreNodeIconFactory
public abstract class AbstractNodeIconFactory
- extends java.lang.Object
- implements INodeIconFactory
Abstract factory for creating NodeIcons
. It should be extended
by factories provided to pl.edu.agh.cast.nodeIcons
extension
point.
Classes that derive from this abstract class should only call init()
when created.
- Author:
- tmilos
Method Summary |
static NodeIcon |
createNodeIcon(java.lang.Class location,
java.lang.String type,
java.lang.String name,
java.lang.String iconPath,
java.lang.String smallIconPath,
java.lang.String group)
Creates node icon object. |
java.util.Collection<NodeIcon> |
getNodeIcons()
|
protected void |
init(java.lang.Class location,
java.lang.String[][] description)
Initializes the factory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractNodeIconFactory
public AbstractNodeIconFactory()
getNodeIcons
public java.util.Collection<NodeIcon> getNodeIcons()
- Specified by:
getNodeIcons
in interface INodeIconFactory
- Returns:
- collection of node icons provided by EP extender
init
protected void init(java.lang.Class location,
java.lang.String[][] description)
- Initializes the factory. Creates
NodeIcon
s according to
provided location
and description
.
- Parameters:
location
- defines the base path for image file lookup
(see org.eclipse.jface.resource.ImageDescriptor.createFromFile(Class, String)
location
parameter)description
- description of icons provided in a Nx5 String array, where N
is the number of rows. Each row has to have 5 cells which
fully describe a NodeIcon
to be created. The
cells should contain:
- The type of node the icon is for (by default). This should
be a unique value.
- Localized display name of the icon
- Path to the icon large image file (relative to the
location
)
- Path to the icon small image file (relative to the
location
)
- Localized name of the group this icon is in. This
parameter is used to group icons in editor tools, such as
Palette's
createNodeIcon
public static NodeIcon createNodeIcon(java.lang.Class location,
java.lang.String type,
java.lang.String name,
java.lang.String iconPath,
java.lang.String smallIconPath,
java.lang.String group)
- Creates node icon object. If any of the specified images does not exist
null
is returned.
- Parameters:
location
- type
- name
- iconPath
- smallIconPath
- group
-
- Returns:
Copyright © 2007-2008 AGH University of Science and Technology. All Rights Reserved.