uci.gef
Class ModeDragScroll

java.lang.Object
  |
  +--uci.gef.Mode
        |
        +--uci.gef.ModeDragScroll

public class ModeDragScroll
extends Mode
implements ActionListener

A Mode that allows the user to scroll the Editor by clicking and dragging with the middle mouse button.

See Also:
Mode, Editor, Serialized Form

Fields inherited from class uci.gef.Mode
_args, _editor
 
Constructor Summary
ModeDragScroll()
          Construct a new ModeDragScroll instance.
ModeDragScroll(Editor par)
          Construct a new ModeDragScroll with the given parent.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Called by the autoTimer to scroll once during autoscrolling.
 boolean canExit()
          Always false since this mode can never be exited.
 String instructions()
          Instructions for the user.
 void mouseDragged(MouseEvent me)
          If mouse is outside the component, begins autoscrolling or speeds it up.
 void mouseEntered(MouseEvent me)
          If mouse re-enters component, stops autoscrolling.
 void mousePressed(MouseEvent me)
          Grabs component to begin scrolling.
 void mouseReleased(MouseEvent me)
          Stops autoscrolling.
 
Methods inherited from class uci.gef.Mode
done, getArg, getArgs, getEditor, getInitialCursor, keyPressed, keyReleased, keyTyped, mouseClicked, mouseExited, mouseMoved, paint, print, setArg, setArgs, setCursor, setEditor, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModeDragScroll

public ModeDragScroll(Editor par)
Construct a new ModeDragScroll with the given parent.
Parameters:
par - The Editor this Mode will drag

ModeDragScroll

public ModeDragScroll()
Construct a new ModeDragScroll instance. Its parent must be set before this instance can be used.
Method Detail

canExit

public boolean canExit()
Always false since this mode can never be exited.
Overrides:
canExit in class Mode

instructions

public String instructions()
Instructions for the user.
Overrides:
instructions in class Mode

mousePressed

public void mousePressed(MouseEvent me)
Grabs component to begin scrolling. Will turn cursor into a hand.
Parameters:
me -  
Overrides:
mousePressed in class Mode

mouseDragged

public void mouseDragged(MouseEvent me)
If mouse is outside the component, begins autoscrolling or speeds it up. Otherwise will just scroll.
Parameters:
me -  
Overrides:
mouseDragged in class Mode

mouseReleased

public void mouseReleased(MouseEvent me)
Stops autoscrolling.
Parameters:
me -  
Overrides:
mouseReleased in class Mode

mouseEntered

public void mouseEntered(MouseEvent me)
If mouse re-enters component, stops autoscrolling.
Parameters:
me -  
Overrides:
mouseEntered in class Mode

actionPerformed

public void actionPerformed(ActionEvent e)
Called by the autoTimer to scroll once during autoscrolling. Multithreaded note: No synchronization needed because Timers will fire this ActionEvent on the event dispatching thread
Specified by:
actionPerformed in interface ActionListener
Parameters:
e -