com.yospace.yae.midlet.simple
Class SimpleDashBar

java.lang.Object
  |
  +--com.yospace.yae.yogi.YogiComponent
        |
        +--com.yospace.yae.yogi.YogiDashBar
              |
              +--com.yospace.yae.midlet.simple.SimpleDashBar
All Implemented Interfaces:
ActionListener, PropertyChangeListener

public class SimpleDashBar
extends YogiDashBar
implements ActionListener, PropertyChangeListener

The DashBar is the menu bar associated with the root window. The SimpleDashBar constitutes a bar with a 'start' button which invokes a popup list of currently active and installed Panelets. From this list, the user can request a Panelet to be started or set a currently running Panelet as the active one. The system can be exited through this list, also.


Fields inherited from class com.yospace.yae.yogi.YogiDashBar
dashBarExit
 
Fields inherited from class com.yospace.yae.yogi.YogiComponent
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, BORDER_DOTTED, BORDER_NONE, BORDER_PLAIN, BORDER_ROUNDED, BORDER_SOLID, COLOR_BACKGROUND, COLOR_BORDER, COLOR_FOREGROUND, FOCUS_DEFAULT, FOCUS_OFF, FOCUS_ON, PROPERTY_ALIGN, PROPERTY_BORDER_STYLE, PROPERTY_BOUNDS, PROPERTY_COLOR, PROPERTY_CONTEXT_ENABLED, PROPERTY_ENABLED, PROPERTY_FOCUS, PROPERTY_FOCUS_INDEX, PROPERTY_FOCUS_TRAVERSABLE, PROPERTY_FONT, PROPERTY_HOTKEY, PROPERTY_LOCATION, PROPERTY_OPAQUE, PROPERTY_SIZE, PROPERTY_VISIBLE, PROPERTY_X_INSET, PROPERTY_Y_INSET
 
Constructor Summary
SimpleDashBar()
          Adds a "YoGI" button to itself and builds an empty popup for active and installed Panelets to be listed in.
 
Method Summary
 void actionPerformed(YogiComponent source)
          Required by the ActionListener interface.
 int getActivesCount()
          Gets the total number of active Panelets listed.
 int getInstalledsCount()
          Gets the total number of installed Panelets listed.
 YogiList getPaneletsList()
          Accessor method for the list of active and installed Panelets.
 YogiPopup getPopup()
          Accessor method for the popup.
 YogiScrollPane getScrollPane()
          Accessor method for the scroll pane.
 void init(PaneletManager paneletManager)
          Initialises the dash bar by providing a reference to the Panelet manager.
 void propertyChanged(java.lang.Object source, int propertyCode)
          Required by the PropertyChangeListener interface.
 
Methods inherited from class com.yospace.yae.yogi.YogiComponent
_debugPrintComponents, add, addPropertyChangeListener, bringForwards, bringInFrontOf, bringToFront, contains, containsComponent, ensureVisible, ensureVisible, findComponentAt, findCurrentFocus, findFirstFocus, findFocusDomainRoot, findFocusDomainRootImpl, findHotkeyComponent, findNextFocus, fireActionPerformedEvent, firePropertyChangeEvent, getAlign, getBorderStyle, getBounds, getColor, getColors, getComponent, getComponent, getComponentCount, getComponentIndex, getComponents, getFocusBounds, getFocusIndex, getFont, getGlobalLocation, getHeight, getHotkey, getId, getParent, getParent, getTreeLock, getUI, getWidth, getX, getXInset, getY, getYInset, hasFocus, isActive, isContextEnabled, isEnabled, isFocusDomainRoot, isFocusTraversable, isOpaque, isVisible, keyPressed, keyReleased, keyRepeated, paint, paintBackground, paintBorder, paintForeground, pointerDragged, pointerPressed, pointerReleased, remove, remove, removeAll, removePropertyChangeListener, repaint, repaint, repaintAfterRebounding, requestFocus, requestFocus, sendBackwards, sendBehind, sendToBack, setActionListener, setActive, setAlign, setBorderStyle, setBounds, setColor, setColors, setContextEnabled, setDefaultColor, setEnabled, setFocusDomainRoot, setFocusIndex, setFocusTraversable, setFont, setHotkey, setId, setLocation, setNoFocus, setOpaque, setProperty, setSize, setUI, setVisible, setXInset, setYInset, updateUI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleDashBar

public SimpleDashBar()
Adds a "YoGI" button to itself and builds an empty popup for active and installed Panelets to be listed in.
Method Detail

init

public void init(PaneletManager paneletManager)
Initialises the dash bar by providing a reference to the Panelet manager. This allows the dash bar to get the list of installed Panelets, and to set up a listener on the manager to ensure that the list of active Panelets is up-to-date.
Overrides:
init in class YogiDashBar
Parameters:
paneletManager - the Panelet manager.

getPopup

public YogiPopup getPopup()
Accessor method for the popup. Used by the dash bar UI when laying out components.
Returns:
the YogiPopup associated with this dash bar.

getScrollPane

public YogiScrollPane getScrollPane()
Accessor method for the scroll pane. Used by the dash bar UI when laying out components.
Returns:
the YogiScrollPane associated with this dash bar.

getPaneletsList

public YogiList getPaneletsList()
Accessor method for the list of active and installed Panelets. Used by the dash bar UI when laying out components.
Returns:
the YogiList of Panelets.

getActivesCount

public int getActivesCount()
Gets the total number of active Panelets listed.
Returns:
the number of active Panelets.

getInstalledsCount

public int getInstalledsCount()
Gets the total number of installed Panelets listed.
Returns:
the number of installed Panelets.

actionPerformed

public void actionPerformed(YogiComponent source)
Required by the ActionListener interface. Listens for when the 'start' button on the dash bar has been pressed, and then shows or destroys the popup list accordingly.
Specified by:
actionPerformed in interface ActionListener
Parameters:
source - the source of the action event (in this case the button on the dash bar).

propertyChanged

public void propertyChanged(java.lang.Object source,
                            int propertyCode)
Required by the PropertyChangeListener interface. Listens for when an item in the popup list has been selected. If the selected item represents an active Panelet, that Panelet is given focus. If the selected item represents an installed Panelet, a request is made to the Panelet manager to start a new Panelet. If "EXIT" is selected from the list, exit is called.

The dash bar also listens for property change events from the Panelet manager, indicating that the currently active Panelet has changed, or that a Panelet has been added or removed, or that a Panelets current state has changed. In any such situation the popup list is updated adccordingly.

Specified by:
propertyChanged in interface PropertyChangeListener
Parameters:
source - the source of the action event.
propertyCode - the String identifying the property that has been changed.

Copyright 2002 Yospace Holdings Ltd. All Rights Reserved.