|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bbn.openmap.util.stateMachine.State
public abstract class State
The state is intended to be a abstract juncture in a pattern of events. The idea is that for a given state, an event will call a unique response. This class lets you define this juncture, and can be used as a Java adapter to define only the listener responses you care about. The state, as defined in your implementation, can reset the StateMachine to it's new state after it responds to an event.
Since this state machine can be used in OpenMap, the Mouse/MouseMotion Listeners are MapMouseListeners. This is to let OpenMap know not to send the result on to other layers that like to hear about events. This State class has a setting on how you want the unused MapMouseListener functions to respond to events. The default is false, and this means that other layers will have a chance to respond to events. If you want other layer's event reception to pause a little, set the mapMouseListenerResponse to true.
| Field Summary | |
|---|---|
protected I18n |
i18n
To read local settings |
| Constructor Summary | |
|---|---|
State()
|
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
|
void |
componentAdded(java.awt.event.ContainerEvent e)
|
void |
componentHidden(java.awt.event.ComponentEvent e)
|
void |
componentMoved(java.awt.event.ComponentEvent e)
|
void |
componentRemoved(java.awt.event.ContainerEvent e)
|
void |
componentResized(java.awt.event.ComponentEvent e)
|
void |
componentShown(java.awt.event.ComponentEvent e)
|
void |
focusGained(java.awt.event.FocusEvent e)
|
void |
focusLost(java.awt.event.FocusEvent e)
|
boolean |
getMapMouseListenerResponse()
Get the value of the default response to MapMouseListener methods. |
java.lang.String[] |
getMouseModeServiceList()
Return a list of the modes that are interesting to the MapMouseListener. |
void |
itemStateChanged(java.awt.event.ItemEvent e)
|
void |
keyPressed(java.awt.event.KeyEvent e)
|
void |
keyReleased(java.awt.event.KeyEvent e)
|
void |
keyTyped(java.awt.event.KeyEvent e)
|
boolean |
mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse has been clicked on a component. |
boolean |
mouseDragged(java.awt.event.MouseEvent e)
Invoked when a mouse button is pressed on a component and then dragged. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component. |
void |
mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component. |
void |
mouseMoved()
Handle a mouse cursor moving without the button being pressed. |
boolean |
mouseMoved(java.awt.event.MouseEvent e)
Invoked when the mouse button has been moved on a component (with no buttons down). |
boolean |
mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component. |
boolean |
mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component. |
void |
setMapMouseListenerResponse(boolean value)
Set the MapMouseListener method default response value. |
void |
textValueChanged(java.awt.event.TextEvent e)
|
void |
windowActivated(java.awt.event.WindowEvent e)
|
void |
windowClosed(java.awt.event.WindowEvent e)
|
void |
windowClosing(java.awt.event.WindowEvent e)
|
void |
windowDeactivated(java.awt.event.WindowEvent e)
|
void |
windowDeiconified(java.awt.event.WindowEvent e)
|
void |
windowIconified(java.awt.event.WindowEvent e)
|
void |
windowOpened(java.awt.event.WindowEvent e)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected I18n i18n
| Constructor Detail |
|---|
public State()
| Method Detail |
|---|
public void setMapMouseListenerResponse(boolean value)
public boolean getMapMouseListenerResponse()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerpublic void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
adjustmentValueChanged in interface java.awt.event.AdjustmentListenerpublic void componentResized(java.awt.event.ComponentEvent e)
componentResized in interface java.awt.event.ComponentListenerpublic void componentMoved(java.awt.event.ComponentEvent e)
componentMoved in interface java.awt.event.ComponentListenerpublic void componentShown(java.awt.event.ComponentEvent e)
componentShown in interface java.awt.event.ComponentListenerpublic void componentHidden(java.awt.event.ComponentEvent e)
componentHidden in interface java.awt.event.ComponentListenerpublic void componentAdded(java.awt.event.ContainerEvent e)
componentAdded in interface java.awt.event.ContainerListenerpublic void componentRemoved(java.awt.event.ContainerEvent e)
componentRemoved in interface java.awt.event.ContainerListenerpublic void focusGained(java.awt.event.FocusEvent e)
focusGained in interface java.awt.event.FocusListenerpublic void focusLost(java.awt.event.FocusEvent e)
focusLost in interface java.awt.event.FocusListenerpublic void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged in interface java.awt.event.ItemListenerpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped in interface java.awt.event.KeyListenerpublic void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenerpublic java.lang.String[] getMouseModeServiceList()
MapMouseListener
return new String[] { SelectMouseMode.modeID };
getMouseModeServiceList in interface MapMouseListenerNavMouseMode.modeID,
SelectMouseMode.modeID,
NullMouseMode.modeIDpublic boolean mousePressed(java.awt.event.MouseEvent e)
MapMouseListener
mousePressed in interface MapMouseListenere - MouseEvent
public boolean mouseReleased(java.awt.event.MouseEvent e)
MapMouseListener
mouseReleased in interface MapMouseListenere - MouseEvent
public boolean mouseClicked(java.awt.event.MouseEvent e)
MapMouseListenermousePressed(), or if no other listener
processes the event. If the listener successfully processes
mouseClicked(), then it will receive the next
mouseClicked() notifications that have a click
count greater than one.
NOTE: We have noticed that this method can sometimes be
erroneously invoked. It seems to occur when a light-weight AWT
component (like an internal window or menu) closes (removes
itself from the window hierarchy). A specific OpenMap example
is when you make a menu selection when the MenuItem you select
is above the MapBean canvas. After making the selection, the
mouseClicked() gets invoked on the MouseDelegator, which passes
it to the appropriate listeners depending on the MouseMode. The
best way to avoid this problem is to not implement anything
crucial in this method. Use a combination of
mousePressed() and mouseReleased()
instead.
mouseClicked in interface MapMouseListenere - MouseEvent
public void mouseEntered(java.awt.event.MouseEvent e)
MapMouseListener
mouseEntered in interface MapMouseListenere - MouseEventpublic void mouseExited(java.awt.event.MouseEvent e)
MapMouseListener
mouseExited in interface MapMouseListenere - MouseEventpublic boolean mouseDragged(java.awt.event.MouseEvent e)
MapMouseListener
mouseDragged in interface MapMouseListenere - MouseEvent
public boolean mouseMoved(java.awt.event.MouseEvent e)
MapMouseListener
mouseMoved in interface MapMouseListenere - MouseEvent
public void mouseMoved()
MapMouseListener
mouseMoved in interface MapMouseListenerpublic void textValueChanged(java.awt.event.TextEvent e)
textValueChanged in interface java.awt.event.TextListenerpublic void windowOpened(java.awt.event.WindowEvent e)
windowOpened in interface java.awt.event.WindowListenerpublic void windowClosing(java.awt.event.WindowEvent e)
windowClosing in interface java.awt.event.WindowListenerpublic void windowClosed(java.awt.event.WindowEvent e)
windowClosed in interface java.awt.event.WindowListenerpublic void windowIconified(java.awt.event.WindowEvent e)
windowIconified in interface java.awt.event.WindowListenerpublic void windowDeiconified(java.awt.event.WindowEvent e)
windowDeiconified in interface java.awt.event.WindowListenerpublic void windowActivated(java.awt.event.WindowEvent e)
windowActivated in interface java.awt.event.WindowListenerpublic void windowDeactivated(java.awt.event.WindowEvent e)
windowDeactivated in interface java.awt.event.WindowListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||