edu.psu.geovista.app.scatterplot
Class ScatterPlot

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byedu.psu.geovista.app.scatterplot.ScatterPlot
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ComponentListener, java.util.EventListener, ExcentricLabelClient, java.awt.image.ImageObserver, MatrixElement, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable

public class ScatterPlot
extends javax.swing.JPanel
implements java.awt.event.ComponentListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, MatrixElement, java.io.Serializable, ExcentricLabelClient

put your documentation comment here

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
static double AXISSPACEPORTION
           
static java.lang.String COMMAND_DATARANGE_SET
           
static java.lang.String COMMAND_POINT_SELECTED
           
 
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 edu.psu.geovista.app.matrix.MatrixElement
COMMAND_COLOR_CLASSFICIATION
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ScatterPlot()
          put your documentation comment here
ScatterPlot(java.lang.Object[] dataObject, int[] dataIndices, boolean axisOn, java.awt.Color c)
          put your documentation comment here
 
Method Summary
 void addActionListener(java.awt.event.ActionListener l)
          adds an ActionListener to the button
 void addIndicationListener(edu.psu.geovista.ui.event.IndicationListener l)
          adds an IndicationListener to the button
 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 fireActionPerformed(java.lang.String command)
          Notify all listeners that have registered interest for notification on this event type.
 edu.psu.geovista.symbolization.BivariateColorSymbolClassification getBivarColorClasser()
           
 java.awt.Color[] getColors()
           
 int[] getElementPosition()
          put your documentation comment here
 java.lang.String getObservationLabel(int i)
           
 java.util.Vector getSelectedObservations()
          Return selections from this scatterplot.
 java.awt.Color getSelectionColor()
           
 int[] getSelections()
          Return selections from this scatterplot.
 boolean getSelOriginalColorMode()
           
 java.awt.Shape getShapeAt(int i)
           
 java.lang.String getShortDiscription()
           
 MatrixElement getThis()
          Return itself.
 double[] getXAxisExtents()
          put your documentation comment here
 double[] getYAxisExtents()
          put your documentation comment here
 boolean isAxisOn()
          If AxisOn is true, it will be a detailed version of scatterplot with axises.
static void main(java.lang.String[] args)
          Test file.
 void makeColors()
           
 void mouseClicked(java.awt.event.MouseEvent e)
          Mouse click for selecting or brushing points (observations).
 void mouseDragged(java.awt.event.MouseEvent e)
          Work with mouseReleased to draw a selection region (box) for selection.
 void mouseEntered(java.awt.event.MouseEvent e)
          put your documentation comment here
 void mouseExited(java.awt.event.MouseEvent e)
          put your documentation comment here
 void mouseMoved(java.awt.event.MouseEvent e)
          Mouse over, it will show the values for current point by tool tip.
 void mousePressed(java.awt.event.MouseEvent e)
          Begin the drawing of selection region (box).
 void mouseReleased(java.awt.event.MouseEvent e)
          Work with mouseDragged to draw a selection region (box) for selection.
 void paintComponent(java.awt.Graphics g)
          Draw the scatter plot.
 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 button
 void setAttributeArrays(java.lang.String[] attributeArrays)
          put your documentation comment here
 void setAxisOn(boolean axisOn)
           
 void setBackground(java.awt.Color c)
          put your documentation comment here
 void setBivarColorClasser(edu.psu.geovista.symbolization.BivariateColorSymbolClassification bivarColorClasser, boolean reverseColor)
          Sets colors for the current data.
 void setColorArrayForObs(java.awt.Color[] colorArray)
           
 void setConditionArray(int[] conditionArray)
          put your documentation comment here
 void setDataIndices(int[] dataIndices)
          Not used in dataObject version.
 void setDataObject(java.lang.Object[] data)
          Set up data.
 void setDoubleDataArrays(double[][] doubleDataArrays)
          put your documentation comment here
 void setElementPosition(int[] indices)
          Set up x and y axises in each element by setting the attributes displayed.
 void setIndication(int indication)
           
 void setMultipleSelectionColors(java.awt.Color[] c)
           
 void setPointSelected(boolean pointselected)
           
 void setSelectedObservations(java.util.Vector selectedObservations)
          Set up selections from other components.
 void setSelectionColor(java.awt.Color c)
           
 void setSelections(int[] selectedObservations)
           
 void setSelOriginalColorMode(boolean selOriginalColorMode)
           
 void setX(double[] dataX)
          put your documentation comment here
 void setXAxisExtents(double[] xAxisExtents)
          Minimum and maximum values for xAxis.
 void setY(double[] dataY)
          put your documentation comment here
 void setYAxisExtents(double[] yAxisExtents)
          put your documentation comment here
 
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

AXISSPACEPORTION

public static double AXISSPACEPORTION

COMMAND_POINT_SELECTED

public static final java.lang.String COMMAND_POINT_SELECTED
See Also:
Constant Field Values

COMMAND_DATARANGE_SET

public static final java.lang.String COMMAND_DATARANGE_SET
See Also:
Constant Field Values
Constructor Detail

ScatterPlot

public ScatterPlot()
put your documentation comment here


ScatterPlot

public ScatterPlot(java.lang.Object[] dataObject,
                   int[] dataIndices,
                   boolean axisOn,
                   java.awt.Color c)
put your documentation comment here

Method Detail

setDataObject

public void setDataObject(java.lang.Object[] data)
Set up data.

Specified by:
setDataObject in interface MatrixElement
Parameters:
data -

setDoubleDataArrays

public void setDoubleDataArrays(double[][] doubleDataArrays)
put your documentation comment here

Parameters:
doubleDataArrays -

setDataIndices

public void setDataIndices(int[] dataIndices)
Not used in dataObject version.

Parameters:
dataIndices -

setElementPosition

public void setElementPosition(int[] indices)
Set up x and y axises in each element by setting the attributes displayed.

Specified by:
setElementPosition in interface MatrixElement
Parameters:
indices -

getElementPosition

public int[] getElementPosition()
put your documentation comment here

Specified by:
getElementPosition in interface MatrixElement
Returns:

setAttributeArrays

public void setAttributeArrays(java.lang.String[] attributeArrays)
put your documentation comment here

Parameters:
attributeArrays -

setX

public void setX(double[] dataX)
put your documentation comment here

Parameters:
dataX -

setY

public void setY(double[] dataY)
put your documentation comment here

Parameters:
dataY -

setAxisOn

public void setAxisOn(boolean axisOn)
Specified by:
setAxisOn in interface MatrixElement

setXAxisExtents

public void setXAxisExtents(double[] xAxisExtents)
Minimum and maximum values for xAxis. xAxisExtents[0] = min, xAxisExtents[1] = max.

Specified by:
setXAxisExtents in interface MatrixElement
Parameters:
xAxisExtents -

setYAxisExtents

public void setYAxisExtents(double[] yAxisExtents)
put your documentation comment here

Specified by:
setYAxisExtents in interface MatrixElement
Parameters:
yAxisExtents -

getXAxisExtents

public double[] getXAxisExtents()
put your documentation comment here

Specified by:
getXAxisExtents in interface MatrixElement
Returns:

getYAxisExtents

public double[] getYAxisExtents()
put your documentation comment here

Specified by:
getYAxisExtents in interface MatrixElement
Returns:

setConditionArray

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

Specified by:
setConditionArray in interface MatrixElement
Parameters:
conditionArray -

setColorArrayForObs

public void setColorArrayForObs(java.awt.Color[] colorArray)
Specified by:
setColorArrayForObs in interface MatrixElement

setBackground

public void setBackground(java.awt.Color c)
put your documentation comment here

Specified by:
setBackground in interface MatrixElement
Parameters:
c -

setSelectionColor

public void setSelectionColor(java.awt.Color c)
Specified by:
setSelectionColor in interface MatrixElement

getSelectionColor

public java.awt.Color getSelectionColor()

getSelOriginalColorMode

public boolean getSelOriginalColorMode()

setSelOriginalColorMode

public void setSelOriginalColorMode(boolean selOriginalColorMode)
Specified by:
setSelOriginalColorMode in interface MatrixElement

setPointSelected

public void setPointSelected(boolean pointselected)

setMultipleSelectionColors

public void setMultipleSelectionColors(java.awt.Color[] c)
Specified by:
setMultipleSelectionColors in interface MatrixElement

getColors

public java.awt.Color[] getColors()

getThis

public MatrixElement getThis()
Return itself.

Returns:

getShortDiscription

public java.lang.String getShortDiscription()
Specified by:
getShortDiscription in interface MatrixElement

paintComponent

public void paintComponent(java.awt.Graphics g)
Draw the scatter plot.

Parameters:
g -

getSelectedObservations

public java.util.Vector getSelectedObservations()
Return selections from this scatterplot.

Specified by:
getSelectedObservations in interface MatrixElement
Returns:

setSelectedObservations

public void setSelectedObservations(java.util.Vector selectedObservations)
Set up selections from other components.

Specified by:
setSelectedObservations in interface MatrixElement
Parameters:
selectedObservations -

setSelections

public void setSelections(int[] selectedObservations)
Specified by:
setSelections in interface MatrixElement

getSelections

public int[] getSelections()
Return selections from this scatterplot.

Specified by:
getSelections in interface MatrixElement
Returns:

setIndication

public void setIndication(int indication)
Specified by:
setIndication in interface MatrixElement

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

componentHidden

public void componentHidden(java.awt.event.ComponentEvent e)
Specified by:
componentHidden 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

componentShown

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

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Begin the drawing of selection region (box).

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

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Work with mouseDragged to draw a selection region (box) for selection.

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

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
put your documentation comment here

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

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Work with mouseReleased to draw a selection region (box) for selection.

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

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Mouse over, it will show the values for current point by tool tip.

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

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
put your documentation comment here

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

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Mouse click for selecting or brushing points (observations).

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

addIndicationListener

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

Specified by:
addIndicationListener in interface MatrixElement

removeIndicationListener

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

Specified by:
removeIndicationListener in interface MatrixElement

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
adds an ActionListener to the button

Specified by:
addActionListener in interface MatrixElement

removeActionListener

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


fireActionPerformed

public 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

isAxisOn

public boolean isAxisOn()
If AxisOn is true, it will be a detailed version of scatterplot with axises.

Returns:

setBivarColorClasser

public void setBivarColorClasser(edu.psu.geovista.symbolization.BivariateColorSymbolClassification bivarColorClasser,
                                 boolean reverseColor)
Sets colors for the current data.

Specified by:
setBivarColorClasser in interface MatrixElement

getBivarColorClasser

public edu.psu.geovista.symbolization.BivariateColorSymbolClassification getBivarColorClasser()
Specified by:
getBivarColorClasser in interface MatrixElement

makeColors

public void makeColors()

main

public static void main(java.lang.String[] args)
Test file.

Parameters:
args -


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