org.sbml.jsbml.ext.layout
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.
Modifier and Type | Field and Description |
---|---|
private static org.apache.log4j.Logger |
logger
A
Logger for this class. |
private static long |
serialVersionUID |
private double |
x
the x coordinate
|
private java.lang.String |
xmlElementName
The name to be used when writing this point to XML.
|
private double |
y
the y coordinate
|
private double |
z
the z coordinate
|
ignoredExtensions, ignoredXMLElements
listOfListeners, parent, UNKNOWN_ATTRIBUTES, UNKNOWN_ELEMENTS
Constructor and 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. |
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 and Description |
---|---|
Point |
clone()
Creates a deep copy of this object, i.e., a new
SBase with the same properties
like this one. |
protected void |
clonePointAttributes(Point point,
Point cloned)
Clones the x, y and z coordinates from point to cloned.
|
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. |
boolean |
isIdMandatory()
This method can be used to query if the identifier of this
NamedSBase is required to be defined (i.e., not null )
in the definition of SBML. |
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 . |
(package private) void |
setElementName(java.lang.String elementName)
Sets the name to be used when writing this
Point to XML. |
void |
setX(double x)
Sets the x coordinate.
|
void |
setY(double y)
Sets the y coordinate.
|
void |
setZ(double z)
Sets the z coordinate.
|
java.lang.String |
toString()
Returns the name of the component, if it is available.
|
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.
|
getId, getName, isSetId, isSetName, isValidId, setId, setName, unsetId, unsetName
addCVTerm, addDeclaredNamespace, addExtension, addPlugin, appendNotes, appendNotes, checkLevelAndVersionCompatibility, createHistory, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, fireNodeRemovedEvent, firePropertyChange, getAllowsChildren, getAnnotation, getAnnotationString, getChildAt, getChildCount, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getExtension, getExtensionCount, getExtensionPackages, getHistory, getIdManager, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getParent, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getVersion, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, isValidLevelAndVersionCombination, isValidMetaId, notifyChildChange, registerChild, removeCVTerm, removeCVTerm, setAnnotation, setHistory, setLevel, setMetaId, setNamespace, setNotes, setNotes, setParentSBML, setParentSBMLObject, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, 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
finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getName, isSetId, isSetName, setId, setName, unsetId, unsetName
addCVTerm, addDeclaredNamespace, addExtension, addPlugin, appendNotes, appendNotes, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getExtension, getExtensionCount, getExtensionPackages, getHistory, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getVersion, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, registerChild, removeCVTerm, removeCVTerm, removeTreeNodeChangeListener, setAnnotation, setHistory, setLevel, setMetaId, setNotes, setNotes, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNotes, unsetPlugin, unsetSBOTerm
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
private static final long serialVersionUID
private static final org.apache.log4j.Logger logger
Logger
for this class.private double x
private double y
private double z
private java.lang.String xmlElementName
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 coordinatez
- the z 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
protected void clonePointAttributes(Point point, Point cloned)
point
- cloned
- 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 AbstractNamedSBase
SBase
instance.Object.hashCode()
public boolean isIdMandatory()
NamedSBase
NamedSBase
is required to be defined (i.e., not null
)
in the definition of SBML.isIdMandatory
in interface NamedSBase
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 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 AbstractNamedSBase
attributeName
- localName of the XML attributeprefix
- prefix of the XML attributevalue
- value of the XML attributetrue
if the attribute has been successfully read.void setElementName(java.lang.String elementName)
Point
to XML.
This method should only be used internally.
elementName
- the xml element name.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 java.lang.String toString()
AbstractNamedSBase
toString
in class AbstractNamedSBase
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 AbstractNamedSBase
Map
containing the XML attributes of this object.public double x()
getX()
public double y()
getY()
public double z()
getZ()