public class Rectangle extends GraphicalPrimitive2D
Rectangle allows the definition of rectangles with or without rounded
edges. The Rectangle object derives from the GraphicalPrimitive2D class
and thus inherits any attributes and elements that are present on this
class. In addition, the Rectangle object has the required attributes 'x',
'y', 'height', and 'width' as well as the optional attributes 'z', 'rx', 'ry' and
'ratio'.
| Constructor and Description |
|---|
Rectangle()
Creates a new
Rectangle using the given SBML Level, Version and
“render” package version. |
Rectangle(long level)
Creates a new
Rectangle using the given SBML Level, Version and
“render” package version. |
Rectangle(long level,
long version)
Creates a new
Rectangle using the given SBML Level, Version and
“render” package version. |
Rectangle(long level,
long version,
long pkgVersion)
Creates a new
Rectangle using the given SBML Level, Version and
“render” package version. |
Rectangle(Rectangle orig)
Copy constructor for
Rectangle. |
Rectangle(RenderPkgNamespaces renderns)
Creates a new
Rectangle using the given RenderPkgNamespaces object. |
Rectangle(RenderPkgNamespaces renderns,
java.lang.String id)
Instantiates a new
Rectangle object. |
Rectangle(RenderPkgNamespaces renderns,
java.lang.String id,
RelAbsVector x,
RelAbsVector y,
RelAbsVector w,
RelAbsVector h)
Instantiates a new
Rectangle object. |
Rectangle(RenderPkgNamespaces renderns,
java.lang.String id,
RelAbsVector x,
RelAbsVector y,
RelAbsVector z,
RelAbsVector w,
RelAbsVector h)
Instantiates a new
Rectangle object. |
Rectangle(XMLNode node)
|
Rectangle(XMLNode node,
long l2version)
|
| Modifier and Type | Method and Description |
|---|---|
Rectangle |
cloneObject()
Creates and returns a deep copy of this
Rectangle object. |
void |
delete()
Explicitly deletes the underlying native object.
|
java.lang.String |
getElementName()
Returns the XML element name of this
Rectangle object. |
RelAbsVector |
getHeight()
Returns the height of the rectangle
|
RelAbsVector |
getRadiusX()
Returns the corner radius along the x axis
|
RelAbsVector |
getRadiusY()
Returns the corner radius along the y axis
|
double |
getRatio()
Returns the value of the 'ratio' attribute of this
Rectangle. |
RelAbsVector |
getRX()
Returns the value of the 'rX' element of this
Rectangle. |
RelAbsVector |
getRY()
Returns the value of the 'rY' element of this
Rectangle. |
int |
getTypeCode()
Returns the libSBML type code for this
Rectangle object. |
RelAbsVector |
getWidth()
Returns the with of the rectangle
|
RelAbsVector |
getX()
Returns the x coordinate of the rectangle's position
|
RelAbsVector |
getY()
Returns the y coordinate of the rectangle's position
|
RelAbsVector |
getZ()
Returns the z coordinate of the rectangle's position
|
boolean |
hasRequiredAttributes()
Predicate returning
true if all the required attributes for this
Rectangle object have been set. |
boolean |
isSetHeight()
Predicate returning
true if this Rectangle's 'height' attribute is set. |
boolean |
isSetRadiusX()
Predicate returning
true if this Rectangle's 'rX' attribute is set. |
boolean |
isSetRadiusY()
Predicate returning
true if this Rectangle's 'rY' attribute is set. |
boolean |
isSetRatio()
Predicate returning
true if this Rectangle's 'ratio' attribute is set. |
boolean |
isSetRX()
Predicate returning
true if this Rectangle's 'rX' attribute is set. |
boolean |
isSetRY()
Predicate returning
true if this Rectangle's 'rY' attribute is set. |
boolean |
isSetWidth()
Predicate returning
true if this Rectangle's 'width' attribute is set. |
boolean |
isSetX()
Predicate returning
true if this Rectangle's 'x' attribute is set. |
boolean |
isSetY()
Predicate returning
true if this Rectangle's 'y' attribute is set. |
boolean |
isSetZ()
Predicate returning
true if this Rectangle's 'z' attribute is set. |
void |
setCoordinates(RelAbsVector x,
RelAbsVector y,
RelAbsVector z)
Sets the position of the
Rectangle within the viewport. |
void |
setCoordinatesAndSize(RelAbsVector x,
RelAbsVector y,
RelAbsVector z,
RelAbsVector w,
RelAbsVector h)
Sets the position and the size of the
Rectangle within the viewport. |
int |
setHeight(RelAbsVector h)
Sets the height of the
Rectangle |
void |
setRadii(RelAbsVector rx,
RelAbsVector ry)
Sets the two corner radii of the rectangle
|
int |
setRadiusX(RelAbsVector rx)
Sets the corner radius along the x axis
|
int |
setRadiusY(RelAbsVector ry)
Sets the corner radius along the y axis
|
int |
setRatio(double ratio)
Sets the value of the 'ratio' attribute of this
Rectangle. |
int |
setRX(RelAbsVector rx)
Sets the corner radius along the x axis
|
int |
setRY(RelAbsVector ry)
Sets the corner radius along the y axis
|
void |
setSize(RelAbsVector w,
RelAbsVector h)
Sets the size of the
Rectangle |
int |
setWidth(RelAbsVector w)
Sets the width of the
Rectangle |
int |
setX(RelAbsVector x)
Sets the x position of the
Rectangle within the viewport. |
int |
setY(RelAbsVector y)
Sets the y position of the
Rectangle within the viewport. |
int |
setZ(RelAbsVector z)
Sets the z position of the
Rectangle within the viewport. |
XMLNode |
toXML()
|
int |
unsetHeight()
Unsets the value of the 'height' attribute of this
Rectangle. |
int |
unsetRadiusX()
Unsets the value of the 'rX' attribute of this
Rectangle. |
int |
unsetRadiusY()
Unsets the value of the 'rY' attribute of this
Rectangle. |
int |
unsetRatio()
Unsets the value of the 'ratio' attribute of this
Rectangle. |
int |
unsetRX()
Unsets the value of the 'rX' attribute of this
Rectangle. |
int |
unsetRY()
Unsets the value of the 'rY' attribute of this
Rectangle. |
int |
unsetWidth()
Unsets the value of the 'width' attribute of this
Rectangle. |
int |
unsetX()
Unsets the value of the 'x' attribute of this
Rectangle. |
int |
unsetY()
Unsets the value of the 'y' attribute of this
Rectangle. |
int |
unsetZ()
Unsets the value of the 'z' attribute of this
Rectangle. |
getFill, getFillColor, getFillRule, getFillRuleAsString, isEllipse, isLineEnding, isPolygon, isRectangle, isRenderGroup, isSetFill, isSetFillColor, isSetFillRule, setFill, setFillColor, setFillRule, setFillRule, unsetFill, unsetFillRuleaddDash, clearDashes, getDashByIndex, getId, getNumDashes, getStroke, getStrokeDashArray, getStrokeWidth, insertDash, isRenderCurve, isSetDashArray, isSetId, isSetStroke, isSetStrokeDashArray, isSetStrokeWidth, isText, removeDash, setDashByIndex, setId, setStroke, setStrokeDashArray, setStrokeWidth, unsetId, unsetStroke, unsetStrokeDashArray, unsetStrokeWidthgetIdentityMatrix2D, getMatrix2D, isImage, setMatrix, setMatrix2DgetIdentityMatrix, getMatrix, getName, getTransform, isSetMatrix, isSetName, isSetTransform, setName, setTransform, unsetMatrix, unsetName, unsetTransformaddCVTerm, addCVTerm, appendAnnotation, appendAnnotation, appendNotes, appendNotes, connectToChild, deleteDisabledPlugins, deleteDisabledPlugins, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getDisabledPlugin, getElementByMetaId, getElementBySId, getIdAttribute, getLevel, getLine, getListOfAllElements, getListOfAllElements, getListOfAllElementsFromPlugins, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumDisabledPlugins, getNumPlugins, getPackageCoreVersion, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getPrefix, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getURI, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetIdAttribute, isSetMetaId, isSetModelHistory, isSetNotes, isSetSBOTerm, isSetUserData, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeFromParentAndDelete, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, renameSIdRefs, renameUnitSIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setIdAttribute, setMetaId, setModelHistory, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetIdAttribute, unsetMetaId, unsetModelHistory, unsetNotes, unsetSBOTerm, unsetUserDatapublic Rectangle(long level, long version, long pkgVersion) throws SBMLConstructorException
Rectangle using the given SBML Level, Version and
“render” package version.
level - a long integer, the SBML Level to assign to this Rectangle.
version - a long integer, the SBML Version to assign to this
Rectangle.
pkgVersion - a long integer, the SBML Render Version to assign to
this Rectangle.
SBMLConstructorExceptionSBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public Rectangle(long level, long version) throws SBMLConstructorException
Rectangle using the given SBML Level, Version and
“render” package version.
level - a long integer, the SBML Level to assign to this Rectangle.
version - a long integer, the SBML Version to assign to this
Rectangle.
pkgVersion - a long integer, the SBML Render Version to assign to
this Rectangle.
SBMLConstructorExceptionSBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public Rectangle(long level) throws SBMLConstructorException
Rectangle using the given SBML Level, Version and
“render” package version.
level - a long integer, the SBML Level to assign to this Rectangle.
version - a long integer, the SBML Version to assign to this
Rectangle.
pkgVersion - a long integer, the SBML Render Version to assign to
this Rectangle.
SBMLConstructorExceptionSBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public Rectangle() throws SBMLConstructorException
Rectangle using the given SBML Level, Version and
“render” package version.
level - a long integer, the SBML Level to assign to this Rectangle.
version - a long integer, the SBML Version to assign to this
Rectangle.
pkgVersion - a long integer, the SBML Render Version to assign to
this Rectangle.
SBMLConstructorExceptionSBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public Rectangle(RenderPkgNamespaces renderns) throws SBMLConstructorException
Rectangle using the given RenderPkgNamespaces object.
The package namespaces object used in this constructor is derived from a
SBMLNamespaces object, which encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
package version and name information used in addition to SBML Level 3 Core. A
common approach to using libSBML's SBMLNamespaces facilities is to create an
package namespace object somewhere in a program once, then hand that object
as needed to object constructors of that package that accept it as and
argument, such as this one.
renderns - the RenderPkgNamespaces object.
SBMLConstructorExceptionSBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make the
addition. A parent object must have compatible Level, Version and XML
namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can be
created by permitting callers to create objects bottom-up if desired. In
situations where objects are not yet attached to parents (e.g.,
SBMLDocument), knowledge of the intented SBML Level and Version help
libSBML determine such things as whether it is valid to assign a
particular value to an attribute. For packages, this means that the
parent object to which this package element is being added must have
been created with the package namespace, or that the package namespace
was added to it, even if that parent is not a package object itself.public Rectangle(XMLNode node, long l2version) throws SBMLConstructorException
Rectangle object from the given XMLNode object.
The XMLNode object has to contain a valid XML representation of a
Rectangle object as defined in the render extension specification.
This method is normally called when render information is read from a file and
should normally not have to be called explicitly.
node - the XMLNode object reference that describes the Rectangle
object to be instantiated.
l2version - an integer indicating the version of SBML Level 2SBMLConstructorExceptionpublic Rectangle(XMLNode node) throws SBMLConstructorException
Rectangle object from the given XMLNode object.
The XMLNode object has to contain a valid XML representation of a
Rectangle object as defined in the render extension specification.
This method is normally called when render information is read from a file and
should normally not have to be called explicitly.
node - the XMLNode object reference that describes the Rectangle
object to be instantiated.
l2version - an integer indicating the version of SBML Level 2SBMLConstructorExceptionpublic Rectangle(RenderPkgNamespaces renderns, java.lang.String id) throws SBMLConstructorException
Rectangle object.
All attributes are set as described for the default constructor
of GraphicalPrimitive2D.
The id is set to the given string and all rectangle specific attributes are set to 0.
renderns - the SBMLNamespaces object for the SBML 'render' packageid - id string for the rectangle
SBMLConstructorExceptionSBMLNamespaces object.public Rectangle(RenderPkgNamespaces renderns, java.lang.String id, RelAbsVector x, RelAbsVector y, RelAbsVector z, RelAbsVector w, RelAbsVector h) throws SBMLConstructorException
Rectangle object.
All attributes are set as described for the default constructor
of GraphicalPrimitive2D.
The id is set to the given string and all rectangle specific attributes are set to the given values.
renderns - the SBMLNamespaces object for the SBML 'render' packageid - id string for the rectanglex - x coordinate of the positiony - y coordinate of the positionz - z coordinate of the positionw - w widthh - h height
SBMLConstructorExceptionSBMLNamespaces object.public Rectangle(RenderPkgNamespaces renderns, java.lang.String id, RelAbsVector x, RelAbsVector y, RelAbsVector w, RelAbsVector h) throws SBMLConstructorException
Rectangle object.
All attributes are set as described for the default constructor
of GraphicalPrimitive2D.
The id is set to the given string and all rectangle specific attributes are set to the given values. The z coordinate of the position is set to 0.
renderns - the SBMLNamespaces object for the SBML 'render' packageid - id string for the rectanglex - x coordinate of the positiony - y coordinate of the positionw - w widthh - h height
SBMLConstructorExceptionSBMLNamespaces object.public Rectangle(Rectangle orig) throws SBMLConstructorException
Rectangle.
orig - the Rectangle instance to copy.SBMLConstructorExceptionpublic void delete()
In general, application software will not need to call this method directly. The Java language binding for libSBML is implemented as a language wrapper that provides a Java interface to libSBML's underlying C++/C code. Some of the Java methods return objects that are linked to objects created not by Java code, but by C++ code. The Java objects wrapped around them will be deleted when the garbage collector invokes the corresponding C++ finalize() methods for the objects. The finalize() methods in turn call the Rectangle.delete() method on the libSBML object.
This method is exposed in case calling programs want to ensure that the underlying object is freed immediately, and not at some arbitrary time determined by the Java garbage collector. In normal usage, callers do not need to invoke Rectangle.delete() themselves.
delete in class GraphicalPrimitive2Dpublic Rectangle cloneObject()
Rectangle object.
cloneObject in class GraphicalPrimitive2DRectangle object.public double getRatio()
Rectangle.
Rectangle as a double.public boolean isSetRatio()
true if this Rectangle's 'ratio' attribute is set.
true if this Rectangle's 'ratio' attribute has been set,
otherwise false is returned.public int setRatio(double ratio)
Rectangle.
ratio - double value of the 'ratio' attribute to be set.
LIBSBML_OPERATION_SUCCESS
OperationReturnValues_t}
public int unsetRatio()
Rectangle.
public RelAbsVector getX()
RelAbsVector that represents the x positionpublic RelAbsVector getY()
RelAbsVector that represents the y positionpublic RelAbsVector getZ()
RelAbsVector that represents the z positionpublic RelAbsVector getWidth()
RelAbsVector that represents the widthpublic RelAbsVector getHeight()
RelAbsVector that represents the heightpublic RelAbsVector getRX()
Rectangle.
Rectangle as a
RelAbsVector.public RelAbsVector getRadiusX()
RelAbsVector that corner radius along the x axispublic RelAbsVector getRY()
Rectangle.
Rectangle as a
RelAbsVector.public RelAbsVector getRadiusY()
RelAbsVector that corner radius along the y axispublic boolean isSetX()
true if this Rectangle's 'x' attribute is set.
true if this Rectangle's 'x' attribute has been set, otherwise
false is returned.public boolean isSetY()
true if this Rectangle's 'y' attribute is set.
true if this Rectangle's 'y' attribute has been set, otherwise
false is returned.public boolean isSetZ()
true if this Rectangle's 'z' attribute is set.
true if this Rectangle's 'z' attribute has been set, otherwise
false is returned.public boolean isSetWidth()
true if this Rectangle's 'width' attribute is set.
true if this Rectangle's 'width' attribute has been set,
otherwise false is returned.public boolean isSetHeight()
true if this Rectangle's 'height' attribute is set.
true if this Rectangle's 'height' attribute has been set,
otherwise false is returned.public boolean isSetRX()
true if this Rectangle's 'rX' attribute is set.
true if this Rectangle's 'rX' attribute has been set, otherwise
false is returned.public boolean isSetRadiusX()
true if this Rectangle's 'rX' attribute is set.
true if this Rectangle's 'rX' attribute has been set, otherwise
false is returned.public boolean isSetRY()
true if this Rectangle's 'rY' attribute is set.
true if this Rectangle's 'rY' attribute has been set, otherwise
false is returned.public boolean isSetRadiusY()
true if this Rectangle's 'rY' attribute is set.
true if this Rectangle's 'rY' attribute has been set, otherwise
false is returned.public void setCoordinatesAndSize(RelAbsVector x, RelAbsVector y, RelAbsVector z, RelAbsVector w, RelAbsVector h)
Rectangle within the viewport.
x - x coordinate of the positiony - y coordinate of the positionz - z coordinate of the positionw - w widthh - h heightpublic void setCoordinates(RelAbsVector x, RelAbsVector y, RelAbsVector z)
Rectangle within the viewport.
x - x coordinate of the positiony - y coordinate of the positionz - z coordinate of the positionpublic void setSize(RelAbsVector w, RelAbsVector h)
Rectangle
w - w widthh - h heightpublic void setRadii(RelAbsVector rx, RelAbsVector ry)
rx - corner radius along the x axisry - corner radius along the y axispublic int setX(RelAbsVector x)
Rectangle within the viewport.
x - x coordinate of the position
public int setY(RelAbsVector y)
Rectangle within the viewport.
y - y coordinate of the position
public int setZ(RelAbsVector z)
Rectangle within the viewport.
z - z coordinate of the position
public int setWidth(RelAbsVector w)
Rectangle
w - w width
public int setHeight(RelAbsVector h)
Rectangle
h - h height
public int setRadiusX(RelAbsVector rx)
rx - corner radius along the x axis
public int setRX(RelAbsVector rx)
rx - corner radius along the x axis
public int setRadiusY(RelAbsVector ry)
ry - corner radius along the y axis
public int setRY(RelAbsVector ry)
ry - corner radius along the y axis
public int unsetX()
Rectangle.
public int unsetY()
Rectangle.
public int unsetZ()
Rectangle.
public int unsetWidth()
Rectangle.
public int unsetHeight()
Rectangle.
public int unsetRadiusX()
Rectangle.
public int unsetRX()
Rectangle.
public int unsetRadiusY()
Rectangle.
public int unsetRY()
Rectangle.
public java.lang.String getElementName()
Rectangle object.
For Rectangle, the XML element name is always 'rectangle'.
getElementName in class GraphicalPrimitive2D'rectangle'.public int getTypeCode()
Rectangle object.
LibSBML attaches an identifying code to every kind of SBML object. These
are integer constants known as SBML type codes. The names of all
the codes begin with the characters SBML_.
In the Java language interface for libSBML, the
type codes are defined as static integer constants in the interface class
libsbmlConstants. Note that different Level 3
package plug-ins may use overlapping type codes; to identify the package
to which a given object belongs, call the
method on the object.
SBase.getPackageName()
The exception to this is lists: all SBML-style list elements have the type
SBML_LIST_OF, regardless of what package they
are from.
getTypeCode in class GraphicalPrimitive2DSBML_RENDER_RECTANGLE.
Rectangle.getElementName(),
SBase.getPackageName()ListOf.getItemTypeCode()).
public boolean hasRequiredAttributes()
true if all the required attributes for this
Rectangle object have been set.
hasRequiredAttributes in class GraphicalPrimitive2Dtrue to indicate that all the required attributes of this
Rectangle have been set, otherwise false is returned.