public abstract class LookAndFeel extends Object
Constructor and Description |
---|
LookAndFeel() |
Modifier and Type | Method and Description |
---|---|
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)
Invoked for drawing the Tab Pane widget
|
abstract void |
drawTabbedPaneContentPane(TabbedPane tp,
Graphics g,
Rectangle rect,
Dimension cellsPreferredSize,
int numOfTabs,
int selectedTabIndex,
Dimension tabsSize,
int cellOffsetX,
int cellOffsetY)
Draws and return the TabbedPane contentpane painter
|
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 |
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
|
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,
String text,
Image icon,
boolean isSelected,
boolean cellHasFocus,
Style cellStyle,
Style cellSelectedStyle,
Style tabbedPaneStyle,
int cellOffsetX,
int cellOffsetY,
Dimension cellsPreferredSize,
Dimension contentPaneSize)
Draws and return the TabbedPane cell component (renderer)
according to each tab orientation, the borders are getting draws
|
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.
|
abstract Dimension |
getTextAreaSize(TextArea ta,
boolean pref)
Calculate the preferred size of the component
|
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 |
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 |
isDefaultTensileDrag()
Indicates whether tensile drag should be active by default
|
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()
Indicates whether the menu UI should target a touch based device or a
standard cell phone
|
void |
refreshTheme()
This method is a callback to the LookAndFeel when a theme is being
changed in the UIManager
|
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 |
setDefaultTensileDrag(boolean defaultTensileDrag)
Indicates whether tensile drag should be active by default
|
void |
setDisableColor(int disableColor)
Simple setter to disable color
|
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 |
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.
|
void |
setTickerSpeed(long tickerSpeed)
Sets the ticker speed
|
void |
setTouchMenus(boolean touchMenus)
Indicates whether the menu UI should target a touch based device or a
standard cell phone
|
void |
uninstall()
Invoked when a look and feel is removed, allows a look and feel to release
resources related to binding components.
|
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 calculatedpublic abstract Dimension getCheckBoxPreferredSize(Button cb)
cb
- component whose size should be calculatedpublic abstract Dimension getLabelPreferredSize(Label l)
l
- component whose size should be calculatedpublic abstract Dimension getListPreferredSize(List l)
l
- component whose size should be calculatedpublic abstract Dimension getRadioButtonPreferredSize(Button rb)
rb
- component whose size should be calculatedpublic abstract Dimension getTextAreaSize(TextArea ta, boolean pref)
ta
- component whose size should be calculatedpref
- indicates whether preferred or scroll size should be returnedpublic abstract Dimension getTextFieldPreferredSize(TextArea ta)
ta
- component whose size should be calculatedpublic abstract Dimension getComboBoxPreferredSize(List box)
box
- component whose size should be calculatedpublic 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, 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 contentPaneSizepublic 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 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 scrolling