All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class mesquite.lib.TreeDisplay

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----mesquite.lib.MousePanel
                                   |
                                   +----mesquite.lib.MesquitePanel
                                           |
                                           +----mesquite.lib.TreeDisplay

public class TreeDisplay
extends mesquite.lib.MesquitePanel
The panel in which a tree is drawn. This is used within the main tree window, and can be used by other modules. If multiple trees need to be drawn, multiple TreeDisplays should be created. A TreeDisplay is created and supervised by a tree draw coordinator module. A reference to a TreeDisplay is needed for shading and decorating the tree.

Within the graphics Panel which is the TreeDisplay, a special object of class TreeDrawing is actually the one responsible for drawing the tree itself. The TreeDrawing is created by the chosen tree drawing module (e.g. diagonal draw tree). Modules can contribute to the drawing of the TreeDisplay, whether shading or node pictures or a simple tree legend, by creating an object of class TreeDisplayExtra and adding it to the vector of extras. The TreeDisplay calls all of the extras after the tree is drawn, in case those extras need to contribute to the TreeDisplay drawing.

This needs to be fixed up (e.g., fields made private with set and get methods).


Variable Index

 o branchColor
The color of the branches
 o branchColorDimmed
The color of a dimmed branch
 o CIRCULAR
Tree is drawn in circular arrangement of nodes
 o DOWN
Orientation of the tree with tips down
 o fixedDepthScale
If tree drawn with fixed depth, this is the depth.
 o fixedScalingOn
Records whether fixed depth scale is in use.
 o FREEFORM
Orientation of the tree unspecified
 o holdingTree
A tree which is to be drawn, but which is being held until drawing of the current tree is finished.
 o LEFT
Orientation of the tree with tips to left
 o needsUpdating
This is part of system to record whether the tree needs redrawing, used so as to prevent multiple updates
 o ownerModule
 o RIGHT
Orientation of the tree with tips to right
 o scaling
Scaling of the tree drawing
 o showBranchLengths
If true, then branches are drawn proportional to their lengths
 o suppress
Records whether tree drawing is to be suppressed
 o suppressNames
Records whether or not the taxon names are to be drawn
 o tipsMargin
The margin from the tips to the edge of the drawing field
 o totalCreated
 o tree
The tree being drawn
 o UP
Orientation of the tree with tips up

Constructor Index

 o TreeDisplay(MesquiteModule, MesquiteWindow)

Method Index

 o addComponentPlease(Component)
 o addExtra(TreeDisplayExtra)
 o addPanelPlease(Panel)
 o destroyExtras()
 o dispose()
 o drawAllBackgroundExtras(Tree, int, Graphics)
 o drawAllExtras(Tree, int, Graphics)
 o fillTaxon(Graphics, int)
 o findExtra(TreeDisplayExtra)
 o getAllowReorientation()
 o getBranchColor(int)
 o getDrawingInProcess()
 o getDrawTaxonNames()
 o getEdgeWidth()
 o getExtras()
 o getField()
 o getFieldHeight()
 o getFieldWidth()
 o getInvalid()
 o getOrientation()
 o getTaxa()
 o getTaxonNameBuffer()
 o getTaxonSpacing()
 o getTextVersion()
 o getTipsMargin()
 o getTree()
 o getTreeDrawing()
 o moveExtraToFront(TreeDisplayExtra)
 o paint(Graphics)
 o pleaseUpdate()
 o pleaseUpdateAll()
 o printAllExtras(Tree, int, Graphics)
 o removeComponentPlease(Component)
 o removeExtra(TreeDisplayExtra)
 o removePanelPlease(Panel)
 o repaint()
 o setAllowReorientation(boolean)
 o setDrawingInProcess(boolean)
 o setDrawTaxonNames(DrawTaxonNames)
 o setEdgeWidth(int)
 o setFieldHeight(int)
 o setFieldSize(int, int)
 o setFieldWidth(int)
 o setFrame(boolean)
 o setInvalid(boolean)
 o setNotice(String)
 o setOrientation(int)
 o setSize()
 o setTaxa(Taxa)
 o setTaxonNameBuffer(int)
 o setTaxonSpacing(int)
 o setTipsMargin(int)
 o setTree(Tree)
 o setTreeAllExtras(Tree, CommandRecord)
 o setTreeDrawing(TreeDrawing)
 o suppressDrawing(boolean)

Variables

 o tree
 protected mesquite.lib.Tree tree
The tree being drawn

 o holdingTree
 protected mesquite.lib.Tree holdingTree
A tree which is to be drawn, but which is being held until drawing of the current tree is finished.

 o FREEFORM
 public static final int FREEFORM
Orientation of the tree unspecified

 o UP
 public static final int UP
Orientation of the tree with tips up

 o RIGHT
 public static final int RIGHT
Orientation of the tree with tips to right

 o LEFT
 public static final int LEFT
Orientation of the tree with tips to left

 o DOWN
 public static final int DOWN
Orientation of the tree with tips down

 o CIRCULAR
 public static final int CIRCULAR
Tree is drawn in circular arrangement of nodes

 o needsUpdating
 protected int needsUpdating
This is part of system to record whether the tree needs redrawing, used so as to prevent multiple updates

 o suppress
 protected boolean suppress
Records whether tree drawing is to be suppressed

 o suppressNames
 public boolean suppressNames
Records whether or not the taxon names are to be drawn

 o tipsMargin
 public int tipsMargin
The margin from the tips to the edge of the drawing field

 o showBranchLengths
 public boolean showBranchLengths
If true, then branches are drawn proportional to their lengths

 o scaling
 public double scaling
Scaling of the tree drawing

 o fixedDepthScale
 public double fixedDepthScale
If tree drawn with fixed depth, this is the depth.

 o fixedScalingOn
 public boolean fixedScalingOn
Records whether fixed depth scale is in use.

 o branchColor
 public java.awt.Color branchColor
The color of the branches

 o branchColorDimmed
 public java.awt.Color branchColorDimmed
The color of a dimmed branch

 o ownerModule
 protected mesquite.lib.MesquiteModule ownerModule
 o totalCreated
 public static long totalCreated

Constructors

 o TreeDisplay
 public TreeDisplay(mesquite.lib.MesquiteModule ownerModule,
                    mesquite.lib.MesquiteWindow window)

Methods

 o getBranchColor
 public java.awt.Color getBranchColor(int N)
 o setTreeDrawing
 public void setTreeDrawing(mesquite.lib.TreeDrawing td)
 o getTreeDrawing
 public mesquite.lib.TreeDrawing getTreeDrawing()
 o getDrawingInProcess
 public boolean getDrawingInProcess()
 o setDrawingInProcess
 public void setDrawingInProcess(boolean inProgress)
 o getDrawTaxonNames
 public mesquite.lib.duties.DrawTaxonNames getDrawTaxonNames()
 o setDrawTaxonNames
 public void setDrawTaxonNames(mesquite.lib.duties.DrawTaxonNames dtn)
 o setTaxa
 public void setTaxa(mesquite.lib.Taxa taxa)
 o getTaxa
 public mesquite.lib.Taxa getTaxa()
 o getTree
 public mesquite.lib.Tree getTree()
 o setTree
 public void setTree(mesquite.lib.Tree tree)
 o setTaxonNameBuffer
 public void setTaxonNameBuffer(int b)
 o getTaxonNameBuffer
 public int getTaxonNameBuffer()
 o setTipsMargin
 public void setTipsMargin(int margin)
 o getTipsMargin
 public int getTipsMargin()
 o setInvalid
 public void setInvalid(boolean iv)
 o getInvalid
 public boolean getInvalid()
 o pleaseUpdateAll
 public void pleaseUpdateAll()
 o pleaseUpdate
 public void pleaseUpdate()
 o repaint
 public void repaint()
Overrides:
repaint in class java.awt.Component
 o setFrame
 public void setFrame(boolean doFrame)
 o setSize
 public void setSize()
 o setFieldSize
 public void setFieldSize(int x,
                          int y)
 o setFieldWidth
 public void setFieldWidth(int x)
 o setFieldHeight
 public void setFieldHeight(int y)
 o getFieldWidth
 public int getFieldWidth()
 o getFieldHeight
 public int getFieldHeight()
 o getField
 public java.awt.Rectangle getField()
 o setEdgeWidth
 public void setEdgeWidth(int sp)
 o getEdgeWidth
 public int getEdgeWidth()
 o setTaxonSpacing
 public void setTaxonSpacing(int sp)
 o getTaxonSpacing
 public int getTaxonSpacing()
 o setNotice
 public void setNotice(java.lang.String s)
 o getExtras
 public mesquite.lib.ListableVector getExtras()
 o addExtra
 public void addExtra(mesquite.lib.TreeDisplayExtra extra)
 o removeExtra
 public void removeExtra(mesquite.lib.TreeDisplayExtra extra)
 o findExtra
 public boolean findExtra(mesquite.lib.TreeDisplayExtra extra)
 o setTreeAllExtras
 public void setTreeAllExtras(mesquite.lib.Tree tree,
                              mesquite.lib.CommandRecord commandRec)
 o drawAllBackgroundExtras
 public void drawAllBackgroundExtras(mesquite.lib.Tree tree,
                                     int drawnRoot,
                                     java.awt.Graphics g)
 o drawAllExtras
 public void drawAllExtras(mesquite.lib.Tree tree,
                           int drawnRoot,
                           java.awt.Graphics g)
 o printAllExtras
 public void printAllExtras(mesquite.lib.Tree tree,
                            int drawnRoot,
                            java.awt.Graphics g)
 o suppressDrawing
 public void suppressDrawing(boolean toSuppress)
 o setOrientation
 public void setOrientation(int orient)
 o getOrientation
 public int getOrientation()
 o setAllowReorientation
 public void setAllowReorientation(boolean allow)
 o getAllowReorientation
 public boolean getAllowReorientation()
 o paint
 public void paint(java.awt.Graphics g)
Overrides:
paint in class java.awt.Container
 o getTextVersion
 public java.lang.String getTextVersion()
 o fillTaxon
 public void fillTaxon(java.awt.Graphics g,
                       int m)
 o addPanelPlease
 public void addPanelPlease(java.awt.Panel p)
 o removePanelPlease
 public void removePanelPlease(java.awt.Panel p)
 o addComponentPlease
 public void addComponentPlease(java.awt.Component p)
 o removeComponentPlease
 public void removeComponentPlease(java.awt.Component p)
 o moveExtraToFront
 public void moveExtraToFront(mesquite.lib.TreeDisplayExtra extra)
 o destroyExtras
 public void destroyExtras()
 o dispose
 public void dispose()
Overrides:
dispose in class mesquite.lib.MesquitePanel

All Packages  Class Hierarchy  This Package  Previous  Next  Index