Class NodeHelper
java.lang.Object
de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.editing_tools.script_helper.NodeHelper
- All Implemented Interfaces:
Comparable<GraphElement>
,Attributable
,GraphElement
,Node
,HelperClass
public class NodeHelper extends Object implements Node, HelperClass
-
Constructor Summary
Constructors Constructor Description NodeHelper(Node workNode)
NodeHelper(Node n, boolean isLastNode)
-
Method Summary
Modifier and Type Method Description void
addAttribute(Attribute attr, String path)
Addsattr
to the attributes at position indicated by path.void
addBoolean(String path, String id, boolean value)
Adds aBooleanAttribute
with the given value and id to aCollectionAttribute
atpath
.void
addByte(String path, String id, byte value)
Adds an ByteAttribute with the given value and id to aCollectionAttribute
atpath
.void
addDataMapping(SubstanceInterface mappingData)
void
addDataMapping(Collection<DataSetRow> datasetRows, String substanceName)
void
addDouble(String path, String id, double value)
Adds aDoubleAttribute
with the given value andid
to aCollectionAttribute
atpath
.void
addFloat(String path, String id, float value)
Adds aFloatAttribute
with the given value andid
to aCollectionAttribute
atpath
.void
addInteger(String path, String id, int value)
Adds an IntegerAttribute with the given value andid
to aCollectionAttribute
atpath
.void
addLong(String path, String id, long value)
Adds an LongAttribute with the given value and id to aCollectionAttribute
atpath
.void
addShort(String path, String id, short value)
Adds an ShortAttribute with the given value and id to aCollectionAttribute
atpath
.void
addString(String path, String id, String value)
Adds an StringAttribute with the given value and id to aCollectionAttribute
atpath
.void
changeBoolean(String path, boolean value)
Changes theAttribute
at the given path to the given value.void
changeByte(String path, byte value)
Changes theAttribute
at the given path to the given value.void
changeDouble(String path, double value)
Changes theAttribute
at the given path to the given value.void
changeFloat(String path, float value)
Changes theAttribute
at the given path to the given value.void
changeInteger(String path, int value)
Changes theAttribute
at the given path to the given value.void
changeLong(String path, long value)
Changes theAttribute
at the given path to the given value.void
changeShort(String path, short value)
Changes theAttribute
at the given path to the given value.void
changeString(String path, String value)
Changes theAttribute
at the given path to the given value.int
compareTo(GraphElement o)
Collection<Edge>
getAllInEdges()
Union ofgetDirectedInEdges()
andgetUndirectedEdges()
.Collection<Node>
getAllInNeighbors()
Union ofgetInNeighbors()
andgetUndirectedNeighbors()
.HashSet<Node>
getAllOutChildNodes()
Collection<Edge>
getAllOutEdges()
Union ofgetDirectedOutEdges()
andgetUndirectedEdges()
.Collection<Node>
getAllOutNeighbors()
Union ofgetOutNeighbors()
andgetUndirectedNeighbors()
.ArrayList<String>
getAlternativeIDs()
Enumerate alternative identifiers, assigned to the mapped xml substance data.ArrayList<String>
getAlternativeIDsWithIdx(int index)
Enumerate alternative identifiers, assigned to the mapped xml substance data.Attribute
getAttribute(String path)
Returns theAttribute
located at the given path.CollectionAttribute
getAttributes()
Returns the attributes of the current object in the base hierarchie in aCollectionAttribute
.Object
getAttributeValue(String path, String name, Object returnIfNull, Object returnType)
double
getAverage()
boolean
getBoolean(String path)
Returns the value of theAttribute
at the given path.Color
getBorderColor()
double
getBorderWidth()
byte
getByte(String path)
Returns the value of theAttribute
at the given path.String
getClusterID(String ifNoCluster)
ExperimentInterface
getDataMappings()
DataSetTable
getDatasetTable()
int
getDegree()
Returns the degree of a nodeCollection<Edge>
getDirectedInEdges()
Returns a collection containing the directed ingoing edges of theNode
.Iterator<Edge>
getDirectedInEdgesIterator()
Returns an iterator containing the directed ingoing edges of theNode
.Collection<Edge>
getDirectedOutEdges()
Returns a collection containing the outgoing directed edges of theNode
.Iterator<Edge>
getDirectedOutEdgesIterator()
Returns an iterator containing the outgoing directed edges of theNode
.double
getDouble(String path)
Returns the value of theAttribute
at the given path.Collection<Edge>
getEdges()
Returns a collection containing all the ingoing and outgoing directed and undirected edges of the currentNode
.Iterator<Edge>
getEdgesIterator()
Returns an iterator containing all the ingoing and outgoing directed and undirected edges of the currentNode
.Color
getFillColor()
float
getFloat(String path)
Returns the value of theAttribute
at the given path.Graph
getGraph()
Returns the Graph the GraphElement belongs to.Node
getGraphNode()
double
getHeight()
long
getID()
TreeMap<DataMappingId,Stack<Double>>
getIdsAndAverageValues()
TreeMap<DataMappingId,Stack<Double>>
getIdsAndValues(Integer overrideReplicateId)
int
getInDegree()
Returns the in-degree of the currentNode
.Set<Node>
getInNeighbors()
Returns a collection containing the neighbor nodes belonging to incoming edges.Iterator<Node>
getInNeighborsIterator()
Returns an iterator over the neighbor nodes belonging to incoming edges.int
getInteger(String path)
Returns the value of theAttribute
at the given path.String
getLabel()
String
getLabel(boolean htmlEncoded)
ListenerManager
getListenerManager()
Returns theListenerManager
asscociated to thisAttributable
.long
getLong(String path)
Returns the value of theAttribute
at the given path.ArrayList<SampleAverageInterface>
getMappedAverageSampleData()
double
getMappedMaxSampleAvgValue()
ArrayList<Double>
getMappedMeanValuesForTimePoint(int timeValue)
double
getMappedMinSampleAvgValue()
ArrayList<NumericMeasurementInterface>
getMappedSampleData()
ArrayList<NumericMeasurementInterface>
getMappedSampleDataForTimePoint(int timeValue)
ArrayList<ConditionInterface>
getMappedSeriesData()
Set<String>
getMappedSeriesNames()
Set<Integer>
getMappedTimePointsCoveredByAllLines()
Set<Integer>
getMappedUniqueTimePoints()
ExperimentInterface
getMappingDataDocument(String substanceName, String measurementUnit, String experimentStart, String experimentName, String coordinator, String optRemark, String optSequence)
ArrayList<SubstanceInterface>
getMappings()
Set<Node>
getNeighbors()
Returns a collection containing all the neighbor nodes of the currentNode
.Iterator<Node>
getNeighborsIterator()
Returns an interator over the neighbor nodes of the currentNode
.static List<NodeHelper>
getNodeHelperList(Collection<Node> nodes)
int
getOutDegree()
Returns the out-degree of the currentNode
.Set<Node>
getOutNeighbors()
Returns a collection containing all the neighbors of the currentNode
which are connected by an outgoingEdge
.Iterator<Node>
getOutNeighborsIterator()
Returns an iterator containing all the neighbors of the currentNode
which are connected by an outgoingEdge
.String
getPathwayReference()
Point2D
getPosition()
ArrayList<NodeHelper>
getReachableLeafNodes()
double
getRounding()
String
getShape()
short
getShort(String path)
Returns the value of theAttribute
at the given path.String
getString(String path)
Returns the value of theAttribute
at the given path.String
getTooltip()
Collection<Edge>
getUndirectedEdges()
Returns a collection containing the undirected ingoing and outgoing edges of theNode
.Iterator<Edge>
getUndirectedEdgesIterator()
Returns an iterator containing all undirected edges of theNode
.Collection<Node>
getUndirectedNeighbors()
Returns a collection containing all the neighbors which are connected to the currentNode
by an undirectedEdge
.Iterator<Node>
getUndirectedNeighborsIterator()
String
getURL()
int
getViewID()
double
getWidth()
double
getX()
double
getY()
boolean
hasDataMapping()
boolean
isLastNode()
void
labelWordWrap()
boolean
memAddDataMapping(String substanceName, String measurementUnit, String experimentStart, String experimentName, String coordinator, String optRemark, String optSequence)
int
memGetPlantID(String species, String genotype, String optVariety, String optGrowthConditions, String optTreatment)
boolean
memSample(double value, int replicate, int plantID, String unit, String optTimeUnit, Integer optTimeValueForComparision)
void
mergeMultipleMappings()
int
removeAdditionalDataMappingIDs()
Attribute
removeAttribute(String path)
Deletes theAttribute
located at the given path from the attributes.void
removeDataMapping()
void
setAttributeValue(String path, String name, Object value)
void
setBoolean(String path, boolean value)
Sets theAttribute
at the given path to the given value.void
setBorderColor(Color c)
void
setBorderWidth(double w)
void
setByte(String path, byte value)
Sets theAttribute
at the given path to the given value.void
setChartRange(double minValue, double maxValue)
Shortcut method to modify the range axis minimum and maximum value.void
setChartSettingUseCustomRange(boolean set)
Shortcut method to enable or disable the display of a custom range.void
setChartType(GraffitiCharts chartType0123456)
void
setClusterID(String clusterID)
void
setDouble(String path, double value)
Sets theAttribute
at the given path to the given value.void
setFillColor(Color c)
void
setFloat(String path, float value)
Sets theAttribute
at the given path to the given value.void
setGraph(Graph graph)
void
setID(long id)
void
setInteger(String path, int value)
Sets theAttribute
at the given path to the given value.void
setLabel(String label)
void
setLabelAlignment(int index, AlignmentSetting align)
Set Label Position relative to the node.void
setLabelFontSize(int size, boolean wordWrap)
void
setLong(String path, long value)
Sets theAttribute
at the given path to the given value.void
setPathwayReference(String ref)
void
setPosition(double x, double y)
void
setPosition(Point2D position)
void
setRounding(double r)
void
setShort(String path, short value)
Sets theAttribute
at the given path to the given value.void
setSize(double width, double height)
void
setString(String path, String value)
Sets theAttribute
at the given path to the given value.void
setTooltip(String tooltip)
void
setURL(String url)
void
setViewID(int id)
boolean
writeDatasetTable(String fileName, boolean useAverage)
-
Constructor Details
-
NodeHelper
-
NodeHelper
-
-
Method Details
-
getAlternativeIDs
Enumerate alternative identifiers, assigned to the mapped xml substance data.- Returns:
- A list of alternative names, assigned to a node and its mapping data.
-
getAlternativeIDsWithIdx
Enumerate alternative identifiers, assigned to the mapped xml substance data. Only the specified index value is processed.- Returns:
- A list of alternative names, assigned to a node and its mapping data.
-
memSample
-
memGetPlantID
-
memAddDataMapping
-
addDataMapping
-
getMappingDataDocument
-
writeDatasetTable
-
getGraphNode
-
setFillColor
-
getFillColor
-
isLastNode
public boolean isLastNode() -
getBorderColor
-
setBorderColor
-
setSize
public void setSize(double width, double height) -
getWidth
public double getWidth() -
getHeight
public double getHeight() -
getClusterID
-
setClusterID
-
setPosition
public void setPosition(double x, double y) -
getX
public double getX() -
getY
public double getY() -
getURL
-
setURL
-
getPathwayReference
-
setPathwayReference
-
setAttributeValue
-
getAttributeValue
-
getTooltip
-
setTooltip
-
setLabel
-
getLabel
-
getBorderWidth
public double getBorderWidth() -
setBorderWidth
public void setBorderWidth(double w) -
setRounding
public void setRounding(double r) -
getRounding
public double getRounding() -
getDataMappings
-
getMappings
-
getMappedSeriesNames
-
getMappedSeriesData
-
getMappedSampleData
-
getMappedAverageSampleData
-
getMappedSampleDataForTimePoint
-
getMappedMeanValuesForTimePoint
-
getMappedTimePointsCoveredByAllLines
-
getMappedUniqueTimePoints
-
setChartType
-
getAverage
public double getAverage() -
getAllInEdges
Description copied from interface:Node
Union ofgetDirectedInEdges()
andgetUndirectedEdges()
.- Specified by:
getAllInEdges
in interfaceNode
- Returns:
- Collection
-
getAllInNeighbors
Description copied from interface:Node
Union ofgetInNeighbors()
andgetUndirectedNeighbors()
.- Specified by:
getAllInNeighbors
in interfaceNode
- Returns:
- Collection
-
getAllOutEdges
Description copied from interface:Node
Union ofgetDirectedOutEdges()
andgetUndirectedEdges()
.- Specified by:
getAllOutEdges
in interfaceNode
- Returns:
- Collection
-
getAllOutNeighbors
Description copied from interface:Node
Union ofgetOutNeighbors()
andgetUndirectedNeighbors()
.- Specified by:
getAllOutNeighbors
in interfaceNode
- Returns:
- Collection
-
getDirectedInEdges
Description copied from interface:Node
Returns a collection containing the directed ingoing edges of theNode
.- Specified by:
getDirectedInEdges
in interfaceNode
- Returns:
- a collection containing the directed ingoing edges of the
Node
.
-
getDirectedInEdgesIterator
Description copied from interface:Node
Returns an iterator containing the directed ingoing edges of theNode
.- Specified by:
getDirectedInEdgesIterator
in interfaceNode
- Returns:
- an iterator containing the directed ingoing edges of the
Node
.
-
getDirectedOutEdges
Description copied from interface:Node
Returns a collection containing the outgoing directed edges of theNode
.- Specified by:
getDirectedOutEdges
in interfaceNode
- Returns:
- a collection containing the outgoing directed edges of the
Node
.
-
getDirectedOutEdgesIterator
Description copied from interface:Node
Returns an iterator containing the outgoing directed edges of theNode
.- Specified by:
getDirectedOutEdgesIterator
in interfaceNode
- Returns:
- an iterator containing the outgoing directed edges of the
Node
.
-
getEdges
Description copied from interface:Node
Returns a collection containing all the ingoing and outgoing directed and undirected edges of the currentNode
. Ingoing and outgoing edges will not be separated and there will be no ordering on the collection. -
getEdgesIterator
Description copied from interface:Node
Returns an iterator containing all the ingoing and outgoing directed and undirected edges of the currentNode
. Ingoing and outgoing edges will not be separated and there will be no ordering on the collection.- Specified by:
getEdgesIterator
in interfaceNode
- Returns:
- an iterator containing all ingoing and outgoing directed and
undirected edges of the current
Node
.
-
getInDegree
public int getInDegree()Description copied from interface:Node
Returns the in-degree of the currentNode
. The in-degree is defined as the number of ingoing, directed edges plus the number of undirected edges.- Specified by:
getInDegree
in interfaceNode
- Returns:
- the in-degree of the current
Node
.
-
getInNeighbors
Description copied from interface:Node
Returns a collection containing the neighbor nodes belonging to incoming edges. Note that the number of Elements returned by this function might be less than the number returned bygetInDegree()
, due to the fact that multiple edges between the same two nodes are possible but the correspondingNode
is only inserted once.- Specified by:
getInNeighbors
in interfaceNode
- Returns:
- a collection containing the neighbor nodes belonging to incoming edges.
-
getInNeighborsIterator
Description copied from interface:Node
Returns an iterator over the neighbor nodes belonging to incoming edges.- Specified by:
getInNeighborsIterator
in interfaceNode
- Returns:
- a Iterator over the neighbor nodes belonging to incoming edges.
-
getNeighbors
Description copied from interface:Node
Returns a collection containing all the neighbor nodes of the currentNode
. A neighborNode
is either the source or the target of either an ingoing or an outgoing or an undirectedEdge
.- Specified by:
getNeighbors
in interfaceNode
- Returns:
- a collection containing all the neighbor nodes of the current
Node
.
-
getNeighborsIterator
Description copied from interface:Node
Returns an interator over the neighbor nodes of the currentNode
. A neighborNode
is either the source or the target of either an ingoing or outgoing or undirectedEdge
.- Specified by:
getNeighborsIterator
in interfaceNode
- Returns:
- an iterator over the neighbor nodes of the current
Node
.
-
getOutDegree
public int getOutDegree()Description copied from interface:Node
Returns the out-degree of the currentNode
. The out-degree is defined as the number of outgoing, directed edges plus the number of undirected edges.- Specified by:
getOutDegree
in interfaceNode
- Returns:
- the out-degree of the current
Node
.
-
getOutNeighbors
Description copied from interface:Node
Returns a collection containing all the neighbors of the currentNode
which are connected by an outgoingEdge
. Note that the number of elements returned by this function might be less than the number returned bygetOutDegree()
, due to the fact that multiple edges between the same two nodes are possible but the correspondingNode
is only inserted once.- Specified by:
getOutNeighbors
in interfaceNode
- Returns:
- a collection containing all the neighbor nodes of the current
Node
connected by an outgoingEdge
.
-
getOutNeighborsIterator
Description copied from interface:Node
Returns an iterator containing all the neighbors of the currentNode
which are connected by an outgoingEdge
.- Specified by:
getOutNeighborsIterator
in interfaceNode
- Returns:
- an iterator containing all the neighbor
Node
s of the currentNode
connected by an outgoingEdge
.
-
getUndirectedNeighborsIterator
- Specified by:
getUndirectedNeighborsIterator
in interfaceNode
-
getUndirectedEdges
Description copied from interface:Node
Returns a collection containing the undirected ingoing and outgoing edges of theNode
.- Specified by:
getUndirectedEdges
in interfaceNode
- Returns:
- a collection containing the undirected ingoing and outgoing edges of
the
Node
.
-
getUndirectedEdgesIterator
Description copied from interface:Node
Returns an iterator containing all undirected edges of theNode
.- Specified by:
getUndirectedEdgesIterator
in interfaceNode
- Returns:
- an iterator containing all undirected edges of the
Node
.
-
getUndirectedNeighbors
Description copied from interface:Node
Returns a collection containing all the neighbors which are connected to the currentNode
by an undirectedEdge
.- Specified by:
getUndirectedNeighbors
in interfaceNode
- Returns:
- a collection containing all the neighbors which are connected to the
current
Node
by an undirectedEdge
.
-
setGraph
-
getGraph
Description copied from interface:GraphElement
Returns the Graph the GraphElement belongs to.- Specified by:
getGraph
in interfaceGraphElement
- Returns:
- the Graph the GraphElement belongs to.
-
setID
public void setID(long id)- Specified by:
setID
in interfaceGraphElement
-
getID
public long getID()- Specified by:
getID
in interfaceGraphElement
-
getViewID
public int getViewID()- Specified by:
getViewID
in interfaceGraphElement
-
setViewID
public void setViewID(int id)- Specified by:
setViewID
in interfaceGraphElement
-
getAttribute
Description copied from interface:Attributable
Returns theAttribute
located at the given path.- Specified by:
getAttribute
in interfaceAttributable
- Parameters:
path
- the path to theAttribute
.- Returns:
- DOCUMENT ME!
- Throws:
AttributeNotFoundException
- if there is noAttribute
at the location specified bypath
.
-
getAttributes
Description copied from interface:Attributable
Returns the attributes of the current object in the base hierarchie in aCollectionAttribute
.- Specified by:
getAttributes
in interfaceAttributable
- Returns:
- the attributes of the current object.
-
setBoolean
Description copied from interface:Attributable
Sets theAttribute
at the given path to the given value. TheAttribute
is created at the given location, if it does not yet exist.- Specified by:
setBoolean
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.value
- the value to set to theAttribute
to.
-
getBoolean
Description copied from interface:Attributable
Returns the value of theAttribute
at the given path.- Specified by:
getBoolean
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.- Returns:
- the value of the
Attribute
at the given path. - Throws:
AttributeNotFoundException
- if there is noAttribute
at the specified location.
-
setByte
Description copied from interface:Attributable
Sets theAttribute
at the given path to the given value. TheAttribute
is created at the given location, if it does not yet exist.- Specified by:
setByte
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.value
- the value to set to theAttribute
to.
-
getByte
Description copied from interface:Attributable
Returns the value of theAttribute
at the given path.- Specified by:
getByte
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.- Returns:
- the value of the
Attribute
at the given path. - Throws:
AttributeNotFoundException
- if there is noAttribute
at the specified location.
-
setDouble
Description copied from interface:Attributable
Sets theAttribute
at the given path to the given value. The attribute is created at the given location, if it does not yet exist.- Specified by:
setDouble
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.value
- the value to set to theAttribute
to.
-
getDouble
Description copied from interface:Attributable
Returns the value of theAttribute
at the given path.- Specified by:
getDouble
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.- Returns:
- the value of the
Attribute
at the given path. - Throws:
AttributeNotFoundException
- if there is noAttribute
at the specified location.
-
setFloat
Description copied from interface:Attributable
Sets theAttribute
at the given path to the given value. The attribute is created at the given location, if it does not yet exist.- Specified by:
setFloat
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.value
- the value to set to theAttribute
to.
-
getFloat
Description copied from interface:Attributable
Returns the value of theAttribute
at the given path.- Specified by:
getFloat
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.- Returns:
- the value of the
Attribute
at the given path. - Throws:
AttributeNotFoundException
- if there is noAttribute
at the specified location.
-
setInteger
Description copied from interface:Attributable
Sets theAttribute
at the given path to the given value. TheAttribute
is created at the given location, if it does not yet exist.- Specified by:
setInteger
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.value
- the value to set to theAttribute
to.
-
getInteger
Description copied from interface:Attributable
Returns the value of theAttribute
at the given path.- Specified by:
getInteger
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.- Returns:
- the value of the
Attribute
at the given path. - Throws:
AttributeNotFoundException
- if there is noAttribute
at the specified location.
-
getListenerManager
Description copied from interface:Attributable
Returns theListenerManager
asscociated to thisAttributable
.- Specified by:
getListenerManager
in interfaceAttributable
- Returns:
- the
ListenerManager
asscociated to thisAttributable
.
-
setLong
Description copied from interface:Attributable
Sets theAttribute
at the given path to the given value. TheAttribute
is created at the given location, if it does not yet exist.- Specified by:
setLong
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.value
- the value to set to theAttribute
to.
-
getLong
Description copied from interface:Attributable
Returns the value of theAttribute
at the given path.- Specified by:
getLong
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.- Returns:
- the value of the
Attribute
at the given path. - Throws:
AttributeNotFoundException
- if there is noAttribute
at the specified location.
-
setShort
Description copied from interface:Attributable
Sets theAttribute
at the given path to the given value. TheAttribute
is created at the given location, if it does not yet exist.- Specified by:
setShort
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.value
- the value to set to theAttribute
to.
-
getShort
Description copied from interface:Attributable
Returns the value of theAttribute
at the given path.- Specified by:
getShort
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.- Returns:
- the value of the
Attribute
at the given path. - Throws:
AttributeNotFoundException
- if there is noAttribute
at the specified location.
-
setString
Description copied from interface:Attributable
Sets theAttribute
at the given path to the given value. TheAttribute
is created at the given location, if it does not yet exist.- Specified by:
setString
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.value
- the value to set to theAttribute
to.
-
getString
Description copied from interface:Attributable
Returns the value of theAttribute
at the given path.- Specified by:
getString
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.- Returns:
- the value of the
Attribute
at the given path. - Throws:
AttributeNotFoundException
- if there is noAttribute
at the specified location.
-
addAttribute
public void addAttribute(Attribute attr, String path) throws AttributeExistsException, NoCollectionAttributeException, FieldAlreadySetExceptionDescription copied from interface:Attributable
Addsattr
to the attributes at position indicated by path. Informs the ListenerManager about the change: callspreAttributeAdded
andpostAttributeAdded
in the ListenManager. Also sets theparent
and theattributable
ofattr
.Implementation Notes:
path
specifies the location of the CollectionAttribute or (in casepath
is the empty string) the Attributableattr
should be added to. Usage should look as follows:Graph g = new Graph(..); CollectionAttribute ca = new CollectionAttribute("root"); //add ca to the attributable g as root attribute g.addAttribute(ca, ""); IntegerAttribute ia = Integer.valueOfAttribute("int", 10); //add ia as child of root g.addAttribute(ia, "root");
Given there already exists an
Attribute
with the sameid
and cannot be overwritten, then anAttributeExistsException
will be thrown.- Specified by:
addAttribute
in interfaceAttributable
- Parameters:
attr
- theAttribute
to be added.- Throws:
AttributeExistsException
- if there is already anAttribute
with the sameid
asattr
at locationpath
.NoCollectionAttributeException
- if theAttribute
at locationpath
is not aCollectionAttribute
.FieldAlreadySetException
-
addBoolean
public void addBoolean(String path, String id, boolean value) throws NoCollectionAttributeException, AttributeExistsException, FieldAlreadySetExceptionDescription copied from interface:Attributable
Adds aBooleanAttribute
with the given value and id to aCollectionAttribute
atpath
.- Specified by:
addBoolean
in interfaceAttributable
- Parameters:
path
- the path to theCollectionAttribute
the new IntegerAttribute should be added to.id
- the id of the newly createdAttribute
.value
- the value of the newly createdAttribute
.- Throws:
NoCollectionAttributeException
- if theAttribute
at the location specified bypath
is noCollectionAttribute
.AttributeExistsException
- if there is already anAttribute
with the givenid
at the givenpath
.FieldAlreadySetException
-
addByte
public void addByte(String path, String id, byte value) throws NoCollectionAttributeException, AttributeExistsException, FieldAlreadySetExceptionDescription copied from interface:Attributable
Adds an ByteAttribute with the given value and id to aCollectionAttribute
atpath
.- Specified by:
addByte
in interfaceAttributable
- Parameters:
path
- the path to theCollectionAttribute
the new ByteAttribute should be added to.id
- the id of the new ByteAttribute.value
- the value of the new ByteAttribute.- Throws:
NoCollectionAttributeException
- if theAttribute
at the location specified bypath
is noCollectionAttribute
.AttributeExistsException
- if there is already anAttribute
with the givenid
at the givenpath
.FieldAlreadySetException
-
addDouble
public void addDouble(String path, String id, double value) throws NoCollectionAttributeException, AttributeExistsException, FieldAlreadySetExceptionDescription copied from interface:Attributable
Adds aDoubleAttribute
with the given value andid
to aCollectionAttribute
atpath
.- Specified by:
addDouble
in interfaceAttributable
- Parameters:
path
- the path to theCollectionAttribute
the newIntegerAttribute
should be added to.id
- the id of the newly createdAttribute
.value
- the value of the newly createdAttribute
.- Throws:
NoCollectionAttributeException
- if theAttribute
at the location specified bypath
is noCollectionAttribute
.AttributeExistsException
- if there is already anAttribute
with the givenid
at the givenpath
.FieldAlreadySetException
-
addFloat
public void addFloat(String path, String id, float value) throws NoCollectionAttributeException, AttributeExistsException, FieldAlreadySetExceptionDescription copied from interface:Attributable
Adds aFloatAttribute
with the given value andid
to aCollectionAttribute
atpath
.- Specified by:
addFloat
in interfaceAttributable
- Parameters:
path
- the path to theCollectionAttribute
the new IntegerAttribute should be added to.id
- the id of the newly createdAttribute
.value
- the value of the newly createdAttribute
.- Throws:
NoCollectionAttributeException
- if theAttribute
at the location specified bypath
is noCollectionAttribute
.AttributeExistsException
- if there is already anAttribute
with the givenid
at the givenpath
.FieldAlreadySetException
-
addInteger
public void addInteger(String path, String id, int value) throws NoCollectionAttributeException, AttributeExistsException, FieldAlreadySetExceptionDescription copied from interface:Attributable
Adds an IntegerAttribute with the given value andid
to aCollectionAttribute
atpath
.- Specified by:
addInteger
in interfaceAttributable
- Parameters:
path
- the path to theCollectionAttribute
the new IntegerAttribute should be added to.id
- the id of the Integer.valueOfAttribute.value
- the value of the Integer.valueOfAttribute.- Throws:
NoCollectionAttributeException
- if theAttribute
at the location specified bypath
is noCollectionAttribute
.AttributeExistsException
- if there is already anAttribute
with the givenid
at the givenpath
.FieldAlreadySetException
-
addLong
public void addLong(String path, String id, long value) throws NoCollectionAttributeException, AttributeExistsException, FieldAlreadySetExceptionDescription copied from interface:Attributable
Adds an LongAttribute with the given value and id to aCollectionAttribute
atpath
.- Specified by:
addLong
in interfaceAttributable
- Parameters:
path
- the path to theCollectionAttribute
the new LongAttribute should be added to.id
- the id of the new LongAttribute.value
- the value of the new LongAttribute.- Throws:
NoCollectionAttributeException
- if theAttribute
at the location specified bypath
is noCollectionAttribute
.AttributeExistsException
- if there is already anAttribute
with the givenid
at the givenpath
.FieldAlreadySetException
-
addShort
public void addShort(String path, String id, short value) throws NoCollectionAttributeException, AttributeExistsException, FieldAlreadySetExceptionDescription copied from interface:Attributable
Adds an ShortAttribute with the given value and id to aCollectionAttribute
atpath
.- Specified by:
addShort
in interfaceAttributable
- Parameters:
path
- the path to theCollectionAttribute
the new ShortAttribute should be added to.id
- the id of the new ShortAttribute.value
- the value of the new ShortAttribute.- Throws:
NoCollectionAttributeException
- if theAttribute
at the location specified bypath
is noCollectionAttribute
.AttributeExistsException
- if there is already anAttribute
with the givenid
at the givenpath
.FieldAlreadySetException
-
addString
public void addString(String path, String id, String value) throws NoCollectionAttributeException, AttributeExistsException, FieldAlreadySetExceptionDescription copied from interface:Attributable
Adds an StringAttribute with the given value and id to aCollectionAttribute
atpath
.- Specified by:
addString
in interfaceAttributable
- Parameters:
path
- the path to theCollectionAttribute
the new IntegerAttribute should be added to.id
- the id of the newly createdAttribute
.value
- the value of the newly createdAttribute
.- Throws:
NoCollectionAttributeException
- if theAttribute
at the location specified bypath
is noCollectionAttribute
.AttributeExistsException
- if there is already anAttribute
with the givenid
at the givenpath
.FieldAlreadySetException
-
changeBoolean
Description copied from interface:Attributable
Changes theAttribute
at the given path to the given value.- Specified by:
changeBoolean
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.value
- the value to set to theAttribute
to.- Throws:
AttributeNotFoundException
- if there is noAttribute
at the specified location.
-
changeByte
Description copied from interface:Attributable
Changes theAttribute
at the given path to the given value.- Specified by:
changeByte
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.value
- the value to set to theAttribute
to.- Throws:
AttributeNotFoundException
- if there is noAttribute
at the specified location.
-
changeDouble
Description copied from interface:Attributable
Changes theAttribute
at the given path to the given value.- Specified by:
changeDouble
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.value
- the value to set to theAttribute
to.- Throws:
AttributeNotFoundException
- if there is noAttribute
at the specified location.
-
changeFloat
Description copied from interface:Attributable
Changes theAttribute
at the given path to the given value.- Specified by:
changeFloat
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.value
- the value to set to theAttribute
to.- Throws:
AttributeNotFoundException
- if there is noAttribute
at the specified location.
-
changeInteger
Description copied from interface:Attributable
Changes theAttribute
at the given path to the given value.- Specified by:
changeInteger
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.value
- the value to set to theAttribute
to.- Throws:
AttributeNotFoundException
- if there is noAttribute
at the specified location.
-
changeLong
Description copied from interface:Attributable
Changes theAttribute
at the given path to the given value.- Specified by:
changeLong
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.value
- the value to set to theAttribute
to.- Throws:
AttributeNotFoundException
- if there is noAttribute
at the specified location.
-
changeShort
Description copied from interface:Attributable
Changes theAttribute
at the given path to the given value.- Specified by:
changeShort
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.value
- the value to set to theAttribute
to.- Throws:
AttributeNotFoundException
- if there is noAttribute
at the specified location.
-
changeString
Description copied from interface:Attributable
Changes theAttribute
at the given path to the given value.- Specified by:
changeString
in interfaceAttributable
- Parameters:
path
- the path to search for theAttribute
.value
- the value to set to theAttribute
to.- Throws:
AttributeNotFoundException
- if there is noAttribute
at the specified location.
-
removeAttribute
Description copied from interface:Attributable
Deletes theAttribute
located at the given path from the attributes. Informs the ListenerManager about the change: callspre-/postAttributeRemoved
in the ListenerManager.- Specified by:
removeAttribute
in interfaceAttributable
- Parameters:
path
- the path of theAttribute
to be removed.- Returns:
- the removed attribute
- Throws:
AttributeNotFoundException
- if there is noAttribute
at the location specified bypath
.
-
removeDataMapping
public void removeDataMapping() -
addDataMapping
-
mergeMultipleMappings
public void mergeMultipleMappings() -
getDegree
public int getDegree()Description copied from interface:Node
Returns the degree of a node -
getNodeHelperList
-
setPosition
-
getPosition
-
setChartRange
public void setChartRange(double minValue, double maxValue)Shortcut method to modify the range axis minimum and maximum value. Besides setting the minimum and maximum value, this method enables the use of the custom values. You may disable the use of the custom range with the methodsetChartSettingUseCustomRange
.- Parameters:
minValue
-maxValue
-
-
setChartSettingUseCustomRange
public void setChartSettingUseCustomRange(boolean set)Shortcut method to enable or disable the display of a custom range. (see alsosetChartRange
) Implementation: setAttributeValue("charting", "useCustomRange", Boolean.valueOf(set)); -
getMappedMinSampleAvgValue
public double getMappedMinSampleAvgValue() -
getMappedMaxSampleAvgValue
public double getMappedMaxSampleAvgValue() -
getDatasetTable
-
getAllOutChildNodes
-
hasDataMapping
public boolean hasDataMapping() -
getIdsAndValues
-
getIdsAndAverageValues
-
setLabelFontSize
public void setLabelFontSize(int size, boolean wordWrap) -
setLabelAlignment
Set Label Position relative to the node.- Parameters:
index
- Use "-1" to set position of main label, use values 0 to 99 to set annotation label positions.align
- The node label alignment setting.
-
labelWordWrap
public void labelWordWrap() -
removeAdditionalDataMappingIDs
public int removeAdditionalDataMappingIDs() -
getShape
-
getLabel
-
compareTo
- Specified by:
compareTo
in interfaceComparable<GraphElement>
-
getReachableLeafNodes
- Returns:
- List of leaf-nodes, reachable from this node.
-