public class Polygon extends GraphicalPrimitive2D
The Polygon
is very similar to the RenderCurve
class. The only difference is that in the
polygon the end point of the last element in the curve segment list is
automatically connected to the start point of the first element.
Since a polygon is a closed shape and doesn't really have a start or an end, it does not get
decorations as the RenderCurve
does.
So a polygon is always closed and can therefor have a fill style and fill style related attributes.
Those attributes are inherited from Polygons base class GraphicalPrimitive2D
.
EVENODD, INHERIT, NONZERO, UNSET
Constructor and Description |
---|
Polygon()
Creates a new
Polygon object with the given SBML level
and SBML version. |
Polygon(long level)
Creates a new
Polygon object with the given SBML level
and SBML version. |
Polygon(long level,
long version)
Creates a new
Polygon object with the given SBML level
and SBML version. |
Polygon(long level,
long version,
long pkgVersion)
Creates a new
Polygon object with the given SBML level
and SBML version. |
Polygon(RenderPkgNamespaces renderns)
Creates a new
Polygon object with the given SBMLNamespaces . |
Polygon(RenderPkgNamespaces renderns,
java.lang.String id)
Instanciates a polygon with the given
id and no elements. |
Polygon(XMLNode node)
|
Polygon(XMLNode node,
long l2version)
|
Modifier and Type | Method and Description |
---|---|
int |
addElement(RenderPoint cs)
Adds a copy of the given segment to the end of the list of
segments.
|
Polygon |
cloneObject()
Creates and returns a deep copy of the
Polygon object. |
void |
connectToChild()   |
RenderCubicBezier |
createCubicBezier()
Creates a new bezier element.
|
RenderPoint |
createPoint()
Creates a new point element.
|
void |
delete()
Explicitly deletes the underlying native object.
|
RenderPoint |
getElement(long index)
Returns a pointer to the segment with the given index or null if
the id is invalid.
|
java.lang.String |
getElementName()
Returns the XML element name of this object, which for
Polygon , is always 'polygon'. |
ListOfCurveElements |
getListOfElements()
Returns a pointer to the list of segments.
|
long |
getNumElements()
Returns the number of segments.
|
int |
getTypeCode()
Returns the libSBML type code for this SBML object.
|
XMLNode |
toXML()
|
getFillColor, getFillRule, isSetFill, isSetFillColor, isSetFillRule, setFillColor, setFillRule
addDash, clearDashes, getDashByIndex, getId, getNumDashes, getStroke, getStrokeWidth, insertDash, isSetDashArray, isSetId, isSetStroke, isSetStrokeWidth, removeDash, setDashByIndex, setId, setStroke, setStrokeWidth, unsetId
getIdentityMatrix2D, getMatrix2D, setMatrix, setMatrix2D
getIdentityMatrix, getMatrix, isSetMatrix
addCVTerm, addCVTerm, appendAnnotation, appendAnnotation, appendNotes, appendNotes, 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, getName, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumDisabledPlugins, getNumPlugins, getObjectVersion, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getPrefix, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getURI, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetIdAttribute, isSetMetaId, isSetModelHistory, isSetName, isSetNotes, isSetSBOTerm, isSetUserData, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeFromParentAndDelete, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, renameSIdRefs, renameUnitSIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setIdAttribute, setMetaId, setModelHistory, setName, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetIdAttribute, unsetMetaId, unsetModelHistory, unsetName, unsetNotes, unsetSBOTerm, unsetUserData
public Polygon(long level, long version, long pkgVersion) throws SBMLConstructorException
Polygon
object with the given SBML level
and SBML version.
level
- SBML level of the new objectlevel
- SBML version of the new objectSBMLConstructorException
public Polygon(long level, long version) throws SBMLConstructorException
Polygon
object with the given SBML level
and SBML version.
level
- SBML level of the new objectlevel
- SBML version of the new objectSBMLConstructorException
public Polygon(long level) throws SBMLConstructorException
Polygon
object with the given SBML level
and SBML version.
level
- SBML level of the new objectlevel
- SBML version of the new objectSBMLConstructorException
public Polygon() throws SBMLConstructorException
Polygon
object with the given SBML level
and SBML version.
level
- SBML level of the new objectlevel
- SBML version of the new objectSBMLConstructorException
public Polygon(RenderPkgNamespaces renderns) throws SBMLConstructorException
Polygon
object with the given SBMLNamespaces
.
sbmlns
- The SBML namespace for the object.SBMLConstructorException
public Polygon(XMLNode node, long l2version) throws SBMLConstructorException
Polygon
object from the given XMLNode
object.
The XMLNode
object has to contain a valid XML representation of a
Polygon
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 Polygon
object to be instantiated.SBMLConstructorException
public Polygon(XMLNode node) throws SBMLConstructorException
Polygon
object from the given XMLNode
object.
The XMLNode
object has to contain a valid XML representation of a
Polygon
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 Polygon
object to be instantiated.SBMLConstructorException
public Polygon(RenderPkgNamespaces renderns, java.lang.String id) throws SBMLConstructorException
id
and no elements.
All attributes inherited from GraphicalPrimitive are set as described
in the corresponding constructor of that class (id
- id string for the polygon
This constructor is deprecated. The new libsbml API only has
constructors which take the SBML level and version or one that takes
an SBMLNamespaces
object.
SBMLConstructorException
GraphicalPrimitive2D)
public 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 Polygon.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 Polygon.delete()
themselves.
delete
 in class GraphicalPrimitive2D
public long getNumElements()
public ListOfCurveElements getListOfElements()
ListOfCurveElements
object for the Polygon
.public RenderPoint createPoint()
RenderCubicBezier
object.public RenderCubicBezier createCubicBezier()
RenderCubicBezier
object.public RenderPoint getElement(long index)
index
- the index of the element to be returned
public int addElement(RenderPoint cs)
cs
- pointer to the RenderPoint
object to be added to the end of the elements list.
Polygon.createPoint()
,
Polygon.createCubicBezier()
Polygon
. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in the Polygon
. In addition, the caller should make
sure to free the original object if it is no longer being used, or
else a memory leak will result. Please see Polygon.createPoint()
or Polygon.createCubicBezier()
for methods that do not lead to these issues.
public Polygon cloneObject()
Polygon
object.
cloneObject
 in class SBase
Polygon
public java.lang.String getElementName()
Polygon
, is always 'polygon'.
getElementName
 in class SBase
'polygon'.
public int getTypeCode()
LibSBML attaches an
identifying code to every kind of SBML object. These are known as
SBML type codes. In other languages, the set of type codes
is stored in an enumeration in the Java language interface for
libSBML, the type codes are defined as static integer constants in
interface class libsbmlConstants
. The names of the type codes
all begin with the characters SBML_.
getTypeCode
 in class SBase
SBML_UNKNOWN
(default).
Polygon.getElementName()
public XMLNode toXML()
toXML
 in class GraphicalPrimitive1D
XMLNode
with the XML representation for the
Polygon
object.public void connectToChild()
connectToChild
 in class SBase