com.jfimagine.jfgraph.shape.base
Class NodeList

java.lang.Object
  |
  +--com.jfimagine.jfgraph.shape.base.AbstractObject
        |
        +--com.jfimagine.jfgraph.shape.base.ObjectList
              |
              +--com.jfimagine.jfgraph.shape.base.NodeList
All Implemented Interfaces:
java.lang.Cloneable

public class NodeList
extends ObjectList

NodeList class. A node list is used to manipulate node issues.

Version:
$Revision: 1.1 $
Author:
CookieMaker

Field Summary
static java.lang.String XML_NODELIST
          A XML string tag represents a Node List
 
Fields inherited from class com.jfimagine.jfgraph.shape.base.ObjectList
m_objectList, XML_OBJECTCOUNT, XML_OBJECTLIST
 
Fields inherited from class com.jfimagine.jfgraph.shape.base.AbstractObject
m_lastError, XML_OBJECTID, XML_OBJECTTYPE
 
Constructor Summary
NodeList()
          Constructor for NodeList
 
Method Summary
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.
 Rect getBounds()
          Get the maximum bounds of this all nodes.
 int getIndex(Node node)
          Get the index of a node within the list.
 Node nodeIntersects(JFPoint pnt, int usage)
          Get which node that intersects with point pnt.
 Node removeLastNode()
          Remove last node in this list.
 void setParent(AbstractObject obj)
          Set parent object of each node in the list.
 void setZoomScale(double zoomScale)
          set zoom scale of all nodes.
 
Methods inherited from class com.jfimagine.jfgraph.shape.base.ObjectList
add, add, appendChildToDOM, attachRealPort, attachRealPort, bringToFront, clear, clone, contains, equals, extractChildFromDOM, getByIndex, getByObjectId, getFromGroupsByObjectId, getIndexByObjectId, getList, hashCode, loadFromStream, moveObject, newObjectId, removeAll, removeByIndex, removeByObjectId, saveToStream, sendToBack, setList, setShowDesign, size, toString
 
Methods inherited from class com.jfimagine.jfgraph.shape.base.AbstractObject
fromDOM, getLastError, getMaxObjectId, getObjectId, getObjectType, getXMLTag, getZoomScale, isShowDesign, setLastError, setObjectId, setObjectType, setValue, setXMLTag, toDOM
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

XML_NODELIST

public static final java.lang.String XML_NODELIST
A XML string tag represents a Node List

See Also:
Constant Field Values
Constructor Detail

NodeList

public NodeList()
Constructor for NodeList

Method Detail

setParent

public void setParent(AbstractObject obj)
Set parent object of each node in the list.


getIndex

public int getIndex(Node node)
Get the index of a node within the list.

Parameters:
node - A node to be found.
Returns:
The index.

cloneMe

protected AbstractObject cloneMe()
                          throws java.lang.CloneNotSupportedException
Creates a new AbstractObject of the same class and with the same contents as this object. This method implements the method defined in AbstractObject.

Overrides:
cloneMe in class ObjectList
Returns:
A clone of this class.
java.lang.CloneNotSupportedException

draw

public void draw(java.awt.Graphics g,
                 boolean ifRotate)
Draw current object on graphic canvas.

Parameters:
g - A graphic canvas.
ifRotate - If user's operation or other actions force objects to be rotated.

nodeIntersects

public Node nodeIntersects(JFPoint pnt,
                           int usage)
Get which node that intersects with point pnt.

Parameters:
pnt - A JFPoint used to test intersection.
usage - Purpose to get a node intersected, e.g. move or rotate.
Returns:
A node of current shape.

getBounds

public Rect getBounds()
Get the maximum bounds of this all nodes.

Overrides:
getBounds in class ObjectList
Returns:
The bounds rectangle of all nodes.

removeLastNode

public Node removeLastNode()
Remove last node in this list.

Returns:
Last node that remained.

setZoomScale

public void setZoomScale(double zoomScale)
set zoom scale of all nodes.

Overrides:
setZoomScale in class ObjectList
Parameters:
zoomScale - A new zoom scale.


Copyright 2004 ~ 2005 JingFei International Cooperation LTD. All Rights Reserved.