FreeHEP API
Version current

org.freehep.util.commanddispatcher
Class CommandSourceAdapter

java.lang.Object
  extended byorg.freehep.util.commanddispatcher.CommandSourceAdapter
All Implemented Interfaces:
ActionListener, BooleanCommandState, CommandSource, CommandState, EventListener, Observer

public class CommandSourceAdapter
extends Object
implements CommandSource, ActionListener, BooleanCommandState, Observer

A class which implements CommandSource and can be used to associate any AbstractButton with a command

Version:
$Id:
Author:
Tony Johnson (tonyj@slac.stanford.edu)
Source Code:
CommandSourceAdapter.java

Constructor Summary
CommandSourceAdapter(AbstractButton button)
           
 
Method Summary
 void actionPerformed(ActionEvent evt)
           
 void clearTarget()
          Clears the CommandTarget associated with the CommandSource
 String getCommand()
          Returns the command associated with the CommandSource
 CommandTarget getTarget()
          Returns the current CommandTarget, or null of there isnt a current command target
 void setEnabled(boolean state)
           
 void setSelected(boolean selected)
           
 boolean setTarget(CommandTarget target)
          Sets a CommandTarget associated with the CommandSource
 void setText(String text)
           
 void setToolTipText(String text)
           
 void update(Observable o, Object arg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandSourceAdapter

public CommandSourceAdapter(AbstractButton button)
Method Detail

getCommand

public String getCommand()
Description copied from interface: CommandSource
Returns the command associated with the CommandSource

Specified by:
getCommand in interface CommandSource

setEnabled

public void setEnabled(boolean state)
Specified by:
setEnabled in interface CommandState

setSelected

public void setSelected(boolean selected)
Specified by:
setSelected in interface BooleanCommandState

setTarget

public boolean setTarget(CommandTarget target)
Description copied from interface: CommandSource
Sets a CommandTarget associated with the CommandSource

Specified by:
setTarget in interface CommandSource

getTarget

public CommandTarget getTarget()
Description copied from interface: CommandSource
Returns the current CommandTarget, or null of there isnt a current command target

Specified by:
getTarget in interface CommandSource

setText

public void setText(String text)
Specified by:
setText in interface CommandState

setToolTipText

public void setToolTipText(String text)
Specified by:
setToolTipText in interface CommandState

actionPerformed

public void actionPerformed(ActionEvent evt)
Specified by:
actionPerformed in interface ActionListener

clearTarget

public void clearTarget()
Description copied from interface: CommandSource
Clears the CommandTarget associated with the CommandSource

Specified by:
clearTarget in interface CommandSource

update

public void update(Observable o,
                   Object arg)
Specified by:
update in interface Observer

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.