|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--com.jfimagine.jfgraph.shape.base.AbstractObject
|
+--com.jfimagine.jfgraph.shape.base.Node
Node Class. A node is used to construct, adjust or transform a shape, especially for a line object, it should always have two or more nodes to modify its shape
| Field Summary | |
protected JFPoint |
m_nodePoint
A point for x,y coordinates. |
protected AbstractObject |
m_parent
A parent object of this node. |
static int |
NODEUSAGE_MOVE
A node used to move its parent object |
static int |
NODEUSAGE_ROTATE
A node used to rotate its parent object |
static java.lang.String |
XML_NODE
A XML string tag represents a jfnode |
static java.lang.String |
XML_XOFFSET
A XML string tag represents the x coordinate offset of this node |
static java.lang.String |
XML_YOFFSET
A XML string tag represents the y coordinate offset of this node |
| Fields inherited from class com.jfimagine.jfgraph.shape.base.AbstractObject |
m_lastError, XML_OBJECTID, XML_OBJECTTYPE |
| Constructor Summary | |
Node()
Constructor for Node |
|
Node(double x,
double y)
Constructor for Node |
|
Node(JFPoint pnt)
Constructor for Node |
|
| Method Summary | |
protected void |
appendChildToDOM(Element element,
JFVersion version)
Append necessary xml child for current element, this method will be called internally by toDOM. |
java.lang.Object |
clone()
Creates a new object of the same class and with the same contents as this object. |
protected AbstractObject |
cloneMe()
Creates a new AbstractObject of the same class and with the same contents as this object. |
void |
draw(java.awt.Graphics g,
boolean ifRotate)
Draw current object on graphic canvas. |
protected void |
drawNodeCircle(java.awt.Graphics g,
java.awt.Color interColor)
Draw current node circle on graphic canvas. |
protected void |
drawNodeRect(java.awt.Graphics g,
java.awt.Color interColor,
java.awt.Color exterColor)
Draw current node rectangle on graphic canvas. |
protected void |
drawRotateSign(java.awt.Graphics g)
Draw a rotation arrow on current node. |
boolean |
equals(java.lang.Object obj)
Determines whether or not two objects are equal. |
protected void |
extractChildFromDOM(Element element,
JFVersion version)
Extract needed xml child from current element, this method will be called internally by fromDOM. |
JFPoint |
getNodePoint()
Get the point of current node. |
AbstractObject |
getParent()
Get parent object of this node. |
double |
getXOffset()
Get the x offset of current node. |
double |
getYOffset()
Get the y offset of current node. |
int |
hashCode()
Returns the hashcode for this Object. |
boolean |
intersects(JFPoint pnt)
Test if current object intersects with a specified point. |
boolean |
intersects(Rect rect)
Test if current object intersects with a specified rectangle. |
boolean |
isRotatable()
Ask if this node is rotatable. |
void |
loadFromStream(JFReader stream,
boolean skipHead,
JFVersion version)
Load node data from a binary stream |
void |
moveBy(double x,
double y)
Move current object by an x and y offset. |
void |
saveToStream(JFWriter stream,
JFVersion version)
Save this node to a binary stream |
void |
setNodePoint(JFPoint pnt)
Set the point of current node. |
void |
setParent(AbstractObject obj)
Set parent object of this node. |
void |
setXOffset(double xOffset)
Set the x offset of current node. |
void |
setYOffset(double yOffset)
Set the y offset of current node. |
java.lang.String |
toString()
Convert this node to String |
| Methods inherited from class com.jfimagine.jfgraph.shape.base.AbstractObject |
fromDOM, getLastError, getMaxObjectId, getObjectId, getObjectType, getXMLTag, getZoomScale, isShowDesign, setLastError, setObjectId, setObjectType, setShowDesign, setValue, setXMLTag, setZoomScale, toDOM |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String XML_NODE
public static final java.lang.String XML_XOFFSET
public static final java.lang.String XML_YOFFSET
public static final int NODEUSAGE_MOVE
public static final int NODEUSAGE_ROTATE
protected JFPoint m_nodePoint
protected AbstractObject m_parent
| Constructor Detail |
public Node()
public Node(double x,
double y)
public Node(JFPoint pnt)
| Method Detail |
public AbstractObject getParent()
public void setParent(AbstractObject obj)
obj - A new parent object.public double getXOffset()
public void setXOffset(double xOffset)
xOffset - The x offset of current node.
public double getYOffset()
public void setYOffset(double yOffset)
yOffset - The y offset of current node.public JFPoint getNodePoint()
public void setNodePoint(JFPoint pnt)
pnt - The point of current node.
protected void drawNodeRect(java.awt.Graphics g,
java.awt.Color interColor,
java.awt.Color exterColor)
g - A graphic canvas.interColor - Interior color to fill the node rectangle.exterColor - Exterior color to draw the outline of node rectangle.
protected void drawNodeCircle(java.awt.Graphics g,
java.awt.Color interColor)
g - A graphic canvas.interColor - Interior color to fill the node rectangle.public boolean isRotatable()
protected void drawRotateSign(java.awt.Graphics g)
public void draw(java.awt.Graphics g,
boolean ifRotate)
g - A graphic canvas.ifRotate - If user's operation or other actions force objects to be rotated.public boolean intersects(JFPoint pnt)
pnt - A JFPoint used to test intersection.public boolean intersects(Rect rect)
rect - A Rect used to test intersection.
public void moveBy(double x,
double y)
public java.lang.String toString()
toString in class AbstractObject
protected AbstractObject cloneMe()
throws java.lang.CloneNotSupportedException
cloneMe in class AbstractObjectjava.lang.CloneNotSupportedException
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class AbstractObjectjava.lang.CloneNotSupportedExceptionpublic int hashCode()
hashCode in class AbstractObjectpublic boolean equals(java.lang.Object obj)
equals in class AbstractObjectobj - an object to be compared with this object
protected void appendChildToDOM(Element element,
JFVersion version)
appendChildToDOM in class AbstractObjectelement - A XML element to append child xml nodesversion - A file version notification so this object can obey the rules to save data.
protected void extractChildFromDOM(Element element,
JFVersion version)
extractChildFromDOM in class AbstractObjectelement - An element used to extract needed xml childversion - A file version notification so this object can obey the rules to fetch data.
public void saveToStream(JFWriter stream,
JFVersion version)
throws java.io.IOException
saveToStream in class AbstractObjectstream - An binary output streamversion - A file version notification so this object can obey the rules to save data.
java.io.IOException
public void loadFromStream(JFReader stream,
boolean skipHead,
JFVersion version)
throws java.io.IOException
loadFromStream in class AbstractObjectstream - An binary input streamskipHead - Skip head 'TYPE' check, an shape object should always
has its own shape-type stored, if this shape-type has already been readed,
this loadFromStream should/could not read the type anymore.version - A file version notification so this object can obey the rules to fetch data.
java.io.IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||