java.io.Serializable
, java.lang.Cloneable
, javax.swing.tree.TreeNode
, ICurve
, SBase
, TreeNodeWithChangeSupport
public class RenderCurve extends GraphicalPrimitive1D implements ICurve
The curve concept in the SBML render extension is similar to the curves in the SBML layout. Each curve consists of a number of either straight line segments or cubic Bézier elements. The two element types can also be mixed in a single curve object.
In contrast to layout curves, render curves can not have gaps and the individual coordinates of the curve elements can be specified as a combination of absolute and relative values.
Another difference to layout curves is the fact that render curves can specify decorations to be applied to the start and/or the end of the curve (@see LineEnding).
Since RenderCurve
is derived from GraphicalPrimitive1D
, it
inherits all its attributes and methods.
JSBML_WRONG_SBO_TERM
Constructor | Description |
---|---|
RenderCurve() |
Creates an Curve instance
|
RenderCurve(RenderCurve obj) |
Clone constructor
|
Modifier and Type | Method | Description |
---|---|---|
void |
addCurveSegment(int index,
CurveSegment element) |
|
boolean |
addCurveSegment(CurveSegment curveSegment) |
Adds a new
CurveSegment to the listOfCurveSegments . |
boolean |
addElement(RenderPoint element) |
|
RenderCurve |
clone() |
Creates a deep copy of this object, i.e., a new
SBase with the same
properties
like this one. |
CubicBezier |
createCubicBezier() |
Creates a new
CubicBezier instance and adds it to the
listOfCurveSegments list. |
RenderPoint |
createElement() |
Deprecated.
use#createRenderPoint()
|
LineSegment |
createLineSegment() |
Creates a new
LineSegment instance and adds it to the
listOfCurveSegments list. |
RenderPoint |
createRenderCubicBezier() |
Creates a new
RenderCubicBezier instance and adds it to the ListOfElements list |
RenderPoint |
createRenderPoint() |
Creates a new
RenderPoint instance and adds it to the ListOfElements list |
boolean |
equals(java.lang.Object obj) |
|
boolean |
getAllowsChildren() |
|
SBase |
getChildAt(int childIndex) |
|
int |
getChildCount() |
|
CurveSegment |
getCurveSegment(int i) |
Gets an element from the
listOfCurveSegments at the given index. |
int |
getCurveSegmentCount() |
Returns the number of
CurveSegment s in this
RenderCurve . |
java.lang.String |
getElementName() |
Returns the XML element name of this object.
|
java.lang.String |
getEndHead() |
Returns the value of endHead
|
ListOf<CurveSegment> |
getListOfCurveSegments() |
Returns the
listOfCurveSegments . |
ListOf<RenderPoint> |
getListOfElements() |
|
int |
getNumCurveSegments() |
Returns the number of
CurveSegment s in this
RenderCurve . |
java.lang.String |
getStartHead() |
Returns the value of startHead
|
int |
hashCode() |
Returns a hash code value for this
SBase instance. |
void |
initDefaults() |
Initializes the default values using the namespace.
|
boolean |
isListOfCurveSegmentsEmpty() |
|
boolean |
isListOfElementsEmpty() |
|
boolean |
isSetEndHead() |
Returns
true if endHead is set. |
boolean |
isSetListOfCurveSegments() |
Returns
true if listOfCurveSegments contains at least
one element. |
boolean |
isSetListOfElements() |
|
boolean |
isSetStartHead() |
Returns
true if startHead is set |
boolean |
readAttribute(java.lang.String attributeName,
java.lang.String prefix,
java.lang.String value) |
Sets the given attribute in this
SBase . |
CurveSegment |
removeCurveSegment(int i) |
Removes an element from the
listOfCurveSegments at the given index. |
boolean |
removeCurveSegment(CurveSegment curveSegment) |
Removes an element from the
listOfCurveSegments . |
void |
removeElement(int i) |
|
boolean |
removeElement(RenderPoint element) |
|
void |
setEndHead(java.lang.String endHead) |
Sets the value of endHead
|
void |
setListOfCurveSegments(ListOf<CurveSegment> listOfCurveSegments) |
Sets the given
ListOf<CurveSegment> . |
void |
setListOfElements(ListOf<RenderPoint> listOfElements) |
|
void |
setStartHead(java.lang.String startHead) |
Sets the value of startHead.
|
boolean |
unsetEndHead() |
Unsets the variable endHead
|
boolean |
unsetListOfCurveSegments() |
|
boolean |
unsetListOfElements() |
|
boolean |
unsetStartHead() |
Unsets the variable startHead
|
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. |
addCVTerm, addDeclaredNamespace, addExtension, addPlugin, addResources, appendAnnotation, appendAnnotation, appendNotes, appendNotes, createHistory, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, fireNodeRemovedEvent, firePropertyChange, getAllDeclaredNamespaces, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementByMetaId, getElementBySId, getExtension, getExtensionCount, getExtensionPackages, getFirstElementIndex, getHistory, getId, getLevel, getLevelAndVersion, getMetaId, getModel, getName, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getPackageName, getPackageVersion, getParent, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getURI, getVersion, hasExtension, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isIdMandatory, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetId, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetName, isSetNotes, isSetPackageVErsion, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, isValidLevelAndVersionCombination, isValidMetaId, registerChild, removeCVTerm, removeCVTerm, removeDeclaredNamespaceByNamespace, removeDeclaredNamespaceByPrefix, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setAnnotation, setHistory, setId, setLevel, setMetaId, setName, setNamespace, setNotes, setNotes, setPackageVersion, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, toString, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetId, unsetMetaId, unsetName, 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
addStrokeDash, getStroke, getStrokeDash, getStrokeDashArray, getStrokeWidth, isSetStroke, isSetStrokeDashArray, isSetStrokeWidth, setStroke, setStrokeDashArray, setStrokeDashArray, setStrokeWidth, unsetStroke, unsetStrokeDashArray, unsetStrokeWidth
removeTreeNodeChangeListener
isSetTransform, setTransform
getTransform, unsetTransform
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, getListOfTreeNodeChangeListeners, getRoot, getTreeNodeChangeListenerCount, getUserObject, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeUserObject, userObjectKeySet
public RenderCurve()
public RenderCurve(RenderCurve obj)
obj
- the RenderCurve
to clonepublic RenderCurve clone()
SBase
SBase
with the same
properties
like this one.clone
in interface SBase
clone
in class GraphicalPrimitive1D
public void initDefaults()
Transformation
initDefaults
in class GraphicalPrimitive1D
public int hashCode()
SBase
SBase
instance.hashCode
in interface SBase
hashCode
in class GraphicalPrimitive1D
SBase
instance.Object.hashCode()
public boolean equals(java.lang.Object obj)
SBase
public java.lang.String getElementName()
SBase
getElementName
in interface SBase
getElementName
in class AbstractSBase
public java.lang.String getStartHead()
public boolean isSetStartHead()
true
if startHead is setpublic void setStartHead(java.lang.String startHead)
startHead
- the start headpublic boolean unsetStartHead()
true
, if startHead was set before,
otherwise false
public java.lang.String getEndHead()
public boolean isSetEndHead()
true
if endHead is set.public void setEndHead(java.lang.String endHead)
endHead
- the end headpublic boolean unsetEndHead()
true
, if endHead was set before,
otherwise false
public boolean isSetListOfElements()
true
, if listOfElements contains at least one element,
otherwise false
public boolean isListOfElementsEmpty()
true
iff listOfElements is not null
, but empty
(relevant for validation)public ListOf<RenderPoint> getListOfElements()
public void setListOfElements(ListOf<RenderPoint> listOfElements)
listOfElements
- the list of RenderPoint
spublic boolean unsetListOfElements()
true
, if listOfElements contained at least one element,
otherwise false
public boolean addElement(RenderPoint element)
element
- public boolean removeElement(RenderPoint element)
element
- public void removeElement(int i)
i
- public RenderPoint createElement()
RenderPoint
instance and adds it to the ListOfElements listRenderPoint
instancepublic RenderPoint createRenderCubicBezier()
RenderCubicBezier
instance and adds it to the ListOfElements listRenderCubicBezier
instancepublic RenderPoint createRenderPoint()
RenderPoint
instance and adds it to the ListOfElements listRenderPoint
instancepublic boolean isSetListOfCurveSegments()
true
if listOfCurveSegments
contains at least
one element.isSetListOfCurveSegments
in interface ICurve
true
if listOfCurveSegments
contains at least
one element, otherwise false
.public boolean isListOfCurveSegmentsEmpty()
true
iff listOfCurveSegments is not null
, but empty
(relevant for validation)public ListOf<CurveSegment> getListOfCurveSegments()
listOfCurveSegments
.
Creates it if it does not already exist.getListOfCurveSegments
in interface ICurve
listOfCurveSegments
.public void setListOfCurveSegments(ListOf<CurveSegment> listOfCurveSegments)
ListOf<CurveSegment>
.
If listOfCurveSegments
was defined before and contains some
elements, they are all unset.setListOfCurveSegments
in interface ICurve
listOfCurveSegments
- the list of CurveSegment
spublic boolean unsetListOfCurveSegments()
unsetListOfCurveSegments
in interface ICurve
true
if listOfCurveSegments
contains at least
one element, otherwise false
.public boolean addCurveSegment(CurveSegment curveSegment)
CurveSegment
to the listOfCurveSegments
.
The listOfCurveSegments is initialized if necessary.
addCurveSegment
in interface ICurve
curveSegment
- the element to add to the listtrue
(as specified by Collection.add(E)
)Collection.add(Object)
public void addCurveSegment(int index, CurveSegment element)
addCurveSegment
in interface ICurve
public boolean removeCurveSegment(CurveSegment curveSegment)
listOfCurveSegments
.removeCurveSegment
in interface ICurve
curveSegment
- the element to be removed from the list.true
if the list contained the specified element and it was
removed.List.remove(Object)
public CurveSegment removeCurveSegment(int i)
listOfCurveSegments
at the given index.i
- the index where to remove the CurveSegment
.java.lang.IndexOutOfBoundsException
- if the listOf is not set or if the index is
out of bound ((i < 0) || (i > listOfCurveSegments)
).public LineSegment createLineSegment()
LineSegment
instance and adds it to the
listOfCurveSegments
list.listOfCurveSegments
public CubicBezier createCubicBezier()
CubicBezier
instance and adds it to the
listOfCurveSegments
list.createCubicBezier
in interface ICurve
listOfCurveSegments
public CurveSegment getCurveSegment(int i)
listOfCurveSegments
at the given index.getCurveSegment
in interface ICurve
i
- the index of the CurveSegment
element to get.java.lang.IndexOutOfBoundsException
- if the listOf is not set or
if the index is out of bound (index < 0 || index > list.size).public int getCurveSegmentCount()
CurveSegment
s in this
RenderCurve
.getCurveSegmentCount
in interface ICurve
CurveSegment
s in this
RenderCurve
.public int getNumCurveSegments()
CurveSegment
s in this
RenderCurve
.CurveSegment
s in this
RenderCurve
.getCurveSegmentCount()
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 GraphicalPrimitive1D
Map
containing the XML attributes of this object.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 GraphicalPrimitive1D
attributeName
- localName of the XML attributeprefix
- prefix of the XML attributevalue
- value of the XML attributetrue
if the attribute has been successfully read.public boolean getAllowsChildren()
getAllowsChildren
in interface javax.swing.tree.TreeNode
getAllowsChildren
in class AbstractSBase
public SBase getChildAt(int childIndex)
getChildAt
in interface javax.swing.tree.TreeNode
getChildAt
in class AbstractSBase
public int getChildCount()
getChildCount
in interface javax.swing.tree.TreeNode
getChildCount
in class AbstractSBase