IcanGui
Class GuiIcanPlotFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by IcanGui.GuiIcanPlotFrame
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class GuiIcanPlotFrame
extends java.awt.Frame

Encapsulate the behavior of GUI for ICAN/JAVA plot window. Contains a PlotPanel and buttons to print or cancel/continue.

Since:
1.0.1;
Version:
1.1.6;
Updated by Louis Handler on Dec 29, 2005, 12:00 EST (1.1.6).
Updated by Louis Handler on May 25, 2005, 08:47 EDT (1.1.5).
Updated by Louis Handler on Apr 25, 2005, 15:05 EDT (1.1.0).
Updated by Louis Handler on Nov 10, 2004, 10:23 EST (1.0.10).
Updated by Louis Handler on Feb 10, 2004, 10:52 EST.
Updated by Louis Handler on Jan 23, 2004, 11:34 EST.
Updated by Louis Handler on Jan 22, 2004, 11:07 EST.
Updated by Louis Handler on Jan 22, 2004, 11:02 EST.
Updated by Louis Handler on Jan 21, 2004, 11:21 EST.
Updated by Louis Handler on Jan 21, 2004, 10:03 EST.
Updated by Louis Handler on Dec 30, 2003, 13:02 EST.
Updated by Louis Handler on Sep 16, 2003, 12:40 EDT.
Updated by Louis Handler on Sep 15, 2003, 15:48 EDT.
Author:
Louis Handler
See Also:
GuiWindow, Serialized Form

Nested Class Summary
(package private)  class GuiIcanPlotFrame.Action
           
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  java.awt.Button bOk
          Plot window Ok button which continues execution.
private  java.awt.Button bPrint
          Plot window Print button which prints the current plot.
private  java.awt.Button bSave
          Plot window save SVG button which saves the plot as an SVG file.
private static IcanDataSet data
          A reference to the input data is set/used.
private  boolean firstRun
          Variable to test for the first time the frame is displayed.
private  PlotPanel gPlotPanel
          Panel containing the plot.
private  int htPlot
          Plot height.
private  int nPlot
          Number of curves on plot.
private  int percent
          Percent of non-legend from 50 to 100 percent.
private  java.lang.String plotTitle
          Title of plot.
private  java.awt.Frame plotWindowFrame
          Plot window frame in which plot appears.
private  java.awt.Panel pPlotIt
          Plot Panel used for printing.
private  int screenRes
          Screen resolution (pixels/inch).
private  GuiWindow that
          param that The window from which plot is requested.
private  int wdPlot
          Plot width.
private  int xcycles
          Number of cycles in x scale/axis.
private  int ycycles
          Number of cycles in y scale/axis.
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
GuiIcanPlotFrame(GuiWindow that, java.lang.String frameTitle, java.lang.String plotTitle, int nPlot, int percent)
          Constructor creates a window to display plot and buttons.
 
Method Summary
 int getCycles(int iwh)
          Get number of cycles in plot/axis in specified direction.
 java.lang.String getName()
          Get class name.
 PlotPanel getPlotPanel()
          Get actual plot panel for plotting.
 void printPlot()
          Print the plot displayed.
 void savePlot()
          Save the plot displayed as an SVG file.
 void setCycles(int cycles, int iwh)
          Save number of cycles in plot/axis in specified direction.
 void setSameScale()
          Set the scaling the same in both directions so that the number of increments per cycle is the same.
 void setScale()
          Set scale factors.
 void setVisible(boolean shown)
          Display plot and bring the window to the front.
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

data

private static IcanDataSet data
A reference to the input data is set/used.


plotWindowFrame

private java.awt.Frame plotWindowFrame
Plot window frame in which plot appears.


that

private GuiWindow that
param that The window from which plot is requested. The window to be redisplayed after this one.


plotTitle

private java.lang.String plotTitle
Title of plot.


nPlot

private int nPlot
Number of curves on plot.


percent

private int percent
Percent of non-legend from 50 to 100 percent.


pPlotIt

private java.awt.Panel pPlotIt
Plot Panel used for printing.


gPlotPanel

private PlotPanel gPlotPanel
Panel containing the plot.


bOk

private java.awt.Button bOk
Plot window Ok button which continues execution.


bPrint

private java.awt.Button bPrint
Plot window Print button which prints the current plot.


bSave

private java.awt.Button bSave
Plot window save SVG button which saves the plot as an SVG file.


wdPlot

private int wdPlot
Plot width.


htPlot

private int htPlot
Plot height.


xcycles

private int xcycles
Number of cycles in x scale/axis.


ycycles

private int ycycles
Number of cycles in y scale/axis.


screenRes

private int screenRes
Screen resolution (pixels/inch).


firstRun

private boolean firstRun
Variable to test for the first time the frame is displayed. Used to set focus on entry.

Constructor Detail

GuiIcanPlotFrame

public GuiIcanPlotFrame(GuiWindow that,
                        java.lang.String frameTitle,
                        java.lang.String plotTitle,
                        int nPlot,
                        int percent)
Constructor creates a window to display plot and buttons.

Parameters:
that - The window from which plot is requested. The window to be redisplayed after this one.
frameTitle - Title of window.
plotTitle - Title of plot.
nPlot - Number of curves on plot.
percent - Percent of non-legend from 50 to 100 percent.
Method Detail

setVisible

public void setVisible(boolean shown)
Display plot and bring the window to the front.

Overrides:
setVisible in class java.awt.Component
Parameters:
shown - True, if plot is to be displayed; else, false, if plot is to be hidden.

getPlotPanel

public PlotPanel getPlotPanel()
Get actual plot panel for plotting. After adding items to plot panel, one may resize frame and set visible.

Returns:
Plot Panel on which plot is drawn.

setScale

public void setScale()
Set scale factors.


getCycles

public int getCycles(int iwh)
Get number of cycles in plot/axis in specified direction.

Parameters:
iwh - 0, for X direction; else, for Y direction.
Returns:
Number of cycles in specified direction.

setCycles

public void setCycles(int cycles,
                      int iwh)
Save number of cycles in plot/axis in specified direction.

Parameters:
cycles - Number of cycles in specified direction.
iwh - 0, for X direction; else, for Y direction.

setSameScale

public void setSameScale()
Set the scaling the same in both directions so that the number of increments per cycle is the same.


printPlot

public void printPlot()
Print the plot displayed.


savePlot

public void savePlot()
Save the plot displayed as an SVG file. Save the plot displayed to an SVG (Scalable Vector Graphics) file. An SVG file may be drawn by an external program. For more information about SVG viewers,see http://www.w3.org/Graphics/SVG/SVG-Implementations. External Link


getName

public java.lang.String getName()
Get class name.

Overrides:
getName in class java.awt.Component
Returns:
Class name.