java.io.Serializable
, java.lang.Cloneable
, javax.swing.tree.TreeNode
, NamedSBase
, SBase
, UniqueNamedSBase
, UniqueSId
, TreeNodeWithChangeSupport
public class Point extends AbstractNamedSBase implements UniqueNamedSBase
A Point
is specified via the required attributes 'x', 'y' and an optional
attribute 'z', all of which are of type double. If the attribute z is not
specified, the object is a two dimensional object. The Point
class also has
an optional attribute id of type SId. While not used in the Layout
package,
it can be used by programs to refer to the elements.
JSBML_WRONG_SBO_TERM
Constructor | Description |
---|---|
Point() |
Creates a new
Point instance with all coordinates set to Double.NaN . |
Point(double x,
double y) |
Creates a new
Point instance with the given x and y coordinates. z is set to Double.NaN . |
Point(double x,
double y,
double z) |
Creates a new
Point instance with the given coordinates. |
Point(double x,
double y,
double z,
int level,
int version) |
Creates a new
Point instance with the given coordinates and level and version. |
Point(int level,
int version) |
Creates a new
Point instance with the given level and version, all coordinates are set to Double.NaN . |
Point(Point point) |
Modifier and Type | Method | Description |
---|---|---|
Point |
clone() |
Creates a deep copy of this object, i.e., a new
SBase with the same
properties
like this one. |
boolean |
equals(java.lang.Object object) |
|
java.lang.String |
getElementName() |
Returns the XML element name of this object.
|
double |
getX() |
Gets the x coordinate.
|
double |
getY() |
Gets the y coordinate.
|
double |
getZ() |
Gets the z coordinate.
|
int |
hashCode() |
Returns a hash code value for this
SBase instance. |
void |
initDefaults() |
Initializes the default values using the namespace.
|
boolean |
isIdMandatory() |
Returns
true if the identifier of this
SBase is required to be defined (i.e., not null )
in the definition of SBML. |
boolean |
isSetElementName() |
|
boolean |
isSetX() |
Returns
true if the x coordinate is set. |
boolean |
isSetY() |
Returns
true if the y coordinate is set. |
boolean |
isSetZ() |
Returns
true if the z coordinate is set. |
boolean |
readAttribute(java.lang.String attributeName,
java.lang.String prefix,
java.lang.String value) |
Sets the given attribute in this
SBase . |
void |
setX(double x) |
Sets the x coordinate.
|
void |
setY(double y) |
Sets the y coordinate.
|
void |
setZ(double z) |
Sets the z coordinate.
|
void |
unsetX() |
Unsets the required x coordinate.
|
void |
unsetY() |
Unsets the required y coordinate.
|
void |
unsetZ() |
Unsets the optional z coordinate.
|
java.util.Map<java.lang.String,java.lang.String> |
writeXMLAttributes() |
Returns a map with all the attributes of this
SBase that
need to be written out in XML. |
double |
x() |
Gets the x coordinate.
|
double |
y() |
Gets the y coordinate.
|
double |
z() |
Gets the z coordinate.
|
isValidId
addCVTerm, addDeclaredNamespace, addExtension, addPlugin, addResources, appendAnnotation, appendAnnotation, appendNotes, appendNotes, createHistory, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, fireNodeRemovedEvent, firePropertyChange, getAllDeclaredNamespaces, getAllowsChildren, getAnnotation, getAnnotationString, getChildAt, getChildCount, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementByMetaId, getElementBySId, getExtension, getExtensionCount, getExtensionPackages, getFirstElementIndex, getHistory, getId, getLevel, getLevelAndVersion, getMetaId, getModel, getName, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getPackageName, getPackageVersion, getParent, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getURI, getVersion, hasExtension, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetId, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetName, isSetNotes, isSetPackageVErsion, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, isValidLevelAndVersionCombination, isValidMetaId, registerChild, removeCVTerm, removeCVTerm, removeDeclaredNamespaceByNamespace, removeDeclaredNamespaceByPrefix, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setAnnotation, setHistory, setId, setLevel, setMetaId, setName, setNamespace, setNotes, setNotes, setPackageVersion, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, toString, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetId, unsetMetaId, unsetName, unsetNamespace, unsetNotes, unsetPlugin, unsetSBOTerm
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getRoot, getTreeNodeChangeListenerCount, getUserObject, indexOf, isLeaf, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, setParent, userObjectKeySet
getId, getName, isSetId, isSetName, setId, setName, unsetId, unsetName
addCVTerm, addDeclaredNamespace, addExtension, addPlugin, appendAnnotation, appendAnnotation, appendNotes, appendNotes, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementByMetaId, getElementBySId, getExtension, getExtensionCount, getExtensionPackages, getHistory, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getURI, getVersion, hasExtension, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetPackageVErsion, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, registerChild, removeCVTerm, removeCVTerm, removeDeclaredNamespaceByNamespace, removeDeclaredNamespaceByPrefix, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTreeNodeChangeListener, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setAnnotation, setHistory, setLevel, setMetaId, setNotes, setNotes, setPackageVersion, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNotes, unsetPlugin, unsetSBOTerm
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getListOfTreeNodeChangeListeners, getRoot, getTreeNodeChangeListenerCount, getUserObject, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeUserObject, userObjectKeySet
public Point()
Point
instance with all coordinates set to Double.NaN
.public Point(double x, double y)
Point
instance with the given x and y coordinates. z is set to Double.NaN
.x
- the x coordinatey
- the y coordinatepublic Point(double x, double y, double z)
Point
instance with the given coordinates.x
- the x coordinatey
- the y coordinatez
- the z coordinatepublic Point(double x, double y, double z, int level, int version)
Point
instance with the given coordinates and level and version.x
- the x coordinatey
- the y coordinatez
- the z coordinatelevel
- the SBML levelversion
- the SBML versionpublic Point(int level, int version)
Point
instance with the given level and version, all coordinates are set to Double.NaN
.level
- the SBML levelversion
- the SBML versionpublic Point clone()
SBase
SBase
with the same
properties
like this one.clone
in interface SBase
clone
in class AbstractSBase
public void initDefaults()
public boolean equals(java.lang.Object object)
SBase
public java.lang.String getElementName()
SBase
getElementName
in interface SBase
getElementName
in class AbstractSBase
public double getX()
Returns Double.NaN
if isSetX()
return false.
public double getY()
Returns Double.NaN
if isSetY()
return false.
public double getZ()
Returns Double.NaN
if isSetZ()
return false.
public int hashCode()
SBase
SBase
instance.hashCode
in interface SBase
hashCode
in class AbstractSBase
SBase
instance.Object.hashCode()
public boolean isIdMandatory()
SBase
true
if the identifier of this
SBase
is required to be defined (i.e., not null
)
in the definition of SBML.isIdMandatory
in interface NamedSBase
isIdMandatory
in interface SBase
isIdMandatory
in class AbstractSBase
true
if the identifier of this element must be set in
order to create a valid SBML representation. false
otherwise, i.e., if the identifier can be understood as an optional
attribute.public boolean isSetElementName()
xmlElementName
attribute is setpublic boolean isSetX()
true
if the x coordinate is set.true
if the x coordinate is set.public boolean isSetY()
true
if the y coordinate is set.true
if the y coordinate is set.public boolean isSetZ()
true
if the z coordinate is set.true
if the z coordinate is set.public boolean readAttribute(java.lang.String attributeName, java.lang.String prefix, java.lang.String value)
SBase
SBase
.
If the given attribute name is not recognized, nothing is done and
false
is returned.
readAttribute
in interface SBase
readAttribute
in class AbstractSBase
attributeName
- localName of the XML attributeprefix
- prefix of the XML attributevalue
- value of the XML attributetrue
if the attribute has been successfully read.public void setX(double x)
The general Point
class specifies the x, y, and z (optional) attributes
which defines the graphical location with respect to the coordinate system
of the Layout
extension. The x attribute is required.
x
- the x coordinate to be set.public void setY(double y)
The y attribute is required. For a more general description of the dimension
attributes, see setX(double)
.
y
- the y coordinate to be set.public void setZ(double z)
The z attribute is optional. The layout is 2-dimensional if the z attribute is not specified.
z
- the z coordinate to be set.public void unsetX()
public void unsetY()
public void unsetZ()
public java.util.Map<java.lang.String,java.lang.String> writeXMLAttributes()
SBase
SBase
that
need to be written out in XML.
The attribute name is used as a key and the attribute value as value. If a prefix is needed for the attribute name, it need to be set directly in this map.
writeXMLAttributes
in interface SBase
writeXMLAttributes
in class AbstractSBase
Map
containing the XML attributes of this object.public double x()
getX()
public double y()
getY()
public double z()
getZ()