|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.wtk.skin.ComponentSkin
org.apache.pivot.wtk.skin.ContainerSkin
org.apache.pivot.wtk.skin.terra.TerraMenuSkin
public class TerraMenuSkin
Menu 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.MenuListener |
---|
MenuListener.Adapter |
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerListener |
---|
ContainerListener.Adapter |
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerMouseListener |
---|
ContainerMouseListener.Adapter |
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentListener |
---|
ComponentListener.Adapter |
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentStateListener |
---|
ComponentStateListener.Adapter |
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseListener |
---|
ComponentMouseListener.Adapter |
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseButtonListener |
---|
ComponentMouseButtonListener.Adapter |
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentKeyListener |
---|
ComponentKeyListener.Adapter |
Constructor Summary | |
---|---|
TerraMenuSkin()
|
Method Summary | |
---|---|
void |
activeItemChanged(Menu menu,
Menu.Item previousActiveItem)
Called when a menu's active item has changed. |
Color |
getActiveBackgroundColor()
|
Color |
getActiveColor()
|
Color |
getColor()
|
Color |
getDisabledColor()
|
Font |
getFont()
|
int |
getMargin()
|
Color |
getMarginColor()
|
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. |
int |
getSectionSpacing()
|
Color |
getSeparatorColor()
|
boolean |
getShowKeyboardShortcuts()
|
void |
install(Component component)
Associates a skin with a component. |
boolean |
isFocusable()
By default, skins are focusable. |
void |
itemInserted(Menu.Section section,
int index)
Called when a menu item has been inserted. |
void |
itemsRemoved(Menu.Section section,
int index,
Sequence<Menu.Item> removed)
Called when menu items have been removed. |
boolean |
keyPressed(Component component,
int keyCode,
Keyboard.KeyLocation keyLocation)
UP Select the previous enabled menu item. |
boolean |
keyReleased(Component component,
int keyCode,
Keyboard.KeyLocation keyLocation)
SPACE 'presses' the active menu item if it does
not have a sub-menu. |
boolean |
keyTyped(Component component,
char character)
Select the next enabled menu item where the first character of the rendered text matches the typed key (case insensitive). |
void |
layout()
If the component on which the skin is installed is a container, lays out the container's children. |
void |
nameChanged(Menu.Section section,
String previousName)
Called when a section's name has changed. |
void |
paint(Graphics2D graphics)
Paints the visual. |
void |
sectionInserted(Menu menu,
int index)
Called when a menu section has been inserted. |
void |
sectionsRemoved(Menu menu,
int index,
Sequence<Menu.Section> removed)
Called when menu sections have been removed. |
void |
setActiveBackgroundColor(Color activeBackgroundColor)
|
void |
setActiveBackgroundColor(String activeBackgroundColor)
|
void |
setActiveColor(Color activeColor)
|
void |
setActiveColor(String activeColor)
|
void |
setColor(Color color)
|
void |
setColor(String color)
|
void |
setDisabledColor(Color disabledColor)
|
void |
setDisabledColor(String disabledColor)
|
void |
setFont(Dictionary<String,?> font)
|
void |
setFont(Font font)
|
void |
setFont(String font)
|
void |
setMargin(int margin)
|
void |
setMarginColor(Color marginColor)
|
void |
setSectionSpacing(int sectionSpacing)
|
void |
setSeparatorColor(Color separatorColor)
|
void |
setShowKeyboardShortcuts(boolean showKeyboardShortcuts)
|
Methods inherited from class org.apache.pivot.wtk.skin.ContainerSkin |
---|
componentInserted, componentMoved, componentsRemoved, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isOpaque, mouseDown, mouseMove, mouseUp, mouseWheel, setBackgroundColor, setBackgroundColor, setBackgroundPaint, setBackgroundPaint, setBackgroundPaint |
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin |
---|
cursorChanged, decodeFont, dragSourceChanged, dropTargetChanged, enabledChanged, focusedChanged, getBaseline, getBaseline, getComponent, getHeight, getWidth, heightLimitsChanged, invalidateComponent, locationChanged, menuHandlerChanged, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setSize, sizeChanged, tooltipDelayChanged, tooltipTextChanged, tooltipTriggered, visibleChanged, widthLimitsChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TerraMenuSkin()
Method Detail |
---|
public void install(Component component)
Skin
install
in interface Skin
install
in class ContainerSkin
component
- The component to which the skin is being attached.public boolean isFocusable()
ComponentSkin
isFocusable
in interface Skin
isFocusable
in class ContainerSkin
public int getPreferredWidth(int height)
ConstrainedVisual
getPreferredWidth
in interface ConstrainedVisual
getPreferredWidth
in class ContainerSkin
height
- The height by which to constrain the preferred width, or -1
for no constraint.public int getPreferredHeight(int width)
ConstrainedVisual
getPreferredHeight
in interface ConstrainedVisual
getPreferredHeight
in class ContainerSkin
width
- The width by which to constrain the preferred height, or -1
for no constraint.public Dimensions getPreferredSize()
ConstrainedVisual
getPreferredSize
in interface ConstrainedVisual
getPreferredSize
in class ComponentSkin
public void layout()
Skin
layout
in interface Skin
public void paint(Graphics2D graphics)
Visual
paint
in interface Visual
paint
in class ContainerSkin
graphics
- The graphics context in which to paint the visual.public Font getFont()
public void setFont(Font font)
public final void setFont(String font)
public final void setFont(Dictionary<String,?> font)
public Color getColor()
public void setColor(Color color)
public final void setColor(String color)
public Color getDisabledColor()
public void setDisabledColor(Color disabledColor)
public final void setDisabledColor(String disabledColor)
public Color getActiveColor()
public void setActiveColor(Color activeColor)
public final void setActiveColor(String activeColor)
public Color getActiveBackgroundColor()
public void setActiveBackgroundColor(Color activeBackgroundColor)
public final void setActiveBackgroundColor(String activeBackgroundColor)
public Color getMarginColor()
public void setMarginColor(Color marginColor)
public int getMargin()
public void setMargin(int margin)
public Color getSeparatorColor()
public void setSeparatorColor(Color separatorColor)
public int getSectionSpacing()
public void setSectionSpacing(int sectionSpacing)
public boolean getShowKeyboardShortcuts()
public void setShowKeyboardShortcuts(boolean showKeyboardShortcuts)
public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
UP
Select the previous enabled menu item.DOWN
Select the next enabled menu item.LEFT
Close the current sub-menu.RIGHT
Open the sub-menu of the current menu
item.ENTER
'presses' the active menu item if it
does not have a sub-menu.
keyPressed
in interface ComponentKeyListener
keyPressed
in class ComponentSkin
public boolean keyReleased(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
SPACE
'presses' the active menu item if it does
not have a sub-menu.
keyReleased
in interface ComponentKeyListener
keyReleased
in class ComponentSkin
public boolean keyTyped(Component component, char character)
keyTyped
in interface ComponentKeyListener
keyTyped
in class ComponentSkin
public void sectionInserted(Menu menu, int index)
MenuListener
sectionInserted
in interface MenuListener
public void sectionsRemoved(Menu menu, int index, Sequence<Menu.Section> removed)
MenuListener
sectionsRemoved
in interface MenuListener
public void itemInserted(Menu.Section section, int index)
Menu.SectionListener
itemInserted
in interface Menu.SectionListener
public void itemsRemoved(Menu.Section section, int index, Sequence<Menu.Item> removed)
Menu.SectionListener
itemsRemoved
in interface Menu.SectionListener
public void nameChanged(Menu.Section section, String previousName)
Menu.SectionListener
nameChanged
in interface Menu.SectionListener
public void activeItemChanged(Menu menu, Menu.Item previousActiveItem)
MenuListener
activeItemChanged
in interface MenuListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |