org.argouml.uml.ui
Class UMLButtonGroup

java.lang.Object
  extended byjavax.swing.ButtonGroup
      extended byorg.argouml.uml.ui.UMLButtonGroup
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, ru.novosoft.uml.MElementListener, java.io.Serializable, UMLUserInterfaceComponent
Direct Known Subclasses:
UMLVisibilityButtonGroup

public abstract class UMLButtonGroup
extends javax.swing.ButtonGroup
implements UMLUserInterfaceComponent, java.awt.event.ActionListener

The UMLButtonGroup is the buttongroup behind radio buttons that depict some attribute of a modelelement like visibility. The radio buttons are controlled by the buttongroup. The UMLButtonGroup can be compared to the UMLComboBoxModel where the items in the model are the radionbuttons in the buttongroup.

Since:
Oct 12, 2002
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.ButtonGroup
buttons
 
Constructor Summary
UMLButtonGroup(UMLUserInterfaceContainer container)
          Constructor for UMLButtonGroup.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void add(javax.swing.AbstractButton button, javax.swing.Action action)
          Adds a button and an action to the group.
abstract  void buildModel()
          Builds the model.
 UMLUserInterfaceContainer getContainer()
          Returns the container.
 java.lang.Object getTarget()
          Returns the target.
 void listRoleItemSet(ru.novosoft.uml.MElementEvent e)
           
 void propertySet(ru.novosoft.uml.MElementEvent e)
           
 void recovered(ru.novosoft.uml.MElementEvent e)
           
 void removed(ru.novosoft.uml.MElementEvent e)
          Removing elements does not have any influence on a buttongroup
 void roleAdded(ru.novosoft.uml.MElementEvent e)
          Adding roles does not have any influence on the buttongroup (unless you want to add a button...)
 void roleRemoved(ru.novosoft.uml.MElementEvent e)
          Removing roles does not have any influence on the buttongroup (unless you want to remove a button...)
 void setContainer(UMLUserInterfaceContainer container)
          Sets the container.
 void setTarget(java.lang.Object target)
          Sets the target.
 void targetChanged()
          When the target changes, the buttonmodel must be updated.
 void targetReasserted()
          This method is called when the navigation history has been changed (and navigation buttons may need to be updated).
 
Methods inherited from class javax.swing.ButtonGroup
add, getButtonCount, getElements, getSelection, isSelected, remove, setSelected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UMLButtonGroup

public UMLButtonGroup(UMLUserInterfaceContainer container)
Constructor for UMLButtonGroup.

Method Detail

add

public void add(javax.swing.AbstractButton button,
                javax.swing.Action action)
Adds a button and an action to the group. When the button is selected, the action is fired. If the action is null, no action is done.

Parameters:
button -
action -

targetChanged

public void targetChanged()
When the target changes, the buttonmodel must be updated. Since the API of targetChanged does not have a parameter describing the old and new target, the target is retrieved via the container.

Specified by:
targetChanged in interface UMLUserInterfaceComponent
See Also:
UMLUserInterfaceComponent.targetChanged()

targetReasserted

public void targetReasserted()
Description copied from interface: UMLUserInterfaceComponent
This method is called when the navigation history has been changed (and navigation buttons may need to be updated). targetChanged implies navigationHistoryChanged, so this method will not be called after a targetChange.

Specified by:
targetReasserted in interface UMLUserInterfaceComponent
See Also:
UMLUserInterfaceComponent.targetReasserted()

propertySet

public void propertySet(ru.novosoft.uml.MElementEvent e)
Specified by:
propertySet in interface ru.novosoft.uml.MElementListener
See Also:
MElementListener.propertySet(ru.novosoft.uml.MElementEvent)

roleAdded

public void roleAdded(ru.novosoft.uml.MElementEvent e)
Adding roles does not have any influence on the buttongroup (unless you want to add a button...)

Specified by:
roleAdded in interface ru.novosoft.uml.MElementListener
See Also:
MElementListener.roleAdded(ru.novosoft.uml.MElementEvent)

roleRemoved

public void roleRemoved(ru.novosoft.uml.MElementEvent e)
Removing roles does not have any influence on the buttongroup (unless you want to remove a button...)

Specified by:
roleRemoved in interface ru.novosoft.uml.MElementListener
See Also:
MElementListener.roleRemoved(ru.novosoft.uml.MElementEvent)

listRoleItemSet

public void listRoleItemSet(ru.novosoft.uml.MElementEvent e)
Specified by:
listRoleItemSet in interface ru.novosoft.uml.MElementListener
See Also:
MElementListener.listRoleItemSet(ru.novosoft.uml.MElementEvent)

removed

public void removed(ru.novosoft.uml.MElementEvent e)
Removing elements does not have any influence on a buttongroup

Specified by:
removed in interface ru.novosoft.uml.MElementListener
See Also:
MElementListener.removed(ru.novosoft.uml.MElementEvent)

recovered

public void recovered(ru.novosoft.uml.MElementEvent e)
Specified by:
recovered in interface ru.novosoft.uml.MElementListener
See Also:
MElementListener.recovered(ru.novosoft.uml.MElementEvent)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener
See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)

getContainer

public UMLUserInterfaceContainer getContainer()
Returns the container.

Returns:
UMLUserInterfaceContainer

getTarget

public java.lang.Object getTarget()
Returns the target. The target is directly asked from the _target attribute and not from the _container attribute to make the move to a new targeting system as easy as possible.

Returns:
Object

setContainer

public void setContainer(UMLUserInterfaceContainer container)
Sets the container.

Parameters:
container - The container to set

setTarget

public void setTarget(java.lang.Object target)
Sets the target. This method will not be used untill the target does not come via the container.

Parameters:
target - The target to set

buildModel

public abstract void buildModel()
Builds the model. That is: it selects the correct button. The name of this method is choosen to be compliant with for example UMLModelElementListModel2



ArgoUML © 1996-2003 (20030829)ArgoUML Project HomeArgoUML Cookbook