public class GraphicalPrimitive1D extends Transformation2D
The GraphicalPrimitive1D class implements attributes and methods necessary for 1D objects
like lines. The attributes that are implemented are a stroke color, a stroke width and
a stroke dasharray for dashed line drawing.
Additionally this class adds an id attribute with which all graphical primitives can be referenced.
The GraphicalPrimitive1D class is derived from Transformation2D and inherits all its methods
and attributes.
| Modifier and Type | Method and Description |
|---|---|
void |
addDash(long dash)
Adds a dash at the end of the current list
|
void |
clearDashes()
Clears all defined dashes.
|
void |
delete()
Explicitly deletes the underlying native object.
|
long |
getDashByIndex(long index)
Returns the dash at the given index.
|
java.lang.String |
getId()
Returns the value of the 'id' attribute of this GraphicalPrimitive.
|
long |
getNumDashes()
Returns the number of defined dashes.
|
java.lang.String |
getStroke()
Returns the stroke color.
|
double |
getStrokeWidth()
Returns the stroke width.
|
void |
insertDash(long index,
long dash)
Inserts the dash at the given position.
|
boolean |
isSetDashArray()
Returns true is the dash array has been set or false otherwise.
|
boolean |
isSetId()
Predicate returning
true or false depending on whether this
GraphicalPrimitive's 'id' attribute has been set. |
boolean |
isSetStroke()
Returns true is the stroke has been set or false otherwise.
|
boolean |
isSetStrokeWidth()
Returns true is the stroke width has been set or false otherwise.
|
void |
removeDash(long index)
Removes the dash at the given index
|
void |
setDashByIndex(long index,
long dash)
Sets the dash at the given position.
|
int |
setId(java.lang.String id)
Sets the value of the 'id' attribute of this GraphicalPrimitive.
|
void |
setStroke(java.lang.String stroke)
Sets the stroke color to the given color definition id or color value string.
|
void |
setStrokeWidth(double width)
Sets the stroke width.
|
XMLNode |
toXML()
Creates an
XMLNode object from this GraphicalPrimitive1D object. |
int |
unsetId()
Unsets the value of the 'id' attribute of this GraphicalPrimitive.
|
getIdentityMatrix2D, getMatrix2D, setMatrix, setMatrix2DgetIdentityMatrix, getMatrix, getName, isSetMatrix, isSetName, setName, unsetNameaddCVTerm, addCVTerm, appendAnnotation, appendAnnotation, appendNotes, appendNotes, cloneObject, connectToChild, deleteDisabledPlugins, deleteDisabledPlugins, disablePackage, enablePackage, equals, getAncestorOfType, getAncestorOfType, getAnnotation, getAnnotationString, getColumn, getCVTerm, getCVTerms, getDisabledPlugin, getElementByMetaId, getElementBySId, getElementName, 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, getTypeCode, 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 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 GraphicalPrimitive1D.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 GraphicalPrimitive1D.delete() themselves.
delete in class Transformation2Dpublic void setStroke(java.lang.String stroke)
stroke - id of a ColorDefinition object or a valid color value string.
ColorDefinition)public void setStrokeWidth(double width)
width - New width for strokes. Should be a positive value.public java.lang.String getStroke()
public double getStrokeWidth()
public boolean isSetStrokeWidth()
public boolean isSetStroke()
public boolean isSetDashArray()
public long getNumDashes()
public long getDashByIndex(long index)
public void addDash(long dash)
public void clearDashes()
public void setDashByIndex(long index, long dash)
public void insertDash(long index, long dash)
public void removeDash(long index)
public XMLNode toXML()
XMLNode object from this GraphicalPrimitive1D object.
toXML in class Transformation2DXMLNode with the XML representation for the
GraphicalPrimitive1D object.
This method is purely virtual and has to be implemented by subclasses.
public java.lang.String getId()
getId in class SBaseSBase.getIdAttribute(),
SBase.setIdAttribute(String sid),
SBase.isSetIdAttribute(),
SBase.unsetIdAttribute()public boolean isSetId()
true or false depending on whether this
GraphicalPrimitive's 'id' attribute has been set.
isSetId in class SBaseSBase.getIdAttribute(),
SBase.setIdAttribute(String sid),
SBase.unsetIdAttribute(),
SBase.isSetIdAttribute()public int setId(java.lang.String id)
setId in class SBaseid - the new id for the GraphicalPrimitive
SBase.getIdAttribute(),
SBase.setIdAttribute(String sid),
SBase.isSetIdAttribute(),
SBase.unsetIdAttribute()public int unsetId()
unsetId in class SBaseSBase.getIdAttribute(),
SBase.setIdAttribute(String sid),
SBase.isSetIdAttribute(),
SBase.unsetIdAttribute()