edu.swri.swiftvis.plot
Class PlotSpec

java.lang.Object
  extended by edu.swri.swiftvis.plot.PlotSpec
All Implemented Interfaces:
PlotObject, java.awt.print.Printable, java.io.Serializable, javax.swing.tree.TreeNode

public class PlotSpec
extends java.lang.Object
implements PlotObject, java.awt.print.Printable

This is the serializable class for all the specifications that are used by the standard PlotSurface. It includes a collection of PlotObjects that are structured as a tree. It also has a reference to the Plot object that is is being used for so that it can get hold of the various sources. It is itself a PlotObject and will always act as the root of the tree. List of PlotObject classes: PlotArea2D PlotText

See Also:
Serialized Form

Field Summary
private  java.util.Vector<PlotObject> children
           
private  Plot plot
           
private  javax.swing.JPanel propPanel
           
private static long serialVersionUID
           
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Constructor Summary
PlotSpec(Plot thePlot)
           
PlotSpec(Plot p, PlotSpec c)
           
 
Method Summary
private  void addPlot()
           
private  void addText()
           
 java.util.Enumeration<javax.swing.tree.TreeNode> children()
           
 PlotSpec copy(PlotSpec p)
           
 void draw(java.awt.Graphics2D g, java.awt.geom.Rectangle2D bounds)
          Draw this object on the provided graphics.
 void fireRedraw()
          Sends a message up the tree to redraw the screen.
 void forceRedraw()
          Send a message down the tree that current draw buffers are invalid.
 boolean getAllowsChildren()
           
 javax.swing.tree.TreeNode getChildAt(int index)
           
 int getChildCount()
           
 int getIndex(javax.swing.tree.TreeNode node)
           
 javax.swing.tree.TreeNode getParent()
           
 Plot getPlot()
           
 javax.swing.JComponent getPropertiesPanel()
          Returns a panel that can be used to set the properties of this plot object.
 PlotSurface getSurface()
           
 boolean isLeaf()
           
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
 void mouseClicked(java.awt.event.MouseEvent e, double mx, double my)
           
 void mouseDragged(java.awt.event.MouseEvent e, double mx, double my)
           
 void mouseMoved(java.awt.event.MouseEvent e, double mx, double my)
           
 void mousePressed(java.awt.event.MouseEvent e, double mx, double my)
           
 void mouseReleased(java.awt.event.MouseEvent e, double mx, double my)
           
 void print(java.awt.Graphics2D g, java.awt.geom.Rectangle2D bounds)
          Draw the object without buffering so it is a vector image.
 int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pageIndex)
           
 void relink(java.util.Hashtable<GraphElement,GraphElement> linkHash)
           
private  void remove()
           
 void setSelected(boolean val)
           
 void setSelection(PlotObject po)
           
 java.lang.String toString()
           
 void treeAltered(PlotObject po)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

plot

private Plot plot

children

private java.util.Vector<PlotObject> children

propPanel

private transient javax.swing.JPanel propPanel

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

PlotSpec

public PlotSpec(Plot thePlot)

PlotSpec

public PlotSpec(Plot p,
                PlotSpec c)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setSelection

public void setSelection(PlotObject po)

getSurface

public PlotSurface getSurface()

getPlot

public Plot getPlot()

draw

public void draw(java.awt.Graphics2D g,
                 java.awt.geom.Rectangle2D bounds)
Draw this object on the provided graphics.

Specified by:
draw in interface PlotObject

print

public void print(java.awt.Graphics2D g,
                  java.awt.geom.Rectangle2D bounds)
Description copied from interface: PlotObject
Draw the object without buffering so it is a vector image.

Specified by:
print in interface PlotObject

print

public int print(java.awt.Graphics g,
                 java.awt.print.PageFormat pf,
                 int pageIndex)
Specified by:
print in interface java.awt.print.Printable

getPropertiesPanel

public javax.swing.JComponent getPropertiesPanel()
Returns a panel that can be used to set the properties of this plot object. I'm not yet certain what this will do for the Spec. The plot itself also has a properties panel so I'm not certain which one to use. Right now I'm thinking that I'll use both. The plot one will have a tree at the top and other stuff below. This one will have buttons to add new things into the plot.

Specified by:
getPropertiesPanel in interface PlotObject

treeAltered

public void treeAltered(PlotObject po)
Specified by:
treeAltered in interface PlotObject

setSelected

public void setSelected(boolean val)
Specified by:
setSelected in interface PlotObject

fireRedraw

public void fireRedraw()
Description copied from interface: PlotObject
Sends a message up the tree to redraw the screen.

Specified by:
fireRedraw in interface PlotObject

forceRedraw

public void forceRedraw()
Send a message down the tree that current draw buffers are invalid. This generally happens because data has changed.

Specified by:
forceRedraw in interface PlotObject

copy

public PlotSpec copy(PlotSpec p)
Specified by:
copy in interface PlotObject

relink

public void relink(java.util.Hashtable<GraphElement,GraphElement> linkHash)
Specified by:
relink in interface PlotObject

mousePressed

public void mousePressed(java.awt.event.MouseEvent e,
                         double mx,
                         double my)
Specified by:
mousePressed in interface PlotObject

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e,
                          double mx,
                          double my)
Specified by:
mouseReleased in interface PlotObject

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e,
                         double mx,
                         double my)
Specified by:
mouseClicked in interface PlotObject

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e,
                       double mx,
                       double my)
Specified by:
mouseMoved in interface PlotObject

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e,
                         double mx,
                         double my)
Specified by:
mouseDragged in interface PlotObject

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface PlotObject

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface PlotObject

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface PlotObject

children

public java.util.Enumeration<javax.swing.tree.TreeNode> children()
Specified by:
children in interface javax.swing.tree.TreeNode

getAllowsChildren

public boolean getAllowsChildren()
Specified by:
getAllowsChildren in interface javax.swing.tree.TreeNode

getChildAt

public javax.swing.tree.TreeNode getChildAt(int index)
Specified by:
getChildAt in interface javax.swing.tree.TreeNode

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface javax.swing.tree.TreeNode

getIndex

public int getIndex(javax.swing.tree.TreeNode node)
Specified by:
getIndex in interface javax.swing.tree.TreeNode

getParent

public javax.swing.tree.TreeNode getParent()
Specified by:
getParent in interface javax.swing.tree.TreeNode

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface javax.swing.tree.TreeNode

addText

private void addText()

addPlot

private void addPlot()

remove

private void remove()