|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lib.StandardDiagramRenderer
public class StandardDiagramRenderer
The standard diagram renderer is useful for producing coloured displays of the node hierarchy in a top to bottom, left to right non-proportional tree structure.
Field Summary | |
---|---|
private int |
HEIGHT
|
private double |
HEIGHT_BASE
|
protected boolean |
layoutInvalid
|
private double |
SCALAR
|
private int |
WIDTH
|
private double |
WIDTH_BASE
|
private int |
XSPACING
|
private double |
XSPACING_BASE
|
private int |
yDepth
|
private int |
YSPACING
|
private double |
YSPACING_BASE
|
Constructor Summary | |
---|---|
StandardDiagramRenderer()
Initialize the diagram renderer |
Method Summary | |
---|---|
int |
getHeight()
Get the height of buttons on the diagram |
int |
getWidth()
Get the width of the buttons on the diagram |
int |
getXSpacing()
Get the X spacing |
int |
getYSpacing()
Get the Y spacing |
double |
getZoomLevel()
Get our current zoom level |
void |
invalidateLayout()
|
private void |
layoutButton(JDiagram diagram,
java.awt.Dimension dimensions,
JTreeNode button,
int x,
int y)
Draw the button onto the form at the relevant position |
private void |
layoutNodes(JDiagram diagram,
java.awt.Dimension dimensions,
JTreeNode node,
int xDepth)
Recursively render the diagram |
void |
layoutNodes(JDiagram diagram,
JTreeNode root)
Lay out a hierarchy of nodes onto the diagram |
void |
loadConfiguration()
Reload attributes from the configuration database. |
java.awt.AlphaComposite |
makeComposite(float alpha)
Create a composite colour for transparency |
void |
paintDiagram(JDiagram diagram,
java.awt.Graphics g)
Paint a JDiagram for the user |
private void |
paintRecursively(java.awt.Graphics g,
JTreeNode node)
Recursively iterate through the tree and draw the lines connecting buttons |
void |
paintTreeNode(JTreeNode node,
java.awt.Graphics g)
Paint an individual tree node |
void |
setXSpacing(int value)
Reset the X Spacing |
void |
setYSpacing(int value)
Reset the Y spacing |
void |
setZoomLevel(double zoom)
Reset the zoom level of the diagram |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private double WIDTH_BASE
private double HEIGHT_BASE
private int WIDTH
private int HEIGHT
private double SCALAR
private int yDepth
private double XSPACING_BASE
private double YSPACING_BASE
private int XSPACING
private int YSPACING
protected boolean layoutInvalid
Constructor Detail |
---|
public StandardDiagramRenderer()
Method Detail |
---|
public void loadConfiguration()
public double getZoomLevel()
getZoomLevel
in interface IRenderer
public void setXSpacing(int value)
value
- New valuepublic void setYSpacing(int value)
value
- New valuepublic int getXSpacing()
public int getYSpacing()
public int getWidth()
public int getHeight()
public void setZoomLevel(double zoom)
setZoomLevel
in interface IRenderer
zoom
- New zoom levelpublic void paintDiagram(JDiagram diagram, java.awt.Graphics g)
paintDiagram
in interface IRenderer
diagram
- Diagram to paint to.g
- Graphics object to paint with.private void paintRecursively(java.awt.Graphics g, JTreeNode node)
public void paintTreeNode(JTreeNode node, java.awt.Graphics g)
paintTreeNode
in interface IRenderer
node
- Node to paint.g
- Graphics object to paint with.public java.awt.AlphaComposite makeComposite(float alpha)
public void layoutNodes(JDiagram diagram, JTreeNode root)
layoutNodes
in interface IRenderer
diagram
- Diagram to lay out the nodes on.root
- Root of the hierachy of nodes.private void layoutNodes(JDiagram diagram, java.awt.Dimension dimensions, JTreeNode node, int xDepth)
public void invalidateLayout()
private void layoutButton(JDiagram diagram, java.awt.Dimension dimensions, JTreeNode button, int x, int y)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |