public class EarthDataViewPanel extends javax.swing.JPanel implements DelayedRenderingComponent, TransformableImageComponent
EarthDataViewPanel
class displays an onscreen
version of an EarthDataView
object. The panel has
enhanced functionality over the RenderablePanel
class
with resizing behaviour and mouse events. The panel also supplies
a tracking bar that may be used to display the mouse cursor
position within the panel.
Changes to the view should be performed using panel methods
wherever possible rather than the corresponding view methods, since
a rendering loop may be active in the panel. When the view must be
modified directly, users should call the panel
stopRendering()
method before making the change.
The panel signals a change in rendering status by firing a
RENDERING_PROPERTY
change event with value true
when rendering is in progress or false if not. This can help
with progress monitors.
EarthDataView
,
Serialized FormModifier and Type | Class and Description |
---|---|
class |
EarthDataViewPanel.TrackBar
The track bar class supplies mouse position tracking for an Earth
data view panel.
|
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
RENDERING_PROPERTY
The rendering status property for property change events.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
EarthDataViewPanel(EarthDataView view)
Creates a new earth data view panel using the specified view.
|
Modifier and Type | Method and Description |
---|---|
void |
fitReset()
Resets the view panel so that one dimension of the data grid
fits, centered within the panel.
|
java.awt.geom.AffineTransform |
getAffine()
Gets the affine transform that translates view panel coordinates
to data location coordinates.
|
java.awt.Cursor |
getDefaultCursor()
Gets the default cursor.
|
java.awt.geom.AffineTransform |
getImageAffine()
Gets the image affine transform in the view.
|
EarthDataView |
getView()
Gets the earth data view.
|
boolean |
isRendering()
Returns true if the view panel is being rendered, or false if
not.
|
void |
magnify(double factor)
Magnifies the view around the current center location.
|
void |
magnify(java.awt.Rectangle rect)
Magnifies the specified rectangle to occupy the entire view.
|
void |
paintComponent(java.awt.Graphics g) |
void |
reset()
Resets the view panel so that the entire data grid fits, centered
within the panel.
|
void |
setBounds(java.awt.Rectangle r) |
void |
setCenter(java.awt.geom.Point2D center)
Sets the view center to a new data location.
|
void |
setDefaultCursor(java.awt.Cursor cursor)
Sets the default cursor.
|
void |
setImageAffine(java.awt.geom.AffineTransform affine)
Sets the image affine transform in the view.
|
void |
setStaticView(boolean flag)
Sets the static view mode flag.
|
void |
setView(EarthDataView view)
Sets the earth data view.
|
void |
stopRendering()
Stops the current rendering thread if it is active.
|
java.awt.geom.Point2D |
translate(java.awt.geom.Point2D point)
Translates the specified panel-relative point to a view-relative
point.
|
void |
unityMagnify()
Sets the magnification of the view around the current center
location so that the data:screen pixel magnification is 1:1.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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
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, transferFocusDownCycle, validate, validateTree
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, 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, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String RENDERING_PROPERTY
public EarthDataViewPanel(EarthDataView view)
view
- the earth data view to display.public boolean isRendering()
isRendering
in interface DelayedRenderingComponent
public void stopRendering()
stopRendering
in interface DelayedRenderingComponent
public EarthDataView getView()
public void setView(EarthDataView view)
view
- the new data view.public void unityMagnify()
EarthDataView()
object directly.magnify(double)
public void magnify(double factor)
EarthDataView.magnify()
method directly
on the view itself.factor
- the factor by which to magnify. Factors greater
than 1 increase the magnification and factors less than 1
decrease the magnification.EarthDataView.magnify(double)
public void magnify(java.awt.Rectangle rect)
EarthDataView.magnify()
method directly on the view itself.rect
- the magnification rectangle in panel-relative
coordinates.EarthDataView.magnify(Point,Point)
public void setCenter(java.awt.geom.Point2D center)
EarthDataView.setCenter()
method directly on the
view itself.center
- the new center data location in panel-relative
coordinates.EarthDataView.setCenter(DataLocation)
public void setStaticView(boolean flag)
flag
- the static view flag, true for static view mode.public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public java.awt.Cursor getDefaultCursor()
public void setDefaultCursor(java.awt.Cursor cursor)
cursor
- the new default cursor to use.public void setBounds(java.awt.Rectangle r)
setBounds
in class java.awt.Component
public void fitReset()
java.lang.UnsupportedOperationException
- if the static view mode
flag is on.setStaticView(boolean)
public void reset()
EarthDataView.reset()
method directly on the view itself.public java.awt.geom.AffineTransform getImageAffine()
getImageAffine
in interface TransformableImageComponent
EarthDataView.getImageAffine()
public void setImageAffine(java.awt.geom.AffineTransform affine)
EarthDataView.setImageAffine()
method directly on
the view itself.setImageAffine
in interface TransformableImageComponent
affine
- the image affine transform, or null for no
transform.EarthDataView.setImageAffine(java.awt.geom.AffineTransform)
public java.awt.geom.Point2D translate(java.awt.geom.Point2D point)
point
- the point for translation.public java.awt.geom.AffineTransform getAffine()