info.bioinfweb.treegraph.document
Class PieChartLabel
java.lang.Object
info.bioinfweb.treegraph.document.ConcretePaintableElement
info.bioinfweb.treegraph.document.Label
info.bioinfweb.treegraph.document.GraphicalLabel
info.bioinfweb.treegraph.document.PieChartLabel
- All Implemented Interfaces:
- LineElement, PaintableElement, TreeElement, Cloneable
public class PieChartLabel
- extends GraphicalLabel
- implements LineElement
Represents a pie chart label.
- Since:
- 2.0.43
- Author:
- Ben Stöver
Methods inherited from class info.bioinfweb.treegraph.document.Label |
assignLabelData, getAbove, getBelow, getHoldingBranch, getID, getLabels, getLineIndex, getLineNo, getLinkedNode, getNext, getPrevious, idIsValid, isAbove, reinsert, setID, setLabels |
valueIDs
private List<String> valueIDs
formats
private PieChartLabelFormats formats
PieChartLabel
public PieChartLabel(Labels labels)
addValueID
public void addValueID(int index,
String id)
addValueID
public boolean addValueID(String id)
getValueID
public String getValueID(int index)
removeValueID
public String removeValueID(int index)
setValueID
public String setValueID(int index,
String id)
clearValueIDs
public void clearValueIDs()
valueCount
public int valueCount()
getValue
public double getValue(int index)
- Returns the value of the data column for the ID with the specified index. (The value is not normalized to
100 % or 2 Pi)
- Parameters:
index
- the index of the ID to be used
- Returns:
- the numeric value or
Double.NaN
if no data with this ID is available at the specified node
or a textual value is stored
- Throws:
NoLinkedNodeException
- if this label has no linked node (no linked Labels
object).- See Also:
getPieChartAngles()
,
IDManager.getDataByID(Node, String)
getPieChartAngles
public double[] getPieChartAngles()
- Returns an array with angles the single value would make up in a resulting pie chart in degrees.
- Returns:
- a array with the length
valueCount()
- Throws:
NoLinkedNodeException
- if this label has no linked node (no linked Labels
object).
getFormats
public PieChartLabelFormats getFormats()
- Specified by:
getFormats
in interface LineElement
- Specified by:
getFormats
in interface PaintableElement
- Specified by:
getFormats
in class GraphicalLabel
setFormats
public void setFormats(ElementFormats format)
- Specified by:
setFormats
in interface PaintableElement
assignPieChartData
public void assignPieChartData(PieChartLabel other)
clone
public PieChartLabel clone()
- Returns a deep copy of this pie chart label. Note that the linked
Labels
-object
of the returned object is null
no matter if this object was linked or not.
- Specified by:
clone
in class Label