edu.psu.geovista.ui
Class ExcentricLabels

java.lang.Object
  extended byjava.awt.event.MouseAdapter
      extended byedu.psu.geovista.ui.ExcentricLabels
All Implemented Interfaces:
java.util.Comparator, java.util.EventListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

public class ExcentricLabels
extends java.awt.event.MouseAdapter
implements java.util.Comparator, java.awt.event.MouseMotionListener

Display excentric labels around items in a visualization.

Version:
$Revision: 1.2 $
Author:
Jean-Daniel Fekete

Constructor Summary
ExcentricLabels()
          Constructor for ExcentricLabels.
 
Method Summary
protected  double comparableValueLeft(java.awt.geom.Point2D.Double pos)
           
protected  double comparableValueRight(java.awt.geom.Point2D.Double pos)
           
 int compare(java.lang.Object o1, java.lang.Object o2)
          For sorting points vertically.
protected  void computeExcentricLabels(java.awt.Graphics2D graphics, java.awt.geom.Rectangle2D bounds)
           
protected  void computeItemPositions(java.awt.Graphics2D graphics, java.awt.geom.Rectangle2D bounds)
           
 java.awt.Color getBackgroundColor()
          Returns the backgroundColor.
 int getFocusSize()
          Returns the focusSize.
 int getGap()
          Returns the gap.
 int getMaxLabels()
          Returns the maxLabels.
 int getThreshold()
          Returns the threshold.
 boolean isOpaque()
          Returns the opaque.
 boolean isVisible()
          Returns the visible.
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void paint(java.awt.Graphics2D graphics, java.awt.geom.Rectangle2D bounds)
           
protected  void projectLeftRight(java.awt.Graphics2D graphics, java.awt.geom.Rectangle2D bounds)
           
 void setBackgroundColor(java.awt.Color backgroundColor)
          Sets the backgroundColor.
 void setComponent(javax.swing.JComponent c)
           
 void setFocusSize(int focusSize)
          Sets the focusSize.
 void setGap(int gap)
          Sets the gap.
 void setMaxLabels(int maxLabels)
          Sets the maxLabels.
 void setOpaque(boolean opaque)
          Sets the opaque.
 void setThreshold(int threshold)
          Sets the threshold.
 void setVisible(boolean visible)
          Sets the visible.
 
Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseReleased
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

ExcentricLabels

public ExcentricLabels()
Constructor for ExcentricLabels.

Method Detail

setComponent

public void setComponent(javax.swing.JComponent c)
See Also:
JToolTip.setComponent(JComponent)

paint

public void paint(java.awt.Graphics2D graphics,
                  java.awt.geom.Rectangle2D bounds)

computeExcentricLabels

protected void computeExcentricLabels(java.awt.Graphics2D graphics,
                                      java.awt.geom.Rectangle2D bounds)

computeItemPositions

protected void computeItemPositions(java.awt.Graphics2D graphics,
                                    java.awt.geom.Rectangle2D bounds)

comparableValueLeft

protected double comparableValueLeft(java.awt.geom.Point2D.Double pos)

comparableValueRight

protected double comparableValueRight(java.awt.geom.Point2D.Double pos)

projectLeftRight

protected void projectLeftRight(java.awt.Graphics2D graphics,
                                java.awt.geom.Rectangle2D bounds)

isVisible

public boolean isVisible()
Returns the visible.

Returns:
boolean

setVisible

public void setVisible(boolean visible)
Sets the visible.

Parameters:
visible - The visible to set

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
For sorting points vertically.

Specified by:
compare in interface java.util.Comparator
See Also:
Comparator.compare(Object, Object)

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener
See Also:
MouseAdapter.mouseEntered(MouseEvent)

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener
See Also:
MouseAdapter.mouseExited(MouseEvent)

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener
See Also:
MouseAdapter.mousePressed(MouseEvent)

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
See Also:
MouseMotionListener.mouseDragged(MouseEvent)

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
See Also:
MouseMotionListener.mouseMoved(MouseEvent)

getGap

public int getGap()
Returns the gap.

Returns:
int

setGap

public void setGap(int gap)
Sets the gap.

Parameters:
gap - The gap to set

getMaxLabels

public int getMaxLabels()
Returns the maxLabels.

Returns:
int

setMaxLabels

public void setMaxLabels(int maxLabels)
Sets the maxLabels.

Parameters:
maxLabels - The maxLabels to set

getThreshold

public int getThreshold()
Returns the threshold. When the mouse moves a distance larger than this threshold since the last event, excentric labels are disabled.

Returns:
int

setThreshold

public void setThreshold(int threshold)
Sets the threshold. When the mouse moves a distance larger than the specified threshold since the last event, excentric labels are disabled.

Parameters:
threshold - The threshold to set

getFocusSize

public int getFocusSize()
Returns the focusSize.

Returns:
int

setFocusSize

public void setFocusSize(int focusSize)
Sets the focusSize.

Parameters:
focusSize - The focusSize to set

getBackgroundColor

public java.awt.Color getBackgroundColor()
Returns the backgroundColor.

Returns:
Color

isOpaque

public boolean isOpaque()
Returns the opaque.

Returns:
boolean

setBackgroundColor

public void setBackgroundColor(java.awt.Color backgroundColor)
Sets the backgroundColor.

Parameters:
backgroundColor - The backgroundColor to set

setOpaque

public void setOpaque(boolean opaque)
Sets the opaque.

Parameters:
opaque - The opaque to set


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