Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse GEF
3.3

org.eclipse.gef.tools
Class PanningSelectionTool

java.lang.Object
  extended by

org.eclipse.gef.util.FlagSupport
      extended by

org.eclipse.gef.tools.AbstractTool
          extended by

org.eclipse.gef.tools.TargetingTool
              extended by

org.eclipse.gef.tools.SelectionTool
                  extended by
org.eclipse.gef.tools.PanningSelectionTool
All Implemented Interfaces:
RequestConstants, Tool

public class PanningSelectionTool
extends SelectionTool

A subclass of the SelectionTool that allows panning by holding down the space bar.


Nested Class Summary
 
Nested classes inherited from class org.eclipse.gef.tools. AbstractTool
AbstractTool.Input
 
Field Summary
protected static int MAX_STATE
          Max state
protected static int PAN
          The state to indicate that the space bar has been pressed but no drag has been initiated.
protected static int PAN_IN_PROGRESS
          The state to indicate that a pan is in progress.
 
Fields inherited from class org.eclipse.gef.tools. SelectionTool
MAX_FLAG, STATE_TRAVERSE_HANDLE
 
Fields inherited from class org.eclipse.gef.tools. AbstractTool
MOUSE_BUTTON_ANY, MOUSE_BUTTON1, MOUSE_BUTTON2, MOUSE_BUTTON3, PROPERTY_UNLOAD_WHEN_FINISHED, STATE_ACCESSIBLE_DRAG, STATE_ACCESSIBLE_DRAG_IN_PROGRESS, STATE_DRAG, STATE_DRAG_IN_PROGRESS, STATE_INITIAL, STATE_INVALID, STATE_TERMINAL
 
Fields inherited from interface org.eclipse.gef. RequestConstants
REQ_ADD, REQ_ALIGN, REQ_ALIGN_CHILDREN, REQ_CLONE, REQ_CONNECTION_END, REQ_CONNECTION_START, REQ_CREATE, REQ_CREATE_BENDPOINT, REQ_DELETE, REQ_DELETE_DEPENDANT, REQ_DIRECT_EDIT, REQ_MOVE, REQ_MOVE_BENDPOINT, REQ_MOVE_CHILDREN, REQ_OPEN, REQ_ORPHAN, REQ_ORPHAN_CHILDREN, REQ_RECONNECT_SOURCE, REQ_RECONNECT_TARGET, REQ_RESIZE, REQ_RESIZE_CHILDREN, REQ_SELECTION, REQ_SELECTION_HOVER
 
Constructor Summary
PanningSelectionTool ()
           
 
Method Summary
protected  boolean acceptSpaceBar (KeyEvent e)
          Returns true if spacebar condition was accepted.
protected  java.lang.String getDebugName ()
          Returns the debug name for this tool.
protected  java.lang.String getDebugNameForState (int state)
          Returns a String representation of the given state for debug purposes.
protected  Cursor getDefaultCursor ()
          Returns the cursor used under normal conditions.
protected  boolean handleButtonDown (int which)
          If there is a Handle under the mouse, this method sets the drag tracker returned from the handle.
protected  boolean handleButtonUp (int which)
          Resets this tool when the last button is released.
protected  boolean handleDrag ()
          Called whenever the mouse is being dragged.
protected  boolean handleFocusLost ()
          Sets the drag tracker to null and goes into the initial state when focus is lost.
protected  boolean handleKeyDown (KeyEvent e)
          Processes key down events.
protected  boolean handleKeyUp (KeyEvent e)
          If in the initial state and the viewer has a KeyHandler, calls KeyHandler#keyReleased(KeyEvent) sending it the given key event.
 
Methods inherited from class org.eclipse.gef.tools. SelectionTool
createHoverRequest, createTargetRequest, deactivate, eraseHoverFeedback, getCommandName, getDragTracker, getTargetHoverRequest, getTargetingConditional, handleCommandStackChanged, handleHover, handleHoverStop, handleMove, handleNativeDragFinished, handleNativeDragStarted, handleViewerExited, keyDown, keyUp, mouseDoubleClick, mouseDown, mouseDrag, mouseHover, mouseMove, mouseUp, mouseWheelScrolled, refreshCursor, setDragTracker, showHoverFeedback, updateHoverRequest, updateTargetRequest
 
Methods inherited from class org.eclipse.gef.tools. TargetingTool
doAutoexpose, eraseTargetFeedback, getAutoexposeHelper, getCommand, getExclusionSet, getTargetEditPart, getTargetRequest, handleAutoexpose, handleEnteredEditPart, handleExitingEditPart, handleInvalidInput, handleLeavingEditPart, isShowingTargetFeedback, isTargetLocked, lockTargetEditPart, resetFlags, resetHover, setAutoexposeHelper, setTargetEditPart, setTargetRequest, showTargetFeedback, unlockTargetEditPart, updateAutoexposeHelper, updateTargetUnderMouse
 
Methods inherited from class org.eclipse.gef.tools. AbstractTool
acceptArrowKey, activate, addFeedback, applyProperty, calculateCursor, commitDrag, createOperationSet, debug, executeCommand, executeCurrentCommand, focusGained, focusLost, getCurrentCommand, getCurrentInput, getCurrentViewer, getDisabledCursor, getDomain, getDragMoveDelta, getLocation, getOperationSet, getStartLocation, getState, handleDoubleClick, handleDragInProgress, handleDragStarted, handleFinished, handleFocusGained, handleKeyTraversed, handleViewerEntered, isActive, isHoverActive, isInState, isViewerImportant, keyTraversed, movedPastThreshold, nativeDragFinished, nativeDragStarted, performViewerMouseWheel, placeMouseInViewer, reactivate, releaseToolCapture, removeFeedback, setCurrentCommand, setCursor, setDefaultCursor, setDisabledCursor, setEditDomain, setHoverActive, setProperties, setStartLocation, setState, setToolCapture, setUnloadWhenFinished, setViewer, stateTransition, unloadWhenFinished, viewerEntered, viewerExited
 
Methods inherited from class org.eclipse.gef.util. FlagSupport
getFlag, setFlag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PAN

protected static final int PAN
The state to indicate that the space bar has been pressed but no drag has been initiated.

See Also:
Constant Field Values

PAN_IN_PROGRESS

protected static final int PAN_IN_PROGRESS
The state to indicate that a pan is in progress.

See Also:
Constant Field Values

MAX_STATE

protected static final int MAX_STATE
Max state

See Also:
Constant Field Values
Constructor Detail

PanningSelectionTool

public PanningSelectionTool()
Method Detail

acceptSpaceBar

protected boolean acceptSpaceBar(KeyEvent e)
Returns true if spacebar condition was accepted.

Parameters:
e - the key event
Returns:
true if the space bar was the key event.

getDebugName

protected java.lang.String getDebugName()
Description copied from class: AbstractTool
Returns the debug name for this tool.

Overrides:
getDebugName in class SelectionTool
See Also:
AbstractTool.getDebugName()

getDebugNameForState

protected java.lang.String getDebugNameForState(int state)
Description copied from class: AbstractTool
Returns a String representation of the given state for debug purposes.

Overrides:
getDebugNameForState in class SelectionTool
See Also:
AbstractTool.getDebugNameForState(int)

getDefaultCursor

protected Cursor getDefaultCursor()
Returns the cursor used under normal conditions.

Overrides:
getDefaultCursor in class AbstractTool
Returns:
the default cursor
See Also:
AbstractTool.setDefaultCursor(Cursor)

handleButtonDown

protected boolean handleButtonDown(int which)
Description copied from class: SelectionTool
If there is a Handle under the mouse, this method sets the drag tracker returned from the handle. If there's an EditPart under the mouse, this method sets the drag tracker returned from the edit part.

Overrides:
handleButtonDown in class SelectionTool
See Also:
SelectionTool.handleButtonDown(int)

handleButtonUp

protected boolean handleButtonUp(int which)
Description copied from class: SelectionTool
Resets this tool when the last button is released.

Overrides:
handleButtonUp in class SelectionTool
See Also:
SelectionTool.handleButtonUp(int)

handleDrag

protected boolean handleDrag()
Description copied from class: AbstractTool
Called whenever the mouse is being dragged. This method continues to be called even once AbstractTool.handleDragInProgress() starts getting called. By default, nothing happens, and false is returned. Subclasses may override this method to interpret a drag. Returning true indicates that the drag was handled in some way.

Overrides:
handleDrag in class AbstractTool
Returns:
true if the drag is handled
See Also:
AbstractTool.handleDrag()

handleFocusLost

protected boolean handleFocusLost()
Description copied from class: SelectionTool
Sets the drag tracker to null and goes into the initial state when focus is lost.

Overrides:
handleFocusLost in class SelectionTool
See Also:
SelectionTool.handleFocusLost()

handleKeyDown

protected boolean handleKeyDown(KeyEvent e)
Description copied from class: SelectionTool
Processes key down events. Specifically, arrow keys for moving edit parts, the ESC key for aborting a drag, the period '.' key for traversing handles, and the ENTER key for committing a drag. If none of these keys were pressed and the current viewer has a KeyHandler, it calls KeyHandler.keyPressed(KeyEvent).

Overrides:
handleKeyDown in class SelectionTool
See Also:
org.eclipse.gef.tools.SelectionTool#handleKeyDown(org.eclipse.swt.events.KeyEvent)

handleKeyUp

protected boolean handleKeyUp(KeyEvent e)
Description copied from class: SelectionTool
If in the initial state and the viewer has a KeyHandler, calls KeyHandler.keyReleased(KeyEvent) sending it the given key event.

Overrides:
handleKeyUp in class SelectionTool
See Also:
org.eclipse.gef.tools.SelectionTool#handleKeyUp(org.eclipse.swt.events.KeyEvent)

Eclipse GEF
3.3

Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire