com.jfimagine.jfgraph.shape.base
Class Property

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

public class Property
extends AbstractObject

Property class. An instance for BaseProperty.

Version:
$Revision: 1.1 $
Author:
CookieMaker

Field Summary
static int PROPERTYTYPE_BOOLEAN
          PropertyType: Boolean type
static int PROPERTYTYPE_CURRENCY
          PropertyType: Currency type
static int PROPERTYTYPE_DATETIME
          PropertyType: DateTime type
static java.lang.String PROPERTYTYPE_DESC_BOOLEAN
          PropertyType description: Boolean type
static java.lang.String PROPERTYTYPE_DESC_CURRENCY
          PropertyType description: Currency type
static java.lang.String PROPERTYTYPE_DESC_DATETIME
          PropertyType description: DateTime type
static java.lang.String PROPERTYTYPE_DESC_NUMERIC
          PropertyType description: Numeric type
static java.lang.String PROPERTYTYPE_DESC_STRING
          PropertyType description: String type
static int PROPERTYTYPE_NUMERIC
          PropertyType: Numeric type
static int PROPERTYTYPE_STRING
          PropertyType: String type
static java.lang.String XML_COMMENT
          A XML string tag represents the comment of this property
static java.lang.String XML_FORMAT
          A XML string tag represents the display format of this property
static java.lang.String XML_NAME
          A XML string tag represents the name of this property
static java.lang.String XML_PROPERTY
          A XML string tag represents a jfproperty
static java.lang.String XML_TYPE
          A XML string tag represents the type of this property
static java.lang.String XML_VALUE
          A XML string tag represents the string value of this property
 
Fields inherited from class com.jfimagine.jfgraph.shape.base.AbstractObject
m_lastError, XML_OBJECTID, XML_OBJECTTYPE
 
Constructor Summary
Property()
          Constructor for Property
 
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.
 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.
 java.lang.String getComment()
          Get the comment of property
static java.lang.String getDescByType(int id)
          get type desc by a type id
 java.lang.String getFormat()
          Get the display format of property
 java.lang.String getName()
          Get the name of property
 int getType()
          Get the type of property
static int getTypeByDesc(java.lang.String desc)
          get type id by a type description
static java.util.List getTypeDescList()
          get a string list of all types
 java.lang.String getValue()
          Get the value of property
 int hashCode()
          Returns the hashcode for this Object.
 void loadFromStream(JFReader stream, boolean skipHead, JFVersion version)
          Load property data from a binary stream
 void saveToStream(JFWriter stream, JFVersion version)
          Save this property to a binary stream
 void setComment(java.lang.String comment)
          Set the comment of current property.
 void setFormat(java.lang.String displayFormat)
          Set the display format of current property.
 void setName(java.lang.String name)
          Set the name of current property.
 void setType(int type)
          Set the type of current property.
 void setValue(java.lang.String value)
          Set the value of current property.
 java.lang.String toString()
          Convert this property 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

XML_PROPERTY

public static final java.lang.String XML_PROPERTY
A XML string tag represents a jfproperty

See Also:
Constant Field Values

XML_NAME

public static final java.lang.String XML_NAME
A XML string tag represents the name of this property

See Also:
Constant Field Values

XML_TYPE

public static final java.lang.String XML_TYPE
A XML string tag represents the type of this property

See Also:
Constant Field Values

XML_FORMAT

public static final java.lang.String XML_FORMAT
A XML string tag represents the display format of this property

See Also:
Constant Field Values

XML_VALUE

public static final java.lang.String XML_VALUE
A XML string tag represents the string value of this property

See Also:
Constant Field Values

XML_COMMENT

public static final java.lang.String XML_COMMENT
A XML string tag represents the comment of this property

See Also:
Constant Field Values

PROPERTYTYPE_STRING

public static final int PROPERTYTYPE_STRING
PropertyType: String type

See Also:
Constant Field Values

PROPERTYTYPE_DESC_STRING

public static final java.lang.String PROPERTYTYPE_DESC_STRING
PropertyType description: String type


PROPERTYTYPE_NUMERIC

public static final int PROPERTYTYPE_NUMERIC
PropertyType: Numeric type

See Also:
Constant Field Values

PROPERTYTYPE_DESC_NUMERIC

public static final java.lang.String PROPERTYTYPE_DESC_NUMERIC
PropertyType description: Numeric type


PROPERTYTYPE_BOOLEAN

public static final int PROPERTYTYPE_BOOLEAN
PropertyType: Boolean type

See Also:
Constant Field Values

PROPERTYTYPE_DESC_BOOLEAN

public static final java.lang.String PROPERTYTYPE_DESC_BOOLEAN
PropertyType description: Boolean type


PROPERTYTYPE_CURRENCY

public static final int PROPERTYTYPE_CURRENCY
PropertyType: Currency type

See Also:
Constant Field Values

PROPERTYTYPE_DESC_CURRENCY

public static final java.lang.String PROPERTYTYPE_DESC_CURRENCY
PropertyType description: Currency type


PROPERTYTYPE_DATETIME

public static final int PROPERTYTYPE_DATETIME
PropertyType: DateTime type

See Also:
Constant Field Values

PROPERTYTYPE_DESC_DATETIME

public static final java.lang.String PROPERTYTYPE_DESC_DATETIME
PropertyType description: DateTime type

Constructor Detail

Property

public Property()
Constructor for Property

Method Detail

getName

public java.lang.String getName()
Get the name of property

Returns:
The name of this property

setName

public void setName(java.lang.String name)
Set the name of current property.

Parameters:
name - The name of this property

getTypeDescList

public static java.util.List getTypeDescList()
get a string list of all types


getDescByType

public static java.lang.String getDescByType(int id)
get type desc by a type id


getTypeByDesc

public static int getTypeByDesc(java.lang.String desc)
get type id by a type description


getType

public int getType()
Get the type of property

Returns:
The type of this property

setType

public void setType(int type)
Set the type of current property.

Parameters:
type - The type of this property

getFormat

public java.lang.String getFormat()
Get the display format of property

Returns:
The display format of this property

setFormat

public void setFormat(java.lang.String displayFormat)
Set the display format of current property.

Parameters:
displayFormat - The display format of this property

getValue

public java.lang.String getValue()
Get the value of property

Returns:
The value of this property, always be a string

setValue

public void setValue(java.lang.String value)
Set the value of current property.

Parameters:
value - The value of this property

getComment

public java.lang.String getComment()
Get the comment of property

Returns:
The comment of this property, always be a string

setComment

public void setComment(java.lang.String comment)
Set the comment of current property.

Parameters:
comment - The comment of this property

toString

public java.lang.String toString()
Convert this property to String

Overrides:
toString in class AbstractObject
Returns:
An string represents the content of the property

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.

Specified by:
cloneMe in class AbstractObject
Returns:
A clone of this class.
java.lang.CloneNotSupportedException

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates a new object of the same class and with the same contents as this object.

Overrides:
clone in class AbstractObject
Returns:
A clone of this instance.
java.lang.CloneNotSupportedException

hashCode

public int hashCode()
Returns the hashcode for this Object.

Overrides:
hashCode in class AbstractObject
Returns:
hash code for this Property.

equals

public boolean equals(java.lang.Object obj)
Determines whether or not two objects are equal.

Overrides:
equals in class AbstractObject
Parameters:
obj - an object to be compared with this object
Returns:
true if the object to be compared is an instance of Property and has the same values; false otherwise.

appendChildToDOM

protected void appendChildToDOM(Element element,
                                JFVersion version)
Append necessary xml child for current element, this method will be called internally by toDOM.

Overrides:
appendChildToDOM in class AbstractObject
Parameters:
element - A XML element to append child xml nodes
version - A file version notification so this object can obey the rules to save data.

extractChildFromDOM

protected void extractChildFromDOM(Element element,
                                   JFVersion version)
Extract needed xml child from current element, this method will be called internally by fromDOM.

Overrides:
extractChildFromDOM in class AbstractObject
Parameters:
element - An element used to extract needed xml child
version - A file version notification so this object can obey the rules to fetch data.

saveToStream

public void saveToStream(JFWriter stream,
                         JFVersion version)
                  throws java.io.IOException
Save this property to a binary stream

Overrides:
saveToStream in class AbstractObject
Parameters:
stream - An binary output stream
version - A file version notification so this object can obey the rules to save data.
Throws:
java.io.IOException

loadFromStream

public void loadFromStream(JFReader stream,
                           boolean skipHead,
                           JFVersion version)
                    throws java.io.IOException
Load property data from a binary stream

Overrides:
loadFromStream in class AbstractObject
Parameters:
stream - An binary input stream
skipHead - 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.
Throws:
java.io.IOException


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