Package org.apache.pivot.wtk.skin.terra
Class TerraPanoramaSkin
- java.lang.Object
-
- org.apache.pivot.wtk.skin.ComponentSkin
-
- org.apache.pivot.wtk.skin.ContainerSkin
-
- org.apache.pivot.wtk.skin.terra.TerraPanoramaSkin
-
- All Implemented Interfaces:
ComponentKeyListener
,ComponentListener
,ComponentMouseButtonListener
,ComponentMouseListener
,ComponentMouseWheelListener
,ComponentStateListener
,ComponentTooltipListener
,ConstrainedVisual
,ContainerListener
,ContainerMouseListener
,Skin
,Viewport.Skin
,ViewportListener
,Visual
public class TerraPanoramaSkin extends ContainerSkin implements Viewport.Skin, ViewportListener
Panorama skin.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
TerraPanoramaSkin.EastButtonImage
East button image.protected class
TerraPanoramaSkin.NorthButtonImage
North button image.protected class
TerraPanoramaSkin.ScrollButton
protected class
TerraPanoramaSkin.ScrollButtonImage
Abstract base class for button images.class
TerraPanoramaSkin.ScrollButtonSkin
protected class
TerraPanoramaSkin.SouthButtonImage
South button image.protected class
TerraPanoramaSkin.WestButtonImage
West button image.-
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.ViewportListener
ViewportListener.Adapter, ViewportListener.Listeners
-
-
Constructor Summary
Constructors Constructor Description TerraPanoramaSkin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getAlwaysShowScrollButtons()
java.awt.Color
getButtonBackgroundColor()
java.awt.Color
getButtonColor()
int
getButtonPadding()
protected int
getMaxScrollLeft()
protected int
getMaxScrollTop()
int
getPreferredHeight(int width)
Returns the visual's preferred height given the provided width constraint.Dimensions
getPreferredSize()
Returns the visual's unconstrained preferred size.int
getPreferredWidth(int height)
Returns the visual's preferred width given the provided height constraint.Bounds
getViewportBounds()
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.void
layout()
If the component on which the skin is installed is a container, lays out the container's children.void
mouseOut(Component component)
Called when the mouse exits a component.void
mouseOver(Component component)
Called when the mouse enters a component.boolean
mouseWheel(Component component, Mouse.ScrollType scrollType, int scrollAmount, int wheelRotation, int x, int y)
Called when the mouse wheel is scrolled over a component.void
scrollLeftChanged(Viewport panorama, int previousScrollLeft)
Called when a viewport's scroll left has changed.void
scrollTopChanged(Viewport panorama, int previousScrollTop)
Called when a viewport's scroll top has changed.void
setAlwaysShowScrollButtons(boolean alwaysShowScrollButtons)
void
setButtonBackgroundColor(int buttonBackgroundColor)
void
setButtonBackgroundColor(java.awt.Color buttonBackgroundColor)
void
setButtonBackgroundColor(java.lang.String buttonBackgroundColor)
void
setButtonColor(java.awt.Color buttonColor)
void
setButtonColor(java.lang.String buttonColor)
void
setButtonPadding(int buttonPadding)
void
setButtonPadding(java.lang.Number padding)
protected void
updateScrollButtonVisibility()
void
viewChanged(Viewport panorama, Component previousView)
Called when a viewport's view component has changed.-
Methods inherited from class org.apache.pivot.wtk.skin.ContainerSkin
componentInserted, componentMoved, componentsRemoved, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isFocusable, isOpaque, mouseDown, 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, keyPressed, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseClick, mouseDown, mouseMove, mouseUp, 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
setSize
-
-
-
-
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 classContainerSkin
- Parameters:
component
- The component to which the skin is being attached.
-
getPreferredWidth
public int getPreferredWidth(int height)
Description copied from interface:ConstrainedVisual
Returns the visual's preferred width given the provided height constraint.- Specified by:
getPreferredWidth
in interfaceConstrainedVisual
- Overrides:
getPreferredWidth
in classContainerSkin
- Parameters:
height
- The height by which to constrain the preferred width, or-1
for no constraint.- Returns:
- The preferred width given the height constraint.
-
getPreferredHeight
public int getPreferredHeight(int width)
Description copied from interface:ConstrainedVisual
Returns the visual's preferred height given the provided width constraint.- Specified by:
getPreferredHeight
in interfaceConstrainedVisual
- Overrides:
getPreferredHeight
in classContainerSkin
- Parameters:
width
- The width by which to constrain the preferred height, or-1
for no constraint.- Returns:
- The preferred height given the width constraint.
-
getPreferredSize
public Dimensions getPreferredSize()
Description copied from interface:ConstrainedVisual
Returns the visual's unconstrained preferred size.- Specified by:
getPreferredSize
in interfaceConstrainedVisual
- Overrides:
getPreferredSize
in classComponentSkin
- Returns:
- The preferred size (width and height) of this component.
Depending on the component this can be a static value or derived (as for a container) from its subcomponents, etc.
The default implementation simply calls
ConstrainedVisual.getPreferredWidth(int)
andConstrainedVisual.getPreferredHeight(int)
.
-
layout
public void layout()
Description copied from interface:Skin
If the component on which the skin is installed is a container, lays out the container's children.
-
getViewportBounds
public Bounds getViewportBounds()
- Specified by:
getViewportBounds
in interfaceViewport.Skin
- Returns:
- The bounds of the Viewport within the container, for example, in ScrollPaneSkin, this excludes the scrollbars.
-
mouseWheel
public boolean mouseWheel(Component component, Mouse.ScrollType scrollType, int scrollAmount, int wheelRotation, int x, int y)
Description copied from interface:ComponentMouseWheelListener
Called when the mouse wheel is scrolled over a component.- Specified by:
mouseWheel
in interfaceComponentMouseWheelListener
- Overrides:
mouseWheel
in classComponentSkin
- Parameters:
component
- Component under the mouse pointer.scrollType
- What type of scroll was requested on the mouse.scrollAmount
- Amount of scrolling.wheelRotation
- Rotation value.x
- X position of the mouse.y
- Y position of the mouse.- Returns:
true
to consume the event;false
to allow it to propagate.
-
getButtonColor
public java.awt.Color getButtonColor()
-
setButtonColor
public void setButtonColor(java.awt.Color buttonColor)
-
setButtonColor
public final void setButtonColor(java.lang.String buttonColor)
-
getButtonBackgroundColor
public java.awt.Color getButtonBackgroundColor()
-
setButtonBackgroundColor
public void setButtonBackgroundColor(java.awt.Color buttonBackgroundColor)
-
setButtonBackgroundColor
public final void setButtonBackgroundColor(java.lang.String buttonBackgroundColor)
-
setButtonBackgroundColor
public final void setButtonBackgroundColor(int buttonBackgroundColor)
-
getButtonPadding
public int getButtonPadding()
-
setButtonPadding
public void setButtonPadding(int buttonPadding)
-
setButtonPadding
public final void setButtonPadding(java.lang.Number padding)
-
getAlwaysShowScrollButtons
public boolean getAlwaysShowScrollButtons()
-
setAlwaysShowScrollButtons
public void setAlwaysShowScrollButtons(boolean alwaysShowScrollButtons)
-
getMaxScrollTop
protected int getMaxScrollTop()
-
getMaxScrollLeft
protected int getMaxScrollLeft()
-
updateScrollButtonVisibility
protected void updateScrollButtonVisibility()
-
mouseOver
public void mouseOver(Component component)
Description copied from interface:ComponentMouseListener
Called when the mouse enters a component.Default is to do nothing.
- Specified by:
mouseOver
in interfaceComponentMouseListener
- Overrides:
mouseOver
in classComponentSkin
- Parameters:
component
- Component that is now under the mouse pointer.
-
mouseOut
public void mouseOut(Component component)
Description copied from interface:ComponentMouseListener
Called when the mouse exits a component.Default is to do nothing.
- Specified by:
mouseOut
in interfaceComponentMouseListener
- Overrides:
mouseOut
in classComponentSkin
- Parameters:
component
- Component that has now lost the mouse pointer.
-
scrollTopChanged
public void scrollTopChanged(Viewport panorama, int previousScrollTop)
Description copied from interface:ViewportListener
Called when a viewport's scroll top has changed.- Specified by:
scrollTopChanged
in interfaceViewportListener
- Parameters:
panorama
- The viewport that has scrolled.previousScrollTop
- The previous top scroll position.
-
scrollLeftChanged
public void scrollLeftChanged(Viewport panorama, int previousScrollLeft)
Description copied from interface:ViewportListener
Called when a viewport's scroll left has changed.- Specified by:
scrollLeftChanged
in interfaceViewportListener
- Parameters:
panorama
- The viewport that has been scrolled.previousScrollLeft
- The previous left scroll position.
-
viewChanged
public void viewChanged(Viewport panorama, Component previousView)
Description copied from interface:ViewportListener
Called when a viewport's view component has changed.- Specified by:
viewChanged
in interfaceViewportListener
- Parameters:
panorama
- The viewport whose view has changed.previousView
- What the view (or the scrollable component) used to be.
-
-