All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.beans.mb.DesktopBeanBagView
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----com.ibm.beans.mb.BeanBagView
|
+----com.ibm.beans.mb.DesktopBeanBagView
- public class DesktopBeanBagView
- extends BeanBagView
- implements ActionListener, ItemSelectable
This class provides a simple view for BeanBagModel objects that
uses icons to represent individual
managed beans. This view supports single and multiple selection. This
class is suggested for use as a guide for developing more sophisticated
BeanBag views; however, it has enough function to support typical usages
of BeanBag views and models.
If the default size of the view is unacceptable, call the setSize()
method with the desired dimension immediately after construction.
- See Also:
- BeanBagView, ActionListener
-
DesktopBeanBagView()
- Default constructor.
-
DesktopBeanBagView(BeanBagModel)
- Constructs a DesktopBeanBagView object containing the
specified model using the
default LayoutManager object and default LabeledIconStyle object.
-
DesktopBeanBagView(BeanBagModel, LayoutManager, LabeledIconStyle)
- Constructs a DesktopBeanBagView object containing the specified
model using the
specified LayoutManager object and specified LabeledIconStyle object.
-
actionPerformed(ActionEvent)
- Handles the event generated when the mouse selects an icon in the view.
-
addIcon(ManagedBean)
- Adds an icon to the view representing the specified managed bean.
-
addIcons(Vector)
- Adds icons to the view representing the specified managed beans.
-
addItemListener(ItemListener)
-
-
destruct()
- Removes all icons from the view and then calls the
destruct() method of base class.
-
fireItem(Object)
-
-
getIconStyle()
- Gets the icon style that the view currently is using when adding icons.
-
getPreferredSize()
- Gets the preferred size of the view.
-
getSelectedObjects()
-
-
handleAdd(ModelEvent)
- Handles the event generated when items are added to the
BeanBagModel object.
-
handleRemove(ModelEvent)
- Handles the event generated when items are removed from
our BeanBagModel object.
-
isSingleSelect()
- Gets the selection behavior.
-
itemStateChanged(ItemEvent)
- Manages selection changes.
-
mouseClicked(MouseEvent)
- Handles the event generated when the mouse is clicked in the view.
-
paint(Graphics)
- Paints the DesktopBeanBagView object.
-
refresh()
- Refreshes the view.
-
removeAllIcons()
- Removes all icons from the view.
-
removeIcon(ManagedBean)
- Removes the icon representing the specified managed bean from the view.
-
removeIcons(Vector)
- Removes the icons representing the specified managed beans from the view.
-
removeItemListener(ItemListener)
-
-
select(ManagedBean)
- Selects or deselects, using the appropriate selection behavior,
the specified managed bean.
-
setIconStyle(LabeledIconStyle)
- Sets the icon style for future icons added to the view.
-
setSingleSelect(boolean)
- Sets the selection behavior as single or multiple.
-
setSize(int, int)
- Sets the size of the current view.
DesktopBeanBagView
public DesktopBeanBagView()
- Default constructor.
DesktopBeanBagView
public DesktopBeanBagView(BeanBagModel model)
- Constructs a DesktopBeanBagView object containing the
specified model using the
default LayoutManager object and default LabeledIconStyle object.
- Parameters:
- model - The BeanBagModel to be viewed.
- See Also:
- BeanBagModel
DesktopBeanBagView
public DesktopBeanBagView(BeanBagModel model,
LayoutManager lm,
LabeledIconStyle iconStyle)
- Constructs a DesktopBeanBagView object containing the specified
model using the
specified LayoutManager object and specified LabeledIconStyle object.
The LabeledIconStyle object specified is used when icons are added to the
view. This property can be set at any time. Changing the icon style
does not affect the existing icons in the view, but it will
change all subsequent icons added to this view.
- Parameters:
- model - The BeanBagModel object to be viewed.
- lm - The LayoutManager object to use when adding icons to the view.
- iconStyle -
- The LabeledIconStyle object describing
the appearance of subsequent icons
added to the view.
- See Also:
- BeanBagModel
setSingleSelect
public void setSingleSelect(boolean singleSelect)
- Sets the selection behavior as single or multiple.
- Parameters:
- singleSelect - true sets the selection
behavior to single; false, to multiple.
isSingleSelect
public boolean isSingleSelect()
- Gets the selection behavior.
- Returns:
- The select behavior for a view. true
indicates a single selection; false, multiple.
getPreferredSize
public Dimension getPreferredSize()
- Gets the preferred size of the view.
- Returns:
- The preferred size for the view.
- Overrides:
- getPreferredSize in class Container
setSize
public void setSize(int width,
int height)
- Sets the size of the current view.
- Parameters:
- width - The desired width of the view.
- height - The desired height of the view.
- Overrides:
- setSize in class Component
setIconStyle
public void setIconStyle(LabeledIconStyle iconStyle)
- Sets the icon style for future icons added to the view.
- Parameters:
- iconStyle - The LabeledIconStyle type describing the
appearance of icons added to the view.
getIconStyle
public LabeledIconStyle getIconStyle()
- Gets the icon style that the view currently is using when adding icons.
- Returns:
- The LabeledIconStyle type describing the appearance of icons
added to the view.
addIcon
protected void addIcon(ManagedBean mb)
- Adds an icon to the view representing the specified managed bean.
- Parameters:
- mb - The managed bean to be added as an icon to the view.
- See Also:
- ManagedBean
addIcons
protected void addIcons(Vector mbeans)
- Adds icons to the view representing the specified managed beans.
- Parameters:
- mbeans - The Vector of ManagedBean objects to be
added as icons to the view.
removeIcon
protected void removeIcon(ManagedBean mb)
- Removes the icon representing the specified managed bean from the view.
- Parameters:
- mb - The managed bean whose icon is to be removed from the view.
- See Also:
- ManagedBean
removeIcons
protected void removeIcons(Vector mbeans)
- Removes the icons representing the specified managed beans from the view.
- Parameters:
- mb - The Vector of ManagedBean objects whose icons are to be
removed from the view.
removeAllIcons
protected void removeAllIcons()
- Removes all icons from the view.
paint
public void paint(Graphics g)
- Paints the DesktopBeanBagView object. Painting is performed by first
painting the unselected icons, then painting the selected icons.
- Parameters:
- g - The specified graphics window.
- Overrides:
- paint in class Container
refresh
public void refresh()
- Refreshes the view. This method removes and then recreates and adds
icons corresponding to the managed beans of this BeanBag model, and then
calls the paintAll() method.
select
protected void select(ManagedBean mb)
- Selects or deselects, using the appropriate selection behavior,
the specified managed bean.
- Parameters:
- mb - The target bean for the selection action.
- See Also:
- ManagedBean
destruct
public synchronized void destruct()
- Removes all icons from the view and then calls the
destruct() method of base class.
- Overrides:
- destruct in class BeanBagView
mouseClicked
public void mouseClicked(MouseEvent e)
- Handles the event generated when the mouse is clicked in the view.
Deselects all beans in the model.
- Parameters:
- e - The generated event.
- Overrides:
- mouseClicked in class BeanBagView
- See Also:
- MouseListener, MouseEvent
actionPerformed
public void actionPerformed(ActionEvent e)
- Handles the event generated when the mouse selects an icon in the view.
This method causes the managed bean represented by the icon to be
selected or deselected depending on its current selection state. In
single selection mode, all the other managed beans are deselected.
- Parameters:
- e - The generated ActionEvent object.
- See Also:
- ActionListener, ActionEvent
handleAdd
public void handleAdd(ModelEvent e)
- Handles the event generated when items are added to the
BeanBagModel object. Adds the corresponding bean icons to the view.
- Parameters:
- e - The ModelEvent object generated by the BeanBagModel object.
- Overrides:
- handleAdd in class BeanBagView
- See Also:
- ModelChangeListener, ModelEvent
handleRemove
public void handleRemove(ModelEvent e)
- Handles the event generated when items are removed from
our BeanBagModel object. Removes the corresponding bean icons
from the view.
- Parameters:
- e - The ModelEvent object generated by the BeanBagModel object.
- Overrides:
- handleRemove in class BeanBagView
- See Also:
- ModelChangeListener, ModelEvent
itemStateChanged
public void itemStateChanged(ItemEvent e)
- Manages selection changes. This method is invoked when the
selection changes in the BeanBagModel instance.
Refreshes the view of selected beans.
- Parameters:
- e - The ItemEvent object generated by our BeanBagModel object.
- Overrides:
- itemStateChanged in class BeanBagView
fireItem
public void fireItem(Object item)
addItemListener
public synchronized void addItemListener(ItemListener l)
removeItemListener
public synchronized void removeItemListener(ItemListener l)
getSelectedObjects
public Object[] getSelectedObjects()
All Packages Class Hierarchy This Package Previous Next Index