|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.yospace.yae.pm.PaneletManager
The Panelet manager is responsible for the current collection of Panelets. It maintains an ordered list of Panelets, accessible by index, where the zeroth element is the least recently touched. (Note that the index of a given panelet may change at any time, so full synchronization is necessary).
| Field Summary | |
protected ApplicationManager |
appMan
A back-reference to the Application Manager. |
static int |
PROPERTY_ACTIVE
The constant defining the property of a Panelet being active. |
static int |
PROPERTY_ADDED
The constant defining the property of a Panelet being added. |
static int |
PROPERTY_PANELET_STATE
The constant defining the property of a Panelet's state. |
static int |
PROPERTY_REMOVED
The constant defining the property of a Panelet being removed. |
| Constructor Summary | |
protected |
PaneletManager()
Simply sets up an empty Vector of current Panelets. |
| Method Summary | |
void |
add(Panelet p)
Adds a Panelet to the end of the current set of Panelets. |
void |
addPropertyChangeListener(PropertyChangeListener newPcl)
Adds a listener for any of the various property change events that components can produce. |
abstract void |
exit()
Abstract method which, when implemented, should be used to tell the system to exit. |
void |
firePropertyChangeEvent(int propertyCode)
This method is used to send a notification to any registered PropertyChangeListeners to say that the specified
property has changed. |
void |
firePropertyChangeEvent(java.lang.Object source,
int propertyCode)
This method is used to send a notification to any registered PropertyChangeListeners to say that the specified
property has changed. |
Panelet |
getActivePanelet()
Gets the currently active Panelet. |
Panelet |
getPanelet(int index)
Returns the Panelet at the specified index. |
Panelet |
getPanelet(YogiComponent child)
Finds the Panelet to which the specified child belongs. |
PaneletConfigBuilder |
getPaneletConfig()
Gets the mappings of Panelet names to their associated class, XML and resource files, as declared in the Panelet config XML file. |
int |
getPaneletCount()
Returns the number of registered Panelets. |
void |
init(PaneletConfigBuilder paneletConfig,
ApplicationManager appMan,
YogiComponent popupComponentParent)
Initialises the Panelet Manager. |
void |
remove(Panelet p)
Removes the specified Panelet from the current set. |
void |
removePropertyChangeListener(PropertyChangeListener oldPcl)
This method removes a PropertyChangeListener that may have been
registered previously. |
void |
setActivePanelet(int i)
Sets the currently active Panelet to be that with the given index. |
abstract void |
setPaneletState(Panelet thePanelet,
int newState)
It is expected that all subclasses of this abstract base class implement this method, which handles a request to change the state of a Panelet. |
abstract void |
start()
Called by YaeMIDlet to start up this
manager. |
void |
startPanelet(java.lang.String name)
Generates and starts a Panelet by getting the relevant application parameters. |
protected void |
touch(Panelet p)
Moves the specified Panelet to the end of the set. |
protected void |
updatePaneletState(Panelet thePanelet,
int newState)
Used internally to modify a Panelets state to the given new state. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int PROPERTY_ADDED
public static final int PROPERTY_REMOVED
public static final int PROPERTY_PANELET_STATE
public static final int PROPERTY_ACTIVE
protected ApplicationManager appMan
| Constructor Detail |
protected PaneletManager()
| Method Detail |
public void init(PaneletConfigBuilder paneletConfig,
ApplicationManager appMan,
YogiComponent popupComponentParent)
paneletConfig - the Panelet Configuration for this YoGI session.appMan - the Application Manager to be associated with this Panelet Manager.popupComponentParent - the component parent to use when a Dialog is required. This will be the case
when the request to start a Panelet fails.IllegalStateException - if the Application Manager has already been set up.public abstract void start()
YaeMIDlet to start up this
manager.public void startPanelet(java.lang.String name)
name - the Panelet name (as used in the Panelet Config) to start.public void add(Panelet p)
p - the panelet to add.public void remove(Panelet p)
p - the Panelet to be removed.public Panelet getPanelet(int index)
index - the index of the Panelet to be retrieved.ArrayIndexOutOfBoundsException - if the index lies outside the
range 0 <= index < number of paneletspublic Panelet getPanelet(YogiComponent child)
child - the component whose Panelet is requiredpublic int getPaneletCount()
public PaneletConfigBuilder getPaneletConfig()
public void setActivePanelet(int i)
i - the index of the Panelet in this manager's list to set as active.public Panelet getActivePanelet()
protected void touch(Panelet p)
p - the panelet to be moved.public void addPropertyChangeListener(PropertyChangeListener newPcl)
newPcl - the property change listener to be added. If it is already a listener,
then this method does nothing.public void removePropertyChangeListener(PropertyChangeListener oldPcl)
PropertyChangeListener that may have been
registered previously. If no such listener was registered, then this method does
nothing.oldPcl - the listener to be removed.public void firePropertyChangeEvent(int propertyCode)
PropertyChangeListeners to say that the specified
property has changed.propertyCode - the property that has changed. For maximum efficiency, this should
be one of the PROPERTY_XXXXX constants.
public void firePropertyChangeEvent(java.lang.Object source,
int propertyCode)
PropertyChangeListeners to say that the specified
property has changed.source - the source from which this event purports to be fired from.propertyCode - the property that has changed. For maximum efficiency, this should
be one of the PROPERTY_XXXXX constants.
public abstract void setPaneletState(Panelet thePanelet,
int newState)
thePanelet - the Panelet whose state is to be set.newState - the target state for the given Panelet.
protected void updatePaneletState(Panelet thePanelet,
int newState)
thePanelet - the Panelet whose state needs changing.newState - the new state for the Panelet.public abstract void exit()
|
Copyright 2002 Yospace Holdings Ltd. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||