org.esa.beam.framework.ui.tool
Class AbstractTool

java.lang.Object
  extended by org.esa.beam.framework.ui.tool.AbstractTool
All Implemented Interfaces:
Drawable, Tool

Deprecated. since BEAM 4.7, no replacement

@Deprecated
public abstract class AbstractTool
extends Object
implements Tool, Drawable

An abstract implementation of the tool interface.

Version:
$Revision$ $Date$
Author:
Norman Fomferra

Constructor Summary
protected AbstractTool()
          Deprecated.  
 
Method Summary
 void activate()
          Deprecated. Activates the tool for the given view.
 void addToolListener(ToolListener listener)
          Deprecated. Adds a new tool listener to this tool.
 void cancel()
          Deprecated. Cancels the tool.
 void deactivate()
          Deprecated. Deactivates the tool.
 void draw(Graphics2D g2d)
          Deprecated. Draws this Drawable on the given Graphics2D drawing surface.
protected  void finish()
          Deprecated. This method can be called by a tool, when it finishes its work.
protected  void fireToolActivated()
          Deprecated.  
protected  void fireToolCanceled()
          Deprecated.  
protected  void fireToolDeactivated()
          Deprecated.  
protected  void fireToolDisabled()
          Deprecated.  
protected  void fireToolEnabled()
          Deprecated.  
protected  void fireToolFinished()
          Deprecated.  
 Cursor getCursor()
          Deprecated. Gets the cursor for this tool.
 Drawable getDrawable()
          Deprecated. Gets a thing that can be drawn while the tool is working.
 DrawingEditor getDrawingEditor()
          Deprecated. Gets the editor for this tool.
 void handleEvent(ToolInputEvent e)
          Deprecated. Handles a tool input event.
 boolean isActive()
          Deprecated. An active tool is the currently selected tool in the DrawingView.
protected static boolean isAltKeyDown(ToolInputEvent e)
          Deprecated.  
 boolean isCanceled()
          Deprecated. A tool must be enabled in order to use it and to activate/deactivate it.
protected static boolean isControlKeyDown(ToolInputEvent e)
          Deprecated.  
protected static boolean isDoubleLeftClick(ToolInputEvent e)
          Deprecated.  
 boolean isDragging()
          Deprecated. Determines whether oer not this tool is currently dragging.
 boolean isEnabled()
          Deprecated. A tool must be enabled in order to use it and to activate/deactivate it.
protected static boolean isLeftMouseButtonDown(ToolInputEvent e)
          Deprecated.  
protected static boolean isShiftKeyDown(ToolInputEvent e)
          Deprecated.  
protected static boolean isSingleLeftClick(ToolInputEvent e)
          Deprecated.  
 void keyPressed(ToolInputEvent e)
          Deprecated. Invoked when a key has been pressed.
 void keyReleased(ToolInputEvent e)
          Deprecated. Invoked when a key has been released.
 void keyTyped(ToolInputEvent e)
          Deprecated. Invoked when a key has been typed.
 void mouseClicked(ToolInputEvent e)
          Deprecated. Invoked when the mouse has been clicked on a component.
 void mouseDragged(ToolInputEvent e)
          Deprecated. Invoked when a mouse button is pressed on a component and then dragged.
 void mouseEntered(ToolInputEvent e)
          Deprecated. Invoked when the mouse enters a component.
 void mouseExited(ToolInputEvent e)
          Deprecated. Invoked when the mouse exits a component.
 void mouseMoved(ToolInputEvent e)
          Deprecated. Invoked when the mouse button has been moved on a component (with no buttons no down).
 void mousePressed(ToolInputEvent e)
          Deprecated. Invoked when a mouse button has been pressed on a component.
 void mouseReleased(ToolInputEvent e)
          Deprecated. Invoked when a mouse button has been released on a component.
 void removeToolListener(ToolListener listener)
          Deprecated. Removes an existsing tool listener from this tool.
protected  void setActive(boolean active)
          Deprecated.  
protected  void setCanceled(boolean canceled)
          Deprecated.  
protected  void setDragging(boolean dragging)
          Deprecated.  
 void setDrawingEditor(DrawingEditor editor)
          Deprecated. Sets the editor for this tool.
 void setEnabled(boolean enabled)
          Deprecated. Sets the enabled state of this tool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTool

protected AbstractTool()
Deprecated. 
Method Detail

getDrawable

public Drawable getDrawable()
Deprecated. 
Gets a thing that can be drawn while the tool is working. The default implementation simply returns this, because this AbstractTool is a Drawable.

If your tool does not paint anything, override this method and simply return null here.

Specified by:
getDrawable in interface Tool
Returns:
always this

draw

public void draw(Graphics2D g2d)
Deprecated. 
Draws this Drawable on the given Graphics2D drawing surface. The default implementation is left empty. Override this method in order to perform some drawing while the tool executes.

Specified by:
draw in interface Drawable
Parameters:
g2d - the graphics context

activate

public void activate()
Deprecated. 
Activates the tool for the given view. This method is called whenever the user switches to this tool. Use this method to reinitialize a tool.

The default implementation calls setCanceled(false) followed by setActive(true).

Subclassers should always call super.activate().

Specified by:
activate in interface Tool

deactivate

public void deactivate()
Deprecated. 
Deactivates the tool. This method is called whenever the user switches to another tool. Use this method to do some clean-up when the tool is switched.

The default implementation cancels this tool if it is active and the calls setActive(false).

Subclassers should always call super.deactivate().

Specified by:
deactivate in interface Tool

isActive

public boolean isActive()
Deprecated. 
An active tool is the currently selected tool in the DrawingView. A tool can be activated/deactivated by calling the activate()/deactivate() method.

Specified by:
isActive in interface Tool
Returns:
true if the tool is the selected tool in the DrawingView, false otherwise
See Also:
isEnabled()

setActive

protected void setActive(boolean active)
Deprecated. 

isEnabled

public boolean isEnabled()
Deprecated. 
A tool must be enabled in order to use it and to activate/deactivate it. Typically, the program enables or disables a tool.

Specified by:
isEnabled in interface Tool
See Also:
isActive()

setEnabled

public void setEnabled(boolean enabled)
Deprecated. 
Description copied from interface: Tool
Sets the enabled state of this tool.

Specified by:
setEnabled in interface Tool
Parameters:
enabled - the enabled state

finish

protected void finish()
Deprecated. 
This method can be called by a tool, when it finishes its work. Override this method in order implement the actual work of tool, for example, insert a figure in the drawing.

The default implementation simply calls fireToolFinished().

Subclassers should always call super.finish().


cancel

public void cancel()
Deprecated. 
Cancels the tool. This method is called whenever the user switches to another tool while this tool is active. Use this method to do some clean-up when the tool is switched.

The default implementation simply calls setCanceled(false).

Subclassers should always call super.cancel().

Specified by:
cancel in interface Tool

isCanceled

public boolean isCanceled()
Deprecated. 
A tool must be enabled in order to use it and to activate/deactivate it. Typically, the program enables or disables a tool.

Returns:
true, if so
See Also:
isActive()

setCanceled

protected void setCanceled(boolean canceled)
Deprecated. 

isDragging

public boolean isDragging()
Deprecated. 
Description copied from interface: Tool
Determines whether oer not this tool is currently dragging.

Specified by:
isDragging in interface Tool

setDragging

protected void setDragging(boolean dragging)
Deprecated. 

getDrawingEditor

public DrawingEditor getDrawingEditor()
Deprecated. 
Gets the editor for this tool. The editor is the image display on which this tool acts.

Specified by:
getDrawingEditor in interface Tool
Returns:
the editor, can be null

setDrawingEditor

public void setDrawingEditor(DrawingEditor editor)
Deprecated. 
Sets the editor for this tool. The editor is the image display on which this tool acts.

Specified by:
setDrawingEditor in interface Tool
Parameters:
editor - the editor, can be null

getCursor

public Cursor getCursor()
Deprecated. 
Gets the cursor for this tool. The method simply returns null.

Specified by:
getCursor in interface Tool
Returns:
the cursor for this tool or null if this tool does not have a special cursor.

keyPressed

public void keyPressed(ToolInputEvent e)
Deprecated. 
Invoked when a key has been pressed.

Parameters:
e - The tool input event.

keyReleased

public void keyReleased(ToolInputEvent e)
Deprecated. 
Invoked when a key has been released.

Parameters:
e - The tool input event.

keyTyped

public void keyTyped(ToolInputEvent e)
Deprecated. 
Invoked when a key has been typed. This event occurs when a key press is followed by a key release.

Parameters:
e - The tool input event.

mouseClicked

public void mouseClicked(ToolInputEvent e)
Deprecated. 
Invoked when the mouse has been clicked on a component.

Parameters:
e - The tool input event.

mouseDragged

public void mouseDragged(ToolInputEvent e)
Deprecated. 
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).

Parameters:
e - The tool input event.

mouseEntered

public void mouseEntered(ToolInputEvent e)
Deprecated. 
Invoked when the mouse enters a component.

Parameters:
e - The tool input event.

mouseExited

public void mouseExited(ToolInputEvent e)
Deprecated. 
Invoked when the mouse exits a component.

Parameters:
e - The tool input event.

mouseMoved

public void mouseMoved(ToolInputEvent e)
Deprecated. 
Invoked when the mouse button has been moved on a component (with no buttons no down).

Parameters:
e - The tool input event.

mousePressed

public void mousePressed(ToolInputEvent e)
Deprecated. 
Invoked when a mouse button has been pressed on a component.

Parameters:
e - The tool input event.

mouseReleased

public void mouseReleased(ToolInputEvent e)
Deprecated. 
Invoked when a mouse button has been released on a component.

Parameters:
e - The tool input event.

isSingleLeftClick

protected static boolean isSingleLeftClick(ToolInputEvent e)
Deprecated. 

isDoubleLeftClick

protected static boolean isDoubleLeftClick(ToolInputEvent e)
Deprecated. 

isLeftMouseButtonDown

protected static boolean isLeftMouseButtonDown(ToolInputEvent e)
Deprecated. 

isShiftKeyDown

protected static boolean isShiftKeyDown(ToolInputEvent e)
Deprecated. 

isControlKeyDown

protected static boolean isControlKeyDown(ToolInputEvent e)
Deprecated. 

isAltKeyDown

protected static boolean isAltKeyDown(ToolInputEvent e)
Deprecated. 

addToolListener

public void addToolListener(ToolListener listener)
Deprecated. 
Adds a new tool listener to this tool.

Specified by:
addToolListener in interface Tool
Parameters:
listener - the new listener to be added

removeToolListener

public void removeToolListener(ToolListener listener)
Deprecated. 
Removes an existsing tool listener from this tool.

Specified by:
removeToolListener in interface Tool
Parameters:
listener - the existsing listener to be removed

fireToolActivated

protected void fireToolActivated()
Deprecated. 

fireToolDeactivated

protected void fireToolDeactivated()
Deprecated. 

fireToolEnabled

protected void fireToolEnabled()
Deprecated. 

fireToolDisabled

protected void fireToolDisabled()
Deprecated. 

fireToolCanceled

protected void fireToolCanceled()
Deprecated. 

fireToolFinished

protected void fireToolFinished()
Deprecated. 

handleEvent

public void handleEvent(ToolInputEvent e)
Deprecated. 
Description copied from interface: Tool
Handles a tool input event.

Specified by:
handleEvent in interface Tool
Parameters:
e - a tool input event


Copyright © 2002-2012 Brockmann Consult GmbH. All Rights Reserved.