jebl.gui.trees.treeviewer.painters
Class BasicLabelPainter

java.lang.Object
  extended by jebl.gui.trees.treeviewer.painters.AbstractPainter<Node>
      extended by jebl.gui.trees.treeviewer.painters.BasicLabelPainter
All Implemented Interfaces:
Painter<Node>, ControlsProvider

public class BasicLabelPainter
extends AbstractPainter<Node>

Author:
Andrew Rambaut

Nested Class Summary
static class BasicLabelPainter.PainterIntent
           
 
Nested classes/interfaces inherited from interface jebl.gui.trees.treeviewer.painters.Painter
Painter.Justification, Painter.Orientation
 
Field Summary
protected  String attribute
           
protected  String[] attributes
           
static String BRANCH_LENGTHS
           
static String NODE_HEIGHTS
           
static String TAXON_NAMES
           
 
Constructor Summary
BasicLabelPainter(String title, RootedTree tree, BasicLabelPainter.PainterIntent intent)
           
BasicLabelPainter(String title, RootedTree tree, BasicLabelPainter.PainterIntent intent, int defaultSize)
           
 
Method Summary
 void calibrate(Graphics2D g2, Node item)
           
 String[] getAttributes()
           
 List<Controls> getControls(boolean detachPrimaryCheckbox)
          Get a list of Controls handled by this provider.
 double getHeightBound()
           
protected  String getLabel(Node node)
           
 double getPreferredHeight()
           
 double getPreferredWidth()
           
 void getSettings(ControlsSettings settings)
          Get the settings for a given Controls object.
 String getTitle()
           
 boolean isVisible()
           
 void paint(Graphics2D g2, Node item, Painter.Justification justification, Rectangle2D bounds)
           
 void setAttribute(String attribute)
           
 void setBackground(Paint background)
           
 void setBorder(Paint borderPaint, Stroke borderStroke)
           
 void setControlPalette(ControlPalette controlPalette)
          Give the controls provider with a handle for the controlPalette object.
 void setFontSize(float size)
           
 void setForeground(Paint foreground)
           
 void setSettings(ControlsSettings settings)
          Give the provider some settings.
 void setVisible(boolean visible)
           
 
Methods inherited from class jebl.gui.trees.treeviewer.painters.AbstractPainter
addPainterListener, firePainterChanged, removePainterListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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

attribute

protected String attribute

attributes

protected String[] attributes
Constructor Detail

BasicLabelPainter

public BasicLabelPainter(String title,
                         RootedTree tree,
                         BasicLabelPainter.PainterIntent intent)

BasicLabelPainter

public BasicLabelPainter(String title,
                         RootedTree tree,
                         BasicLabelPainter.PainterIntent intent,
                         int defaultSize)
Method Detail

getLabel

protected String getLabel(Node node)

isVisible

public boolean isVisible()

setVisible

public void setVisible(boolean visible)

calibrate

public void calibrate(Graphics2D g2,
                      Node item)

getPreferredWidth

public double getPreferredWidth()

getPreferredHeight

public double getPreferredHeight()

getHeightBound

public double getHeightBound()

setFontSize

public void setFontSize(float size)

setForeground

public void setForeground(Paint foreground)

setBackground

public void setBackground(Paint background)

setBorder

public void setBorder(Paint borderPaint,
                      Stroke borderStroke)

paint

public void paint(Graphics2D g2,
                  Node item,
                  Painter.Justification justification,
                  Rectangle2D bounds)

getAttributes

public String[] getAttributes()

setAttribute

public void setAttribute(String attribute)

setControlPalette

public void setControlPalette(ControlPalette controlPalette)
Description copied from interface: ControlsProvider
Give the controls provider with a handle for the controlPalette object.


getControls

public List<Controls> getControls(boolean detachPrimaryCheckbox)
Description copied from interface: ControlsProvider
Get a list of Controls handled by this provider.

Parameters:
detachPrimaryCheckbox - When false, do nothing. When true, if controls have a "main" on/off switch (implemented as a JCheckBox), that checkbox should not be included in the controls panel but returned in
Returns:
A list of Controls
See Also:
Controls.getPrimaryCheckbox()

setSettings

public void setSettings(ControlsSettings settings)
Description copied from interface: ControlsProvider
Give the provider some settings.


getSettings

public void getSettings(ControlsSettings settings)
Description copied from interface: ControlsProvider
Get the settings for a given Controls object.


getTitle

public String getTitle()