nl.astron.lofar.java.gui.plotter
Class PlotPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by nl.astron.lofar.java.gui.plotter.PlotPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class PlotPanel
extends javax.swing.JPanel

Version:
$Id$
Author:
pompert
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
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
PlotPanel()
          - Constructs a new PlotPanel - Gets a new PlotController to work with
 
Method Summary
 void createPlot(int type, boolean separateLegend, java.lang.String[] constraints)
          This method will attempt to generate a plot using several key arguments: -int type (this is defined by PlotConstants.PLOT_*) -boolean separateLegend (this will tell the plotter that you would like a separate JComponent legend, otherwise you will see a legend where the plotter puts it by default.
 void exportData(java.lang.String[] arguments)
          This method will attempt to export the data currently in the plot to your configured data export layer using a single argument: -String[] arguments (These are the arguments you need for the data export layer to export the data you currently have in the plot, and these strings can mean anything, as long as your configured data export layer supports them!)
 java.awt.Image exportImage(int type, java.lang.String[] constraints)
          This method will attempt to generate a plot image using several key arguments: -int type (this is defined by PlotConstants.PLOT_*) -String[] constraints (These are the arguments you need for the data access layer to get the data you want, which can be anything, as long as your configured data access layer supports it!)
 void finalize()
          Finalize method to cleanup instance variables.
 javax.swing.JComponent getLegendForPlot()
          This method will return the legend for the plot currently in memory.
 javax.swing.JComponent getPlot()
          This method will return the plot currently in memory
 void modifyDataSelection()
          TODO: JavaDoc!
 java.awt.PrintJob printPlot()
          This method will attempt to print the current plot
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PlotPanel

public PlotPanel()
- Constructs a new PlotPanel - Gets a new PlotController to work with

Method Detail

finalize

public void finalize()
              throws java.lang.Throwable
Finalize method to cleanup instance variables.

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

createPlot

public void createPlot(int type,
                       boolean separateLegend,
                       java.lang.String[] constraints)
                throws PlotterException
This method will attempt to generate a plot using several key arguments: -int type (this is defined by PlotConstants.PLOT_*) -boolean separateLegend (this will tell the plotter that you would like a separate JComponent legend, otherwise you will see a legend where the plotter puts it by default. -String[] constraints (These are the arguments you need for the data access layer to get the data you want, which can be anything, as long as your configured data access layer supports it!) The plot will be added to this class' ContentPane so you can view it directly. It can also be retrieved separately by calling the getPlot() method.

Parameters:
type - The type of plot to be generated (these types are defined in PlotConstants.PLOT_* )
separateLegend - Tells the plotter if you like a separate legend JComponent, or leave it embedded in the plot itself. Dont forget to call getLegendForPlot() to get the separate legend!
constraints - The arguments to be passed to the configured data access layer
Throws:
PlotterException

exportImage

public java.awt.Image exportImage(int type,
                                  java.lang.String[] constraints)
                           throws PlotterException
This method will attempt to generate a plot image using several key arguments: -int type (this is defined by PlotConstants.PLOT_*) -String[] constraints (These are the arguments you need for the data access layer to get the data you want, which can be anything, as long as your configured data access layer supports it!)

Parameters:
type - The type of plot to be generated (these types are defined in PlotConstants.PLOT_* )
constraints - The arguments to be passed to the configured data access layer
Returns:
The image file which can be saved to a file or used in different software.
Throws:
PlotterException

exportData

public void exportData(java.lang.String[] arguments)
                throws PlotterException
This method will attempt to export the data currently in the plot to your configured data export layer using a single argument: -String[] arguments (These are the arguments you need for the data export layer to export the data you currently have in the plot, and these strings can mean anything, as long as your configured data export layer supports them!)

Throws:
PlotterException

modifyDataSelection

public void modifyDataSelection()
                         throws PlotterException
TODO: JavaDoc!

Throws:
PlotterException

printPlot

public java.awt.PrintJob printPlot()
                            throws PlotterException
This method will attempt to print the current plot

Throws:
PlotterException

getPlot

public javax.swing.JComponent getPlot()
This method will return the plot currently in memory

Returns:
The plot currently in memory

getLegendForPlot

public javax.swing.JComponent getLegendForPlot()
                                        throws PlotterException
This method will return the legend for the plot currently in memory. It will throw a NotSupportedException should the plot not have a separate legend available.

Returns:
The plot legend currently in memory
Throws:
PlotterException