jas.util
Class CommandProcessor
java.lang.Object
  
java.util.Observable
      
jas.util.CommandProcessor
- Direct Known Subclasses: 
 - NestedCommandProcessor
 
public class CommandProcessor
- extends Observable
 
A CommandProcessor represents a collection of CommandTargets. The CommandProcessor is Observable,
 and is normally Observed by the CommandTargetManager. When the CommandProcessor calls
 its notifyObservers method, the CommandTargetManager prompts each CommandSource currently
 attached to CommandTargets within the CommandProcessor to update their enabled/disabled status.
 
 Typically applications provide their own CommandProcessor(s)  which extend this base class
 and which can handle a set of commands. By default CommandProcessor's acceptCommand method
 uses reflection to search for methods in the subClass which correspond to specific commands,
 although subclasses could also override the acceptCommand method to implement a different
 scheme. The default scheme looks for methods of type:
 
            public void onXXX()
 
 to handle the command XXX. Also
 
            public void enableXXX(JASState state)
 
 to determine if the command is active or not.
 
 
 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
CommandProcessor
public CommandProcessor()
translate
protected String translate(String command)
 
setChanged
protected void setChanged()
- Overrides:
 setChanged in class Observable
 
 
setManager
protected void setManager(CommandTargetManager m)
 
acceptCommand
protected CommandTarget acceptCommand(String command)
- The CommandTargetManager called acceptCommand to find out if this CommandProcessor
 can respond to the specified command. If it can it returns a CommandTarget for the command,
 otherwise it returns null.
 
 
invoke
protected void invoke(Method method,
                      Object[] args)
               throws IllegalAccessException,
                      InvocationTargetException
- Throws:
 IllegalAccessException
InvocationTargetException
 
invokeEnable
protected void invokeEnable(Method method,
                            Object[] args)
                     throws IllegalAccessException,
                            InvocationTargetException
- Throws:
 IllegalAccessException
InvocationTargetException
 
invokeCommand
protected void invokeCommand(Method method,
                             Object[] args)
                      throws IllegalAccessException,
                             InvocationTargetException
- Throws:
 IllegalAccessException
InvocationTargetException
 
invokeCommand
protected void invokeCommand(CommandProcessor.SimpleTarget t)
 
invokeCommand
protected void invokeCommand(CommandProcessor.BooleanTarget t,
                             boolean arg)
 
Copyright © 2000-2009 FreeHEP. All Rights Reserved.