de.cau.cs.kieler.kaom.karma.ptolemy.figurecreation
Class FigureProvider

java.lang.Object
  extended by de.cau.cs.kieler.kaom.karma.ptolemy.figurecreation.FigureProvider

public class FigureProvider
extends Object

Class for generating draw2d Figures out of svg documents and EditorIcons.

Rating red

Constructor Summary
FigureProvider()
           
 
Method Summary
 IFigure createAccumulator()
          A custom svg of an Accumulator since the ptolemy one is bugged.
 IFigure createDirector()
          Method holding a figure description used by directors.
 IFigure createFigureFromIcon(EditorIcon icon)
          Creates a draw2d ImageFigure out of an ptolemy EditorIcon.
 IFigure createFigureFromSvg(Document doc)
          Create a draw2d figure out of an svg Document.
 IFigure createInputPort()
          Create a figure for an entity representing an ptolemy input port.
 IFigure createMonitorValue(EObject object)
          Method for creating a custom monitorvalue figure.
 IFigure createOutputPort()
          Create a figure for an entity representing an ptolemy output port.
 IFigure createValueFigure(EObject object, String valueAttribute, EditPart part)
          A figure that displays a value.
 IFigure getDefaultFigure()
          builds a default figure for this diagram.
 IFigure getErrorFigure()
          A figure to display if things go haywire.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FigureProvider

public FigureProvider()
Method Detail

createFigureFromIcon

public IFigure createFigureFromIcon(EditorIcon icon)
Creates a draw2d ImageFigure out of an ptolemy EditorIcon.

Parameters:
icon - the EditorIcon to display in draw2d
Returns:
draw2d Figure representing the EditorIcon

createInputPort

public IFigure createInputPort()
Create a figure for an entity representing an ptolemy input port.

Returns:
the input port figure

createOutputPort

public IFigure createOutputPort()
Create a figure for an entity representing an ptolemy output port.

Returns:
the output port figure

createFigureFromSvg

public IFigure createFigureFromSvg(Document doc)
Create a draw2d figure out of an svg Document. FigureParser.createFigure does the actual work.

Parameters:
doc - the Document holding the svg description
Returns:
the figure representing the svg

getDefaultFigure

public IFigure getDefaultFigure()
builds a default figure for this diagram.

Returns:
the default figure

createDirector

public IFigure createDirector()
Method holding a figure description used by directors.

Returns:
a figure represention an director

createAccumulator

public IFigure createAccumulator()
A custom svg of an Accumulator since the ptolemy one is bugged.

Returns:
a ScalableImageFigure representing an Accumulator

createMonitorValue

public IFigure createMonitorValue(EObject object)
Method for creating a custom monitorvalue figure.

Parameters:
object - the modelelement
Returns:
the monitorvalue figure

createValueFigure

public IFigure createValueFigure(EObject object,
                                 String valueAttribute,
                                 EditPart part)
A figure that displays a value.

Parameters:
object - the model element
valueAttribute - name of the annotation holding the value
part - the editpart of the model element
Returns:
a figure that display the given value

getErrorFigure

public IFigure getErrorFigure()
A figure to display if things go haywire.

Returns:
a red box with a questionmark in it