com.pentec.adapt
Class APlot

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
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
AMultiPlot

public class APlot
extends APanel

APlot extends APanel and provides the base class for all XY type data viewed by ADAPT.

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  double[] adOverlay
           
protected  java.awt.image.DataBufferDouble 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
APlot(DataFrame ownerFrame)
           
 
Method Summary
protected  boolean apaint(java.awt.Graphics2D graphics)
          Plot the data points for a single trace with optional overlay.
private  void centerAbout(double dy)
           
 void centerMax()
           
 void centerMin()
           
 void clearOverlay()
          This is overridden by APlot but not defined by AImage
 void editCopy(java.lang.String $)
          Edit--Copy
 void editOriginal()
           
 void findMinima(java.lang.String $)
          Tools - Find Local Minima
 java.lang.String[] getCursorInfo$(double dx, double dy)
           
protected  double[][] getData()
           
protected  int getMaxLen(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
 double[][] getSourceData()
           
 double getX(int i)
          Get an x value
 double getY1(int i)
          Get a y value from the first data set
 double getY2(int i)
          Get a y value from the second data set
 double getY3(int i)
          Get a y value from the third data set
 int getZdim()
          Get the Z dimensionality
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(DataFrame callingFrame, java.lang.String $Text, double[][] aad, boolean doCopy)
          Make a new frame with a new plot, display it, and save it
static DataFrame makeDataFrame(java.io.File newFile, double[][] aad)
          Make a new frame and a new plot
static DataFrame makeDataFrame(javax.swing.JFrame parentFrame, java.lang.String $File, double[][] aad)
          Make a new frame and a new plot, then display it
protected  void menuFixer(AMenuBar menuBar)
          Disables or remove menu items that are not implemented for plots
private  boolean multiPaint(java.awt.Graphics graphics)
          Plot the data points for multiple traces
protected  void reSync()
           
private  void scaleData(double[][] xyArray)
           
 void scaleData(double dMin, double dMax)
          Set the y-axis range to a specific minimum and maximum
private  void setDataBuffer(java.awt.image.DataBuffer dbd)
           
 void setOverlay()
          This is overridden by APlot but not defined by AImage
 void setSourceData(java.util.ArrayList ax, java.util.ArrayList ay)
          Set the plot data buffer using 2 array lists
 void setSourceData(java.awt.image.DataBuffer dbd)
          Set the plot data using an input data buffer
 void setSourceData(double[][] aad)
          Set the plot data buffer using a 2D input array
 void setSourceData(double[][] aad, boolean doScale)
          Set the plot data buffer using a 2D input array
 void setSourceData(double[][] xyArray, double dXMin, double dXMax, double dYMin, double dYMax)
          Set the plot data buffer using a 2D input array
 java.nio.channels.FileChannel write(boolean isNative, java.lang.String $Format)
          Create a file and write out the header and the data.
protected  java.nio.channels.FileChannel writePng()
           
protected  java.nio.channels.FileChannel writeSaf()
           
protected  java.nio.channels.FileChannel writeTxt()
           
 java.nio.channels.FileChannel 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

adOverlay

private double[] adOverlay

plotDB

protected java.awt.image.DataBufferDouble plotDB
Constructor Detail

APlot

public APlot(DataFrame ownerFrame)
Method Detail

apaint

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

Specified by:
apaint in class APanel

centerAbout

private void centerAbout(double dy)

centerMax

public void centerMax()
Specified by:
centerMax in class APanel

centerMin

public void centerMin()
Specified by:
centerMin in class APanel

clearOverlay

public void clearOverlay()
Description copied from class: APanel
This is overridden by APlot but not defined by AImage

Overrides:
clearOverlay in class APanel

editCopy

public void editCopy(java.lang.String $)
Edit--Copy


editOriginal

public void editOriginal()
Specified by:
editOriginal in class APanel

findMinima

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

Specified by:
findMinima in class APanel

getCursorInfo$

public java.lang.String[] getCursorInfo$(double dx,
                                         double dy)
Specified by:
getCursorInfo$ in class APanel

getData

protected double[][] getData()

getMaxLen

protected int getMaxLen(double[][] aadPlot)

getMinMaxIn

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

Specified by:
getMinMaxIn in class APanel

getMinMaxOut

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

Specified by:
getMinMaxOut in class APanel

getSourceData

public double[][] getSourceData()

getX

public double getX(int i)
Get an x value

Parameters:
i - the x element to retrieve
Returns:
the value of the requested x element

getY1

public double getY1(int i)
Get a y value from the first data set

Parameters:
i - the y element to retrieve
Returns:
the value of the requested y element

getY2

public double getY2(int i)
Get a y value from the second data set

Parameters:
i - the y element to retrieve
Returns:
the value of the requested y element

getY3

public double getY3(int i)
Get a y value from the third data set

Parameters:
i - the y element to retrieve
Returns:
the value of the requested y element

getZdim

public int getZdim()
Get the Z dimensionality


init

protected void init(DataFrame ownerFrame)
This method will be called by the super constructor when the owner frame handle is available

Overrides:
init in class APanel

integrate

public void integrate()
Specified by:
integrate in class APanel

makeDataFrame

public static DataFrame makeDataFrame(DataFrame callingFrame,
                                      java.lang.String $Text,
                                      double[][] aad,
                                      boolean doCopy)
Make a new frame with a new plot, display it, and save it

Parameters:
callingFrame - the frame from which the function is called
$Text - text to be appended to form a new file name
aad - the source data
Returns:
a handle to the new frame

makeDataFrame

public static DataFrame makeDataFrame(java.io.File newFile,
                                      double[][] aad)
Make a new frame and a new plot

Parameters:
newFile - the file to associate with the new frame
aad - the source data
Returns:
a handle to the new frame

makeDataFrame

public static DataFrame makeDataFrame(javax.swing.JFrame parentFrame,
                                      java.lang.String $File,
                                      double[][] aad)
Make a new frame and a new plot, then display it

Parameters:
parentFrame - a reference frame for positioning
$File - what to name the associated data file
aad - the source data
Returns:
a handle to the new frame

menuFixer

protected void menuFixer(AMenuBar menuBar)
Disables or remove menu items that are not implemented for plots

Specified by:
menuFixer in class APanel

multiPaint

private boolean multiPaint(java.awt.Graphics graphics)
Plot the data points for multiple traces


reSync

protected void reSync()
Specified by:
reSync in class APanel

scaleData

private void scaleData(double[][] xyArray)

scaleData

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

Specified by:
scaleData in class APanel

setDataBuffer

private void setDataBuffer(java.awt.image.DataBuffer dbd)

setOverlay

public void setOverlay()
Description copied from class: APanel
This is overridden by APlot but not defined by AImage

Overrides:
setOverlay in class APanel

setSourceData

public void setSourceData(java.util.ArrayList ax,
                          java.util.ArrayList ay)
Set the plot data buffer using 2 array lists

Parameters:
ax - the list of x values
ay - the list of y values

setSourceData

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

Specified by:
setSourceData in class APanel
Parameters:
dbd - a data buffer to use for the plot data

setSourceData

public void setSourceData(double[][] aad)
Set the plot data buffer using a 2D input array

Parameters:
aad - a 2D array to use for the plot data

setSourceData

public void setSourceData(double[][] aad,
                          boolean doScale)
Set the plot data buffer using a 2D input array

Parameters:
aad - a 2D array to use for the plot data
doScale - if true, rescale the plot to the input array extrema

setSourceData

public void setSourceData(double[][] xyArray,
                          double dXMin,
                          double dXMax,
                          double dYMin,
                          double dYMax)
Set the plot data buffer using a 2D input array

Parameters:
xyArray - the 2D array to use in creating a data buffer for this plot
dXMin - the initial minimum x-axis value
dXMax - the initial maximum x-axis value
dYMin - the initial minimum y-axis value
dYMax - the initial maximum y-axis value

write

public java.nio.channels.FileChannel write(boolean isNative,
                                           java.lang.String $Format)
Create a file and write out the header and the data. All output is done with big endian byte ordering.

Specified by:
write in class APanel

writePng

protected java.nio.channels.FileChannel writePng()
                                          throws java.lang.Exception
Throws:
java.lang.Exception

writeSaf

protected java.nio.channels.FileChannel writeSaf()
                                          throws java.lang.Exception
Throws:
java.lang.Exception

writeTxt

protected java.nio.channels.FileChannel writeTxt()
                                          throws java.lang.Exception
Throws:
java.lang.Exception

writeXLS

public java.nio.channels.FileChannel writeXLS()
                                       throws java.lang.Exception
Throws:
java.lang.Exception