org.apache.pivot.wtk
Interface Skin

All Superinterfaces:
ConstrainedVisual, Visual
All Known Subinterfaces:
FileBrowser.Skin, Window.Skin
All Known Implementing Classes:
ActivityIndicatorSkin, BorderSkin, BoxPaneSkin, ButtonSkin, CalendarButtonSkin, CalendarSkin, CardPaneSkin, ChartViewSkin, CheckboxSkin, ColorChooserButtonSkin, ColorChooserButtonSkin.ColorChooserPopupSkin, ColorChooserSkin, ComponentSkin, ContainerSkin, DisplaySkin, ExpanderSkin, FileBrowserSkin, FillPaneSkin, FlowPaneSkin, GridPaneFillerSkin, GridPaneSkin, ImageViewSkin, LabelSkin, LinkButtonSkin, ListButtonSkin, MenuBarItemSkin, MenuButtonSkin, MenuItemSkin, MovieViewSkin, PanelSkin, PushButtonSkin, RadioButtonSkin, RollupSkin, ScrollPaneSkin, SeparatorSkin, SliderSkin, StackPaneSkin, TablePaneFillerSkin, TablePaneSkin, TabPaneSkin, TerraAccordionSkin, TerraAccordionSkin.PanelHeaderSkin, TerraActivityIndicatorSkin, TerraAlertSkin, TerraBorderSkin, TerraBoxPaneSkin, TerraCalendarButtonSkin, TerraCalendarSkin, TerraCalendarSkin.DateButtonSkin, TerraCheckboxSkin, TerraColorChooserButtonSkin, TerraColorChooserSkin, TerraDialogSkin, TerraExpanderSkin, TerraExpanderSkin.ShadeButtonSkin, TerraFileBrowserSheetSkin, TerraFileBrowserSkin, TerraFillPaneSkin, TerraFormSkin, TerraFrameSkin, TerraFrameSkin.FrameButtonSkin, TerraGridPaneSkin, TerraLabelSkin, TerraLinkButtonSkin, TerraListButtonSkin, TerraListViewSkin, TerraMenuBarItemSkin, TerraMenuBarSkin, TerraMenuButtonSkin, TerraMenuItemSkin, TerraMenuPopupSkin, TerraMenuSkin, TerraMeterSkin, TerraPaletteSkin, TerraPanelSkin, TerraPanoramaSkin, TerraPanoramaSkin.ScrollButtonSkin, TerraPromptSkin, TerraPushButtonSkin, TerraRadioButtonSkin, TerraRollupSkin, TerraRollupSkin.RollupButtonSkin, TerraScrollBarSkin, TerraScrollBarSkin.HandleSkin, TerraScrollBarSkin.ScrollButtonSkin, TerraScrollPaneCornerSkin, TerraScrollPaneSkin, TerraSeparatorSkin, TerraSheetSkin, TerraSliderSkin, TerraSliderSkin.ThumbSkin, TerraSpinnerSkin, TerraSpinnerSkin.SpinButtonSkin, TerraSpinnerSkin.SpinnerContentSkin, TerraSplitPaneSkin, TerraSplitPaneSkin.SplitterShadowSkin, TerraSplitPaneSkin.SplitterSkin, TerraSuggestionPopupSkin, TerraTablePaneSkin, TerraTableViewHeaderSkin, TerraTableViewSkin, TerraTabPaneSkin, TerraTabPaneSkin.TabButtonSkin, TerraTextAreaSkin, TerraTextInputSkin, TerraTextPaneSkin, TerraTooltipSkin, TerraTreeViewSkin, TextAreaSkin, TextPaneSkin, WindowSkin

public interface Skin
extends ConstrainedVisual

Interface defining a "skin". A skin is the graphical representation of a component. In MVC terminology, a skin represents the "view" of the "model" data provided by a component. Components delegate a number of methods to the skin, including all methods defined by the Visual interface as well as style properties and layout. In conjunction with renderers (implementations of the Renderer interface), skins define the overall look and feel of an application.

Skins are primarily responsible for the following:

Skins will often change their appearance in response to events fired by the component; most commonly, this will be in response to data changes within the component but may also be in response to input events (e.g. keyboard, mouse). Skins are not required to register for such events - skin base classes implement all relevant listener interfaces and the component calls them as appropriate.

Skins may (but are not required to) expose internal properties that affect the appearance of the component as "style properties", similar to CSS styles. For example, a component might provide styles to let a caller set the foreground color and font. Since callers are not allowed to interact with a component's skin directly, access to styles is via the component's styles collection, which delegates to the dictionary methods in the installed skin. Skins are responsible for invalidating or repainting the component as appropriate in response to events and style changes.


Method Summary
 Component getComponent()
          Returns the component with which a skin is associated.
 void install(Component component)
          Associates a skin with a component.
 boolean isFocusable()
          Returns the skin's focusable state.
 boolean isOpaque()
          Tells whether or not this skin is fully opaque when painted.
 void layout()
          If the component on which the skin is installed is a container, lays out the container's children.
 
Methods inherited from interface org.apache.pivot.wtk.ConstrainedVisual
getBaseline, getPreferredHeight, getPreferredSize, getPreferredWidth, setSize
 
Methods inherited from interface org.apache.pivot.wtk.Visual
getBaseline, getHeight, getWidth, paint
 

Method Detail

install

void install(Component component)
Associates a skin with a component.

Parameters:
component - The component to which the skin is being attached.

getComponent

Component getComponent()
Returns the component with which a skin is associated.


layout

void layout()
If the component on which the skin is installed is a container, lays out the container's children.


isFocusable

boolean isFocusable()
Returns the skin's focusable state.

Returns:
true if this skin is focusable; false, otherwise.

isOpaque

boolean isOpaque()
Tells whether or not this skin is fully opaque when painted.

Returns:
true if this skin is opaque; false if any part of it is transparent or translucent.