edu.psu.geovista.app.parvis.gui
Class BasicParallelDisplayUI

java.lang.Object
  extended byjavax.swing.plaf.ComponentUI
      extended byedu.psu.geovista.app.parvis.gui.ParallelDisplayUI
          extended byedu.psu.geovista.app.parvis.gui.BasicParallelDisplayUI
All Implemented Interfaces:
java.util.EventListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

public class BasicParallelDisplayUI
extends ParallelDisplayUI
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener

The UI Delegate, responsible for rendering the ParallelDisplay component.

Version:
0.1
Author:
Flo Ledermann flo@subnet.at

Constructor Summary
BasicParallelDisplayUI()
          Default Constructor.
 
Method Summary
 void createBrushImage(ParallelDisplay comp)
           
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
          Swing method.
 int[] getAllRecordsByCoordinates(java.awt.geom.Rectangle2D hitBox, ParallelDisplay comp)
          Returns the record that goes through the screen coordinates x,y.
 int getRecordByCoordinates(int x, int y, ParallelDisplay comp)
          Returns the record that goes through the screen coordinates x,y.
 void installUI(javax.swing.JComponent c)
          Installs this instance as UI delegate for the given component.
 void mouseClicked(java.awt.event.MouseEvent e)
          Invoked when the mouse has been clicked on a component.
 void mouseDragged(java.awt.event.MouseEvent e)
          Invoked when a mouse button is pressed on a component and then dragged.
 void mouseEntered(java.awt.event.MouseEvent e)
          Invoked when the mouse enters a component.
 void mouseExited(java.awt.event.MouseEvent e)
          Invoked when the mouse exits the component.
 void mouseMoved(java.awt.event.MouseEvent e)
          Invoked when the mouse button has been moved on a component (with no buttons no down).
 void mousePressed(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been pressed on a component.
 void mouseReleased(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been released on a component.
 void paint(java.awt.Graphics g, javax.swing.JComponent c)
          Renders the component on the screen.
 void renderBrush()
           
 void setColors(java.awt.Color[] colors)
           
 void setConditioning(int[] conditioning)
           
 void setHoverRecord(int record, ParallelDisplay comp)
          Added by Frank Hardisty 19 July 2002 This method is called to create a hover record from outside the component
 void uninstallUI(javax.swing.JComponent c)
          Uninstalls this instance from its component.
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicParallelDisplayUI

public BasicParallelDisplayUI()
Default Constructor. Creates a new BasicParallelDisplayUI.

Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
Swing method. Returns a new instance.


installUI

public void installUI(javax.swing.JComponent c)
Installs this instance as UI delegate for the given component.

Parameters:
c - The component, a ParallelDisplay in our case.

uninstallUI

public void uninstallUI(javax.swing.JComponent c)
Uninstalls this instance from its component.

Parameters:
c - The component, a ParallelDisplay in our case.

paint

public void paint(java.awt.Graphics g,
                  javax.swing.JComponent c)
Renders the component on the screen.

Parameters:
g - The graphics object to draw on.
c - The Component, our ParallelDisplay.

renderBrush

public void renderBrush()
Specified by:
renderBrush in class ParallelDisplayUI

setColors

public void setColors(java.awt.Color[] colors)

setConditioning

public void setConditioning(int[] conditioning)

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits the component.

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

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component. Checks if something has been dragged and finishes the drag process.

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

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component. Checks if the user starts dragging something.

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

createBrushImage

public void createBrushImage(ParallelDisplay comp)
Specified by:
createBrushImage in class ParallelDisplayUI

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Invoked when a mouse button is pressed on a component and then dragged. Mouse drag events will continue to be delivered to the component where the first originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component). Depending on the current mode, this method performs scaling, translating or reordering of axes.

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

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse has been clicked on a component. Checks if the click hit an arrow and inverts the corresponding axis.

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

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component.

Specified by:
mouseEntered in interface java.awt.event.MouseListener

setHoverRecord

public void setHoverRecord(int record,
                           ParallelDisplay comp)
Added by Frank Hardisty 19 July 2002 This method is called to create a hover record from outside the component


mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Invoked when the mouse button has been moved on a component (with no buttons no down). Displays tooltips if mouse is hovering over axes or records.

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

getRecordByCoordinates

public int getRecordByCoordinates(int x,
                                  int y,
                                  ParallelDisplay comp)
Returns the record that goes through the screen coordinates x,y. The first record that is found is returned.

Parameters:
x - The x screen coordinate.
y - The y screen coordinate.
comp - The "parent" component.
Returns:
The recordnumber of the first record found passing through the given point.

getAllRecordsByCoordinates

public int[] getAllRecordsByCoordinates(java.awt.geom.Rectangle2D hitBox,
                                        ParallelDisplay comp)
Returns the record that goes through the screen coordinates x,y. The first record that is found is returned.

Parameters:
comp - The "parent" component.
Returns:
The recordnumber of the first record found passing through the given point.


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