com.pentec.adapt
Class AMultiPlot

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 com.pentec.adapt.APanel
                      extended by com.pentec.adapt.APlot
                          extended by com.pentec.adapt.AMultiPlot
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class AMultiPlot
extends APlot

Multiple plots on top of one another in the same APanel

Plots may be different lengths X and Y arrays in a pair must be the same length

Author:
Pender Technology
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
private static java.awt.Color[] aDefaultColor
           
private  java.util.Vector colors
           
 
Fields inherited from class com.pentec.adapt.APlot
plotDB
 
Fields inherited from class com.pentec.adapt.APanel
axes, color_Grid, color_Markers, color_Overlay, color_Plot, color_Trace1, color_Trace2, color_Trace3, dataFrame, dDataXMax, dDataXMin, dDataYMax, dDataYMin, dXScale, dYScale, iLRX, iLRY, imageBuffer, iScanNumber, isIntegrationEnabled, iULX, iULY, panelBounds, zl
 
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
AMultiPlot(DataFrame callingFrame, double[][] aaData)
           
AMultiPlot(DataFrame callingFrame, double[][] aadData, java.awt.Color[] colors)
           
AMultiPlot(double[][] aaData)
           
AMultiPlot(double[][] aadData, java.awt.Color[] colors)
           
 
Method Summary
 void addPlot(double[][] aadAdditionalPlot)
           
 void addPlot(double[][] aadAdditionalPlot, java.awt.Color color)
           
protected  boolean apaint(java.awt.Graphics2D graphics)
          Plot the data points for a single trace with optional overlay.
 void centerMax()
           
 void centerMin()
           
 void findMinima(java.lang.String $)
          Tools - Find Local Minima
private static java.awt.Color getColor(int iColor)
           
 java.lang.String[] getCursorInfo$(double dx, double dy)
           
private  double[] getMaxPair(double[][] aadPlot)
           
private  double getMaxX(double[][] aadPlot)
           
private  double getMaxY(double[][] aadPlot)
           
 double[][] getMinMaxIn()
          Find the max and min in the current ROI
 double[][] getMinMaxOut()
          Find the max and min outside of the current ROI
private  double[] getMinPair(double[][] aadPlot)
           
private  double getMinX(double[][] aadPlot)
           
private  double getMinY(double[][] aadPlot)
           
 int getNumPlots()
           
 java.awt.Color getPlotColor(int iPlot)
           
 int getPlotLength(int iPlot)
           
 double getX(int iPlot, int iElement)
          Get the X value of a plot at an element
 double getY(int iPlot, int iElement)
          Get the Y value of a plot at an element
protected  void init(DataFrame ownerFrame)
          This method will be called by the super constructor when the owner frame handle is available
 void integrate()
           
static DataFrame makeDataFrame(java.io.File newFile, double[][] aadPlot)
          Create a DataFrame with an AMultiPlot representing the data passed in.
protected  void reSync()
           
 void scaleData(double dMin, double dMax)
          Set the y-axis range to a specific minimum and maximum
private  void setData(java.awt.image.DataBufferDouble plotDB)
           
private  void setData(double[][] aadPlot)
           
 void setSourceData(java.awt.image.DataBuffer dbd)
          Set the plot data using an input data buffer
private  void spanPlot(double[][] aad)
           
 
Methods inherited from class com.pentec.adapt.APlot
clearOverlay, editCopy, editOriginal, getData, getMaxLen, getSourceData, getX, getY1, getY2, getY3, getZdim, makeDataFrame, makeDataFrame, menuFixer, setOverlay, setSourceData, setSourceData, setSourceData, setSourceData, write, writePng, writeSaf, writeTxt, writeXLS
 
Methods inherited from class com.pentec.adapt.APanel
addPopupMenu, autoscaleInsideExtr, autoscaleInsideZero, autoscaleOutsideExtr, autoscaleOutsideZero, boundX, boundY, centerAbout, centerMouseCursor, convertBox, drawBorder, getAoi, getMouseX, getMouseY, getScaledX, getScaledY, getSize, getXScale, getXYAdjust, getYScale, menuFixer, paint, scaleX, scaleY, scrollX, scrollY, setActive, setBounds, setIntegrationEnabled, setSize, setTraceColor, setXRange, setXYRange, setXYRange, setYRange, toString, update, zoom
 
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, 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
 
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, 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, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

aDefaultColor

private static final java.awt.Color[] aDefaultColor

colors

private final java.util.Vector colors
Constructor Detail

AMultiPlot

public AMultiPlot(DataFrame callingFrame,
                  double[][] aaData)

AMultiPlot

public AMultiPlot(DataFrame callingFrame,
                  double[][] aadData,
                  java.awt.Color[] colors)

AMultiPlot

public AMultiPlot(double[][] aaData)

AMultiPlot

public AMultiPlot(double[][] aadData,
                  java.awt.Color[] colors)
Method Detail

addPlot

public void addPlot(double[][] aadAdditionalPlot)

addPlot

public void addPlot(double[][] aadAdditionalPlot,
                    java.awt.Color color)

apaint

protected boolean apaint(java.awt.Graphics2D graphics)
Description copied from class: APlot
Plot the data points for a single trace with optional overlay. The points are located using longs to preserve close zooms.

Overrides:
apaint in class APlot

centerMax

public void centerMax()
Overrides:
centerMax in class APlot

centerMin

public void centerMin()
Overrides:
centerMin in class APlot

findMinima

public void findMinima(java.lang.String $)
Tools - Find Local Minima

Overrides:
findMinima in class APlot

getColor

private static java.awt.Color getColor(int iColor)

getCursorInfo$

public java.lang.String[] getCursorInfo$(double dx,
                                         double dy)
Overrides:
getCursorInfo$ in class APlot

getMaxPair

private double[] getMaxPair(double[][] aadPlot)

getMaxX

private double getMaxX(double[][] aadPlot)

getMaxY

private double getMaxY(double[][] aadPlot)

getMinMaxIn

public double[][] getMinMaxIn()
Find the max and min in the current ROI

Overrides:
getMinMaxIn in class APlot

getMinMaxOut

public double[][] getMinMaxOut()
Find the max and min outside of the current ROI

Overrides:
getMinMaxOut in class APlot

getMinPair

private double[] getMinPair(double[][] aadPlot)

getMinX

private double getMinX(double[][] aadPlot)

getMinY

private double getMinY(double[][] aadPlot)

getNumPlots

public int getNumPlots()

getPlotColor

public java.awt.Color getPlotColor(int iPlot)

getPlotLength

public int getPlotLength(int iPlot)

getX

public double getX(int iPlot,
                   int iElement)
Get the X value of a plot at an element

Returns:
X value or Double.NaN if it does not exist

getY

public double getY(int iPlot,
                   int iElement)
Get the Y value of a plot at an element

Returns:
Y value or Double.NaN if it does not exist

init

protected void init(DataFrame ownerFrame)
Description copied from class: APlot
This method will be called by the super constructor when the owner frame handle is available

Overrides:
init in class APlot

integrate

public void integrate()
Overrides:
integrate in class APlot

makeDataFrame

public static DataFrame makeDataFrame(java.io.File newFile,
                                      double[][] aadPlot)
Create a DataFrame with an AMultiPlot representing the data passed in.

Parameters:
newFile - the file to associate with the DataFrame
aadPlot - XY pair arrays - each pair must be the same length, but plots can have different lengths

reSync

protected void reSync()
Overrides:
reSync in class APlot

scaleData

public void scaleData(double dMin,
                      double dMax)
Set the y-axis range to a specific minimum and maximum

Overrides:
scaleData in class APlot

setData

private void setData(java.awt.image.DataBufferDouble plotDB)

setData

private void setData(double[][] aadPlot)

setSourceData

public void setSourceData(java.awt.image.DataBuffer dbd)
Set the plot data using an input data buffer

Overrides:
setSourceData in class APlot
Parameters:
dbd - a data buffer to use for the plot data

spanPlot

private void spanPlot(double[][] aad)