jebl.gui.trees.treeviewer_dev.painters
Class BasicLabelPainter
java.lang.Object
jebl.gui.trees.treeviewer_dev.painters.AbstractPainter<T>
jebl.gui.trees.treeviewer_dev.painters.LabelPainter<Node>
jebl.gui.trees.treeviewer_dev.painters.BasicLabelPainter
- All Implemented Interfaces:
- Painter<Node>
public class BasicLabelPainter
- extends LabelPainter<Node>
A simple implementation of LabelPainter that can be used to display
tip, node or branch labels. It can display, taxon names, branch lengths,
node heights or other attributeNames of nodes.
- Author:
- Andrew Rambaut
Methods inherited from class jebl.gui.trees.treeviewer_dev.painters.LabelPainter |
getBackground, getBorderPaint, getBorderStroke, getFont, getForeground, getNumberFormat, isVisible, setBackground, setBorder, setFont, setForeground, setNumberFormat, setVisible |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TAXON_NAMES
public static final String TAXON_NAMES
- See Also:
- Constant Field Values
NODE_HEIGHTS
public static final String NODE_HEIGHTS
- See Also:
- Constant Field Values
BRANCH_LENGTHS
public static final String BRANCH_LENGTHS
- See Also:
- Constant Field Values
displayAttribute
protected String displayAttribute
attributes
protected String[] attributes
treePane
protected TreePane treePane
BasicLabelPainter
public BasicLabelPainter(BasicLabelPainter.PainterIntent intent)
setupAttributes
public void setupAttributes(Tree tree)
- Specified by:
setupAttributes
in class LabelPainter<Node>
setTreePane
public void setTreePane(TreePane treePane)
- Description copied from interface:
Painter
- Called when the painter is installed in a TreePane. Gives the
painter a handle on the TreePane so that it get additional
information.
getBorderDecorator
public Decorator getBorderDecorator()
setBorderDecorator
public void setBorderDecorator(Decorator borderDecorator)
getTextDecorator
public Decorator getTextDecorator()
setTextDecorator
public void setTextDecorator(Decorator textDecorator)
getLabel
protected String getLabel(Tree tree,
Node node)
calibrate
public Rectangle2D calibrate(Graphics2D g2,
Node item)
- Description copied from interface:
Painter
- Called to calibrate the painters for a given graphics context. This should
work out the preferred width and height (perhaps for the current font).
getPreferredWidth
public double getPreferredWidth()
getPreferredHeight
public double getPreferredHeight()
getHeightBound
public double getHeightBound()
paint
public void paint(Graphics2D g2,
Node item,
Painter.Justification justification,
Rectangle2D bounds)
- Description copied from interface:
Painter
- Called to actually paint into the current graphics context. The painter should
respect the bounds.
getAttributes
public String[] getAttributes()
- Specified by:
getAttributes
in class LabelPainter<Node>
setDisplayAttribute
public void setDisplayAttribute(String displayAttribute)
- Specified by:
setDisplayAttribute
in class LabelPainter<Node>