|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.plaf.LookAndFeel
public abstract class LookAndFeel
Allows a UI developer to completely customize the look of the application by overriding drawing/sizing methods appropriately.
Constructor Summary | |
---|---|
LookAndFeel()
|
Method Summary | |
---|---|
void |
bind(Component cmp)
Every component binds itself to the look and feel thus allowing the look and feel to customize the component. |
abstract void |
drawButton(Graphics g,
Button b)
Invoked for drawing a button widget |
abstract void |
drawCheckBox(Graphics g,
Button cb)
Invoked for drawing a checkbox widget |
abstract void |
drawComboBox(Graphics g,
List cb)
Invoked for drawing a combo box widget |
void |
drawHorizontalScroll(Graphics g,
Component c,
float offsetRatio,
float blockSizeRatio)
Draws a horizontal scroll bar in the given component |
abstract void |
drawLabel(Graphics g,
Label l)
Invoked for drawing a label widget |
abstract void |
drawList(Graphics g,
List l)
Invoked for drawing a list widget |
abstract void |
drawRadioButton(Graphics g,
Button rb)
Invoked for drawing the radio button widget |
abstract void |
drawTabbedPane(Graphics g,
TabbedPane tp)
Deprecated. |
abstract void |
drawTabbedPaneContentPane(TabbedPane tp,
Graphics g,
Rectangle rect,
Dimension cellsPreferredSize,
int numOfTabs,
int selectedTabIndex,
Dimension tabsSize,
int cellOffsetX,
int cellOffsetY)
Deprecated. |
abstract void |
drawTextArea(Graphics g,
TextArea ta)
Draw the given text area |
abstract void |
drawTextField(Graphics g,
TextArea ta)
Draws the text field without its cursor which is drawn in a separate method input mode indication can also be drawn using this method. |
abstract void |
drawTextFieldCursor(Graphics g,
TextArea ta)
Draws the cursor of the text field, blinking is handled simply by avoiding a call to this method. |
void |
drawVerticalScroll(Graphics g,
Component c,
float offsetRatio,
float blockSizeRatio)
Draws a vertical scroll bar in the given component |
abstract Dimension |
getButtonPreferredSize(Button b)
Calculate the preferred size of the component |
abstract Dimension |
getCheckBoxPreferredSize(Button cb)
Calculate the preferred size of the component |
abstract Dimension |
getComboBoxPreferredSize(List box)
Calculate the preferred size of the component |
Transition |
getDefaultDialogTransitionIn()
Allows us to define a default animation that will draw the transition for entering a dialog |
Transition |
getDefaultDialogTransitionOut()
Allows us to define a default animation that will draw the transition for exiting a dialog |
int |
getDefaultFormTintColor()
Tint color is set when a form is partially covered be it by a menu or by a dialog. |
Transition |
getDefaultFormTransitionIn()
Allows us to define a default animation that will draw the transition for entering a form |
Transition |
getDefaultFormTransitionOut()
Allows us to define a default animation that will draw the transition for exiting a form |
Transition |
getDefaultMenuTransitionIn()
Allows us to define a default animation that will draw the transition for entering a Menu |
Transition |
getDefaultMenuTransitionOut()
Allows us to define a default animation that will draw the transition for exiting a Menu |
int |
getDefaultSmoothScrollingSpeed()
Indicates the default speed for smooth scrolling |
int |
getDisableColor()
This color is used to paint disable mode text color. |
int |
getFadeScrollEdgeLength()
Indicates the width/height of the fading edge to indicate scrolling |
int |
getHorizontalScrollHeight()
Returns the default height of a horizontal scroll bar |
abstract Dimension |
getLabelPreferredSize(Label l)
Calculate the preferred size of the component |
abstract Dimension |
getListPreferredSize(List l)
Calculate the preferred size of the component |
java.lang.Class |
getMenuBarClass()
This method returns the MenuBar class. |
Image[] |
getMenuIcons()
Simple getter for the menu icons |
ListCellRenderer |
getMenuRenderer()
Returns the Menu default renderer |
abstract Dimension |
getRadioButtonPreferredSize(Button rb)
Calculate the preferred size of the component |
abstract Component |
getTabbedPaneCell(TabbedPane tp,
java.lang.String text,
Image icon,
boolean isSelected,
boolean cellHasFocus,
Style cellStyle,
Style cellSelectedStyle,
Style tabbedPaneStyle,
int cellOffsetX,
int cellOffsetY,
Dimension cellsPreferredSize,
Dimension contentPaneSize)
Deprecated. |
int |
getTactileTouchDuration()
Allows defining a tactile touch device that vibrates when the user presses a component that should respond with tactile feedback on a touch device (e.g. vibrate). |
abstract Dimension |
getTextAreaSize(TextArea ta,
boolean pref)
Calculate the preferred size of the component |
int |
getTextFieldCursorColor()
The color of the text field cursor |
abstract Dimension |
getTextFieldPreferredSize(TextArea ta)
Calculate the preferred size of the component |
long |
getTickerSpeed()
Gets the ticker speed |
int |
getVerticalScrollWidth()
Returns the default width of a vertical scroll bar |
boolean |
isDefaultAlwaysTensile()
Enable the tensile drag to work even when a component doesn't have a scroll showable (scrollable flag still needs to be set to true) |
boolean |
isDefaultEndsWith3Points()
Indicates whether labels should end with 3 points by default |
boolean |
isDefaultSmoothScrolling()
Indicates whether lists and containers should have smooth scrolling by default |
boolean |
isDefaultSnapToGrid()
Indicates whether scrolling this component should jump to a specific location in a grid |
boolean |
isDefaultTensileDrag()
Indicates whether tensile drag should be active by default |
boolean |
isDefaultTensileHighlight()
Indicates whether tensile highlight should be active by default |
boolean |
isFadeScrollBar()
Indicates whether the scrollbar should fade when unused |
boolean |
isFadeScrollEdge()
Indicates whether the edge of a scrollable area should fade out |
boolean |
isFocusScrolling()
Indicates whether lists and containers should scroll only via focus and thus "jump" when moving to a larger component as was the case in older versions of LWUIT. |
boolean |
isReverseSoftButtons()
Indicates whether softbuttons should be reversed from their default orientation |
boolean |
isRTL()
Use this to check if the LookAndFeel is in RTL mode |
boolean |
isTouchMenus()
Deprecated. use Display.getCommandBehavior() == Display.COMMAND_BEHAVIOR_TOUCH_MENU |
void |
paintTensileHighlight(Graphics g,
boolean top,
int opacity)
Paints the tensile hightlight image |
void |
refreshTheme()
This method is a callback to the LookAndFeel when a theme is being changed in the UIManager |
void |
setDefaultAlwaysTensile(boolean defaultAlwaysTensile)
Enable the tensile drag to work even when a component doesn't have a scroll showable (scrollable flag still needs to be set to true) |
void |
setDefaultDialogTransitionIn(Transition defaultDialogTransitionIn)
Allows us to define a default animation that will draw the transition for entering a dialog |
void |
setDefaultDialogTransitionOut(Transition defaultDialogTransitionOut)
Allows us to define a default animation that will draw the transition for exiting a dialog |
void |
setDefaultEndsWith3Points(boolean defaultEndsWith3Points)
Indicates whether labels should end with 3 points by default |
void |
setDefaultFormTintColor(int defaultFormTintColor)
Tint color is set when a form is partially covered be it by a menu or by a dialog. |
void |
setDefaultFormTransitionIn(Transition defaultFormTransitionIn)
Allows us to define a default animation that will draw the transition for entering a form |
void |
setDefaultFormTransitionOut(Transition defaultFormTransitionOut)
Allows us to define a default animation that will draw the transition for exiting a form |
void |
setDefaultMenuTransitionIn(Transition defaultMenuTransitionIn)
Allows us to define a default animation that will draw the transition for entering a Menu |
void |
setDefaultMenuTransitionOut(Transition defaultMenuTransitionOut)
Allows us to define a default animation that will draw the transition for exiting a Menu |
void |
setDefaultSmoothScrolling(boolean defaultSmoothScrolling)
Indicates whether lists and containers should have smooth scrolling by default |
void |
setDefaultSmoothScrollingSpeed(int defaultSmoothScrollingSpeed)
Indicates the default speed for smooth scrolling |
void |
setDefaultSnapToGrid(boolean defaultSnapToGrid)
Indicates whether scrolling this component should jump to a specific location in a grid |
void |
setDefaultTensileDrag(boolean defaultTensileDrag)
Indicates whether tensile drag should be active by default |
void |
setDisableColor(int disableColor)
Simple setter to disable color |
void |
setFadeScrollBar(boolean fadeScrollBar)
Indicates whether the scrollbar should fade when unused |
void |
setFadeScrollEdge(boolean fadeScrollEdge)
Indicates whether the edge of a scrollable area should fade out |
void |
setFadeScrollEdgeLength(int fadeScrollEdgeLength)
Indicates the width/height of the fading edge to indicate scrolling |
void |
setFG(Graphics g,
Component c)
Sets the foreground color and font for a generic component, reuse-able by most component drawing code |
void |
setFocusScrolling(boolean focusScrolling)
Indicates whether lists and containers should scroll only via focus and thus "jump" when moving to a larger component as was the case in older versions of LWUIT. |
void |
setMenuBarClass(java.lang.Class menuBar)
Simple setter for the MenuBar Class |
void |
setMenuIcons(Image select,
Image cancel,
Image menu)
Sets globally the Menu icons |
void |
setMenuRenderer(ListCellRenderer menuRenderer)
Sets the Menu default renderer |
void |
setReverseSoftButtons(boolean reverseSoftButtons)
Indicates whether softbuttons should be reversed from their default orientation |
void |
setRTL(boolean rtl)
Sets this LookAndFeel to operate in right-to-left mode. |
void |
setTactileTouchDuration(int tactileTouchDuration)
Allows defining a tactile touch device that vibrates when the user presses a component that should respond with tactile feedback on a touch device (e.g. vibrate). |
void |
setTextFieldCursorColor(int textFieldCursorColor)
The color of the text field cursor |
void |
setTickerSpeed(long tickerSpeed)
Sets the ticker speed |
void |
setTouchMenus(boolean touchMenus)
Deprecated. use Display.setCommandBehavior(Display.COMMAND_BEHAVIOR_TOUCH_MENU) |
void |
uninstall()
Invoked when a look and feel is removed, allows a look and feel to release resources related to binding components. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LookAndFeel()
Method Detail |
---|
public void bind(Component cmp)
cmp
- component instance that may be customized by the look and feelpublic void uninstall()
bind(Component)
public abstract void drawButton(Graphics g, Button b)
g
- graphics contextb
- component to drawpublic abstract void drawCheckBox(Graphics g, Button cb)
g
- graphics contextcb
- component to drawpublic abstract void drawComboBox(Graphics g, List cb)
g
- graphics contextcb
- component to drawpublic abstract void drawLabel(Graphics g, Label l)
g
- graphics contextl
- component to drawpublic abstract void drawList(Graphics g, List l)
g
- graphics contextl
- component to drawpublic abstract void drawRadioButton(Graphics g, Button rb)
g
- graphics contextrb
- component to drawpublic abstract void drawTextArea(Graphics g, TextArea ta)
g
- graphics contextta
- component to drawpublic abstract void drawTextField(Graphics g, TextArea ta)
g
- graphics contextta
- component to drawpublic abstract void drawTextFieldCursor(Graphics g, TextArea ta)
g
- graphics contextta
- component to drawpublic abstract void drawTabbedPane(Graphics g, TabbedPane tp)
g
- graphics contexttp
- component to drawpublic abstract Dimension getButtonPreferredSize(Button b)
b
- component whose size should be calculated
public abstract Dimension getCheckBoxPreferredSize(Button cb)
cb
- component whose size should be calculated
public abstract Dimension getLabelPreferredSize(Label l)
l
- component whose size should be calculated
public abstract Dimension getListPreferredSize(List l)
l
- component whose size should be calculated
public abstract Dimension getRadioButtonPreferredSize(Button rb)
rb
- component whose size should be calculated
public abstract Dimension getTextAreaSize(TextArea ta, boolean pref)
ta
- component whose size should be calculatedpref
- indicates whether preferred or scroll size should be returned
public abstract Dimension getTextFieldPreferredSize(TextArea ta)
ta
- component whose size should be calculated
public abstract Dimension getComboBoxPreferredSize(List box)
box
- component whose size should be calculated
public void drawVerticalScroll(Graphics g, Component c, float offsetRatio, float blockSizeRatio)
g
- graphics contextc
- component to draw onoffsetRatio
- ratio of the scroll bar from 0 to 1blockSizeRatio
- block size for the scroll from 0 to 1public void drawHorizontalScroll(Graphics g, Component c, float offsetRatio, float blockSizeRatio)
g
- graphics contextc
- component to draw onoffsetRatio
- ratio of the scroll bar from 0 to 1blockSizeRatio
- block size for the scroll from 0 to 1public void setFG(Graphics g, Component c)
g
- graphics contextc
- component from which fg styles should be setpublic int getVerticalScrollWidth()
public int getHorizontalScrollHeight()
public abstract Component getTabbedPaneCell(TabbedPane tp, java.lang.String text, Image icon, boolean isSelected, boolean cellHasFocus, Style cellStyle, Style cellSelectedStyle, Style tabbedPaneStyle, int cellOffsetX, int cellOffsetY, Dimension cellsPreferredSize, Dimension contentPaneSize)
tp
- the TabbedPanetext
- the cell texticon
- the cell icon imageisSelected
- is the cell is the selected onecellHasFocus
- is the cell has focuscellStyle
- the cell Style objectcellSelectedStyle
- the selected style for the cell objecttabbedPaneStyle
- the TabbedPane Style objectcellOffsetX
- the offset when the cell is on TOP or BOTTOM orientationcellOffsetY
- the offset when the cell is on LEFT or RIGHT orientationcellsPreferredSize
- the total cells PreferredSizecontentPaneSize
- the contentPaneSize
public abstract void drawTabbedPaneContentPane(TabbedPane tp, Graphics g, Rectangle rect, Dimension cellsPreferredSize, int numOfTabs, int selectedTabIndex, Dimension tabsSize, int cellOffsetX, int cellOffsetY)
tp
- the TabbedPaneg
- the content pane graphicsrect
- the content pane painting rectangle areacellsPreferredSize
- the total cells PreferredSizenumOfTabs
- number of tabsselectedTabIndex
- the selected tab indextabsSize
- the tabs sizecellOffsetX
- the offset when the cell is on TOP or BOTTOM orientationcellOffsetY
- the offset when the cell is on LEFT or RIGHT orientationpublic Transition getDefaultFormTransitionIn()
public void setDefaultFormTransitionIn(Transition defaultFormTransitionIn)
defaultFormTransitionIn
- the default transitionpublic Transition getDefaultFormTransitionOut()
public void setDefaultFormTransitionOut(Transition defaultFormTransitionOut)
defaultFormTransitionOut
- the default transitionpublic Transition getDefaultMenuTransitionIn()
public void setDefaultMenuTransitionIn(Transition defaultMenuTransitionIn)
defaultMenuTransitionIn
- the default transitionpublic Transition getDefaultMenuTransitionOut()
public void setDefaultMenuTransitionOut(Transition defaultMenuTransitionOut)
defaultMenuTransitionOut
- the default transitionpublic Transition getDefaultDialogTransitionIn()
public void setDefaultDialogTransitionIn(Transition defaultDialogTransitionIn)
defaultDialogTransitionIn
- the default transitionpublic Transition getDefaultDialogTransitionOut()
public void setDefaultDialogTransitionOut(Transition defaultDialogTransitionOut)
defaultDialogTransitionOut
- the default transitionpublic int getDefaultFormTintColor()
public void setDefaultFormTintColor(int defaultFormTintColor)
defaultFormTintColor
- the default tint colorpublic int getDisableColor()
public void setDisableColor(int disableColor)
disableColor
- the disable color valuepublic boolean isDefaultSmoothScrolling()
public void setDefaultSmoothScrolling(boolean defaultSmoothScrolling)
defaultSmoothScrolling
- true if smooth scrolling should be on by defaultpublic int getDefaultSmoothScrollingSpeed()
public void setDefaultSmoothScrollingSpeed(int defaultSmoothScrollingSpeed)
defaultSmoothScrollingSpeed
- speed for smooth scrollinpublic boolean isReverseSoftButtons()
public void setReverseSoftButtons(boolean reverseSoftButtons)
reverseSoftButtons
- true if softbuttons should be reversedpublic java.lang.Class getMenuBarClass()
public void setMenuBarClass(java.lang.Class menuBar)
menuBar
- public ListCellRenderer getMenuRenderer()
public void setMenuRenderer(ListCellRenderer menuRenderer)
menuRenderer
- default renderer for the menupublic void setMenuIcons(Image select, Image cancel, Image menu)
select
- select iconcancel
- cancel iconmenu
- menu iconpublic Image[] getMenuIcons()
public long getTickerSpeed()
public void setTickerSpeed(long tickerSpeed)
tickerSpeed
- the speed in millisecondspublic void refreshTheme()
public boolean isTouchMenus()
public void setTouchMenus(boolean touchMenus)
touchMenus
- true to enable touch menus false to disablepublic void setRTL(boolean rtl)
rtl
- - true if right-to-left, false if left-to-rightpublic boolean isRTL()
public int getTactileTouchDuration()
public void setTactileTouchDuration(int tactileTouchDuration)
tactileTouchDuration
- the duration of vibrationpublic boolean isDefaultEndsWith3Points()
public void setDefaultEndsWith3Points(boolean defaultEndsWith3Points)
defaultEndsWith3Points
- True to indicates that labels should end with 3 points by defaultpublic boolean isDefaultTensileDrag()
public void setDefaultTensileDrag(boolean defaultTensileDrag)
defaultTensileDrag
- true if tensile drag should be active by defaultpublic boolean isFocusScrolling()
public void setFocusScrolling(boolean focusScrolling)
focusScrolling
- true to enable focus scrollingpublic boolean isFadeScrollEdge()
public void setFadeScrollEdge(boolean fadeScrollEdge)
fadeScrollEdge
- the fadeScrollEdge to setpublic boolean isFadeScrollBar()
public void setFadeScrollBar(boolean fadeScrollBar)
fadeScrollBar
- the fadeScrollBar to setpublic int getFadeScrollEdgeLength()
public void setFadeScrollEdgeLength(int fadeScrollEdgeLength)
fadeScrollEdgeLength
- the fadeScrollEdgeLength to setpublic int getTextFieldCursorColor()
public void setTextFieldCursorColor(int textFieldCursorColor)
textFieldCursorColor
- the textFieldCursorColor to setpublic boolean isDefaultSnapToGrid()
public void setDefaultSnapToGrid(boolean defaultSnapToGrid)
defaultSnapToGrid
- the defaultSnapToGrid to setpublic boolean isDefaultAlwaysTensile()
public void setDefaultAlwaysTensile(boolean defaultAlwaysTensile)
defaultAlwaysTensile
- the defaultAlwaysTensile to setpublic boolean isDefaultTensileHighlight()
public void paintTensileHighlight(Graphics g, boolean top, int opacity)
g
- graphics destination for the tensile highlight imagetop
- destination of the tensile highlight imageopacity
- the opacity of the image
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |