|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.toscanaj.model.diagram.SimpleLineDiagram
This class is an abstraction of all diagram related information. We assume that the first node we get is the top node of the diagram. The order of all other nodes and the order of the lines does not matter. The coordinate system given can use y-coordinates either pointing upwards (the usual mathematical system) or downwards (the usual computer coordinates). The first call to getNode() or getBounds() will make sure that the coordinates will be pointing downwards when reading.
Field Summary | |
protected org.tockit.events.EventBroker |
eventBroker
|
Fields inherited from interface net.sourceforge.toscanaj.model.diagram.Diagram2D |
DESCRIPTION_ELEMENT_NAME, DIAGRAM_ELEMENT_NAME, EXTRA_CANVAS_ITEMS_ELEMENT_NAME, MINIMUM_STEEPNESS, TITLE_ATTRIBUTE_NAME |
Constructor Summary | |
SimpleLineDiagram()
The default constructor creates a diagram with just nothing in it at all. |
|
SimpleLineDiagram(Diagram2D diagram)
A copy constructor creating a duplicate of given diagram. |
|
SimpleLineDiagram(org.jdom.Element element)
|
Method Summary | |
void |
addExtraCanvasItem(org.tockit.canvas.CanvasItem item)
|
void |
addLine(DiagramNode from,
DiagramNode to)
Adds a line to the diagram (at the end of the list). |
void |
addNode(DiagramNode node)
Adds a node to the diagram (at the end of the list). |
protected void |
checkCoordinateSystem()
Makes sure the y-coordinates increase in the downward direction. |
protected DiagramNode |
createNewDiagramNode(org.jdom.Element diagramNode)
|
LabelInfo |
getAttributeLabel(int nodeNumber)
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.util.List |
getExtraCanvasItems()
|
java.awt.geom.Point2D |
getFromPosition(int lineNumber)
Returns the coordinates of a starting point of a line. |
DiagramLine |
getLine(int lineNumber)
Implements Diagram2D.getLine(int). |
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 nodeNumber)
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. |
void |
readXML(org.jdom.Element elem)
Read this element as the content of elem. |
static void |
registerExtraCanvasItemFactory(java.lang.String tagName,
ExtraCanvasItemFactory factory)
|
void |
removeExtraCanvasItems()
|
void |
sendChangeEvent()
Sends a notification about a change into the broker attached. |
void |
setDescription(org.jdom.Element desc)
Gives the diagram a description. |
void |
setEventBroker(org.tockit.events.EventBroker eventBroker)
Sets an event broker to send DiagramChangeEvents to. |
void |
setTitle(java.lang.String title)
Change the title of the diagram. |
org.jdom.Element |
toXML()
Write this element as the content of elem. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected org.tockit.events.EventBroker eventBroker
Constructor Detail |
public SimpleLineDiagram()
public SimpleLineDiagram(org.jdom.Element element) throws XMLSyntaxError
public SimpleLineDiagram(Diagram2D diagram)
Method Detail |
public org.jdom.Element toXML()
XMLizable
toXML
in interface XMLizable
public void readXML(org.jdom.Element elem) throws XMLSyntaxError
XMLizable
readXML
in interface XMLizable
XMLSyntaxError
protected DiagramNode createNewDiagramNode(org.jdom.Element diagramNode) throws XMLSyntaxError
XMLSyntaxError
public java.lang.String getTitle()
getTitle
in interface Diagram2D
public void setTitle(java.lang.String title)
setTitle
in interface WriteableDiagram2D
public int getNumberOfNodes()
getNumberOfNodes
in interface Diagram2D
public java.util.Iterator getNodes()
Diagram2D
getNodes
in interface Diagram2D
public java.util.Iterator getLines()
getLines
in interface Diagram2D
public int getNumberOfLines()
getNumberOfLines
in interface Diagram2D
public java.awt.geom.Rectangle2D getBounds()
getBounds
in interface Diagram2D
public DiagramNode getNode(int nodeNumber)
getNode
in interface Diagram2D
public DiagramNode getNode(java.lang.String identifier)
getNode
in interface Diagram2D
public DiagramNode getNodeForConcept(Concept concept)
Diagram2D
getNodeForConcept
in interface Diagram2D
public DiagramLine getLine(int lineNumber)
getLine
in interface Diagram2D
public void addNode(DiagramNode node)
addNode
in interface WriteableDiagram2D
public java.awt.geom.Point2D getFromPosition(int lineNumber)
getFromPosition
in interface Diagram2D
public java.awt.geom.Point2D getToPosition(int lineNumber)
getToPosition
in interface Diagram2D
public void addLine(DiagramNode from, DiagramNode to)
addLine
in interface WriteableDiagram2D
public LabelInfo getObjectLabel(int nodeNumber)
getObjectLabel
in interface Diagram2D
public LabelInfo getAttributeLabel(int nodeNumber)
getAttributeLabel
in interface Diagram2D
protected void checkCoordinateSystem()
public void setDescription(org.jdom.Element desc)
WriteableDiagram2D
setDescription
in interface WriteableDiagram2D
public void sendChangeEvent()
WriteableDiagram2D
sendChangeEvent
in interface WriteableDiagram2D
public org.jdom.Element getDescription()
Diagram2D
getDescription
in interface Diagram2D
public boolean isHasseDiagram()
Diagram2D
isHasseDiagram
in interface Diagram2D
public void setEventBroker(org.tockit.events.EventBroker eventBroker)
WriteableDiagram2D
setEventBroker
in interface WriteableDiagram2D
public Concept getTopConcept()
Diagram2D
getTopConcept
in interface Diagram2D
public Concept getBottomConcept()
Diagram2D
getBottomConcept
in interface Diagram2D
public static void registerExtraCanvasItemFactory(java.lang.String tagName, ExtraCanvasItemFactory factory)
public void addExtraCanvasItem(org.tockit.canvas.CanvasItem item)
public void removeExtraCanvasItems()
public java.util.List getExtraCanvasItems()
public org.tockit.events.EventBroker getEventBroker()
Diagram2D
getEventBroker
in interface Diagram2D
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |