gov.noaa.pmel.sgt.swing
Class JGraphicLayout

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JLayeredPane
                          |
                          +--gov.noaa.pmel.sgt.JPane
                                |
                                +--gov.noaa.pmel.sgt.swing.JGraphicLayout
All Implemented Interfaces:
AbstractPane, javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, javax.swing.Scrollable, java.io.Serializable
Direct Known Subclasses:
JLineProfileLayout, JPlotLayout

public abstract class JGraphicLayout
extends JPane

JGraphicLayout is a abstract class that provides the basis for pre-defined layouts using the CartesianGraph class. JGraphicLayout extends JPane.

Since:
2.0
Version:
$Revision: 1.20 $, $Date: 2001/07/19 23:52:24 $
Author:
Donald Denbo
See Also:
CartesianGraph, JPlotLayout, Serialized Form

Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static int X_AXIS
          Use X array from SGTData.
static int Y_AXIS
          Use Y array from SGTData.
static int Z_AXIS
          Use Z array from SGTData.
 
Fields inherited from class javax.swing.JLayeredPane
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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 gov.noaa.pmel.sgt.AbstractPane
BOTTOM, CENTER, LEFT, MIDDLE, RIGHT, SPECIFIED_LOCATION, TOP
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JGraphicLayout()
          Default constructor
JGraphicLayout(java.lang.String id, java.awt.Image img)
          JGraphicLayout constructor.
JGraphicLayout(java.lang.String id, java.awt.Image img, java.awt.Dimension size)
          JGraphicLayout constructor.
 
Method Summary
 void addAttribute(SGTData data, Attribute attr)
          Associate SGTData with an Attribute.
 void addData(SGTData data)
          Add data to the layout.
abstract  void addData(SGTData data, java.lang.String label)
          Add data to the plot
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Add a PropertyChangeListener to the list.
 void addVetoableChangeListener(java.beans.VetoableChangeListener l)
          Adds a VetoableChangeListener to the listener list.
 Range2D findRange(SGTGrid data, GridAttribute attr, int dir)
          Find the range of the SGTGrid object in the specified direction.
 Range2D findRange(SGTLine data, int dir)
          Find the range of the SGTLine object in the specific direction.
 SoTRange findSoTRange(SGTGrid data, GridAttribute attr, int dir)
          Find the range of the SGTGrid object in the specified direction.
 SoTRange findSoTRange(SGTLine line, int dir)
          Find the range of the SGTLine object in the specific direction.
 SoTRange findSoTRange(SGTVector data, int dir)
          Find the range of the SGTVector object in the specified direction.
 TimeRange findTimeRange(SGTGrid data, GridAttribute attr)
          Find the TimeRange of the SGTGrid object.
 TimeRange findTimeRange(SGTLine data)
          Find the time range of the SGTLine object.
 Attribute getAttribute(SGTData data)
          Find an Attribute given a SGTData object.
 int getBaseUnit()
          Get the base units
 Collection getData()
          Return data associated with the plot.
 java.awt.Image getIconImage()
          Get icon image
 java.lang.String getId()
          Get the identifier
abstract  Rectangle2D.Double getKeyBoundsP()
          Get the bounds for the line or color key.
 Dimension2D getKeyLayerSizeP()
          Get the size of the key layer in physical coordinates.
 JPane getKeyPane()
          Get KeyPane object
abstract  java.lang.String getLocationSummary(SGTData grid)
          Construct a string that summarizes the location of the data.
 Domain getRange()
          Get the current Domain
 Domain getZoomBoundsU()
          Get the zoom bounds in user units
 boolean isClipping()
          Returns true if clipping is on.
 boolean isEditClasses()
          Are sgt objects editable?
 boolean isKeyPane()
          Is there a key pane?
 boolean isOverlayed()
          Layer overlay flag.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Remove the PropertyChangeListener from the list.
 void removeVetoableChangeListener(java.beans.VetoableChangeListener l)
          Removes a VetoableChangeListener from the listener list.
abstract  void resetZoom()
          Set the axes to the range of the SGTData objects.
 void setBaseUnit(int base)
          Set the base units.
 void setClipping(boolean clip)
          Set clipping on or off.
 void setEditClasses(boolean b)
          Enable sgt object property editing
 void setId(java.lang.String id)
          Set the identifier
abstract  void setKeyBoundsP(Rectangle2D.Double r)
          Set the bounds for the line or color key.
 void setKeyLayerSizeP(Dimension2D d)
          Set the size of the key layer in physical coordinates.
 void setOverlayed(boolean over)
          Set flag to overlay the layers.
abstract  void setRange(Domain domain)
          Set the axes to to range specified by the Domain object.
 void setTitles(java.lang.String title, java.lang.String title2, java.lang.String title3)
          Set the plot titles.
 
Methods inherited from class gov.noaa.pmel.sgt.JPane
add, add, add, add, add, draw, draw, draw, drawPage, getBounds, getComponent, getFirstLayer, getLayer, getLayerFromDataId, getMaximumSize, getMinimumSize, getObjectAt, getPageHAlign, getPageOrigin, getPageSize, getPageVAlign, getPreferredScrollableViewportSize, getPreferredSize, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedObject, getStrokeDrawer, getZoomBounds, init, isBatch, isModified, isPrinter, moveLayerDown, moveLayerDown, moveLayerUp, moveLayerUp, paintComponent, print, processMouseEvent, processMouseMotionEvent, setBatch, setBatch, setModified, setPageAlign, setPageHAlign, setPageOrigin, setPageVAlign, setScrollableBlockIncrement, setScrollableUnitIncrement, setSelectedObject, setSize, toString
 
Methods inherited from class javax.swing.JLayeredPane
getAccessibleContext, getComponentCountInLayer, getComponentsInLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getPosition, highestLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, putLayer, remove, setLayer, setLayer, setPosition
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, removeAll, removeContainerListener, setLayout, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, contains, createImage, createImage, dispatchEvent, enable, enableInputMethods, getBackground, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, show, show, size, transferFocus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

X_AXIS

public static final int X_AXIS
Use X array from SGTData.

Y_AXIS

public static final int Y_AXIS
Use Y array from SGTData.

Z_AXIS

public static final int Z_AXIS
Use Z array from SGTData.
Constructor Detail

JGraphicLayout

public JGraphicLayout()
Default constructor

JGraphicLayout

public JGraphicLayout(java.lang.String id,
                      java.awt.Image img)
JGraphicLayout constructor.
Parameters:
id - identifier
img - icon image
See Also:
JPlotLayout

JGraphicLayout

public JGraphicLayout(java.lang.String id,
                      java.awt.Image img,
                      java.awt.Dimension size)
JGraphicLayout constructor.
Parameters:
id - identifier
img - icon image
size - graph size in device units
See Also:
JPlotLayout
Method Detail

setId

public void setId(java.lang.String id)
Set the identifier
Overrides:
setId in class JPane
Parameters:
id - layout identifier

getId

public java.lang.String getId()
Get the identifier
Overrides:
getId in class JPane
Returns:
layout identifier

setTitles

public void setTitles(java.lang.String title,
                      java.lang.String title2,
                      java.lang.String title3)
Set the plot titles.
Parameters:
title - main plot title
title2 - secondary plot title
title3 - tertiary plot title

setBaseUnit

public void setBaseUnit(int base)
Set the base units. The base units are set automatically based on the first SGTData added to the list. Other SGTData objects added thereafter will be converted to the standard display units for each base unit type. (TEMPERATURE, default units are "degC"; VELOCITY, default units are "m/s"; DISTANCE, default unis are "m"). NOTE: Presently the units supported are very limited.
See Also:
Units.NONE, Units.TEMPERATURE, Units.VELOCITY, Units.DISTANCE

getBaseUnit

public int getBaseUnit()
Get the base units
Returns:
the current base units for the layout

setOverlayed

public void setOverlayed(boolean over)
Set flag to overlay the layers.
Parameters:
over - if true overlay layers if false stack

isOverlayed

public boolean isOverlayed()
Layer overlay flag.
Returns:
true if layers will be overlayed

getIconImage

public java.awt.Image getIconImage()
Get icon image
Returns:
icon image

getKeyPane

public JPane getKeyPane()
Get KeyPane object
Returns:
pane

isKeyPane

public boolean isKeyPane()
Is there a key pane?

addData

public void addData(SGTData data)
Add data to the layout. Where data is added is dependent on the specific layout. Additional layers will be created as required.
Parameters:
data - data to be added

addAttribute

public void addAttribute(SGTData data,
                         Attribute attr)
Associate SGTData with an Attribute. The associations are managed by a Hashtable object.

getAttribute

public Attribute getAttribute(SGTData data)
                       throws DataNotFoundException
Find an Attribute given a SGTData object.

addData

public abstract void addData(SGTData data,
                             java.lang.String label)
Add data to the plot

getLocationSummary

public abstract java.lang.String getLocationSummary(SGTData grid)
Construct a string that summarizes the location of the data.

findRange

public Range2D findRange(SGTLine data,
                         int dir)
Find the range of the SGTLine object in the specific direction.
Parameters:
data - SGTLine object
dir - direction
See Also:
CartesianGraph

findSoTRange

public SoTRange findSoTRange(SGTLine line,
                             int dir)
Find the range of the SGTLine object in the specific direction.
Parameters:
data - SGTLine object
dir - direction
Returns:
range as an SoTRange object
See Also:
CartesianGraph

findSoTRange

public SoTRange findSoTRange(SGTVector data,
                             int dir)
Find the range of the SGTVector object in the specified direction. Uses the U component to find X, Y ranges.
Parameters:
data - the data vector
dir - the direction
Returns:
range as an SoTRange object

findSoTRange

public SoTRange findSoTRange(SGTGrid data,
                             GridAttribute attr,
                             int dir)
Find the range of the SGTGrid object in the specified direction.
Parameters:
data - the data grid
attr - the grid attribute
dir - the direction
Returns:
range as an SoTRange object

findRange

public Range2D findRange(SGTGrid data,
                         GridAttribute attr,
                         int dir)
Find the range of the SGTGrid object in the specified direction.
Parameters:
data - the data grid
attr - the grid attribute
dir - the direction

findTimeRange

public TimeRange findTimeRange(SGTLine data)
Find the time range of the SGTLine object.
Parameters:
data - SGTLine object
See Also:
CartesianGraph

findTimeRange

public TimeRange findTimeRange(SGTGrid data,
                               GridAttribute attr)
Find the TimeRange of the SGTGrid object.
Parameters:
data - the data grid
attr - the grid attribute
dir - the direction

setClipping

public void setClipping(boolean clip)
Set clipping on or off. If clipping is on, clip to the axes range.
Parameters:
clip - true if clipping is on

isClipping

public boolean isClipping()
Returns true if clipping is on.
Returns:
true if clipping is on

resetZoom

public abstract void resetZoom()
Set the axes to the range of the SGTData objects.

setRange

public abstract void setRange(Domain domain)
                       throws java.beans.PropertyVetoException
Set the axes to to range specified by the Domain object.

getRange

public Domain getRange()
Get the current Domain

getZoomBoundsU

public Domain getZoomBoundsU()
Get the zoom bounds in user units

getData

public Collection getData()
Return data associated with the plot.
Returns:
data in a Collection

setEditClasses

public void setEditClasses(boolean b)
Enable sgt object property editing

isEditClasses

public boolean isEditClasses()
Are sgt objects editable?

getKeyBoundsP

public abstract Rectangle2D.Double getKeyBoundsP()
Get the bounds for the line or color key.

setKeyBoundsP

public abstract void setKeyBoundsP(Rectangle2D.Double r)
Set the bounds for the line or color key.

getKeyLayerSizeP

public Dimension2D getKeyLayerSizeP()
Get the size of the key layer in physical coordinates.

setKeyLayerSizeP

public void setKeyLayerSizeP(Dimension2D d)
Set the size of the key layer in physical coordinates.

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.VetoableChangeListener l)
Description copied from class: javax.swing.JComponent
Adds a VetoableChangeListener to the listener list. The listener is registered for all properties.
Overrides:
addVetoableChangeListener in class javax.swing.JComponent
Following copied from class: javax.swing.JComponent
Parameters:
listener - the VetoableChangeListener to be added

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener l)
Description copied from class: javax.swing.JComponent
Removes a VetoableChangeListener from the listener list. This removes a VetoableChangeListener that was registered for all properties.
Overrides:
removeVetoableChangeListener in class javax.swing.JComponent
Following copied from class: javax.swing.JComponent
Parameters:
listener - the VetoableChangeListener to be removed

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface: AbstractPane
Add a PropertyChangeListener to the list. Properties for Pane and JPane include "objectSelected" and "zoomRectangle".
Overrides:
addPropertyChangeListener in class JPane
Following copied from class: javax.swing.JComponent
Parameters:
listener - the PropertyChangeListener to be added

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface: AbstractPane
Remove the PropertyChangeListener from the list.
Overrides:
removePropertyChangeListener in class JPane
Following copied from class: javax.swing.JComponent
Parameters:
listener - the PropertyChangeListener to be removed


Send comments about the Scientific Graphics toolkit to dwd@pmel.noaa.gov. For more information about Java Development in the EPIC Group see the EPIC Software Page
Generated on December 13 2001