edu.mines.jtk.mosaic
Class PlotPanelPixels3

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 edu.mines.jtk.mosaic.IPanel
                      extended by edu.mines.jtk.mosaic.PlotPanel
                          extended by edu.mines.jtk.mosaic.PlotPanelPixels3
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class PlotPanelPixels3
extends PlotPanel

A plot panel with three pixels views of slices from a 3-D array.

Pixels views are arranged in one of four ways, depending on the orientation of this panel. All arrangements are L-shaped with an empty tile in the upper-right corner of a 2x2 mosaic contained in this panel.

This class has numerous methods that enable changing various attributes of the three pixels views while keeping them consistent. Although such attributes can be set independently for each pixels view, one should use the methods in this class when possible.

Version:
2007.08.11
Author:
Dave Hale, Colorado School of Mines
See Also:
Serialized Form

Nested Class Summary
static class PlotPanelPixels3.AxesPlacement
          Placement of labeled axes.
static class PlotPanelPixels3.Orientation
          Orientations of the plot panel are defined by the orientation of the tile in the lower-left corner of the 2x2 mosaic.
 
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
PlotPanelPixels3(PlotPanelPixels3.Orientation orientation, PlotPanelPixels3.AxesPlacement axesPlacement, Sampling s1, Sampling s2, Sampling s3, float[][][] f)
          Constructs a plot panel with three pixels views.
PlotPanelPixels3(PlotPanelPixels3.Orientation orientation, PlotPanelPixels3.AxesPlacement axesPlacement, Sampling s1, Sampling s2, Sampling s3, float[][][][] f)
          Constructs a plot panel with three pixels views.
PlotPanelPixels3(PlotPanelPixels3.Orientation orientation, PlotPanelPixels3.AxesPlacement axesPlacement, Sampling s1, Sampling s2, Sampling s3, Float3 f3)
          Constructs a plot panel with three pixels views.
PlotPanelPixels3(PlotPanelPixels3.Orientation orientation, PlotPanelPixels3.AxesPlacement axesPlacement, Sampling s1, Sampling s2, Sampling s3, Float3[] f3)
          Constructs a plot panel with three pixels views.
 
Method Summary
 float getClipMax()
          Gets the maximum clip value.
 float getClipMax(int ic)
          Gets the maximum clip value for the specified color component.
 float getClipMin()
          Gets the minimum clip value.
 float getClipMin(int ic)
          Gets the minimum clip value for the specified color component.
 java.awt.image.IndexColorModel getColorModel()
          Gets the index color model for this panel.
 float getPercentileMax()
          Gets the maximum percentile.
 float getPercentileMax(int ic)
          Gets the maximum percentile for the specified color component.
 float getPercentileMin()
          Gets the minimum percentile.
 float getPercentileMin(int ic)
          Gets the minimum percentile for the specified color component.
 PixelsView getPixelsView12()
          Gets the pixels view for the 1-2 slice.
 PixelsView getPixelsView13()
          Gets the pixels view for the 1-3 slice.
 PixelsView getPixelsView23()
          Gets the pixels view for the 2-3 slice.
 void setClips(float clipMin, float clipMax)
          Sets the clips for this panel.
 void setClips(int ic, float clipMin, float clipMax)
          Sets the clips for the specified color component.
 void setColorModel(java.awt.image.IndexColorModel colorModel)
          Sets the index color model for this panel.
 void setFormat1(java.lang.String format)
          Sets the format for axis 1.
 void setFormat2(java.lang.String format)
          Sets the format for axis 2.
 void setFormat3(java.lang.String format)
          Sets the format for axis 3.
 void setInterpolation(PixelsView.Interpolation interpolation)
          Sets the method for interpolation between samples.
 void setInterval1(double interval)
          Sets the interval for axis 1.
 void setInterval2(double interval)
          Sets the interval for axis 2.
 void setInterval3(double interval)
          Sets the interval for axis 3.
 void setLabel1(java.lang.String label)
          Sets the label for axis 1.
 void setLabel2(java.lang.String label)
          Sets the label for axis 2.
 void setLabel3(java.lang.String label)
          Sets the label for axis 3.
 void setLineColor(java.awt.Color color)
          Sets the color of lines drawn to indicate slice locations.
 void setPercentiles(float percMin, float percMax)
          Sets the percentiles used to compute clips for this panel.
 void setPercentiles(int ic, float percMin, float percMax)
          Sets the percentiles for the specified color component.
 void setSlice12(int k3)
          Sets sample index for slice of 3rd dimension.
 void setSlice13(int k2)
          Sets sample index for slice of 2nd dimension.
 void setSlice23(int k1)
          Sets sample index for 2-3 slice of 1st dimension.
 void setSlices(int k1, int k2, int k3)
          Sets sample indices for all slices.
 
Methods inherited from class edu.mines.jtk.mosaic.PlotPanel
addColorBar, addColorBar, addGrid, addGrid, addGrid, addGrid, addPixels, addPixels, addPixels, addPixels, addPixels, addPixels, addPixels, addPixels, addPoints, addPoints, addPoints, addPoints, addPoints, addPoints, addPoints, addPoints, addPoints, addPoints, addSequence, addSequence, addSequence, addSequence, addTiledView, addTiledView, addTitle, getMosaic, getTile, remove, removeColorBar, removeTitle, setBackground, setColorBarFormat, setColorBarWidthMinimum, setFont, setForeground, setHFormat, setHFormat, setHInterval, setHInterval, setHLabel, setHLabel, setHLimits, setHLimits, setHLimitsDefault, setHLimitsDefault, setLimits, setLimitsDefault, setTitle, setVFormat, setVFormat, setVInterval, setVInterval, setVLabel, setVLabel, setVLimits, setVLimits, setVLimitsDefault, setVLimitsDefault
 
Methods inherited from class edu.mines.jtk.mosaic.IPanel
computeScale, createGraphics, getLineWidth, paintToImage, paintToImage, paintToPng, paintToRect, scaleLineWidth
 
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, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, 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, 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
 

Constructor Detail

PlotPanelPixels3

public PlotPanelPixels3(PlotPanelPixels3.Orientation orientation,
                        PlotPanelPixels3.AxesPlacement axesPlacement,
                        Sampling s1,
                        Sampling s2,
                        Sampling s3,
                        float[][][] f)
Constructs a plot panel with three pixels views.

Parameters:
orientation - the orientation of views.
axesPlacement - the placement of axes.
s1 - sampling of the 1st dimension.
s2 - sampling of the 2nd dimension.
s3 - sampling of the 3rd dimension.
f - 3-D array of floats.

PlotPanelPixels3

public PlotPanelPixels3(PlotPanelPixels3.Orientation orientation,
                        PlotPanelPixels3.AxesPlacement axesPlacement,
                        Sampling s1,
                        Sampling s2,
                        Sampling s3,
                        float[][][][] f)
Constructs a plot panel with three pixels views.

Parameters:
orientation - the orientation of views.
axesPlacement - the placement of axes.
s1 - sampling of the 1st dimension.
s2 - sampling of the 2nd dimension.
s3 - sampling of the 3rd dimension.
f - array of 3-D arrays of floats.

PlotPanelPixels3

public PlotPanelPixels3(PlotPanelPixels3.Orientation orientation,
                        PlotPanelPixels3.AxesPlacement axesPlacement,
                        Sampling s1,
                        Sampling s2,
                        Sampling s3,
                        Float3 f3)
Constructs a plot panel with three pixels views.

Parameters:
orientation - the orientation of views.
axesPlacement - the placement of axes.
s1 - sampling of the 1st dimension.
s2 - sampling of the 2nd dimension.
s3 - sampling of the 3rd dimension.
f3 - abstract 3-D array of floats.

PlotPanelPixels3

public PlotPanelPixels3(PlotPanelPixels3.Orientation orientation,
                        PlotPanelPixels3.AxesPlacement axesPlacement,
                        Sampling s1,
                        Sampling s2,
                        Sampling s3,
                        Float3[] f3)
Constructs a plot panel with three pixels views.

Parameters:
orientation - the orientation of views.
axesPlacement - the placement of axes.
s1 - sampling of the 1st dimension.
s2 - sampling of the 2nd dimension.
s3 - sampling of the 3rd dimension.
f3 - array of abstract 3-D array of floats, one for each component.
Method Detail

getPixelsView12

public PixelsView getPixelsView12()
Gets the pixels view for the 1-2 slice.


getPixelsView13

public PixelsView getPixelsView13()
Gets the pixels view for the 1-3 slice.


getPixelsView23

public PixelsView getPixelsView23()
Gets the pixels view for the 2-3 slice.


setSlice23

public void setSlice23(int k1)
Sets sample index for 2-3 slice of 1st dimension.

Parameters:
k1 - sample index for 1st dimension.

setSlice13

public void setSlice13(int k2)
Sets sample index for slice of 2nd dimension.

Parameters:
k2 - sample index for 2nd dimension.

setSlice12

public void setSlice12(int k3)
Sets sample index for slice of 3rd dimension.

Parameters:
k3 - sample index for 3rd dimension.

setSlices

public void setSlices(int k1,
                      int k2,
                      int k3)
Sets sample indices for all slices.

Parameters:
k1 - sample index for 1st dimension.
k2 - sample index for 2nd dimension.
k3 - sample index for 3rd dimension.

setInterpolation

public void setInterpolation(PixelsView.Interpolation interpolation)
Sets the method for interpolation between samples.

Parameters:
interpolation - the interpolation method.

setLineColor

public void setLineColor(java.awt.Color color)
Sets the color of lines drawn to indicate slice locations.

Parameters:
color - the line color; if null, no lines are drawn.

setLabel1

public void setLabel1(java.lang.String label)
Sets the label for axis 1.

Parameters:
label - the label.

setLabel2

public void setLabel2(java.lang.String label)
Sets the label for axis 2.

Parameters:
label - the label.

setLabel3

public void setLabel3(java.lang.String label)
Sets the label for axis 3.

Parameters:
label - the label.

setFormat1

public void setFormat1(java.lang.String format)
Sets the format for axis 1.

Parameters:
format - the format.

setFormat2

public void setFormat2(java.lang.String format)
Sets the format for axis 2.

Parameters:
format - the format.

setFormat3

public void setFormat3(java.lang.String format)
Sets the format for axis 3.

Parameters:
format - the format.

setInterval1

public void setInterval1(double interval)
Sets the interval for axis 1.

Parameters:
interval - the interval.

setInterval2

public void setInterval2(double interval)
Sets the interval for axis 2.

Parameters:
interval - the interval.

setInterval3

public void setInterval3(double interval)
Sets the interval for axis 3.

Parameters:
interval - the interval.

setColorModel

public void setColorModel(java.awt.image.IndexColorModel colorModel)
Sets the index color model for this panel. The default color model is a black-to-white gray model.

Parameters:
colorModel - the index color model.

getColorModel

public java.awt.image.IndexColorModel getColorModel()
Gets the index color model for this panel.

Overrides:
getColorModel in class java.awt.Component
Returns:
the index color model; null, if a direct color model is being used (for multiple color components) instead of an index color model.

setClips

public void setClips(float clipMin,
                     float clipMax)
Sets the clips for this panel. Calling this method disables the computation of clips from percentiles. Any clip values computed or specified previously will be forgotten.

Parameters:
clipMin - the sample value corresponding to color model index 0.
clipMax - the sample value corresponding to color model index 255.

getClipMin

public float getClipMin()
Gets the minimum clip value.

Returns:
the minimum clip value.

getClipMax

public float getClipMax()
Gets the maximum clip value.

Returns:
the maximum clip value.

setPercentiles

public void setPercentiles(float percMin,
                           float percMax)
Sets the percentiles used to compute clips for this panel. Calling this method enables the computation of clips from percentiles. Any clip values specified or computed previously will be forgotten.

Parameters:
percMin - the percentile corresponding to clipMin.
percMax - the percentile corresponding to clipMax.

getPercentileMin

public float getPercentileMin()
Gets the minimum percentile.

Returns:
the minimum percentile.

getPercentileMax

public float getPercentileMax()
Gets the maximum percentile.

Returns:
the maximum percentile.

setClips

public void setClips(int ic,
                     float clipMin,
                     float clipMax)
Sets the clips for the specified color component. Calling this method disables the computation of clips from percentiles. Any clip values computed or specified previously will be forgotten.

Parameters:
ic - the index (0, 1, 2, or 3) of the color component.
clipMin - the sample value corresponding to color byte value 0.
clipMax - the sample value corresponding to color byte value 255.

getClipMin

public float getClipMin(int ic)
Gets the minimum clip value for the specified color component.

Parameters:
ic - the index (0, 1, 2, or 3) of the color component.
Returns:
the minimum clip value.

getClipMax

public float getClipMax(int ic)
Gets the maximum clip value for the specified color component.

Parameters:
ic - the index (0, 1, 2, or 3) of the color component.
Returns:
the maximum clip value.

setPercentiles

public void setPercentiles(int ic,
                           float percMin,
                           float percMax)
Sets the percentiles for the specified color component. Calling this method enables the computation of clips from percentiles. Any clip values specified or computed previously will be forgotten.

Parameters:
ic - the index (0, 1, 2, or 3) of the color component.
percMin - the percentile corresponding to clipMin.
percMax - the percentile corresponding to clipMax.

getPercentileMin

public float getPercentileMin(int ic)
Gets the minimum percentile for the specified color component.

Parameters:
ic - the index (0, 1, 2, or 3) of the color component.
Returns:
the minimum percentile.

getPercentileMax

public float getPercentileMax(int ic)
Gets the maximum percentile for the specified color component.

Parameters:
ic - the index (0, 1, 2, or 3) of the color component.
Returns:
the maximum percentile.