pal.gui
public abstract class TreePainter extends java.lang.Object implements Painter
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
attName |
static java.awt.Color |
BACKGROUND |
static java.lang.String |
BOOTSTRAP_ATTRIBUTE_NAME |
static java.awt.Color |
BOOTSTRAP_SUPPORT_COLOUR |
static java.awt.Font |
DEFAULT_FONT |
static java.lang.String |
DEFAULT_FONT_NAME |
static int |
DEFAULT_FONT_SIZE |
static int |
DEFAULT_FONT_STYLE |
static java.awt.Color |
FOREGROUND |
static LabelDisplayer |
HILITED_LABEL_DISPLAY |
static java.awt.Color |
NORMAL_LABEL_COLOR |
static LabelDisplayer |
NORMAL_LABEL_DISPLAY |
protected boolean |
showingInternalLabels
determines whether internal nodes are labelled
|
java.lang.String |
title_ |
PositionedNode |
treeNode |
Constructor and Description |
---|
TreePainter(Tree toDisplay,
java.lang.String title,
boolean showTitle) |
Modifier and Type | Method and Description |
---|---|
protected void |
doScale(java.awt.Graphics g,
double xScale,
int x,
int y) |
void |
doTitle(java.awt.Graphics g,
int x,
int y) |
static void |
drawSymbol(java.awt.Graphics g,
int x,
int y,
int width,
int index) |
protected int |
getBootstrapValue(PositionedNode node)
Returns -1 if no
trap value available
|
protected java.awt.Font |
getLabelFont() |
protected int |
getLongestIdentifierPixelWidth(java.awt.FontMetrics fm) |
protected static double |
getMaxLeafTime(Node node) |
protected LabelDisplayer |
getNodeDisplay(Node n,
LabelDisplayer defaultDisplay) |
protected java.lang.String |
getNodeName(Node node) |
int |
getPenWidth() |
protected double |
getSizeOfScale(double target) |
TimeOrderCharacterData |
getTimeOrderCharacterData() |
java.lang.String |
getTitle() |
protected Tree |
getTree() |
boolean |
isShowingInternalLabels() |
boolean |
isShowingNodeHeights() |
boolean |
isShowTitle() |
boolean |
isUsingColor() |
boolean |
isUsingSymbols() |
void |
setAttributeName(java.lang.String name) |
void |
setColouriser(NameColouriser nc) |
void |
setLabelFont(java.awt.Font f)
Set the font used to display labels
|
void |
setLabelFontSize(int size)
Set the font used to display labels
|
void |
setLabelMapping(LabelMapping lp) |
void |
setMaxHeight(double maxHeight)
sets the maximum height of plot.
|
void |
setPenWidth(int p) |
void |
setShowingNodeHeights(boolean s) |
void |
setTimeOrderCharacterData(TimeOrderCharacterData tocd) |
void |
setTitle(java.lang.String title) |
void |
setTree(Tree tree) |
void |
setTreeImpl(Tree tree)
may be implemented by sub classes
|
void |
setUsingColor(boolean use) |
void |
setUsingSymbols(boolean use)
Sets whether the tree is painted with symbols.
|
protected void |
standardTreePrep()
Rotates the tree by leaf count, creates a positioned node version of the
trees root and calculates postions and width and height information.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPreferredSize, paint, paint
public static final java.awt.Color BACKGROUND
public static final java.awt.Color FOREGROUND
public static final java.awt.Color NORMAL_LABEL_COLOR
public static final LabelDisplayer NORMAL_LABEL_DISPLAY
public static final LabelDisplayer HILITED_LABEL_DISPLAY
public static final java.awt.Color BOOTSTRAP_SUPPORT_COLOUR
public static final java.lang.String BOOTSTRAP_ATTRIBUTE_NAME
public static final int DEFAULT_FONT_SIZE
public static final int DEFAULT_FONT_STYLE
public static final java.lang.String DEFAULT_FONT_NAME
public static final java.awt.Font DEFAULT_FONT
public PositionedNode treeNode
public java.lang.String title_
protected java.lang.String attName
protected boolean showingInternalLabels
public TreePainter(Tree toDisplay, java.lang.String title, boolean showTitle)
toDisplay
- the tree being painted.title
- the title of the tree.showTitle
- true if a title is being displayed.nc
- A name colouriser, may be null.protected int getBootstrapValue(PositionedNode node)
protected void standardTreePrep()
public final void setMaxHeight(double maxHeight)
public final void setAttributeName(java.lang.String name)
public final void setPenWidth(int p)
public final int getPenWidth()
public final void setTree(Tree tree)
public void setTreeImpl(Tree tree)
public final void setUsingColor(boolean use)
public final boolean isUsingColor()
public final void setShowingNodeHeights(boolean s)
public final boolean isShowingNodeHeights()
public final boolean isShowingInternalLabels()
public final TimeOrderCharacterData getTimeOrderCharacterData()
public final void setTimeOrderCharacterData(TimeOrderCharacterData tocd)
public final boolean isUsingSymbols()
public final void setUsingSymbols(boolean use)
protected final Tree getTree()
protected final double getSizeOfScale(double target)
protected static final double getMaxLeafTime(Node node)
public static final void drawSymbol(java.awt.Graphics g, int x, int y, int width, int index)
public final boolean isShowTitle()
public final void setColouriser(NameColouriser nc)
public final void setLabelMapping(LabelMapping lp)
public final void setTitle(java.lang.String title)
protected final java.lang.String getNodeName(Node node)
public final java.lang.String getTitle()
public final void doTitle(java.awt.Graphics g, int x, int y)
protected final void doScale(java.awt.Graphics g, double xScale, int x, int y)
protected final LabelDisplayer getNodeDisplay(Node n, LabelDisplayer defaultDisplay)
protected final int getLongestIdentifierPixelWidth(java.awt.FontMetrics fm)
public final void setLabelFont(java.awt.Font f)
public final void setLabelFontSize(int size)
protected final java.awt.Font getLabelFont()