edu.psu.geovista.app.map
Class MapCanvas

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byedu.psu.geovista.app.map.MapCanvas
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.awt.event.ComponentListener, edu.psu.geovista.ui.event.DataSetListener, java.util.EventListener, ExcentricLabelClient, java.awt.image.ImageObserver, edu.psu.geovista.ui.event.IndicationListener, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, edu.psu.geovista.ui.event.SelectionListener, java.io.Serializable, edu.psu.geovista.ui.event.SpatialExtentListener
Direct Known Subclasses:
MapMatrixElement

public class MapCanvas
extends javax.swing.JPanel
implements java.awt.event.ComponentListener, java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, edu.psu.geovista.ui.event.SelectionListener, edu.psu.geovista.ui.event.IndicationListener, edu.psu.geovista.ui.event.DataSetListener, edu.psu.geovista.ui.event.SpatialExtentListener, ExcentricLabelClient

This class handles the rendering of layer-independent objects like tooltips and the image used for buffering, and manages the layers, which render themselves to the image. This class also transforms spatial data into user space. This class is intended to be used inside other components like the GeoMap or the PlotMatrix.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  boolean autofit
           
protected  edu.psu.geovista.symbolization.BivariateColorSymbolClassificationSimple bivarColorClasser
           
protected  ExcentricLabels exLabels
           
protected  Fisheyes fisheyes
           
static int MODE_EXCENTRIC
           
static int MODE_FISHEYE
           
static int MODE_MAGNIFYING
           
static int MODE_PAN
           
static int MODE_SELECT
           
static int MODE_ZOOM_IN
           
static int MODE_ZOOM_OUT
           
 
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
MapCanvas()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addActionListener(java.awt.event.ActionListener l)
          implements ActionListener
 void addIndicationListener(edu.psu.geovista.ui.event.IndicationListener l)
          adds an IndicationListener
 void addSelectionListener(edu.psu.geovista.ui.event.SelectionListener l)
          adds an SelectionListener
 void addSpatialExtentListener(edu.psu.geovista.ui.event.SpatialExtentListener l)
          adds an SpatialExtentListener
 void componentHidden(java.awt.event.ComponentEvent e)
           
 void componentMoved(java.awt.event.ComponentEvent e)
           
 void componentResized(java.awt.event.ComponentEvent e)
           
 void componentShown(java.awt.event.ComponentEvent e)
           
 void dataSetChanged(edu.psu.geovista.ui.event.DataSetEvent e)
           
 java.awt.Shape[] findFullExtentSpatialData(java.awt.Shape[] originalShapes, boolean useSavedSrc)
           
 java.awt.Shape[] findUserSpaceSpatialData(java.awt.Shape[] originalShapes, java.awt.geom.Rectangle2D dest, boolean useSavedSrc)
           
protected  void fireActionPerformed(java.lang.String command)
          Notify all listeners that have registered interest for notification on this event type.
 java.awt.Color[] getColors()
           
 int getCurrColorColumnX()
           
 int getCurrColorColumnY()
           
 java.lang.String getObservationLabel(int i)
           
 java.util.Vector getSelectedObservations()
           
 int[] getSelectedObservationsInt()
           
 int[] getSelections()
           
 boolean getSelOriginalColorMode()
           
 java.awt.Shape getShapeAt(int i)
           
 void indicationChanged(edu.psu.geovista.ui.event.IndicationEvent e)
           
 void mouseClicked(java.awt.event.MouseEvent e)
          pop up a detail map
 void mouseDragged(java.awt.event.MouseEvent e)
          Draws a bounding box for selection.
 void mouseEntered(java.awt.event.MouseEvent e)
          makes crosshair cursor
 void mouseExited(java.awt.event.MouseEvent e)
          resets cursor
 void mouseMoved(java.awt.event.MouseEvent e)
          Activates a tool tip.
 void mousePressed(java.awt.event.MouseEvent e)
          Inits selection bounding box.
 void mouseReleased(java.awt.event.MouseEvent e)
          Makes selection.
 void paintComponent(java.awt.Graphics g)
          paints buffer, then drawing box
 void pan(int x1, int x2, int y1, int y2)
           
 void panBuff(int x1, int x2, int y1, int y2)
           
 int[] pickAll(java.awt.geom.Rectangle2D hitBox)
           
 void removeActionListener(java.awt.event.ActionListener l)
          removes an ActionListener from the button
 void removeIndicationListener(edu.psu.geovista.ui.event.IndicationListener l)
          removes an IndicationListener from the component
 void removeSelectionListener(edu.psu.geovista.ui.event.SelectionListener l)
          removes an SelectionListener from the component
 void removeSpatialExtentListener(edu.psu.geovista.ui.event.SpatialExtentListener l)
          removes an SpatialExtentListener from the component
 void selectionChanged(edu.psu.geovista.ui.event.SelectionEvent e)
           
 void setAuxiliarySpatialData(edu.psu.geovista.data.geog.DataSetForApps auxData)
           
 void setAuxiliarySpatialData(java.lang.Object[] spatialDataIn)
           
 void setBackground(java.awt.Color c)
           
 void setBivarColorClasser(edu.psu.geovista.symbolization.BivariateColorSymbolClassification bivarColorClasser)
           
 void setColorSelection(java.awt.Color colorSelection)
           
 void setConditionArray(int[] conditionArray)
          put your documentation comment here
 void setCurrColorColumnX(int currColorColumnX)
           
 void setCurrColorColumnY(int currColorColumnY)
           
 void setDataSet(edu.psu.geovista.data.geog.DataSetForApps dataSet)
           
 void setDataSet(java.lang.Object[] dataSetIn)
           
 void setIndication(int indication)
           
 void setMode(int mode)
           
 void setObservationColors(java.awt.Color[] obsColors)
          Set colors for observations.
 void setSelectedObservations(java.util.Vector selectedObservations)
           
 void setSelectedObservationsInt(int[] selectedObservations)
           
 void setSelections(int[] selections)
           
 void setSelOriginalColorMode(boolean selOriginalColorMode)
           
 void setTransformer(ShapeTransformer transformer)
           
 void spatialExtentChanged(edu.psu.geovista.ui.event.SpatialExtentEvent e)
           
protected  void tickleColors()
           
 void zoomFullExtent()
           
 void zoomIn(int x1, int x2, int y1, int y2)
           
 void zoomOut(int x1, int x2, int y1, int y2)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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
 
Methods inherited from interface edu.psu.geovista.ui.ExcentricLabelClient
repaint
 

Field Detail

MODE_SELECT

public static int MODE_SELECT

MODE_ZOOM_IN

public static int MODE_ZOOM_IN

MODE_ZOOM_OUT

public static int MODE_ZOOM_OUT

MODE_PAN

public static int MODE_PAN

MODE_EXCENTRIC

public static int MODE_EXCENTRIC

MODE_FISHEYE

public static int MODE_FISHEYE

MODE_MAGNIFYING

public static int MODE_MAGNIFYING

bivarColorClasser

protected transient edu.psu.geovista.symbolization.BivariateColorSymbolClassificationSimple bivarColorClasser

exLabels

protected transient ExcentricLabels exLabels

autofit

protected transient boolean autofit

fisheyes

protected Fisheyes fisheyes
Constructor Detail

MapCanvas

public MapCanvas()
Method Detail

setObservationColors

public void setObservationColors(java.awt.Color[] obsColors)
Set colors for observations. Normally this method is called by other components that classify or cluster data observations and assign colors.


findUserSpaceSpatialData

public java.awt.Shape[] findUserSpaceSpatialData(java.awt.Shape[] originalShapes,
                                                 java.awt.geom.Rectangle2D dest,
                                                 boolean useSavedSrc)

findFullExtentSpatialData

public java.awt.Shape[] findFullExtentSpatialData(java.awt.Shape[] originalShapes,
                                                  boolean useSavedSrc)

zoomFullExtent

public void zoomFullExtent()

spatialExtentChanged

public void spatialExtentChanged(edu.psu.geovista.ui.event.SpatialExtentEvent e)
Specified by:
spatialExtentChanged in interface edu.psu.geovista.ui.event.SpatialExtentListener

zoomIn

public void zoomIn(int x1,
                   int x2,
                   int y1,
                   int y2)

zoomOut

public void zoomOut(int x1,
                    int x2,
                    int y1,
                    int y2)

pan

public void pan(int x1,
                int x2,
                int y1,
                int y2)

panBuff

public void panBuff(int x1,
                    int x2,
                    int y1,
                    int y2)

componentHidden

public void componentHidden(java.awt.event.ComponentEvent e)
Specified by:
componentHidden in interface java.awt.event.ComponentListener

tickleColors

protected void tickleColors()

componentShown

public void componentShown(java.awt.event.ComponentEvent e)
Specified by:
componentShown in interface java.awt.event.ComponentListener

componentMoved

public void componentMoved(java.awt.event.ComponentEvent e)
Specified by:
componentMoved in interface java.awt.event.ComponentListener

componentResized

public void componentResized(java.awt.event.ComponentEvent e)
Specified by:
componentResized in interface java.awt.event.ComponentListener

setMode

public void setMode(int mode)

setBivarColorClasser

public void setBivarColorClasser(edu.psu.geovista.symbolization.BivariateColorSymbolClassification bivarColorClasser)

setAuxiliarySpatialData

public void setAuxiliarySpatialData(java.lang.Object[] spatialDataIn)

setAuxiliarySpatialData

public void setAuxiliarySpatialData(edu.psu.geovista.data.geog.DataSetForApps auxData)

setDataSet

public void setDataSet(java.lang.Object[] dataSetIn)

setDataSet

public void setDataSet(edu.psu.geovista.data.geog.DataSetForApps dataSet)

setTransformer

public void setTransformer(ShapeTransformer transformer)

setCurrColorColumnX

public void setCurrColorColumnX(int currColorColumnX)

getCurrColorColumnX

public int getCurrColorColumnX()

getColors

public java.awt.Color[] getColors()

setCurrColorColumnY

public void setCurrColorColumnY(int currColorColumnY)

getCurrColorColumnY

public int getCurrColorColumnY()

setIndication

public void setIndication(int indication)

setSelectedObservations

public void setSelectedObservations(java.util.Vector selectedObservations)

getSelectedObservations

public java.util.Vector getSelectedObservations()

setSelections

public void setSelections(int[] selections)

getSelections

public int[] getSelections()

selectionChanged

public void selectionChanged(edu.psu.geovista.ui.event.SelectionEvent e)
Specified by:
selectionChanged in interface edu.psu.geovista.ui.event.SelectionListener

indicationChanged

public void indicationChanged(edu.psu.geovista.ui.event.IndicationEvent e)
Specified by:
indicationChanged in interface edu.psu.geovista.ui.event.IndicationListener

dataSetChanged

public void dataSetChanged(edu.psu.geovista.ui.event.DataSetEvent e)
Specified by:
dataSetChanged in interface edu.psu.geovista.ui.event.DataSetListener

setSelectedObservationsInt

public void setSelectedObservationsInt(int[] selectedObservations)

getSelectedObservationsInt

public int[] getSelectedObservationsInt()

setColorSelection

public void setColorSelection(java.awt.Color colorSelection)

getSelOriginalColorMode

public boolean getSelOriginalColorMode()

setSelOriginalColorMode

public void setSelOriginalColorMode(boolean selOriginalColorMode)

setBackground

public void setBackground(java.awt.Color c)

setConditionArray

public void setConditionArray(int[] conditionArray)
put your documentation comment here

Parameters:
conditionArray -

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Draws a bounding box for selection.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Parameters:
e -

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Activates a tool tip.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Parameters:
e -

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Inits selection bounding box.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
e -

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Makes selection.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
e -

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
makes crosshair cursor

Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
e -

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
resets cursor

Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
e -

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
pop up a detail map

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
e -

paintComponent

public void paintComponent(java.awt.Graphics g)
paints buffer, then drawing box

Parameters:
g -

getObservationLabel

public java.lang.String getObservationLabel(int i)
Specified by:
getObservationLabel in interface ExcentricLabelClient

getShapeAt

public java.awt.Shape getShapeAt(int i)
Specified by:
getShapeAt in interface ExcentricLabelClient

pickAll

public int[] pickAll(java.awt.geom.Rectangle2D hitBox)
Specified by:
pickAll in interface ExcentricLabelClient

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
implements ActionListener


removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
removes an ActionListener from the button


fireActionPerformed

protected void fireActionPerformed(java.lang.String command)
Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.

See Also:
EventListenerList

addIndicationListener

public void addIndicationListener(edu.psu.geovista.ui.event.IndicationListener l)
adds an IndicationListener


removeIndicationListener

public void removeIndicationListener(edu.psu.geovista.ui.event.IndicationListener l)
removes an IndicationListener from the component


addSelectionListener

public void addSelectionListener(edu.psu.geovista.ui.event.SelectionListener l)
adds an SelectionListener


removeSelectionListener

public void removeSelectionListener(edu.psu.geovista.ui.event.SelectionListener l)
removes an SelectionListener from the component


addSpatialExtentListener

public void addSpatialExtentListener(edu.psu.geovista.ui.event.SpatialExtentListener l)
adds an SpatialExtentListener


removeSpatialExtentListener

public void removeSpatialExtentListener(edu.psu.geovista.ui.event.SpatialExtentListener l)
removes an SpatialExtentListener from the component



Copyright © 1996-2003 GeoVista Center. All Rights Reserved.