|
|||||||||||
| 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.ObjectList
ObjectList class. A major type of object list class used in CAD.
| Field Summary | |
protected java.util.List |
m_objectList
A java.util.List used to store all AbstractObjects. |
static java.lang.String |
XML_OBJECTCOUNT
A XML string tag represents the number of objects in this list. |
static java.lang.String |
XML_OBJECTLIST
A XML string tag represents a ObjectList |
| Fields inherited from class com.jfimagine.jfgraph.shape.base.AbstractObject |
m_lastError, XML_OBJECTID, XML_OBJECTTYPE |
| Constructor Summary | |
ObjectList()
Constructor for ObjectList |
|
| Method Summary | |
int |
add(AbstractObject obj)
Add a new object at the end of the list. |
void |
add(java.util.List list)
Add a new object list at the end of the list. |
protected void |
appendChildToDOM(Element element,
JFVersion version)
Append necessary xml child for current element, this method will be called internally by toDOM. |
void |
attachRealPort()
A loadFromStream method should only load an parentId-objectId list of ports attached, So here we use an attachRealPort to ACTUALLY attach some ports to the ports in list. |
void |
attachRealPort(ObjectList shapeList)
A loadFromStream method should only load an parentId-objectId list of ports attached, So here we use an attachRealPort to ACTUALLY attach some ports to the ports in this list. |
void |
bringToFront(java.util.List objList)
Send a sub-collection of this object list to front. |
void |
clear()
Clear all objects in list. |
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. |
boolean |
contains(AbstractObject obj)
If this objectList has already contains such an object. |
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. |
Rect |
getBounds()
Get the bounds of this object list. |
AbstractObject |
getByIndex(int index)
Get an object by an index |
AbstractObject |
getByObjectId(int objectId)
Get an object by an object id |
AbstractObject |
getFromGroupsByObjectId(int objectId,
boolean returnGroup)
Get an object from groups by an object id |
int |
getIndexByObjectId(int objectId)
Get the index of an object by an object id. |
java.util.List |
getList()
Get a java.util.List object encapsulates AbstractObjects |
int |
hashCode()
Returns the hashcode for this Object. |
void |
loadFromStream(JFReader stream,
boolean skipHead,
JFVersion version)
Load node data from a binary stream |
void |
moveObject(int objectId,
int index)
Move one object within this list to a specified index position. |
int |
newObjectId()
Generate a new object id. |
void |
removeAll(java.util.List objList)
Remove a sub-collection of this list. |
void |
removeByIndex(int index)
Remove an object by index |
void |
removeByObjectId(int objectId)
Remove an object by object id. |
void |
saveToStream(JFWriter stream,
JFVersion version)
Save this node to a binary stream |
void |
sendToBack(java.util.List objList)
Send a sub-collection of this object list to back. |
void |
setList(java.util.List objList)
Set a new object list. |
void |
setShowDesign(boolean showDesign)
set if show or hide the design info of objects in this list |
void |
setZoomScale(double zoomScale)
set zoom scale |
int |
size()
Get the number of AbstractObject in list. |
java.lang.String |
toString()
Convert this list to String |
| 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 |
public static final java.lang.String XML_OBJECTCOUNT
public static final java.lang.String XML_OBJECTLIST
protected java.util.List m_objectList
| Constructor Detail |
public ObjectList()
| Method Detail |
public java.util.List getList()
public void setList(java.util.List objList)
public AbstractObject getByIndex(int index)
throws ListException
index - An index.
com.jfimagine.utils.exception.ListException, - An exception while processing list operations.
ListException
public AbstractObject getByObjectId(int objectId)
throws ListException
objectId - An object id.
com.jfimagine.utils.exception.ListException, - An exception while processing list operations.
ListException
public AbstractObject getFromGroupsByObjectId(int objectId,
boolean returnGroup)
throws ListException
objectId - An object id.returnGroup - True if return the group, false return the object itself.
com.jfimagine.utils.exception.ListException, - An exception while processing list operations.
ListExceptionpublic void setShowDesign(boolean showDesign)
setShowDesign in class AbstractObjectpublic boolean contains(AbstractObject obj)
obj - A new AbstractObject.
public int getIndexByObjectId(int objectId)
objectId - An object id.
public int newObjectId()
add method.
com.jfimagine.utils.exception.ListException, - An exception while processing list operations.public int add(AbstractObject obj)
obj - A new AbstractObject.
public void add(java.util.List list)
list - A new AbstractObject list.
public void removeByIndex(int index)
throws ListException
index - A index.
com.jfimagine.utils.exception.ListException, - An exception while processing list operations.
ListException
public void removeByObjectId(int objectId)
throws ListException
objectId - An object id.
com.jfimagine.utils.exception.ListException, - An exception while processing list operations.
ListExceptionpublic void removeAll(java.util.List objList)
objList - A sub collection.public void sendToBack(java.util.List objList)
public void bringToFront(java.util.List objList)
public void moveObject(int objectId,
int index)
objectId - Id of an obect.index - New position to move to.
public void clear()
throws ListException
com.jfimagine.utils.exception.ListException, - An exception while processing list operations.
ListExceptionpublic int size()
public Rect getBounds()
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.IOExceptionpublic void attachRealPort()
public void attachRealPort(ObjectList shapeList)
shapeList - A shapeList used to pick out their ports for ports' attached listpublic void setZoomScale(double zoomScale)
setZoomScale in class AbstractObjectzoomScale - A new zoom scale.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||