com.pentec.adapt
Class APanel

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

public abstract class APanel
extends javax.swing.JPanel

APanel extends JPanel and provides the base class for all data types 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
 Axes axes
          X & Y axes control
protected  java.awt.Color color_Grid
          Default colors
protected  java.awt.Color color_Markers
           
protected  java.awt.Color color_Overlay
           
protected  java.awt.Color color_Plot
           
protected  java.awt.Color color_Trace1
           
protected  java.awt.Color color_Trace2
           
protected  java.awt.Color color_Trace3
           
 DataFrame dataFrame
          The DataFrame this panel belongs to
 double dDataXMax
           
 double dDataXMin
          X-axis extrema
 double dDataYMax
           
 double dDataYMin
          Y-axis extrema
protected  double dXScale
          Image stretch factors
protected  double dYScale
           
protected  int iLRX
           
protected  int iLRY
           
protected  java.awt.Image imageBuffer
          Buffer to draw in to avoid flashing
private  boolean isActive
          Flag indicating if this panel is the active panel in a data frame
 int iScanNumber
          The scan number displayed in this panel
protected  boolean isIntegrationEnabled
          Flag indicating whether or not to perform integration operation
protected  int iULX
          The plot rectangle in pixels upper left x upper left y lower right x lower right y
protected  int iULY
           
protected  java.awt.Rectangle panelBounds
          The panel location, width, and height (in pixels)
protected  ZoomListener zl
          Zoom events listener
 
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
protected APanel(DataFrame ownerFrame)
           
 
Method Summary
protected  void addPopupMenu()
           
protected abstract  boolean apaint(java.awt.Graphics2D g)
           
static void autoscaleInsideExtr(DataFrame callingFrame)
          View--Autoscale--Inside ROI on Extrema
static void autoscaleInsideZero(DataFrame callingFrame)
          View--Autoscale--Inside ROI about Zero
static void autoscaleOutsideExtr(DataFrame callingFrame)
          View--Autoscale--Outside ROI on Extrema
static void autoscaleOutsideZero(DataFrame callingFrame)
          View--Autoscale--Outside ROI about Zero
protected  int boundX(int ix)
          Make sure a point is inside the box (horizontal dimension)
protected  int boundY(int iy)
          Make sure a point is inside the box (vertical dimension)
 void centerAbout(double dx, double dy)
          Center the image/plot about a given point without changing the scaling
abstract  void centerMax()
           
abstract  void centerMin()
           
 boolean centerMouseCursor()
          Get the screen position of this panel and set the mouse cursor to the middle of the panel.
 void clearOverlay()
          This is overridden by APlot but not defined by AImage
 java.awt.Rectangle convertBox(int ix, int iy, int iw, int ih)
          Convert from pixel coordinates to screen coordinates for an enclosing box
private  int convertX(double dx)
           
private  int convertY(double dy)
           
private  void drawAois(java.awt.Graphics2D g)
          Draw a box for all AOIs in this panel
 void drawBorder()
          Draw a border directly to this panel
private  void drawBorder(java.awt.Graphics2D g)
          Draw a border to a particular graphics context
private  void drawMarkers(java.awt.Graphics2D g)
          Draw the markers set in the marker list
abstract  void editOriginal()
           
abstract  void findMinima(java.lang.String $)
           
 java.awt.Rectangle getAoi()
          Determine the AOI bounds
abstract  java.lang.String[] getCursorInfo$(double dx, double dy)
           
abstract  double[][] getMinMaxIn()
           
abstract  double[][] getMinMaxOut()
           
 double getMouseX()
          Return the current mouse cursor X position in axis coordinates
 double getMouseY()
          Return the current mouse cursor Y position in axis coordinates
 double getScaledX(int ixin)
          Scale from screen pixel coordinates to axis coordinates
 double getScaledY(int iyin)
          Scale from screen pixel coordinates to axis coordinates
 java.awt.Dimension getSize()
          Get the size of this component
 double getXScale()
           
protected  int[] getXYAdjust()
          Compute dimensions in pixels of border areas (axes and insets) to use for aspect corrections and window size adjustments
 double getYScale()
           
protected  void init(DataFrame ownerFrame)
           
abstract  void integrate()
           
protected abstract  void menuFixer(AMenuBar menuBar)
           
protected  void menuFixer(javax.swing.JMenuItem jmi)
          Disable menu items that are not implemented
 void paint(java.awt.Graphics graphics)
          Paint the component contents
protected abstract  void reSync()
           
abstract  void scaleData(double dMin, double dMax)
           
protected  int scaleX(int iLabelHeight, int iWidestY)
          Define width of drawing area and compute horizontal scaling factor
protected  int scaleY(int iLabelHeight)
          Define height of drawing area and compute vertical scaling factor
 void scrollX(double delta)
           
 void scrollY(double delta)
           
 void setActive(boolean isActive)
          Set the isActive flag for this panel
private  void setBounds(int iNewWidth, int iNewHeight)
          Resize this component and compute new scale factors
 void setBounds(int x, int y, int iNewWidth, int iNewHeight)
          Move and resize this component
 void setIntegrationEnabled(boolean isIntegrationEnabled)
           
 void setOverlay()
          This is overridden by APlot but not defined by AImage
 void setSize(int iNewWidth, int iNewHeight)
          Set the size of this component
abstract  void setSourceData(java.awt.image.DataBuffer dataBuffer)
           
 void setTraceColor(java.awt.Color color)
           
 void setXRange(double dmin, double dmax)
           
 void setXYRange()
           
 void setXYRange(double dLeft, double dRight, double dDown, double dUp)
          Set the axes endpoints
 void setYRange(double dmin, double dmax)
           
 java.lang.String toString()
           
 void update(java.awt.Graphics g)
          Override update so that it doesn't clear the plot
abstract  java.nio.channels.FileChannel write(boolean isNative, java.lang.String $Format)
           
 void zoom(double dXScale, double dYScale)
          Scale the X & Y range with independent scale factors (+to zoom in, - to zoom out)
 
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

axes

public Axes axes
X & Y axes control


color_Grid

protected java.awt.Color color_Grid
Default colors


color_Markers

protected java.awt.Color color_Markers

color_Overlay

protected java.awt.Color color_Overlay

color_Plot

protected java.awt.Color color_Plot

color_Trace1

protected java.awt.Color color_Trace1

color_Trace2

protected java.awt.Color color_Trace2

color_Trace3

protected java.awt.Color color_Trace3

dataFrame

public DataFrame dataFrame
The DataFrame this panel belongs to


dDataXMax

public double dDataXMax

dDataXMin

public double dDataXMin
X-axis extrema


dDataYMax

public double dDataYMax

dDataYMin

public double dDataYMin
Y-axis extrema


dXScale

protected double dXScale
Image stretch factors


dYScale

protected double dYScale

iLRX

protected int iLRX

iLRY

protected int iLRY

imageBuffer

protected java.awt.Image imageBuffer
Buffer to draw in to avoid flashing


isActive

private boolean isActive
Flag indicating if this panel is the active panel in a data frame


iScanNumber

public int iScanNumber
The scan number displayed in this panel


isIntegrationEnabled

protected boolean isIntegrationEnabled
Flag indicating whether or not to perform integration operation


iULX

protected int iULX
The plot rectangle in pixels upper left x upper left y lower right x lower right y


iULY

protected int iULY

panelBounds

protected java.awt.Rectangle panelBounds
The panel location, width, and height (in pixels)


zl

protected ZoomListener zl
Zoom events listener

Constructor Detail

APanel

protected APanel(DataFrame ownerFrame)
Method Detail

addPopupMenu

protected void addPopupMenu()

apaint

protected abstract boolean apaint(java.awt.Graphics2D g)

autoscaleInsideExtr

public static void autoscaleInsideExtr(DataFrame callingFrame)
View--Autoscale--Inside ROI on Extrema


autoscaleInsideZero

public static void autoscaleInsideZero(DataFrame callingFrame)
View--Autoscale--Inside ROI about Zero


autoscaleOutsideExtr

public static void autoscaleOutsideExtr(DataFrame callingFrame)
View--Autoscale--Outside ROI on Extrema


autoscaleOutsideZero

public static void autoscaleOutsideZero(DataFrame callingFrame)
View--Autoscale--Outside ROI about Zero


boundX

protected int boundX(int ix)
Make sure a point is inside the box (horizontal dimension)


boundY

protected int boundY(int iy)
Make sure a point is inside the box (vertical dimension)


centerAbout

public void centerAbout(double dx,
                        double dy)
Center the image/plot about a given point without changing the scaling


centerMax

public abstract void centerMax()

centerMin

public abstract void centerMin()

centerMouseCursor

public boolean centerMouseCursor()
Get the screen position of this panel and set the mouse cursor to the middle of the panel.

Returns:
true if successful, false if not

clearOverlay

public void clearOverlay()
This is overridden by APlot but not defined by AImage


convertBox

public java.awt.Rectangle convertBox(int ix,
                                     int iy,
                                     int iw,
                                     int ih)
Convert from pixel coordinates to screen coordinates for an enclosing box


convertX

private int convertX(double dx)

convertY

private int convertY(double dy)

drawAois

private void drawAois(java.awt.Graphics2D g)
Draw a box for all AOIs in this panel


drawBorder

public void drawBorder()
Draw a border directly to this panel


drawBorder

private void drawBorder(java.awt.Graphics2D g)
Draw a border to a particular graphics context

Parameters:
g - the graphics context to draw to

drawMarkers

private void drawMarkers(java.awt.Graphics2D g)
Draw the markers set in the marker list


editOriginal

public abstract void editOriginal()

findMinima

public abstract void findMinima(java.lang.String $)

getAoi

public java.awt.Rectangle getAoi()
Determine the AOI bounds


getCursorInfo$

public abstract java.lang.String[] getCursorInfo$(double dx,
                                                  double dy)

getMinMaxIn

public abstract double[][] getMinMaxIn()

getMinMaxOut

public abstract double[][] getMinMaxOut()

getMouseX

public double getMouseX()
Return the current mouse cursor X position in axis coordinates


getMouseY

public double getMouseY()
Return the current mouse cursor Y position in axis coordinates


getScaledX

public double getScaledX(int ixin)
Scale from screen pixel coordinates to axis coordinates


getScaledY

public double getScaledY(int iyin)
Scale from screen pixel coordinates to axis coordinates


getSize

public java.awt.Dimension getSize()
Get the size of this component

Overrides:
getSize in class java.awt.Component

getXScale

public double getXScale()

getXYAdjust

protected int[] getXYAdjust()
Compute dimensions in pixels of border areas (axes and insets) to use for aspect corrections and window size adjustments


getYScale

public double getYScale()

init

protected void init(DataFrame ownerFrame)

integrate

public abstract void integrate()

menuFixer

protected abstract void menuFixer(AMenuBar menuBar)

menuFixer

protected void menuFixer(javax.swing.JMenuItem jmi)
Disable menu items that are not implemented


paint

public void paint(java.awt.Graphics graphics)
Paint the component contents

Overrides:
paint in class javax.swing.JComponent

reSync

protected abstract void reSync()

scaleData

public abstract void scaleData(double dMin,
                               double dMax)

scaleX

protected int scaleX(int iLabelHeight,
                     int iWidestY)
Define width of drawing area and compute horizontal scaling factor


scaleY

protected int scaleY(int iLabelHeight)
Define height of drawing area and compute vertical scaling factor


scrollX

public void scrollX(double delta)

scrollY

public void scrollY(double delta)

setActive

public void setActive(boolean isActive)
Set the isActive flag for this panel


setBounds

private void setBounds(int iNewWidth,
                       int iNewHeight)
Resize this component and compute new scale factors


setBounds

public void setBounds(int x,
                      int y,
                      int iNewWidth,
                      int iNewHeight)
Move and resize this component

Overrides:
setBounds in class java.awt.Component

setIntegrationEnabled

public void setIntegrationEnabled(boolean isIntegrationEnabled)

setOverlay

public void setOverlay()
This is overridden by APlot but not defined by AImage


setSize

public void setSize(int iNewWidth,
                    int iNewHeight)
Set the size of this component

Overrides:
setSize in class java.awt.Component

setSourceData

public abstract void setSourceData(java.awt.image.DataBuffer dataBuffer)

setTraceColor

public void setTraceColor(java.awt.Color color)

setXRange

public void setXRange(double dmin,
                      double dmax)

setXYRange

public void setXYRange()

setXYRange

public void setXYRange(double dLeft,
                       double dRight,
                       double dDown,
                       double dUp)
Set the axes endpoints


setYRange

public void setYRange(double dmin,
                      double dmax)

toString

public java.lang.String toString()
Overrides:
toString in class java.awt.Component

update

public void update(java.awt.Graphics g)
Override update so that it doesn't clear the plot

Overrides:
update in class javax.swing.JComponent

write

public abstract java.nio.channels.FileChannel write(boolean isNative,
                                                    java.lang.String $Format)

zoom

public void zoom(double dXScale,
                 double dYScale)
Scale the X & Y range with independent scale factors (+to zoom in, - to zoom out)