Package pal.gui
Class TreePainter
java.lang.Object
pal.gui.TreePainter
- All Implemented Interfaces:
Painter
- Direct Known Subclasses:
TreePainterCircular,TreePainterNormal
A class that can paint a tree into a Graphics object.
- Version:
- $Id: TreePainter.java,v 1.24 2003/08/16 23:48:26 matt Exp $
- Author:
- Alexei Drummond
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringstatic final Colorstatic final Stringstatic final Colorstatic final Fontstatic final Stringstatic final intstatic final intstatic final Colorstatic final LabelDisplayerstatic final Colorstatic final LabelDisplayerprotected booleandetermines whether internal nodes are labelled -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidfinal voidstatic final voiddrawSymbol(Graphics g, int x, int y, int width, int index) protected intReturns -1 if no trap value availableprotected final Fontprotected final intprotected static final doublegetMaxLeafTime(Node node) protected final LabelDisplayergetNodeDisplay(Node n, LabelDisplayer defaultDisplay) protected final StringgetNodeName(Node node) final intprotected final doublegetSizeOfScale(double target) final TimeOrderCharacterDatafinal StringgetTitle()protected final TreegetTree()final booleanfinal booleanfinal booleanfinal booleanfinal booleanfinal voidsetAttributeName(String name) final voidfinal voidsetLabelFont(Font f) Set the font used to display labelsfinal voidsetLabelFontSize(int size) Set the font used to display labelsfinal voidfinal voidsetMaxHeight(double maxHeight) sets the maximum height of plot.final voidsetPenWidth(int p) final voidsetShowingNodeHeights(boolean s) final voidfinal voidfinal voidvoidsetTreeImpl(Tree tree) may be implemented by sub classesfinal voidsetUsingColor(boolean use) final voidsetUsingSymbols(boolean use) Sets whether the tree is painted with symbols.protected voidRotates the tree by leaf count, creates a positioned node version of the trees root and calculates postions and width and height information.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface pal.gui.Painter
getPreferredSize, paint, paint
-
Field Details
-
BACKGROUND
-
FOREGROUND
-
NORMAL_LABEL_COLOR
-
NORMAL_LABEL_DISPLAY
-
HILITED_LABEL_DISPLAY
-
BOOTSTRAP_SUPPORT_COLOUR
-
BOOTSTRAP_ATTRIBUTE_NAME
- See Also:
-
DEFAULT_FONT_SIZE
public static final int DEFAULT_FONT_SIZE- See Also:
-
DEFAULT_FONT_STYLE
public static final int DEFAULT_FONT_STYLE- See Also:
-
DEFAULT_FONT_NAME
- See Also:
-
DEFAULT_FONT
-
treeNode
-
title_
-
attName
-
showingInternalLabels
protected boolean showingInternalLabelsdetermines whether internal nodes are labelled
-
-
Constructor Details
-
TreePainter
- Parameters:
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.
-
-
Method Details
-
getBootstrapValue
Returns -1 if no trap value available -
standardTreePrep
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. -
setMaxHeight
public final void setMaxHeight(double maxHeight) sets the maximum height of plot. if this height is smaller than root height then only a proportion of tree is drawn. -
setAttributeName
-
setPenWidth
public final void setPenWidth(int p) -
getPenWidth
public final int getPenWidth() -
setTree
-
setTreeImpl
may be implemented by sub classes -
setUsingColor
public final void setUsingColor(boolean use) -
isUsingColor
public final boolean isUsingColor() -
setShowingNodeHeights
public final void setShowingNodeHeights(boolean s) -
isShowingNodeHeights
public final boolean isShowingNodeHeights() -
isShowingInternalLabels
public final boolean isShowingInternalLabels() -
getTimeOrderCharacterData
-
setTimeOrderCharacterData
-
isUsingSymbols
public final boolean isUsingSymbols() -
setUsingSymbols
public final void setUsingSymbols(boolean use) Sets whether the tree is painted with symbols. This can only be set to true of a TimeOrderCharacterData has been set. -
getTree
-
getSizeOfScale
protected final double getSizeOfScale(double target) -
getMaxLeafTime
-
drawSymbol
-
isShowTitle
public final boolean isShowTitle() -
setColouriser
-
setLabelMapping
-
setTitle
-
getNodeName
-
getTitle
-
doTitle
-
doScale
-
getNodeDisplay
-
getLongestIdentifierPixelWidth
-
setLabelFont
Set the font used to display labels -
setLabelFontSize
public final void setLabelFontSize(int size) Set the font used to display labels -
getLabelFont
-