public class RenderGroup extends GraphicalPrimitive2D
RenderGroup
concept from the SBML render extension is used to group graphical primitives together
to create composite representations from simple primitives.
The RenderGroup
class is derived from GrphicalPrimitive2D and inherits all its methods and attributes.
In addition to those, the class defines attributes to specify text render properties (
The attributes of a group are inherited by all children of the group unless they specify
the attribute themselves.
Text),
curve decorations (@see RenderCurve) an id and a list of child elements which can be any
graphical primitive or other groups.
EVENODD, INHERIT, NONZERO, UNSET
Constructor and Description |
---|
RenderGroup()
Creates a new
RenderGroup object with the given SBML level
and SBML version. |
RenderGroup(long level)
Creates a new
RenderGroup object with the given SBML level
and SBML version. |
RenderGroup(long level,
long version)
Creates a new
RenderGroup object with the given SBML level
and SBML version. |
RenderGroup(long level,
long version,
long pkgVersion)
Creates a new
RenderGroup object with the given SBML level
and SBML version. |
RenderGroup(RenderPkgNamespaces renderns)
Creates a new
RenderGroup object with the given SBMLNamespaces . |
RenderGroup(RenderPkgNamespaces renderns,
String id)
Instantiates a new
RenderGroup object. |
RenderGroup(XMLNode group)
Creates a new
RenderGroup object from the given XMLNode object. |
RenderGroup(XMLNode group,
long l2version)
Creates a new
RenderGroup object from the given XMLNode object. |
Modifier and Type | Method and Description |
---|---|
int |
addChildElement(Transformation2D pChild)
Adds a copy of the given element to the end of the list of children elements.
|
SBase |
cloneObject()
Creates and returns a deep copy of this
RenderGroup object. |
void |
connectToChild()   |
RenderCurve |
createCurve()
Creates a curve object and adds it to the end of the list of child
elements The new element is owned by the group..
|
Ellipse |
createEllipse()
Creates an ellipse object and adds it to the end of the list of child
elements The new element is owned by the group..
|
RenderGroup |
createGroup()
Creates an group object and adds it to the end of the list of child
elements The new element is owned by the group..
|
Image |
createImage()
Creates an image object and adds it to the end of the list of child
elements.
|
Polygon |
createPolygon()
Creates a polygon object and adds it to the end of the list of child
elements The new element is owned by the group..
|
Rectangle |
createRectangle()
Creates a rectangle object and adds it to the end of the list of child
elements The new element is owned by the group..
|
Text |
createText()
Creates a text object and adds it to the end of the list of child
elements The new element is owned by the group..
|
void |
delete()
Explicitly deletes the underlying native object.
|
Transformation2D |
getElement(long index)
Returns pointer to the element with index n.
|
Transformation2D |
getElement(String id)
Returns pointer to the element with the given
id . |
String |
getElementName()
Returns the XML element name of this object, which for
RenderGroup , is always 'g'. |
String |
getEndHead()
Returns the id of the
LineEnding object to be applied to the end of the curve. |
String |
getFontFamily()
Returns the font family.
|
RelAbsVector |
getFontSize()
Returns the font size as a reference.
|
int |
getFontStyle()
Returns the font style.
|
int |
getFontWeight()
Returns the font weight.
|
ListOfDrawables |
getListOfElements()
Returns a pointer to the list of elements.
|
long |
getNumElements()
Returns the number of children in the group.
|
String |
getStartHead()
Returns the id of the
LineEnding object to be applied to the start of the curve. |
int |
getTextAnchor()
Returns the text anchor.
|
int |
getTypeCode()
Returns the libSBML type code for this SBML object.
|
int |
getVTextAnchor()
Returns the vertical text anchor.
|
boolean |
isSetEndHead()
Returns true if the end head is set or false otherwise.
|
boolean |
isSetFontFamily()
Returns true if the font family has been set or false otherwise.
|
boolean |
isSetFontSize()
Returns true if the font size has been set or false otherwise.
|
boolean |
isSetFontStyle()
Returns true if the font style has been set or false otherwise.
|
boolean |
isSetFontWeight()
Returns true if the font weight has been set or false otherwise.
|
boolean |
isSetStartHead()
Returns true if the start head is set or false otherwise.
|
boolean |
isSetTextAnchor()
Returns true if the horizonal alignment attribute has been set.
|
boolean |
isSetVTextAnchor()
Returns true if the vertical alignment attribute has been set.
|
void |
setEndHead(String id)
Sets the id of the end head.
|
void |
setFontFamily(String family)
Sets the font family.
|
void |
setFontSize(RelAbsVector size)
Sets the font size.
|
void |
setFontStyle(int style)
Sets the font style.
|
void |
setFontWeight(int weight)
Sets the font weight.
|
void |
setStartHead(String id)
Sets the id of the start head.
|
void |
setTextAnchor(int anchor)
Sets the text anchor.
|
void |
setVTextAnchor(int anchor)
Sets the vertical text anchor.
|
XMLNode |
toXML()
Creates an
XMLNode object from this RenderGroup object. |
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, getLevel, getLine, getListOfAllElements, getListOfAllElements, getListOfAllElementsFromPlugins, getListOfAllElementsFromPlugins, getMetaId, getModel, getModelHistory, getNamespaces, getNotes, getNotesString, getNumCVTerms, getNumDisabledPlugins, getNumPlugins, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getPlugin, getPrefix, getResourceBiologicalQualifier, getResourceModelQualifier, getSBMLDocument, getSBOTerm, getSBOTermAsURL, getSBOTermID, getURI, getVersion, hashCode, hasValidLevelVersionNamespaceCombination, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetMetaId, isSetModelHistory, isSetNotes, isSetSBOTerm, isSetUserData, matchesRequiredSBMLNamespacesForAddition, matchesSBMLNamespaces, removeFromParentAndDelete, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, renameMetaIdRefs, renameSIdRefs, renameUnitSIdRefs, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setMetaId, setModelHistory, setNamespaces, setNotes, setNotes, setNotes, setSBOTerm, setSBOTerm, toSBML, toXMLNode, unsetAnnotation, unsetCVTerms, unsetMetaId, unsetModelHistory, unsetName, unsetNotes, unsetSBOTerm, unsetUserData
public RenderGroup(long level, long version, long pkgVersion) throws SBMLConstructorException
RenderGroup
object with the given SBML level
and SBML version.
level
- SBML level of the new objectlevel
- SBML version of the new objectSBMLConstructorException
public RenderGroup(long level, long version) throws SBMLConstructorException
RenderGroup
object with the given SBML level
and SBML version.
level
- SBML level of the new objectlevel
- SBML version of the new objectSBMLConstructorException
public RenderGroup(long level) throws SBMLConstructorException
RenderGroup
object with the given SBML level
and SBML version.
level
- SBML level of the new objectlevel
- SBML version of the new objectSBMLConstructorException
public RenderGroup() throws SBMLConstructorException
RenderGroup
object with the given SBML level
and SBML version.
level
- SBML level of the new objectlevel
- SBML version of the new objectSBMLConstructorException
public RenderGroup(RenderPkgNamespaces renderns) throws SBMLConstructorException
RenderGroup
object with the given SBMLNamespaces
.
sbmlns
- The SBML namespace for the object.SBMLConstructorException
public RenderGroup(XMLNode group, long l2version) throws SBMLConstructorException
RenderGroup
object from the given XMLNode
object.
The XMLNode
object has to contain a valid XML representation of a
RenderGroup
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 RenderGroup
object to be instantiated.SBMLConstructorException
public RenderGroup(XMLNode group) throws SBMLConstructorException
RenderGroup
object from the given XMLNode
object.
The XMLNode
object has to contain a valid XML representation of a
RenderGroup
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 RenderGroup
object to be instantiated.SBMLConstructorException
public RenderGroup(RenderPkgNamespaces renderns, String id) throws SBMLConstructorException
RenderGroup
object.
All attributes are set as described for the default constructor
of GraphicalPrimitive2D
.
All the font rendering attributes and the curve decorations
are unset. The id is set to the given string.
id
- the id for the RenderGroup
object.
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
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 RenderGroup.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 RenderGroup.delete()
themselves.
delete
 in class GraphicalPrimitive2D
public void setFontFamily(String family)
family
- The name of the font family, e.g. Helveticapublic void setFontSize(RelAbsVector size)
size
- the new font size.public void setFontWeight(int weight)
weight
- The new text weight to be set.public void setFontStyle(int style)
style
- The new font style to be set.public void setTextAnchor(int anchor)
anchor
- The new horizontal alignment flag.public void setVTextAnchor(int anchor)
anchor
- The new vertical alignment flag.public void setStartHead(String id)
The
- id of a LineEnding
object to be applied to the start of curve children.public void setEndHead(String id)
The
- id of a LineEnding
object to be applied to the end of curve children.public String getFontFamily()
public RelAbsVector getFontSize()
public int getFontWeight()
public int getFontStyle()
public int getTextAnchor()
public int getVTextAnchor()
public String getStartHead()
LineEnding
object to be applied to the start of the curve.
LineEnding
for the start of curves.public String getEndHead()
LineEnding
object to be applied to the end of the curve.
LineEnding
for the end of curves.public long getNumElements()
public ListOfDrawables getListOfElements()
public Transformation2D getElement(long index)
null
is returned.
index
- index of element to be returned
public Transformation2D getElement(String id)
id
.
If there is no such element, null
is returned.
Since the id on all those object is optional, this routine
might not be as helpful as similar routines in other classes.
id
- id of element to be returned
public boolean isSetTextAnchor()
public boolean isSetVTextAnchor()
public SBase cloneObject()
RenderGroup
object.
cloneObject
 in class SBase
RenderGroup
objectpublic String getElementName()
RenderGroup
, is always 'g'.
getElementName
 in class SBase
'g'.
public Image createImage()
Image
child.public RenderGroup createGroup()
RenderGroup
child.public Rectangle createRectangle()
public Ellipse createEllipse()
Ellipse
child.public RenderCurve createCurve()
RenderCurve
child.public Polygon createPolygon()
Polygon
child.public Text createText()
Text
child.public int addChildElement(Transformation2D pChild)
RenderGroup.createEllipse()
,
RenderGroup.createRectangle()
,
RenderGroup.createPolygon()
,
RenderGroup.createText()
,
RenderGroup.createCurve()
,
#createRenderGroup()
,
RenderGroup.createImage()
RenderGroup
. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in the RenderGroup
. 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 RenderGroup#createXXX()
for methods that do not lead to these issues.
public boolean isSetStartHead()
public boolean isSetEndHead()
public boolean isSetFontFamily()
public boolean isSetFontSize()
RelAbsVector
specifying the font size does not
contain NaN either as the absolute or the relative value.public boolean isSetFontWeight()
public boolean isSetFontStyle()
public XMLNode toXML()
XMLNode
object from this RenderGroup
object.
toXML
 in class GraphicalPrimitive1D
XMLNode
with the XML representation for the
RenderGroup
object.public void connectToChild()
connectToChild
 in class SBase
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).
RenderGroup.getElementName()