com.yworks.yfiles.bpmn.view
Class BpmnIcon

java.lang.Object
  extended bycom.yworks.yfiles.bpmn.view.BpmnIcon
All Implemented Interfaces:
Icon

public class BpmnIcon
extends Object
implements Icon

Displays BPMN data object type icons, marker icons, or task type icons.

GraphML (de-)serialization support is provided by class BpmnIcon.Handler.

See Also:
DataObjectTypeEnum, MarkerTypeEnum, TaskTypeEnum
 

Nested Class Summary
static class BpmnIcon.Handler
          Provides GraphML (de-)serialization support for BpmnIcon.
 
Constructor Summary
BpmnIcon(DataObjectTypeEnum type)
          Initializes a new BpmnIcon instance that displays an icon corresponding to the specified data object type.
BpmnIcon(MarkerTypeEnum type)
          Initializes a new BpmnIcon instance that displays an icon corresponding to the specified marker.
BpmnIcon(TaskTypeEnum type)
          Initializes a new BpmnIcon instance that displays an icon corresponding to the specified task type.
 
Method Summary
 Color getIconFillColor()
          Returns the primary fill color of this icon.
 Color getIconFillColor2()
          Returns the secondary fill color of this icon.
 int getIconHeight()
          Determines the height of the icon.
 Color getIconLineColor()
          Returns the line color of this icon.
 Object getIconType()
          Returns the type specifier identifying the displayed data object type, marker, or task type.
 int getIconWidth()
          Determines the width of the icon.
 void paintIcon(Component c, Graphics g, int x, int y)
          Paints this icon.
protected  void paintIcon(Graphics2D g, Rectangle2D bounds)
          Paints this icon.
 void setIconFillColor(Color color)
          Specifies the primary fill color for this icon.
 void setIconFillColor2(Color color)
          Specifies the secondary fill color for this icon.
 void setIconHeight(int iconHeight)
          Specifies the height of the icon.
 void setIconLineColor(Color color)
          Specifies the line (or border) color for this icon.
 void setIconWidth(int iconWidth)
          Specifies the width of the icon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BpmnIcon

public BpmnIcon(DataObjectTypeEnum type)
Initializes a new BpmnIcon instance that displays an icon corresponding to the specified data object type.

Parameters:
type - the data object type to visualize.

BpmnIcon

public BpmnIcon(MarkerTypeEnum type)
Initializes a new BpmnIcon instance that displays an icon corresponding to the specified marker.

Parameters:
type - the marker to visualize.

BpmnIcon

public BpmnIcon(TaskTypeEnum type)
Initializes a new BpmnIcon instance that displays an icon corresponding to the specified task type.

Parameters:
type - the task type to visualize.
Method Detail

getIconType

public Object getIconType()
Returns the type specifier identifying the displayed data object type, marker, or task type.

Returns:
the type specifier identifying the displayed data object type, marker, or task type.
See Also:
DataObjectTypeEnum, MarkerTypeEnum, TaskTypeEnum

getIconFillColor

public Color getIconFillColor()
Returns the primary fill color of this icon.

The default is white.

Returns:
the primary fill color of this icon.
See Also:
setIconFillColor(java.awt.Color)

setIconFillColor

public void setIconFillColor(Color color)
Specifies the primary fill color for this icon.

The default is white.

Parameters:
color - the primary fill color.
See Also:
getIconFillColor()

getIconFillColor2

public Color getIconFillColor2()
Returns the secondary fill color of this icon. Depending on the actual icon displayed, the secondary color may be ignored.

The default is white.

Returns:
the secondary fill color of this icon.
See Also:
setIconFillColor2(java.awt.Color)

setIconFillColor2

public void setIconFillColor2(Color color)
Specifies the secondary fill color for this icon. Depending on the actual icon displayed, the secondary color may be ignored.

The default is white.

Parameters:
color - the secondary fill color.
See Also:
getIconFillColor2()

getIconLineColor

public Color getIconLineColor()
Returns the line color of this icon.

The default is black.

Returns:
the line color of this icon.
See Also:
setIconLineColor(java.awt.Color)

setIconLineColor

public void setIconLineColor(Color color)
Specifies the line (or border) color for this icon.

The default is black.

Parameters:
color - the line (or border) color.
See Also:
getIconLineColor()

getIconHeight

public int getIconHeight()
Determines the height of the icon.

By default, the height is 10.

Called from paintIcon(java.awt.Component, java.awt.Graphics, int, int).

Specified by:
getIconHeight in interface Icon
Returns:
the height of the icon.
See Also:
setIconHeight(int)

setIconHeight

public void setIconHeight(int iconHeight)
Specifies the height of the icon.

By default, the height is 10.

Parameters:
iconHeight - the height of the icon.
See Also:
getIconHeight()

getIconWidth

public int getIconWidth()
Determines the width of the icon.

By default, the width is 10.

Called from paintIcon(java.awt.Component, java.awt.Graphics, int, int).

Specified by:
getIconWidth in interface Icon
Returns:
the width of the icon.
See Also:
setIconWidth(int)

setIconWidth

public void setIconWidth(int iconWidth)
Specifies the width of the icon.

By default, the width is 10.

Parameters:
iconWidth - the height of the icon.
See Also:
getIconWidth()

paintIcon

public void paintIcon(Component c,
                      Graphics g,
                      int x,
                      int y)
Paints this icon. Calls paintIcon(java.awt.Graphics2D, java.awt.geom.Rectangle2D).

Specified by:
paintIcon in interface Icon
Parameters:
c - ignored.
g - the graphics context to paint upon.
x - the x-coordinate of the icon's upper left corner.
y - the y-coordinate of the icon's upper left corner.

paintIcon

protected void paintIcon(Graphics2D g,
                         Rectangle2D bounds)
Paints this icon. Called by paintIcon(java.awt.Component, java.awt.Graphics, int, int).

Parameters:
g - the graphics context to paint upon.
bounds - the location and size of the icon.


© Copyright 2010-2014,
yWorks GmbH.
All rights reserved.