prefuse.controls
Class NeighborHighlightControl

java.lang.Object
  extended by prefuse.controls.ControlAdapter
      extended by prefuse.controls.NeighborHighlightControl
All Implemented Interfaces:
java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener, Control

public class NeighborHighlightControl
extends ControlAdapter

A ControlListener that sets the highlighted status (using the VisualItem.setHighlighted method) for nodes neighboring the node currently under the mouse pointer. The highlight flag might then be used by a color function to change node appearance as desired.

Author:
jeffrey heer

Field Summary
 
Fields inherited from interface prefuse.controls.Control
LEFT_MOUSE_BUTTON, MIDDLE_MOUSE_BUTTON, RIGHT_MOUSE_BUTTON
 
Constructor Summary
NeighborHighlightControl()
          Creates a new highlight control.
NeighborHighlightControl(java.lang.String activity)
          Creates a new highlight control that runs the given activity whenever the neighbor highlight changes.
 
Method Summary
 boolean isHighlightWithInvisibleEdge()
          Indicates if neighbor nodes with edges currently not visible still get highlighted.
 void itemEntered(VisualItem item, java.awt.event.MouseEvent e)
          Invoked when the mouse enters a VisualItem.
 void itemExited(VisualItem item, java.awt.event.MouseEvent e)
          Invoked when the mouse exits a VisualItem.
 void setHighlightWithInvisibleEdge(boolean highlightWithInvisibleEdge)
          Determines if neighbor nodes with edges currently not visible still get highlighted.
protected  void setNeighborHighlight(NodeItem n, boolean state)
          Set the highlighted state of the neighbors of a node.
 
Methods inherited from class prefuse.controls.ControlAdapter
isEnabled, itemClicked, itemDragged, itemKeyPressed, itemKeyReleased, itemKeyTyped, itemMoved, itemPressed, itemReleased, itemWheelMoved, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NeighborHighlightControl

public NeighborHighlightControl()
Creates a new highlight control.


NeighborHighlightControl

public NeighborHighlightControl(java.lang.String activity)
Creates a new highlight control that runs the given activity whenever the neighbor highlight changes.

Parameters:
activity - the update Activity to run
Method Detail

itemEntered

public void itemEntered(VisualItem item,
                        java.awt.event.MouseEvent e)
Description copied from interface: Control
Invoked when the mouse enters a VisualItem.

Specified by:
itemEntered in interface Control
Overrides:
itemEntered in class ControlAdapter
See Also:
Control.itemEntered(prefuse.visual.VisualItem, java.awt.event.MouseEvent)

itemExited

public void itemExited(VisualItem item,
                       java.awt.event.MouseEvent e)
Description copied from interface: Control
Invoked when the mouse exits a VisualItem.

Specified by:
itemExited in interface Control
Overrides:
itemExited in class ControlAdapter
See Also:
Control.itemExited(prefuse.visual.VisualItem, java.awt.event.MouseEvent)

setNeighborHighlight

protected void setNeighborHighlight(NodeItem n,
                                    boolean state)
Set the highlighted state of the neighbors of a node.

Parameters:
n - the node under consideration
state - the highlighting state to apply to neighbors

isHighlightWithInvisibleEdge

public boolean isHighlightWithInvisibleEdge()
Indicates if neighbor nodes with edges currently not visible still get highlighted.

Returns:
true if neighbors with invisible edges still get highlighted, false otherwise.

setHighlightWithInvisibleEdge

public void setHighlightWithInvisibleEdge(boolean highlightWithInvisibleEdge)
Determines if neighbor nodes with edges currently not visible still get highlighted.

Parameters:
highlightWithInvisibleEdge - assign true if neighbors with invisible edges should still get highlighted, false otherwise.


Copyright © 2007 Regents of the University of California