|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.toscanaj.model.diagram.DiagramLine
This encapsulates all information about a line in a diagram. This is just the information which nodes the line connects.
Field Summary | |
static java.lang.String |
DIAGRAM_LINE_ELEMENT_NAME
|
static java.lang.String |
FROM_NODE_ATTRIBUTE_NAME
|
static java.lang.String |
TO_NODE_ATTRIBUTE_NAME
|
Constructor Summary | |
DiagramLine(DiagramNode fromNode,
DiagramNode toNode,
Diagram2D diagram)
Initialises a line between the given nodes. |
|
DiagramLine(org.jdom.Element element,
Diagram2D diagram)
|
Method Summary | |
double |
calculateDistance(java.awt.geom.Point2D point)
Returns the distance of the given point to the line. |
DiagramNode |
getFromNode()
Returns the starting node in a Diagram in which DiagramLine object will be connecting. |
java.awt.geom.Point2D |
getFromPosition()
Returns coordinates of first node in a Diagram in which DiagramLine object will be connecting. |
double |
getLength()
Returns the length of this line. |
DiagramNode |
getToNode()
Returns the end node in a Diagram in which DiagramLine object will be connecting. |
java.awt.geom.Point2D |
getToPosition()
Returns coordinates of second node in a Diagram in which DiagramLine object will be connecting. |
void |
readXML(org.jdom.Element elem)
Read this element as the content of elem. |
void |
setFromPoint(DiagramNode fromNode)
Sets the fromPoint to a node in a Diagram. |
void |
setToPoint(DiagramNode toNode)
Sets the toPoint at the position of a node on a 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 |
public static final java.lang.String DIAGRAM_LINE_ELEMENT_NAME
public static final java.lang.String FROM_NODE_ATTRIBUTE_NAME
public static final java.lang.String TO_NODE_ATTRIBUTE_NAME
Constructor Detail |
public DiagramLine(DiagramNode fromNode, DiagramNode toNode, Diagram2D diagram)
public DiagramLine(org.jdom.Element element, Diagram2D diagram) throws XMLSyntaxError
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
public DiagramNode getFromNode()
public DiagramNode getToNode()
public java.awt.geom.Point2D getFromPosition()
public java.awt.geom.Point2D getToPosition()
public void setFromPoint(DiagramNode fromNode)
public void setToPoint(DiagramNode toNode)
public double getLength()
public double calculateDistance(java.awt.geom.Point2D point)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |