Plotting
Class ThreeDPlotter<E>

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 Plotting.ThreeDPlotter<E>
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.MouseInputListener, PlotBase, ThreeDPlot

public class ThreeDPlotter<E>
extends javax.swing.JPanel
implements ThreeDPlot, java.io.Serializable, javax.swing.event.MouseInputListener

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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  boolean bAutoFitOn
           
private  boolean bGridOn
           
private  boolean bHighlightDataPoints
           
private  boolean bLegendOn
           
private  boolean bXLabelOn
           
private  boolean bXMajorTicksOn
           
private  boolean bXMinorTicksOn
           
private  boolean bYLabelOn
           
private  boolean bYMajorTicksOn
           
private  boolean bYMinorTicksOn
           
private  boolean bZLabelOn
           
private  boolean bZMajorTicksOn
           
private  boolean bZMinorTicksOn
           
private  java.awt.Color mBGColor
           
private  java.awt.image.BufferedImage mBufImg
          Buffered image
private  java.util.List<PlotData<E>> mDataSetList
           
private  java.awt.Color mSurfaceColor
           
private  SurfaceType mSurfaceType
           
private  int mXLegendBox
           
private  float mXMajorTickSpacing
           
private  float mXMax
           
private  float mXMin
           
private  float mXMinorTickSpacing
           
private  java.lang.String mXTitle
           
private  int mYLegendBox
           
private  float mYMajorTickSpacing
           
private  float mYMax
           
private  float mYMin
           
private  float mYMinorTickSpacing
           
private  java.lang.String mYTitle
           
private  float mZMajorTickSpacing
           
private  float mZMax
           
private  float mZMin
           
private  float mZMinorTickSpacing
           
private  java.lang.String mZTitle
           
 
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
ThreeDPlotter()
           
ThreeDPlotter(int width, int height)
           
 
Method Summary
 void AddDataSet(PlotData<E> data)
           
 void DeleteAllData()
           
private  void Draw(java.awt.Graphics g)
          Draw the scene on provided graphics instance.
 java.awt.Graphics GetImageGraphics()
          Get the Graphics2d instance associated with buffered image.
 java.awt.Dimension getPreferredSize()
           
 java.awt.Dimension GetSize()
           
 void HighlightDataPoints(boolean toHighlight)
           
 void mouseClicked(java.awt.event.MouseEvent e)
          Handler for mouseClicked event..
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
          Handler for mouseMoved event.
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
protected  void paintComponent(java.awt.Graphics g)
           
 void Redraw()
           
 void RegenerateImage()
          Paint the buffered image again, after possibly resizing it.
 PlotData<E> RemoveDataSet(int setNum)
           
private  void ResizeBufferedImage()
          Resize the buffered image to drawing canvas size.
 void SaveScreenShot(java.io.File file, java.lang.String extension)
           
 void SetAutoFitOn(boolean on)
           
 void SetBGColor(java.awt.Color col)
           
 void SetLegendBoxXCorner(int xcorner)
           
 void SetLegendBoxYCorner(int ycorner)
           
 void SetMajorXTickSpacing(float delta)
           
 void SetMajorYTickSpacing(float delta)
           
 void SetMajorZTickSpacing(float delta)
           
 void SetMinorXTickSpacing(float delta)
           
 void SetMinorYTickSpacing(float delta)
           
 void SetMinorZTickSpacing(float delta)
           
 void SetPlotSize(int xPixelNum, int yPixelNum)
           
 void SetSurfaceColor(java.awt.Color col)
           
 void SetSurfaceType(SurfaceType surfType)
           
 void SetXLabelOn(boolean on)
           
 void SetXRange(float min, float max)
           
 void SetXTitle(java.lang.String title)
           
 void SetYLabelOn(boolean on)
           
 void SetYRange(float min, float max)
           
 void SetYTtitle(java.lang.String title)
           
 void SetZLabelOn(boolean on)
           
 void SetZRange(float min, float max)
           
 void SetZTtitle(java.lang.String title)
           
 void ShowGrid(boolean on)
           
 void ShowLegend(boolean legendOn)
           
 void ShowXMajorTicks(boolean showXTicks)
           
 void ShowXMinorTicks(boolean showXTicks)
           
 void ShowYMajorTicks(boolean showYTicks)
           
 void ShowYMinorTicks(boolean showYTicks)
           
 void ShowZMajorTicks(boolean showZTicks)
           
 void ShowZMinorTicks(boolean showZTicks)
           
 
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, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mDataSetList

private java.util.List<PlotData<E>> mDataSetList

mXMin

private float mXMin

mXMax

private float mXMax

mYMin

private float mYMin

mYMax

private float mYMax

mZMin

private float mZMin

mZMax

private float mZMax

bXMajorTicksOn

private boolean bXMajorTicksOn

bXMinorTicksOn

private boolean bXMinorTicksOn

bYMajorTicksOn

private boolean bYMajorTicksOn

bYMinorTicksOn

private boolean bYMinorTicksOn

bZMajorTicksOn

private boolean bZMajorTicksOn

bZMinorTicksOn

private boolean bZMinorTicksOn

bAutoFitOn

private boolean bAutoFitOn

bGridOn

private boolean bGridOn

mXMinorTickSpacing

private float mXMinorTickSpacing

mXMajorTickSpacing

private float mXMajorTickSpacing

mYMinorTickSpacing

private float mYMinorTickSpacing

mYMajorTickSpacing

private float mYMajorTickSpacing

mZMinorTickSpacing

private float mZMinorTickSpacing

mZMajorTickSpacing

private float mZMajorTickSpacing

bXLabelOn

private boolean bXLabelOn

bYLabelOn

private boolean bYLabelOn

bZLabelOn

private boolean bZLabelOn

mXTitle

private java.lang.String mXTitle

mYTitle

private java.lang.String mYTitle

mZTitle

private java.lang.String mZTitle

bLegendOn

private boolean bLegendOn

mBGColor

private java.awt.Color mBGColor

mSurfaceColor

private java.awt.Color mSurfaceColor

bHighlightDataPoints

private boolean bHighlightDataPoints

mSurfaceType

private SurfaceType mSurfaceType

mXLegendBox

private int mXLegendBox

mYLegendBox

private int mYLegendBox

mBufImg

private java.awt.image.BufferedImage mBufImg
Buffered image

Constructor Detail

ThreeDPlotter

public ThreeDPlotter()

ThreeDPlotter

public ThreeDPlotter(int width,
                     int height)
Method Detail

SetXRange

public void SetXRange(float min,
                      float max)
Specified by:
SetXRange in interface ThreeDPlot

SetYRange

public void SetYRange(float min,
                      float max)
Specified by:
SetYRange in interface ThreeDPlot

SetZRange

public void SetZRange(float min,
                      float max)
Specified by:
SetZRange in interface ThreeDPlot

ShowXMajorTicks

public void ShowXMajorTicks(boolean showXTicks)
Specified by:
ShowXMajorTicks in interface ThreeDPlot

ShowYMajorTicks

public void ShowYMajorTicks(boolean showYTicks)
Specified by:
ShowYMajorTicks in interface ThreeDPlot

ShowZMajorTicks

public void ShowZMajorTicks(boolean showZTicks)
Specified by:
ShowZMajorTicks in interface ThreeDPlot

ShowXMinorTicks

public void ShowXMinorTicks(boolean showXTicks)
Specified by:
ShowXMinorTicks in interface ThreeDPlot

ShowYMinorTicks

public void ShowYMinorTicks(boolean showYTicks)
Specified by:
ShowYMinorTicks in interface ThreeDPlot

ShowZMinorTicks

public void ShowZMinorTicks(boolean showZTicks)
Specified by:
ShowZMinorTicks in interface ThreeDPlot

SetMinorXTickSpacing

public void SetMinorXTickSpacing(float delta)
Specified by:
SetMinorXTickSpacing in interface ThreeDPlot

SetMajorXTickSpacing

public void SetMajorXTickSpacing(float delta)
Specified by:
SetMajorXTickSpacing in interface ThreeDPlot

SetMinorYTickSpacing

public void SetMinorYTickSpacing(float delta)
Specified by:
SetMinorYTickSpacing in interface ThreeDPlot

SetMajorYTickSpacing

public void SetMajorYTickSpacing(float delta)
Specified by:
SetMajorYTickSpacing in interface ThreeDPlot

SetMinorZTickSpacing

public void SetMinorZTickSpacing(float delta)
Specified by:
SetMinorZTickSpacing in interface ThreeDPlot

SetMajorZTickSpacing

public void SetMajorZTickSpacing(float delta)
Specified by:
SetMajorZTickSpacing in interface ThreeDPlot

ShowGrid

public void ShowGrid(boolean on)
Specified by:
ShowGrid in interface PlotBase

SetXLabelOn

public void SetXLabelOn(boolean on)

SetYLabelOn

public void SetYLabelOn(boolean on)

SetZLabelOn

public void SetZLabelOn(boolean on)

SetXTitle

public void SetXTitle(java.lang.String title)

SetYTtitle

public void SetYTtitle(java.lang.String title)

SetZTtitle

public void SetZTtitle(java.lang.String title)

ShowLegend

public void ShowLegend(boolean legendOn)
Specified by:
ShowLegend in interface PlotBase

SetBGColor

public void SetBGColor(java.awt.Color col)
Specified by:
SetBGColor in interface PlotBase

SetSurfaceColor

public void SetSurfaceColor(java.awt.Color col)
Specified by:
SetSurfaceColor in interface ThreeDPlot

HighlightDataPoints

public void HighlightDataPoints(boolean toHighlight)
Specified by:
HighlightDataPoints in interface PlotBase

SetLegendBoxXCorner

public void SetLegendBoxXCorner(int xcorner)
Specified by:
SetLegendBoxXCorner in interface PlotBase

SetLegendBoxYCorner

public void SetLegendBoxYCorner(int ycorner)
Specified by:
SetLegendBoxYCorner in interface PlotBase

SetAutoFitOn

public void SetAutoFitOn(boolean on)
Specified by:
SetAutoFitOn in interface PlotBase

SetPlotSize

public void SetPlotSize(int xPixelNum,
                        int yPixelNum)
Specified by:
SetPlotSize in interface PlotBase

GetSize

public java.awt.Dimension GetSize()
Specified by:
GetSize in interface PlotBase

AddDataSet

public void AddDataSet(PlotData<E> data)

RemoveDataSet

public PlotData<E> RemoveDataSet(int setNum)

DeleteAllData

public void DeleteAllData()
Specified by:
DeleteAllData in interface PlotBase

SetSurfaceType

public void SetSurfaceType(SurfaceType surfType)
Specified by:
SetSurfaceType in interface ThreeDPlot

Redraw

public void Redraw()

paintComponent

protected void paintComponent(java.awt.Graphics g)
Overrides:
paintComponent in class javax.swing.JComponent

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class javax.swing.JComponent

ResizeBufferedImage

private void ResizeBufferedImage()
Resize the buffered image to drawing canvas size.


GetImageGraphics

public java.awt.Graphics GetImageGraphics()
Get the Graphics2d instance associated with buffered image.

Returns:
Graphics instance

RegenerateImage

public void RegenerateImage()
Paint the buffered image again, after possibly resizing it.


Draw

private void Draw(java.awt.Graphics g)
Draw the scene on provided graphics instance.

Parameters:
g - Graphics instance where painting needs to be done.

SaveScreenShot

public void SaveScreenShot(java.io.File file,
                           java.lang.String extension)

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Handler for mouseClicked event..

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
e - MouseEvent corresponding to mouse movement

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Handler for mouseMoved event.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Parameters:
e - MouseEvent corresponding to mouse movement

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener