Home / Development / Documentation / 2.0.44 / PieChartLabel
TreeGraph 2
 


info.bioinfweb.treegraph.document
Class PieChartLabel

java.lang.Object
  extended by info.bioinfweb.treegraph.document.ConcretePaintableElement
      extended by info.bioinfweb.treegraph.document.Label
          extended by info.bioinfweb.treegraph.document.GraphicalLabel
              extended by 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

Field Summary
private  PieChartLabelFormats formats
           
private  List<String> valueIDs
           
 
Fields inherited from class info.bioinfweb.treegraph.document.ConcretePaintableElement
positions
 
Constructor Summary
PieChartLabel(Labels labels)
           
 
Method Summary
 void addValueID(int index, String id)
           
 boolean addValueID(String id)
           
 void assignPieChartData(PieChartLabel other)
           
 void clearValueIDs()
           
 PieChartLabel clone()
          Returns a deep copy of this pie chart label.
 PieChartLabelFormats getFormats()
           
 double[] getPieChartAngles()
          Returns an array with angles the single value would make up in a resulting pie chart in degrees.
 double getValue(int index)
          Returns the value of the data column for the ID with the specified index.
 String getValueID(int index)
           
 String removeValueID(int index)
           
 void setFormats(ElementFormats format)
           
 String setValueID(int index, String id)
           
 int valueCount()
           
 
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
 
Methods inherited from class info.bioinfweb.treegraph.document.ConcretePaintableElement
getPosition
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.bioinfweb.treegraph.document.PaintableElement
getPosition
 

Field Detail

valueIDs

private List<String> valueIDs

formats

private PieChartLabelFormats formats
Constructor Detail

PieChartLabel

public PieChartLabel(Labels labels)
Method Detail

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