jebl.gui.trees.treeviewer_dev.painters
Class ScaleBarPainter

java.lang.Object
  extended by jebl.gui.trees.treeviewer_dev.painters.AbstractPainter<T>
      extended by jebl.gui.trees.treeviewer_dev.painters.LabelPainter<TreePane>
          extended by jebl.gui.trees.treeviewer_dev.painters.ScaleBarPainter
All Implemented Interfaces:
Painter<TreePane>

public class ScaleBarPainter
extends LabelPainter<TreePane>

Author:
Andrew Rambaut, Alexei Drummond

Nested Class Summary
 
Nested classes/interfaces inherited from interface jebl.gui.trees.treeviewer_dev.painters.Painter
Painter.Justification, Painter.Orientation
 
Field Summary
protected  TreePane treePane
           
 
Constructor Summary
ScaleBarPainter()
           
ScaleBarPainter(double scaleRange)
           
 
Method Summary
 void calculateScaleRange()
           
 Rectangle2D calibrate(Graphics2D g2, TreePane treePane)
          Called to calibrate the painters for a given graphics context.
 String[] getAttributes()
           
 double getHeightBound()
           
 double getPreferredHeight()
           
 double getPreferredWidth()
           
 BasicStroke getScaleBarStroke()
           
 double getScaleRange()
           
 void paint(Graphics2D g2, TreePane treePane, Painter.Justification justification, Rectangle2D bounds)
          Called to actually paint into the current graphics context.
 void setAutomaticScale(boolean automaticScale)
           
 void setControlPalette(ControlPalette controlPalette)
           
 void setDisplayAttribute(String displayAttribute)
           
 void setScaleBarStroke(BasicStroke scaleBarStroke)
           
 void setScaleRange(double scaleRange)
           
 void setTreePane(TreePane treePane)
          Called when the painter is installed in a TreePane.
 void setupAttributes(Tree tree)
           
 
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 jebl.gui.trees.treeviewer_dev.painters.AbstractPainter
addPainterListener, firePainterChanged, firePainterSettingsChanged, removePainterListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

treePane

protected TreePane treePane
Constructor Detail

ScaleBarPainter

public ScaleBarPainter()

ScaleBarPainter

public ScaleBarPainter(double scaleRange)
Method Detail

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.


calibrate

public Rectangle2D calibrate(Graphics2D g2,
                             TreePane treePane)
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).


paint

public void paint(Graphics2D g2,
                  TreePane treePane,
                  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.


getPreferredWidth

public double getPreferredWidth()

getPreferredHeight

public double getPreferredHeight()

getHeightBound

public double getHeightBound()

getScaleBarStroke

public BasicStroke getScaleBarStroke()

setScaleBarStroke

public void setScaleBarStroke(BasicStroke scaleBarStroke)

getScaleRange

public double getScaleRange()

setScaleRange

public void setScaleRange(double scaleRange)

setAutomaticScale

public void setAutomaticScale(boolean automaticScale)

setControlPalette

public void setControlPalette(ControlPalette controlPalette)

calculateScaleRange

public void calculateScaleRange()

getAttributes

public String[] getAttributes()
Specified by:
getAttributes in class LabelPainter<TreePane>

setupAttributes

public void setupAttributes(Tree tree)
Specified by:
setupAttributes in class LabelPainter<TreePane>

setDisplayAttribute

public void setDisplayAttribute(String displayAttribute)
Specified by:
setDisplayAttribute in class LabelPainter<TreePane>