net.refractions.udig.tools.edit.behaviour
Class DifferenceFeatureAcceptor

java.lang.Object
  extended by net.refractions.udig.tools.edit.behaviour.DifferenceFeatureAcceptor
All Implemented Interfaces:
Behaviour

public class DifferenceFeatureAcceptor
extends java.lang.Object
implements Behaviour

Requirements:

Action:

Since:
1.1.0
Author:
jones

Constructor Summary
DifferenceFeatureAcceptor()
           
 
Method Summary
 UndoableMapCommand getCommand(EditToolHandler handler)
          The action to be performed by this Behaviour.
 void handleError(EditToolHandler handler, java.lang.Throwable error, UndoableMapCommand command)
          This method is called if an exception occurs during the execution of the run method.
 boolean isValid(EditToolHandler handler)
          Called to determine whether this Behaviour is applicable and should be run.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DifferenceFeatureAcceptor

public DifferenceFeatureAcceptor()
Method Detail

isValid

public boolean isValid(EditToolHandler handler)
Description copied from interface: Behaviour
Called to determine whether this Behaviour is applicable and should be run.

Specified by:
isValid in interface Behaviour
Parameters:
handler - handler that calls this Behaviour
Returns:
true if this mode is applicable and should be run.

getCommand

public UndoableMapCommand getCommand(EditToolHandler handler)
Description copied from interface: Behaviour
The action to be performed by this Behaviour. This action takes place in the event thread so it must perform quickly.

Specified by:
getCommand in interface Behaviour
Parameters:
handler - handler that calls this Behaviour
Returns:
Command that will be executed in order to perform the behaviour

handleError

public void handleError(EditToolHandler handler,
                        java.lang.Throwable error,
                        UndoableMapCommand command)
Description copied from interface: Behaviour
This method is called if an exception occurs during the execution of the run method.

This method should:

  1. Rollback the changes made during the run method
  2. Log the error in the plugin's log

Specified by:
handleError in interface Behaviour
error - Error that occurred
command - Command retrieved from getCommandMethod. May be null if exception occurred while executing getCommand();