|
|||||||||||
| 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
Abstract object class. All classes that can be stored to and recovered from xml/binary file must instance/extend this abstract class.
| Field Summary | |
protected java.lang.String |
m_lastError
Last error info within this object. |
static java.lang.String |
XML_OBJECTID
A XML string tag represents the object id |
static java.lang.String |
XML_OBJECTTYPE
A XML string tag represents the object type |
| Constructor Summary | |
AbstractObject()
|
|
| 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 AbstractObject of the same class and with the same contents as this object. |
protected abstract AbstractObject |
cloneMe()
Creates a new AbstractObject of the same class and with the same contents as this 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. |
void |
fromDOM(Element element,
JFVersion version)
Extract an Object from a xml element |
java.lang.String |
getLastError()
Get last error message within this object. |
int |
getMaxObjectId()
Get a max object id of current object,object id starts at 0. |
int |
getObjectId()
Get the id of current object,object id starts at 0. |
int |
getObjectType()
An object type used to identify the type of an object, especially you need to store such an object type into a DataOutputStream, so we can distinguish this object type from a DataInputStream, although we can easily use an instanceof or the other type casting ways to test an object type at runtime. |
java.lang.String |
getXMLTag()
All AbstractObject should be stored as XML, so here we need a XML tag for each object. |
double |
getZoomScale()
get zoom scale |
int |
hashCode()
Returns the hashcode for this AbstractObject. |
boolean |
isShowDesign()
if current object is under show design state. |
void |
loadFromStream(JFReader stream,
boolean skipHead,
JFVersion version)
Load AbstractObject data from a binary stream |
void |
saveToStream(JFWriter stream,
JFVersion version)
Save this AbstractObject to a binary stream |
void |
setLastError(java.lang.String lastError)
Set last error message within this object. |
void |
setObjectId(int objectId)
Set the id of current object,object id starts at 0. |
void |
setObjectType(int objectType)
Set the type of current object |
void |
setShowDesign(boolean showDesign)
set if show or hide current object's design info |
void |
setValue(AbstractObject obj)
Set value by a new object. |
void |
setXMLTag(java.lang.String xmlTag)
Set a xmlTag for this object. |
void |
setZoomScale(double zoomScale)
set zoom scale |
void |
toDOM(Element element,
JFVersion version)
Convert this Object to a sub element of a specified element |
java.lang.String |
toString()
Convert this AbstractObject to String |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String XML_OBJECTID
public static final java.lang.String XML_OBJECTTYPE
protected java.lang.String m_lastError
| Constructor Detail |
public AbstractObject()
| Method Detail |
public double getZoomScale()
public void setZoomScale(double zoomScale)
zoomScale - A new zoom scale.public boolean isShowDesign()
public void setShowDesign(boolean showDesign)
public int getObjectType()
GetObjectType used to get the type of current object
public void setObjectType(int objectType)
objectType - A new object type for current object.public java.lang.String getXMLTag()
getXMLTag used to get current XML tag of this object.
public void setXMLTag(java.lang.String xmlTag)
xmlTag - XML tag for this object.public java.lang.String getLastError()
public void setLastError(java.lang.String lastError)
lastError - A new last error.public int getObjectId()
public int getMaxObjectId()
public void setObjectId(int objectId)
objectId - The object id.public void setValue(AbstractObject obj)
public java.lang.String toString()
toString in class java.lang.Object
protected abstract AbstractObject cloneMe()
throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - an object to be compared with this object
public void toDOM(Element element,
JFVersion version)
version - A file version notification so this object can obey the rules to save data.element - A jdom.element used to add sub content.
protected void appendChildToDOM(Element element,
JFVersion version)
version - A file version notification so this object can obey the rules to save data.element - A XML element to append child xml nodes
public void fromDOM(Element element,
JFVersion version)
version - A file version notification so this object can obey the rules to fetch data.element - A jdom element used to restore content of a BaseObject
protected void extractChildFromDOM(Element element,
JFVersion version)
version - A file version notification so this object can obey the rules to fetch data.element - An element used to extract needed xml child
public void saveToStream(JFWriter stream,
JFVersion version)
throws java.io.IOException
stream - 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
stream - 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 | ||||||||||