com.mamarce.mhp.mf.components
Class ExitContainer

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by org.havi.ui.HContainer
              extended by com.mamarce.mhp.mf.components.MContainer
                  extended by com.mamarce.mhp.mf.components.ExitContainer
All Implemented Interfaces:
MListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, org.dvb.ui.TestOpacity, org.havi.ui.HComponentOrdering, org.havi.ui.HMatteLayer

public class ExitContainer
extends MContainer
implements MListener

Handles pressure of EXIT button in a mhp application.
It is a UI used by com.mamarce.mhp.mh.MXlet and is called when the EXIT button of the remote controll is pressed. It display a message asking if the user wants to exit the application. It handles also LEFT, RIGHT and OK buttons to confirm user'choice.
If the user select yes option the application is destroyed calling xlet destroy method.

This component is avaiable in two states:

Version:
1.0
Author:
Marco Frattallone
See Also:
MXLet.destroyXlet(boolean), Serialized Form

Field Summary
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Method Summary
 void customizeView(MImage backgroundImage, MImage yesImage, MImage noImage)
          Customizes view for this component.
static MContainer getInstance(MXLet mXlet)
          Gets a MContainer instance.
 void manageEvent(java.awt.event.KeyEvent event)
          Manages LEFT, RIGHT and OK events.
 boolean restoreDefaultView()
          Restore state to STATE_DEFAULT.
 
Methods inherited from class com.mamarce.mhp.mf.components.MContainer
activate, paint, passivate, setBackgroundColor
 
Methods inherited from class org.havi.ui.HContainer
addAfter, addBefore, getMatte, group, isDoubleBuffered, isGrouped, isOpaque, pop, popInFrontOf, popToFront, push, pushBehind, pushToBack, setMatte, ungroup
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static MContainer getInstance(MXLet mXlet)
Gets a MContainer instance.

Returns:
an instance of MContainer.

customizeView

public void customizeView(MImage backgroundImage,
                          MImage yesImage,
                          MImage noImage)
Customizes view for this component. It receive three images.

BackgroundImage is an image that should display exit message and focus off images for yes/no options.
YesImage is an image displayed upon backgrounImage when yes option has the focus.
NoImage is an image displayed upon backgrounImage when no option has the focus.

Parameters:
backgroundImage - background image
yesImage - yes foucesd image
noImage - no focused image

restoreDefaultView

public boolean restoreDefaultView()
Restore state to STATE_DEFAULT.

Returns:
true if changins take effect.

manageEvent

public void manageEvent(java.awt.event.KeyEvent event)
Manages LEFT, RIGHT and OK events.

Specified by:
manageEvent in interface MListener
Parameters:
event - keyEvent