com.googlecode.sarasvati.visual
Class ProcessToImageMapAdapter

java.lang.Object
  extended by com.googlecode.sarasvati.visual.ProcessToImageMapAdapter
All Implemented Interfaces:
ProcessToImageMap

public class ProcessToImageMapAdapter
extends Object
implements ProcessToImageMap

Provides default implementations for methods in the ProcessToImageMap interface. All methods return null unless overridden.

Author:
Paul Lorenz, chungonn

Constructor Summary
ProcessToImageMapAdapter()
           
ProcessToImageMapAdapter(String taskType)
           
 
Method Summary
 boolean drawArcLabels(Arc arc)
          Returns true unless overridden
 String getTaskType()
          TaskType default is "task".
 String hoverForArc(VisualProcessArc arc)
          Every arc in a generated image of a graph process may have associated text which will pop-up when the arc is hovered over.
 String hoverForNode(VisualProcessNode node)
          Every node in a generated image of a graph process may have associated text which will pop-up when the node is hovered over.
 String hrefForArc(VisualProcessArc arc)
          Every arc in a generated image of a process graph may have a link for when the arc is clicked.
 String hrefForNode(VisualProcessNode node)
          Every node in a generated image of a graph process may have a link for when the node is clicked.
 Icon iconForNode(VisualProcessNode node)
          Returns a RectangularNodeIcon for nodes with type of 'task' and a OvalNodeIcon for all other nodes.
 boolean isBackArc(Arc arc, boolean defaultValue)
          Returns the defaultValue for all arcs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessToImageMapAdapter

public ProcessToImageMapAdapter()

ProcessToImageMapAdapter

public ProcessToImageMapAdapter(String taskType)
Method Detail

drawArcLabels

public boolean drawArcLabels(Arc arc)
Returns true unless overridden

Specified by:
drawArcLabels in interface ProcessToImageMap
Returns:
true if arc labels should be rendered, false otherwise
See Also:
ProcessToImageMap.drawArcLabels(Arc)

isBackArc

public boolean isBackArc(Arc arc,
                         boolean defaultValue)
Returns the defaultValue for all arcs

Specified by:
isBackArc in interface ProcessToImageMap
Parameters:
arc - An arc in a process definition
defaultValue - True if the arc is calculated to be backwards based on a GraphTree
Returns:
True if the the arc is generally traversed going back to a previous point in the workflow
See Also:
ProcessToImageMap.isBackArc(Arc, boolean)

iconForNode

public Icon iconForNode(VisualProcessNode node)
Returns a RectangularNodeIcon for nodes with type of 'task' and a OvalNodeIcon for all other nodes.

Specified by:
iconForNode in interface ProcessToImageMap
Parameters:
node - The graph node needing an icon
Returns:
An icon representing the given node.
See Also:
ProcessToImageMap.iconForNode(VisualProcessNode)

getTaskType

public String getTaskType()
TaskType default is "task". It is used to determine the type of node icon returns by iconForNode(VisualProcessNode)


hoverForArc

public String hoverForArc(VisualProcessArc arc)
Description copied from interface: ProcessToImageMap
Every arc in a generated image of a graph process may have associated text which will pop-up when the arc is hovered over. If null is returned, no hover will be created for the arc.

Specified by:
hoverForArc in interface ProcessToImageMap
Parameters:
arc - The arc to generate the hover for.
Returns:
An String to display in a hover when the arc is moused over. May be null, in which case no hover will appear.

hoverForNode

public String hoverForNode(VisualProcessNode node)
Description copied from interface: ProcessToImageMap
Every node in a generated image of a graph process may have associated text which will pop-up when the node is hovered over. If null is returned, no hover will be created for the node.

Specified by:
hoverForNode in interface ProcessToImageMap
Parameters:
node - The node to generate the hover for.
Returns:
An String to display in a hover when the node is moused over. May be null, in which case no hover will appear.

hrefForArc

public String hrefForArc(VisualProcessArc arc)
Description copied from interface: ProcessToImageMap
Every arc in a generated image of a process graph may have a link for when the arc is clicked. The link may be a regular http URL or a javascript: link. If null is returned, no link will be associated with the arc.

Specified by:
hrefForArc in interface ProcessToImageMap
Parameters:
arc - The arc to generate the HREF for
Returns:
An HREF for when the arc is clicked in the generated image. May be null, in which case no link is generated.

hrefForNode

public String hrefForNode(VisualProcessNode node)
Description copied from interface: ProcessToImageMap
Every node in a generated image of a graph process may have a link for when the node is clicked. The link may be a regular http URL or a javascript: link. If null is returned, no link will be associated with the node.

Specified by:
hrefForNode in interface ProcessToImageMap
Parameters:
node - The node to generate the HREF for
Returns:
An HREF for when the node is clicked in the generated image. May be null, in which case no link is generated.


Copyright © 2012. All Rights Reserved.