org.embl.ebi.escience.scufl.view
Class DotView

java.lang.Object
  extended by org.embl.ebi.escience.scufl.view.DotView
All Implemented Interfaces:
java.io.Serializable, ScuflModelEventListener

public class DotView
extends java.lang.Object
implements ScuflModelEventListener, java.io.Serializable

Represents a ScuflModel instance as a dot file which may then be rendered by standard graph rendering tools.

Author:
Tom Oinn
See Also:
Serialized Form

Field Summary
static int ALL
           
static int BLOB
           
static int BOUND
           
static int NAMEDBLOB
           
static int NONE
           
 
Constructor Summary
DotView(ScuflModel model)
          Construct the view and attach it to the given model.
 
Method Summary
 boolean getAlignment()
          Get the alignment, true is equivalent to left to right, false being top to bottom.
 java.lang.String getDot()
          Return a dot representation of the underlying model.
 boolean getExpandWorkflow()
          Are workflows expanded out inline?
 java.lang.String[] getFillColours()
          Get the list of colours used to fill the backgrounds of nested workflows
 int getPortDisplay()
           
 boolean getShowBoring()
          Are we showing boring things?
 boolean getTypeLabelDisplay()
          Are we displaying type labels?
 DotViewSettings getViewSettings()
           
 void receiveModelEvent(ScuflModelEvent event)
          Implements ScuflModelEventListener, in this case is used to tell when our cached version of the dot representation may be out of date.
 void setAlignment(boolean alignment)
          Define whether the graph should be top to bottom (false) or left to right (true)
 void setBoring(boolean showBoring)
          Define whether to show boring things in the diagram
 void setExpandWorkflow(boolean e)
          Set whether subworkflows should be expanded out
 void setFillColours(java.lang.String[] colours)
          Set the list of colours used for expanded workflow fills, defaults to 'white','yellow','goldenrod1'.
 void setPortDisplay(int policy)
          Define whether we are looking at all, none or only bound input output ports in the view, using the DotView.ALL|BOUND|NONE|BLOB constants.
 void setTypeLabelDisplay(boolean display)
          Determine whether to show labels on edges for their types
 void setViewSettings(DotViewSettings settings)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL

public static final int ALL
See Also:
Constant Field Values

BOUND

public static final int BOUND
See Also:
Constant Field Values

NONE

public static final int NONE
See Also:
Constant Field Values

BLOB

public static final int BLOB
See Also:
Constant Field Values

NAMEDBLOB

public static final int NAMEDBLOB
See Also:
Constant Field Values
Constructor Detail

DotView

public DotView(ScuflModel model)
Construct the view and attach it to the given model.

Method Detail

setAlignment

public void setAlignment(boolean alignment)
Define whether the graph should be top to bottom (false) or left to right (true)


getAlignment

public boolean getAlignment()
Get the alignment, true is equivalent to left to right, false being top to bottom.


setBoring

public void setBoring(boolean showBoring)
Define whether to show boring things in the diagram


getShowBoring

public boolean getShowBoring()
Are we showing boring things?


setPortDisplay

public void setPortDisplay(int policy)
Define whether we are looking at all, none or only bound input output ports in the view, using the DotView.ALL|BOUND|NONE|BLOB constants.


getPortDisplay

public int getPortDisplay()

setTypeLabelDisplay

public void setTypeLabelDisplay(boolean display)
Determine whether to show labels on edges for their types


getTypeLabelDisplay

public boolean getTypeLabelDisplay()
Are we displaying type labels?


getDot

public java.lang.String getDot()
Return a dot representation of the underlying model.


receiveModelEvent

public void receiveModelEvent(ScuflModelEvent event)
Implements ScuflModelEventListener, in this case is used to tell when our cached version of the dot representation may be out of date.

Specified by:
receiveModelEvent in interface ScuflModelEventListener

setExpandWorkflow

public void setExpandWorkflow(boolean e)
Set whether subworkflows should be expanded out


getExpandWorkflow

public boolean getExpandWorkflow()
Are workflows expanded out inline?


setFillColours

public void setFillColours(java.lang.String[] colours)
Set the list of colours used for expanded workflow fills, defaults to 'white','yellow','goldenrod1'. Colours should be string names that GraphViz is able to deal with. See the complete list at http://www.graphviz.org/cvs/doc/info/colors.html

If the system property 'taverna.scufldiagram.fillcolours' is set it is interpreted as a comma seperated list and overrides this default.


getFillColours

public java.lang.String[] getFillColours()
Get the list of colours used to fill the backgrounds of nested workflows


getViewSettings

public DotViewSettings getViewSettings()

setViewSettings

public void setViewSettings(DotViewSettings settings)