public abstract class LookAndFeel extends Object
Constructor and Description |
---|
LookAndFeel(UIManager manager)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
bind(Component cmp)
Deprecated.
Every component binds itself to the look and feel thus allowing the look
and feel to customize the component.
|
abstract TextSelection.Span |
calculateLabelSpan(TextSelection sel,
Label l)
Deprecated.
Calculates the text selection spans for a given label
|
abstract TextSelection.Spans |
calculateTextAreaSpan(TextSelection sel,
TextArea ta)
Deprecated.
Calculates the Spans used in text selection for a given text area.
|
abstract TextSelection.Spans |
calculateTextFieldSpan(TextSelection sel,
TextArea ta)
Deprecated.
Calculates the Spans used in text selection for a given text field.
|
abstract void |
drawButton(Graphics g,
Button b)
Deprecated.
this method is no longer used by the implementation, we shifted code away to improve performance
|
abstract void |
drawCheckBox(Graphics g,
Button cb)
Deprecated.
Invoked for drawing a checkbox widget
|
abstract void |
drawComboBox(Graphics g,
List cb)
Deprecated.
Invoked for drawing a combo box widget
|
void |
drawHorizontalScroll(Graphics g,
Component c,
float offsetRatio,
float blockSizeRatio)
Deprecated.
Draws a horizontal scroll bar in the given component
|
abstract void |
drawLabel(Graphics g,
Label l)
Deprecated.
this method is no longer used by the implementation, we shifted code away to improve performance
|
abstract void |
drawList(Graphics g,
List l)
Deprecated.
Invoked for drawing a list widget
|
abstract void |
drawPullToRefresh(Graphics g,
Component cmp,
boolean taskExecuted)
Deprecated.
Paints the pull to refresh
|
abstract void |
drawRadioButton(Graphics g,
Button rb)
Deprecated.
Invoked for drawing the radio button widget
|
abstract void |
drawTextArea(Graphics g,
TextArea ta)
Deprecated.
Draw the given text area
|
abstract void |
drawTextField(Graphics g,
TextArea ta)
Deprecated.
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)
Deprecated.
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)
Deprecated.
Draws a vertical scroll bar in the given component
|
abstract Dimension |
getButtonPreferredSize(Button b)
Deprecated.
Calculate the preferred size of the component
|
abstract Dimension |
getCheckBoxPreferredSize(Button cb)
Deprecated.
Calculate the preferred size of the component
|
abstract Dimension |
getComboBoxPreferredSize(List box)
Deprecated.
Calculate the preferred size of the component
|
Transition |
getDefaultDialogTransitionIn()
Deprecated.
Allows us to define a default animation that will draw the transition for
entering a dialog
|
Transition |
getDefaultDialogTransitionOut()
Deprecated.
Allows us to define a default animation that will draw the transition for
exiting a dialog
|
int |
getDefaultFormTintColor()
Deprecated.
Tint color is set when a form is partially covered be it by a menu or by a
dialog.
|
Transition |
getDefaultFormTransitionIn()
Deprecated.
Allows us to define a default animation that will draw the transition for
entering a form
|
Transition |
getDefaultFormTransitionOut()
Deprecated.
Allows us to define a default animation that will draw the transition for
exiting a form
|
Transition |
getDefaultMenuTransitionIn()
Deprecated.
Allows us to define a default animation that will draw the transition for
entering a Menu
|
Transition |
getDefaultMenuTransitionOut()
Deprecated.
Allows us to define a default animation that will draw the transition for
exiting a Menu
|
int |
getDefaultSmoothScrollingSpeed()
Deprecated.
Indicates the default speed for smooth scrolling
|
int |
getDisableColor()
Deprecated.
This color is used to paint disable mode text color.
|
int |
getFadeScrollBarSpeed()
Deprecated.
|
int |
getFadeScrollEdgeLength()
Deprecated.
Indicates the width/height of the fading edge to indicate scrolling
|
int |
getHorizontalScrollHeight()
Deprecated.
Returns the default height of a horizontal scroll bar
|
abstract Dimension |
getLabelPreferredSize(Label l)
Deprecated.
Calculate the preferred size of the component
|
abstract Dimension |
getListPreferredSize(List l)
Deprecated.
Calculate the preferred size of the component
|
Class |
getMenuBarClass()
Deprecated.
this is no longer supported, Toolbar should be used as
the extension point
|
Image[] |
getMenuIcons()
Deprecated.
Simple getter for the menu icons
|
ListCellRenderer |
getMenuRenderer()
Deprecated.
Returns the Menu default renderer
|
abstract int |
getPullToRefreshHeight()
Deprecated.
Returns the required height of the pull to refresh feature
|
abstract Dimension |
getRadioButtonPreferredSize(Button rb)
Deprecated.
Calculate the preferred size of the component
|
int |
getTactileTouchDuration()
Deprecated.
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)
Deprecated.
Calculate the preferred size of the component
|
int |
getTextFieldCursorColor()
Deprecated.
The color of the text field cursor
|
abstract Dimension |
getTextFieldPreferredSize(TextArea ta)
Deprecated.
Calculate the preferred size of the component
|
long |
getTickerSpeed()
Deprecated.
Gets the ticker speed
|
int |
getVerticalScrollWidth()
Deprecated.
Returns the default width of a vertical scroll bar
|
boolean |
isBackgroundImageDetermineSize()
Deprecated.
Indicates if the bg image of a style should determine the minimum preferred size according to the theme
|
boolean |
isDefaultAlwaysTensile()
Deprecated.
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()
Deprecated.
Indicates whether labels should end with 3 points by default
|
boolean |
isDefaultSmoothScrolling()
Deprecated.
Indicates whether lists and containers should have smooth scrolling by default
|
boolean |
isDefaultSnapToGrid()
Deprecated.
Indicates whether scrolling this component should jump to a specific location
in a grid
|
boolean |
isDefaultTensileDrag()
Deprecated.
Indicates whether tensile drag should be active by default
|
boolean |
isDefaultTensileHighlight()
Deprecated.
Indicates whether tensile highlight should be active by default
|
boolean |
isFadeScrollBar()
Deprecated.
Indicates whether the scrollbar should fade when unused
|
boolean |
isFadeScrollEdge()
Deprecated.
Indicates whether the edge of a scrollable area should fade out
|
boolean |
isFocusScrolling()
Deprecated.
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 Codename One.
|
boolean |
isReverseSoftButtons()
Deprecated.
Indicates whether softbuttons should be reversed from their default orientation
|
boolean |
isRTL()
Deprecated.
Use this to check if the LookAndFeel is in RTL mode
|
boolean |
isScrollVisible()
Deprecated.
|
boolean |
isTouchMenus()
Deprecated.
use Display.getCommandBehavior() == Display.COMMAND_BEHAVIOR_TOUCH_MENU
|
void |
paintTensileHighlight(Component t,
Graphics g,
boolean top,
int opacity)
Deprecated.
Paints the tensile hightlight image
|
void |
refreshTheme(boolean completeClear)
Deprecated.
This method is a callback to the LookAndFeel when a theme is being
changed in the UIManager
|
void |
setBackgroundImageDetermineSize(boolean backgroundImageDetermineSize)
Deprecated.
Indicates if the bg image of a style should determine the minimum preferred size according to the theme
|
void |
setDefaultAlwaysTensile(boolean defaultAlwaysTensile)
Deprecated.
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)
Deprecated.
Allows us to define a default animation that will draw the transition for
entering a dialog
|
void |
setDefaultDialogTransitionOut(Transition defaultDialogTransitionOut)
Deprecated.
Allows us to define a default animation that will draw the transition for
exiting a dialog
|
void |
setDefaultEndsWith3Points(boolean defaultEndsWith3Points)
Deprecated.
Indicates whether labels should end with 3 points by default
|
void |
setDefaultFormTintColor(int defaultFormTintColor)
Deprecated.
Tint color is set when a form is partially covered be it by a menu or by a
dialog.
|
void |
setDefaultFormTransitionIn(Transition defaultFormTransitionIn)
Deprecated.
Allows us to define a default animation that will draw the transition for
entering a form
|
void |
setDefaultFormTransitionOut(Transition defaultFormTransitionOut)
Deprecated.
Allows us to define a default animation that will draw the transition for
exiting a form
|
void |
setDefaultMenuTransitionIn(Transition defaultMenuTransitionIn)
Deprecated.
Allows us to define a default animation that will draw the transition for
entering a Menu
|
void |
setDefaultMenuTransitionOut(Transition defaultMenuTransitionOut)
Deprecated.
Allows us to define a default animation that will draw the transition for
exiting a Menu
|
void |
setDefaultSmoothScrolling(boolean defaultSmoothScrolling)
Deprecated.
Indicates whether lists and containers should have smooth scrolling by default
|
void |
setDefaultSmoothScrollingSpeed(int defaultSmoothScrollingSpeed)
Deprecated.
Indicates the default speed for smooth scrolling
|
void |
setDefaultSnapToGrid(boolean defaultSnapToGrid)
Deprecated.
Indicates whether scrolling this component should jump to a specific location
in a grid
|
void |
setDefaultTensileDrag(boolean defaultTensileDrag)
Deprecated.
Indicates whether tensile drag should be active by default
|
void |
setDisableColor(int disableColor)
Deprecated.
Simple setter to disable color
|
void |
setFadeScrollBar(boolean fadeScrollBar)
Deprecated.
Indicates whether the scrollbar should fade when unused
|
void |
setFadeScrollBarSpeed(int fadeScrollBarSpeed)
Deprecated.
|
void |
setFadeScrollEdge(boolean fadeScrollEdge)
Deprecated.
Indicates whether the edge of a scrollable area should fade out
|
void |
setFadeScrollEdgeLength(int fadeScrollEdgeLength)
Deprecated.
Indicates the width/height of the fading edge to indicate scrolling
|
void |
setFG(Graphics g,
Component c)
Deprecated.
Sets the foreground color and font for a generic component, reuse-able by most component
drawing code
|
void |
setFocusScrolling(boolean focusScrolling)
Deprecated.
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 Codename One.
|
void |
setMenuBarClass(Class menuBar)
Deprecated.
this is no longer supported, Toolbar should be used as
the extension point
|
void |
setMenuIcons(Image select,
Image cancel,
Image menu)
Deprecated.
Sets globally the Menu icons
|
void |
setMenuRenderer(ListCellRenderer menuRenderer)
Deprecated.
Sets the Menu default renderer
|
void |
setReverseSoftButtons(boolean reverseSoftButtons)
Deprecated.
Indicates whether softbuttons should be reversed from their default orientation
|
void |
setRTL(boolean rtl)
Deprecated.
Sets this LookAndFeel to operate in right-to-left mode.
|
void |
setTactileTouchDuration(int tactileTouchDuration)
Deprecated.
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 |
setTextFieldCursorColor(int textFieldCursorColor)
Deprecated.
The color of the text field cursor
|
void |
setTickerSpeed(long tickerSpeed)
Deprecated.
Sets the ticker speed
|
void |
setTouchMenus(boolean touchMenus)
Deprecated.
use Display.setCommandBehavior(Display.COMMAND_BEHAVIOR_TOUCH_MENU)
|
void |
uninstall()
Deprecated.
Invoked when a look and feel is removed, allows a look and feel to release
resources related to binding components.
|
public LookAndFeel(UIManager manager)
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 TextSelection.Span calculateLabelSpan(TextSelection sel, Label l)
sel
- TextSelection instancel
- LabelTextSelection
public 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 TextSelection.Spans calculateTextAreaSpan(TextSelection sel, TextArea ta)
sel
- The current TextSelection instance.ta
- The TextArea to calculate spans for.public abstract void drawTextField(Graphics g, TextArea ta)
g
- graphics contextta
- component to drawpublic abstract TextSelection.Spans calculateTextFieldSpan(TextSelection sel, TextArea ta)
sel
- The current TextSelection instance.ta
- The textfield to calculate spans for.public abstract void drawTextFieldCursor(Graphics g, TextArea ta)
g
- graphics contextta
- 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 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 Class getMenuBarClass()
public void setMenuBarClass(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(boolean completeClear)
completeClear
- indicates that the theme is set and not addedpublic 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(Component t, Graphics g, boolean top, int opacity)
g
- graphics destination for the tensile highlight imagetop
- destination of the tensile highlight imageopacity
- the opacity of the imagepublic int getFadeScrollBarSpeed()
public boolean isScrollVisible()
public void setFadeScrollBarSpeed(int fadeScrollBarSpeed)
fadeScrollBarSpeed
- the fadeScrollBarSpeed to setpublic boolean isBackgroundImageDetermineSize()
public void setBackgroundImageDetermineSize(boolean backgroundImageDetermineSize)
backgroundImageDetermineSize
- the backgroundImageDetermineSize to setpublic abstract void drawPullToRefresh(Graphics g, Component cmp, boolean taskExecuted)
g
- graphics contextcmp
- the Component which we draw the pull to refresh beneath ittaskExecuted
- an indication if the refresh task is currently runningpublic abstract int getPullToRefreshHeight()