Package org.apache.pivot.wtk.skin.terra
Class TerraMenuPopupSkin
- java.lang.Object
-
- org.apache.pivot.wtk.skin.ComponentSkin
-
- org.apache.pivot.wtk.skin.ContainerSkin
-
- org.apache.pivot.wtk.skin.WindowSkin
-
- org.apache.pivot.wtk.skin.terra.TerraMenuPopupSkin
-
- All Implemented Interfaces:
ComponentKeyListener,ComponentListener,ComponentMouseButtonListener,ComponentMouseListener,ComponentMouseWheelListener,ComponentStateListener,ComponentTooltipListener,ConstrainedVisual,ContainerListener,ContainerMouseListener,MenuPopupListener,MenuPopupStateListener,Skin,Visual,Window.Skin,WindowListener,WindowStateListener
public class TerraMenuPopupSkin extends WindowSkin implements MenuPopupListener, MenuPopupStateListener
Menu popup skin.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.pivot.wtk.skin.ContainerSkin
ContainerSkin.IndexFocusTraversalPolicy
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentKeyListener
ComponentKeyListener.Adapter, ComponentKeyListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentListener
ComponentListener.Adapter, ComponentListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseButtonListener
ComponentMouseButtonListener.Adapter, ComponentMouseButtonListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseListener
ComponentMouseListener.Adapter, ComponentMouseListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseWheelListener
ComponentMouseWheelListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentStateListener
ComponentStateListener.Adapter, ComponentStateListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentTooltipListener
ComponentTooltipListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerListener
ContainerListener.Adapter, ContainerListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerMouseListener
ContainerMouseListener.Adapter, ContainerMouseListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.MenuPopupListener
MenuPopupListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.MenuPopupStateListener
MenuPopupStateListener.Adapter, MenuPopupStateListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.WindowListener
WindowListener.Adapter, WindowListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.WindowStateListener
WindowStateListener.Adapter, WindowStateListener.Listeners
-
-
Constructor Summary
Constructors Constructor Description TerraMenuPopupSkin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.ColorgetBorderColor()intgetCloseTransitionDuration()intgetCloseTransitionRate()voidinstall(Component component)Must be implemented in every subclass in order to do component-specific operations at instantiation time, but every subclass must call this superclass method to setup the necessary listeners, etc.booleankeyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)ESCAPEClose the menu popup.voidmenuChanged(MenuPopup menuPopup, Menu previousMenu)Called when a menu popup's menu has changed.voidmenuPopupClosed(MenuPopup menuPopup)Called when a menu popup has closed.voidmenuPopupCloseVetoed(MenuPopup menuPopup, Vote reason)Called when a menu popup close event has been vetoed.VotepreviewMenuPopupClose(MenuPopup menuPopup, boolean immediate)Called to preview a menu popup close event.voidsetBorderColor(java.awt.Color borderColor)voidsetBorderColor(java.lang.String borderColor)voidsetCloseTransitionDuration(int closeTransitionDuration)voidsetCloseTransitionRate(int closeTransitionRate)voidwindowClosed(Window window, Display display, Window owner)Called when a window has closed.voidwindowOpened(Window window)Called when a window has opened.-
Methods inherited from class org.apache.pivot.wtk.skin.WindowSkin
contentChanged, getClientArea, getPreferredHeight, getPreferredSize, getPreferredWidth, layout, mouseDown
-
Methods inherited from class org.apache.pivot.wtk.skin.ContainerSkin
componentInserted, componentMoved, componentsRemoved, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isFocusable, isOpaque, mouseMove, mouseUp, mouseWheel, paint, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundPaint, setBackgroundPaint, setBackgroundPaint
-
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
colorFromObject, colorFromObject, colorFromObject, colorFromObject, currentTheme, cursorChanged, decodeFont, defaultBackgroundColor, defaultForegroundColor, dragSourceChanged, dropTargetChanged, enabledChanged, focusedChanged, fontFromObject, getBaseline, getBaseline, getColor, getComponent, getFocusRectangleStroke, getHeight, getSize, getTextInputMethodListener, getThemeFont, getWidth, heightLimitsChanged, invalidateComponent, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setDefaultStyles, setSize, sizeChanged, themeHasThickFocusRectangle, themeHasTransitionEnabled, themeIsDark, themeIsFlat, tooltipDelayChanged, tooltipTextChanged, tooltipTriggered, visibleChanged, widthLimitsChanged
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pivot.wtk.ConstrainedVisual
getBaseline, setSize, setSize
-
Methods inherited from interface org.apache.pivot.wtk.Skin
getComponent, isFocusable, isOpaque
-
Methods inherited from interface org.apache.pivot.wtk.Visual
getBaseline, getHeight, getSize, getWidth, paint
-
Methods inherited from interface org.apache.pivot.wtk.WindowListener
activeChanged, iconAdded, iconInserted, iconsRemoved, maximizedChanged, titleChanged
-
Methods inherited from interface org.apache.pivot.wtk.WindowStateListener
previewWindowClose, previewWindowOpen, windowCloseVetoed, windowOpenVetoed
-
-
-
-
Method Detail
-
install
public void install(Component component)
Description copied from class:ComponentSkinMust be implemented in every subclass in order to do component-specific operations at instantiation time, but every subclass must call this superclass method to setup the necessary listeners, etc.- Specified by:
installin interfaceSkin- Overrides:
installin classWindowSkin- Parameters:
component- The component to which the skin is being attached.
-
getBorderColor
public java.awt.Color getBorderColor()
-
setBorderColor
public void setBorderColor(java.awt.Color borderColor)
-
setBorderColor
public void setBorderColor(java.lang.String borderColor)
-
getCloseTransitionDuration
public int getCloseTransitionDuration()
-
setCloseTransitionDuration
public void setCloseTransitionDuration(int closeTransitionDuration)
-
getCloseTransitionRate
public int getCloseTransitionRate()
-
setCloseTransitionRate
public void setCloseTransitionRate(int closeTransitionRate)
-
keyPressed
public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
ESCAPEClose the menu popup.- Specified by:
keyPressedin interfaceComponentKeyListener- Overrides:
keyPressedin classComponentSkin- Parameters:
component- Component that has the focus.keyCode- The key code for the key that was pressed.keyLocation- Location value for the key (left or right for shift keys, etc.).- Returns:
trueto consume the event;falseto allow it to propagate.
-
windowOpened
public void windowOpened(Window window)
Description copied from interface:WindowStateListenerCalled when a window has opened.- Specified by:
windowOpenedin interfaceWindowStateListener- Parameters:
window- The newly opened window.
-
windowClosed
public void windowClosed(Window window, Display display, Window owner)
Description copied from interface:WindowStateListenerCalled when a window has closed.- Specified by:
windowClosedin interfaceWindowStateListener- Overrides:
windowClosedin classWindowSkin- Parameters:
window- The window that is now closed.display- The display in which the window was shown.owner- The owner of this window (which could benull).
-
menuChanged
public void menuChanged(MenuPopup menuPopup, Menu previousMenu)
Description copied from interface:MenuPopupListenerCalled when a menu popup's menu has changed.- Specified by:
menuChangedin interfaceMenuPopupListener- Parameters:
menuPopup- The menu popup source of this event.previousMenu- What the menu used to be for this popup.
-
previewMenuPopupClose
public Vote previewMenuPopupClose(MenuPopup menuPopup, boolean immediate)
Description copied from interface:MenuPopupStateListenerCalled to preview a menu popup close event.- Specified by:
previewMenuPopupClosein interfaceMenuPopupStateListener- Parameters:
menuPopup- The source of the event.immediate- Whether the close is meant to be immediate.- Returns:
- The verdict as to whether to close from this listener.
-
menuPopupCloseVetoed
public void menuPopupCloseVetoed(MenuPopup menuPopup, Vote reason)
Description copied from interface:MenuPopupStateListenerCalled when a menu popup close event has been vetoed.- Specified by:
menuPopupCloseVetoedin interfaceMenuPopupStateListener- Parameters:
menuPopup- The source of the event.reason- The accumulated vote that caused the veto.
-
menuPopupClosed
public void menuPopupClosed(MenuPopup menuPopup)
Description copied from interface:MenuPopupStateListenerCalled when a menu popup has closed.- Specified by:
menuPopupClosedin interfaceMenuPopupStateListener- Parameters:
menuPopup- The menu popup that closed.
-
-