net.sourceforge.toscanaj.model.diagram
Interface Diagram2D

All Superinterfaces:
XMLizable
All Known Subinterfaces:
WriteableDiagram2D
All Known Implementing Classes:
SimpleLineDiagram

public interface Diagram2D
extends XMLizable

Interface for getting diagram related information.

To do:
remove index based access, even though this means giving write access in some way, make interface smaller, remove constants from interface

Field Summary
static java.lang.String DESCRIPTION_ELEMENT_NAME
           
static java.lang.String DIAGRAM_ELEMENT_NAME
           
static java.lang.String EXTRA_CANVAS_ITEMS_ELEMENT_NAME
           
static double MINIMUM_STEEPNESS
           
static java.lang.String TITLE_ATTRIBUTE_NAME
           
 
Method Summary
 LabelInfo getAttributeLabel(int pointNumber)
          Returns the information on the attribute label of the diagram.
 Concept getBottomConcept()
          Finds the bottom concept in the underlying lattice.
 java.awt.geom.Rectangle2D getBounds()
          Calculates a rectangle that includes all points.
 org.jdom.Element getDescription()
          Returns the XML Element describing the diagram (if available, null otherwise).
 org.tockit.events.EventBroker getEventBroker()
          Returns the event broker this diagram sends change events to.
 java.awt.geom.Point2D getFromPosition(int lineNumber)
          Returns the coordinates of a starting point of a line.
 DiagramLine getLine(int lineNumber)
          Returns a line in the diagram.
 java.util.Iterator getLines()
           
 DiagramNode getNode(int nodeNumber)
          Returns a node in the diagram.
 DiagramNode getNode(java.lang.String identifier)
           
 DiagramNode getNodeForConcept(Concept concept)
          Finds the node representing the concept given.
 java.util.Iterator getNodes()
          Returns the list of all nodes in the diagram.
 int getNumberOfLines()
          Returns the number of lines in the diagram.
 int getNumberOfNodes()
          Returns the number of nodes in the diagram.
 LabelInfo getObjectLabel(int pointNumber)
          Returns the information on the object label of the diagram.
 java.lang.String getTitle()
          Returns the title of the diagram.
 Concept getTopConcept()
          Finds the top concept in the underlying lattice.
 java.awt.geom.Point2D getToPosition(int lineNumber)
          Returns the coordinates of an end point of a line.
 boolean isHasseDiagram()
          Returns true if the diagram is layouted as Hasse diagram.
 
Methods inherited from interface net.sourceforge.toscanaj.util.xmlize.XMLizable
readXML, toXML
 

Field Detail

DIAGRAM_ELEMENT_NAME

public static final java.lang.String DIAGRAM_ELEMENT_NAME
See Also:
Constant Field Values

TITLE_ATTRIBUTE_NAME

public static final java.lang.String TITLE_ATTRIBUTE_NAME
See Also:
Constant Field Values

DESCRIPTION_ELEMENT_NAME

public static final java.lang.String DESCRIPTION_ELEMENT_NAME
See Also:
Constant Field Values

EXTRA_CANVAS_ITEMS_ELEMENT_NAME

public static final java.lang.String EXTRA_CANVAS_ITEMS_ELEMENT_NAME
See Also:
Constant Field Values

MINIMUM_STEEPNESS

public static final double MINIMUM_STEEPNESS
See Also:
Constant Field Values
Method Detail

getTitle

public java.lang.String getTitle()
Returns the title of the diagram.


getNumberOfNodes

public int getNumberOfNodes()
Returns the number of nodes in the diagram.


getNumberOfLines

public int getNumberOfLines()
Returns the number of lines in the diagram.


getBounds

public java.awt.geom.Rectangle2D getBounds()
Calculates a rectangle that includes all points.


getNode

public DiagramNode getNode(int nodeNumber)
Returns a node in the diagram. Numbers start with zero.


getNode

public DiagramNode getNode(java.lang.String identifier)

getNodeForConcept

public DiagramNode getNodeForConcept(Concept concept)
Finds the node representing the concept given. Returns null if no such node exists in this diagram.


getNodes

public java.util.Iterator getNodes()
Returns the list of all nodes in the diagram.


getLines

public java.util.Iterator getLines()

getFromPosition

public java.awt.geom.Point2D getFromPosition(int lineNumber)
Returns the coordinates of a starting point of a line. Numbers start with zero.


getLine

public DiagramLine getLine(int lineNumber)
Returns a line in the diagram. Numbers start with zero.


getToPosition

public java.awt.geom.Point2D getToPosition(int lineNumber)
Returns the coordinates of an end point of a line. Numbers start with zero.


getObjectLabel

public LabelInfo getObjectLabel(int pointNumber)
Returns the information on the object label of the diagram.


getAttributeLabel

public LabelInfo getAttributeLabel(int pointNumber)
Returns the information on the attribute label of the diagram.


getDescription

public org.jdom.Element getDescription()
Returns the XML Element describing the diagram (if available, null otherwise).


isHasseDiagram

public boolean isHasseDiagram()
Returns true if the diagram is layouted as Hasse diagram. This means every line is pointing downwards or in other terms: every node is located above all nodes that represent a concept lesser than its concept.


getTopConcept

public Concept getTopConcept()
Finds the top concept in the underlying lattice.

Throws:
java.lang.IllegalStateException - if the diagram has no nodes or is not a lattice.
To do:
check where this might be used instead of doing the same thing multiple times

getBottomConcept

public Concept getBottomConcept()
Finds the bottom concept in the underlying lattice.

Throws:
java.lang.IllegalStateException - if the diagram has no nodes or is not a lattice.
To do:
check where this might be used instead of doing the same thing multiple times

getEventBroker

public org.tockit.events.EventBroker getEventBroker()
Returns the event broker this diagram sends change events to.

Returns:
The target event broker for the diagram or null if none is available.


The ToscanaJ project