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.Color
getBorderColor()
int
getCloseTransitionDuration()
int
getCloseTransitionRate()
void
install(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.boolean
keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
ESCAPE
Close the menu popup.void
menuChanged(MenuPopup menuPopup, Menu previousMenu)
Called when a menu popup's menu has changed.void
menuPopupClosed(MenuPopup menuPopup)
Called when a menu popup has closed.void
menuPopupCloseVetoed(MenuPopup menuPopup, Vote reason)
Called when a menu popup close event has been vetoed.Vote
previewMenuPopupClose(MenuPopup menuPopup, boolean immediate)
Called to preview a menu popup close event.void
setBorderColor(java.awt.Color borderColor)
void
setBorderColor(java.lang.String borderColor)
void
setCloseTransitionDuration(int closeTransitionDuration)
void
setCloseTransitionRate(int closeTransitionRate)
void
windowClosed(Window window, Display display, Window owner)
Called when a window has closed.void
windowOpened(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:ComponentSkin
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.- Specified by:
install
in interfaceSkin
- Overrides:
install
in 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)
ESCAPE
Close the menu popup.- Specified by:
keyPressed
in interfaceComponentKeyListener
- Overrides:
keyPressed
in 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:
true
to consume the event;false
to allow it to propagate.
-
windowOpened
public void windowOpened(Window window)
Description copied from interface:WindowStateListener
Called when a window has opened.- Specified by:
windowOpened
in interfaceWindowStateListener
- Parameters:
window
- The newly opened window.
-
windowClosed
public void windowClosed(Window window, Display display, Window owner)
Description copied from interface:WindowStateListener
Called when a window has closed.- Specified by:
windowClosed
in interfaceWindowStateListener
- Overrides:
windowClosed
in 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:MenuPopupListener
Called when a menu popup's menu has changed.- Specified by:
menuChanged
in 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:MenuPopupStateListener
Called to preview a menu popup close event.- Specified by:
previewMenuPopupClose
in 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:MenuPopupStateListener
Called when a menu popup close event has been vetoed.- Specified by:
menuPopupCloseVetoed
in 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:MenuPopupStateListener
Called when a menu popup has closed.- Specified by:
menuPopupClosed
in interfaceMenuPopupStateListener
- Parameters:
menuPopup
- The menu popup that closed.
-
-