public abstract class LookAndFeel
- Object
- LookAndFeel
Known subtypesDefaultLookAndFeel
Deprecated. this class is still crucial for some features in Codename One. The deprecation is here to indicate
our desire to reduce usage/reliance on this class.
Allows a UI developer to completely customize the look of the application by
overriding drawing/sizing methods appropriately.
Constructors
public LookAndFeel(UIManager manager) |
Methods
public void bind(Component cmp) | Every component binds itself to the look and feel thus allowing the look and feel to customize the component. |
public void uninstall() | Invoked when a look and feel is removed, allows a look and feel to release resources related to binding components. |
public abstract void drawButton(Graphics g, Button b) | Deprecated Invoked for drawing a button widget |
public abstract void drawCheckBox(Graphics g, Button cb) | Invoked for drawing a checkbox widget |
public abstract void drawComboBox(Graphics g, List cb) | Invoked for drawing a combo box widget |
public abstract void drawLabel(Graphics g, Label l) | Deprecated Invoked for drawing a label widget |
public abstract TextSelection.Span calculateLabelSpan(TextSelection sel, Label l) | Calculates the text selection spans for a given label |
public abstract void drawList(Graphics g, List l) | Invoked for drawing a list widget |
public abstract void drawRadioButton(Graphics g, Button rb) | Invoked for drawing the radio button widget |
public abstract void drawTextArea(Graphics g, TextArea ta) | Draw the given text area |
public abstract TextSelection.Spans calculateTextAreaSpan(TextSelection sel, TextArea ta) | Calculates the Spans used in text selection for a given text area. |
public 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. |
public abstract TextSelection.Spans calculateTextFieldSpan(TextSelection sel, TextArea ta) | Calculates the Spans used in text selection for a given text field. |
public 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. |
public abstract Dimension getButtonPreferredSize(Button b) | Calculate the preferred size of the component |
public abstract Dimension getCheckBoxPreferredSize(Button cb) | Calculate the preferred size of the component |
public abstract Dimension getLabelPreferredSize(Label l) | Calculate the preferred size of the component |
public abstract Dimension getListPreferredSize(List l) | Calculate the preferred size of the component |
public abstract Dimension getRadioButtonPreferredSize(Button rb) | Calculate the preferred size of the component |
public abstract Dimension getTextAreaSize(TextArea ta, boolean pref) | Calculate the preferred size of the component |
public abstract Dimension getTextFieldPreferredSize(TextArea ta) | Calculate the preferred size of the component |
public abstract Dimension getComboBoxPreferredSize(List box) | Calculate the preferred size of the component |
public void drawVerticalScroll(Graphics g, Component c, float offsetRatio, float blockSizeRatio) | Draws a vertical scroll bar in the given component |
public void drawHorizontalScroll(Graphics g, Component c, float offsetRatio, float blockSizeRatio) | Draws a horizontal scroll bar in the given component |
public void setFG(Graphics g, Component c) | Sets the foreground color and font for a generic component, reuse-able by most component drawing code |
public int getVerticalScrollWidth() | Returns the default width of a vertical scroll bar |
public int getHorizontalScrollHeight() | Returns the default height of a horizontal scroll bar |
public Transition getDefaultFormTransitionIn() | Allows us to define a default animation that will draw the transition for entering a form |
public void setDefaultFormTransitionIn(Transition defaultFormTransitionIn) | Allows us to define a default animation that will draw the transition for entering a form |
public Transition getDefaultFormTransitionOut() | Allows us to define a default animation that will draw the transition for exiting a form |
public void setDefaultFormTransitionOut(Transition defaultFormTransitionOut) | Allows us to define a default animation that will draw the transition for exiting a form |
public Transition getDefaultMenuTransitionIn() | Allows us to define a default animation that will draw the transition for entering a Menu |
public void setDefaultMenuTransitionIn(Transition defaultMenuTransitionIn) | Allows us to define a default animation that will draw the transition for entering a Menu |
public Transition getDefaultMenuTransitionOut() | Allows us to define a default animation that will draw the transition for exiting a Menu |
public void setDefaultMenuTransitionOut(Transition defaultMenuTransitionOut) | Allows us to define a default animation that will draw the transition for exiting a Menu |
public Transition getDefaultDialogTransitionIn() | Allows us to define a default animation that will draw the transition for entering a dialog |
public void setDefaultDialogTransitionIn(Transition defaultDialogTransitionIn) | Allows us to define a default animation that will draw the transition for entering a dialog |
public Transition getDefaultDialogTransitionOut() | Allows us to define a default animation that will draw the transition for exiting a dialog |
public void setDefaultDialogTransitionOut(Transition defaultDialogTransitionOut) | Allows us to define a default animation that will draw the transition for exiting a dialog |
public int getDefaultFormTintColor() | Tint color is set when a form is partially covered be it by a menu or by a dialog. |
public void setDefaultFormTintColor(int defaultFormTintColor) | Tint color is set when a form is partially covered be it by a menu or by a dialog. |
public int getDisableColor() | This color is used to paint disable mode text color. |
public void setDisableColor(int disableColor) | Simple setter to disable color |
public boolean isDefaultSmoothScrolling() | Indicates whether lists and containers should have smooth scrolling by default |
public void setDefaultSmoothScrolling(boolean defaultSmoothScrolling) | Indicates whether lists and containers should have smooth scrolling by default |
public int getDefaultSmoothScrollingSpeed() | Indicates the default speed for smooth scrolling |
public void setDefaultSmoothScrollingSpeed(int defaultSmoothScrollingSpeed) | Indicates the default speed for smooth scrolling |
public boolean isReverseSoftButtons() | Indicates whether softbuttons should be reversed from their default orientation |
public void setReverseSoftButtons(boolean reverseSoftButtons) | Indicates whether softbuttons should be reversed from their default orientation |
public Class getMenuBarClass() | Deprecated This method returns the MenuBar class. |
public void setMenuBarClass(Class menuBar) | Deprecated Simple setter for the MenuBar Class |
public ListCellRenderer getMenuRenderer() | Returns the Menu default renderer |
public void setMenuRenderer(ListCellRenderer menuRenderer) | Sets the Menu default renderer |
public void setMenuIcons(Image select, Image cancel, Image menu) | Sets globally the Menu icons |
public Image[] getMenuIcons() | Simple getter for the menu icons |
public long getTickerSpeed() | Gets the ticker speed |
public void setTickerSpeed(long tickerSpeed) | Sets the ticker speed |
public void refreshTheme(boolean completeClear) | This method is a callback to the LookAndFeel when a theme is being changed in the UIManager |
public boolean isTouchMenus() | Deprecated Indicates whether the menu UI should target a touch based device or a standard cell phone |
public void setTouchMenus(boolean touchMenus) | Deprecated Indicates whether the menu UI should target a touch based device or a standard cell phone |
public boolean isRTL() | Use this to check if the LookAndFeel is in RTL mode |
public void setRTL(boolean rtl) | Sets this LookAndFeel to operate in right-to-left mode. |
public 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). |
public 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). |
public boolean isDefaultEndsWith3Points() | Indicates whether labels should end with 3 points by default |
public void setDefaultEndsWith3Points(boolean defaultEndsWith3Points) | Indicates whether labels should end with 3 points by default |
public boolean isDefaultTensileDrag() | Indicates whether tensile drag should be active by default |
public void setDefaultTensileDrag(boolean defaultTensileDrag) | Indicates whether tensile drag should be active by default |
public 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 Codename One. |
public 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 Codename One. |
public boolean isFadeScrollEdge() | Indicates whether the edge of a scrollable area should fade out |
public void setFadeScrollEdge(boolean fadeScrollEdge) | Indicates whether the edge of a scrollable area should fade out |
public boolean isFadeScrollBar() | Indicates whether the scrollbar should fade when unused |
public void setFadeScrollBar(boolean fadeScrollBar) | Indicates whether the scrollbar should fade when unused |
public int getFadeScrollEdgeLength() | Indicates the width/height of the fading edge to indicate scrolling |
public void setFadeScrollEdgeLength(int fadeScrollEdgeLength) | Indicates the width/height of the fading edge to indicate scrolling |
public int getTextFieldCursorColor() | The color of the text field cursor |
public void setTextFieldCursorColor(int textFieldCursorColor) | The color of the text field cursor |
public boolean isDefaultSnapToGrid() | Indicates whether scrolling this component should jump to a specific location in a grid |
public void setDefaultSnapToGrid(boolean defaultSnapToGrid) | Indicates whether scrolling this component should jump to a specific location in a grid |
public 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) |
public 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) |
public boolean isDefaultTensileHighlight() | Indicates whether tensile highlight should be active by default |
public void paintTensileHighlight(Component t, Graphics g, boolean top, int opacity) | Paints the tensile hightlight image |
public int getFadeScrollBarSpeed() | |
public void setFadeScrollBarSpeed(int fadeScrollBarSpeed) | Notes |
public boolean isScrollVisible() | |
public boolean isInteractiveScroll() | Indicates whether scrollbars behave as interactive desktop scrollbars (grab-able thumb, click-to-page track, always visible). |
public boolean isBackgroundImageDetermineSize() | Indicates if the bg image of a style should determine the minimum preferred size according to the theme |
public void setBackgroundImageDetermineSize(boolean backgroundImageDetermineSize) | Indicates if the bg image of a style should determine the minimum preferred size according to the theme |
public abstract void drawPullToRefresh(Graphics g, Component cmp, boolean taskExecuted) | Paints the pull to refresh |
public abstract int getPullToRefreshHeight() | Returns the required height of the pull to refresh feature |
Inherited methods
Constructor details
LookAndFeel
public LookAndFeel(UIManager manager)Method details
bind
public void bind(Component cmp)Every component binds itself to the look and feel thus allowing the look
and feel to customize the component. Binding occurs at the end of the
constructor when the component is in a valid state and ready to be used.
Notice that a component might be bound twice or more and it is the
responsibility of the LookAndFeel to protect against that.
Parameters
cmpComponent- component instance that may be customized by the look and feel
uninstall
public void uninstall()Invoked when a look and feel is removed, allows a look and feel to release
resources related to binding components.
See also
drawButton
public abstract void drawButton(Graphics g, Button b)Deprecated. this method is no longer used by the implementation, we shifted code away to improve performance
Invoked for drawing a button widget
Parameters
gGraphics- graphics context
bButton- component to draw
drawCheckBox
public abstract void drawCheckBox(Graphics g, Button cb)Invoked for drawing a checkbox widget
Parameters
gGraphics- graphics context
cbButton- component to draw
drawComboBox
public abstract void drawComboBox(Graphics g, List cb)Invoked for drawing a combo box widget
Parameters
gGraphics- graphics context
cbList- component to draw
drawLabel
public abstract void drawLabel(Graphics g, Label l)Deprecated. this method is no longer used by the implementation, we shifted code away to improve performance
Invoked for drawing a label widget
Parameters
gGraphics- graphics context
lLabel- component to draw
calculateLabelSpan
public abstract TextSelection.Span calculateLabelSpan(TextSelection sel, Label l)Calculates the text selection spans for a given label
Parameters
selTextSelection- TextSelection instance
lLabel- Label
Returns
A span representing the positions of characters in the label
See also
drawList
public abstract void drawList(Graphics g, List l)Invoked for drawing a list widget
Parameters
gGraphics- graphics context
lList- component to draw
drawRadioButton
public abstract void drawRadioButton(Graphics g, Button rb)Invoked for drawing the radio button widget
Parameters
gGraphics- graphics context
rbButton- component to draw
drawTextArea
public abstract void drawTextArea(Graphics g, TextArea ta)Draw the given text area
Parameters
gGraphics- graphics context
taTextArea- component to draw
calculateTextAreaSpan
public abstract TextSelection.Spans calculateTextAreaSpan(TextSelection sel, TextArea ta)Calculates the Spans used in text selection for a given text area.
Parameters
selTextSelection- The current TextSelection instance.
taTextArea- The TextArea to calculate spans for.
Returns
The spans for the given text field.
drawTextField
public 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.
Parameters
gGraphics- graphics context
taTextArea- component to draw
calculateTextFieldSpan
public abstract TextSelection.Spans calculateTextFieldSpan(TextSelection sel, TextArea ta)Calculates the Spans used in text selection for a given text field.
Parameters
selTextSelection- The current TextSelection instance.
taTextArea- The textfield to calculate spans for.
Returns
The spans for the given text field.
drawTextFieldCursor
public 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.
Parameters
gGraphics- graphics context
taTextArea- component to draw
getButtonPreferredSize
public abstract Dimension getButtonPreferredSize(Button b)Calculate the preferred size of the component
Parameters
bButton- component whose size should be calculated
Returns
the preferred size for the button
getCheckBoxPreferredSize
public abstract Dimension getCheckBoxPreferredSize(Button cb)Calculate the preferred size of the component
Parameters
cbButton- component whose size should be calculated
Returns
the preferred size for the component
getLabelPreferredSize
public abstract Dimension getLabelPreferredSize(Label l)Calculate the preferred size of the component
Parameters
lLabel- component whose size should be calculated
Returns
the preferred size for the component
getListPreferredSize
public abstract Dimension getListPreferredSize(List l)Calculate the preferred size of the component
Parameters
lList- component whose size should be calculated
Returns
the preferred size for the component
getRadioButtonPreferredSize
public abstract Dimension getRadioButtonPreferredSize(Button rb)Calculate the preferred size of the component
Parameters
rbButton- component whose size should be calculated
Returns
the preferred size for the component
getTextAreaSize
public abstract Dimension getTextAreaSize(TextArea ta, boolean pref)Calculate the preferred size of the component
Parameters
taTextArea- component whose size should be calculated
prefboolean- indicates whether preferred or scroll size should be returned
Returns
the preferred size for the component
getTextFieldPreferredSize
public abstract Dimension getTextFieldPreferredSize(TextArea ta)Calculate the preferred size of the component
Parameters
taTextArea- component whose size should be calculated
Returns
the preferred size for the component
getComboBoxPreferredSize
public abstract Dimension getComboBoxPreferredSize(List box)Calculate the preferred size of the component
Parameters
boxList- component whose size should be calculated
Returns
the preferred size for the component
drawVerticalScroll
public void drawVerticalScroll(Graphics g, Component c, float offsetRatio, float blockSizeRatio)Draws a vertical scroll bar in the given component
Parameters
gGraphics- graphics context
cComponent- component to draw on
offsetRatiofloat- ratio of the scroll bar from 0 to 1
blockSizeRatiofloat- block size for the scroll from 0 to 1
drawHorizontalScroll
public void drawHorizontalScroll(Graphics g, Component c, float offsetRatio, float blockSizeRatio)Draws a horizontal scroll bar in the given component
Parameters
gGraphics- graphics context
cComponent- component to draw on
offsetRatiofloat- ratio of the scroll bar from 0 to 1
blockSizeRatiofloat- block size for the scroll from 0 to 1
setFG
public void setFG(Graphics g, Component c)Sets the foreground color and font for a generic component, reuse-able by most component
drawing code
Parameters
gGraphics- graphics context
cComponent- component from which fg styles should be set
getVerticalScrollWidth
public int getVerticalScrollWidth()Returns the default width of a vertical scroll bar
Returns
default width of a vertical scroll bar
getHorizontalScrollHeight
public int getHorizontalScrollHeight()Returns the default height of a horizontal scroll bar
Returns
default height of a horizontal scroll bar
getDefaultFormTransitionIn
public Transition getDefaultFormTransitionIn()Allows us to define a default animation that will draw the transition for
entering a form
Returns
default transition
setDefaultFormTransitionIn
public void setDefaultFormTransitionIn(Transition defaultFormTransitionIn)Allows us to define a default animation that will draw the transition for
entering a form
Parameters
defaultFormTransitionInTransition- the default transition
getDefaultFormTransitionOut
public Transition getDefaultFormTransitionOut()Allows us to define a default animation that will draw the transition for
exiting a form
Returns
default transition
setDefaultFormTransitionOut
public void setDefaultFormTransitionOut(Transition defaultFormTransitionOut)Allows us to define a default animation that will draw the transition for
exiting a form
Parameters
defaultFormTransitionOutTransition- the default transition
getDefaultMenuTransitionIn
public Transition getDefaultMenuTransitionIn()Allows us to define a default animation that will draw the transition for
entering a Menu
Returns
default transition
setDefaultMenuTransitionIn
public void setDefaultMenuTransitionIn(Transition defaultMenuTransitionIn)Allows us to define a default animation that will draw the transition for
entering a Menu
Parameters
defaultMenuTransitionInTransition- the default transition
getDefaultMenuTransitionOut
public Transition getDefaultMenuTransitionOut()Allows us to define a default animation that will draw the transition for
exiting a Menu
Returns
default transition
setDefaultMenuTransitionOut
public void setDefaultMenuTransitionOut(Transition defaultMenuTransitionOut)Allows us to define a default animation that will draw the transition for
exiting a Menu
Parameters
defaultMenuTransitionOutTransition- the default transition
getDefaultDialogTransitionIn
public Transition getDefaultDialogTransitionIn()Allows us to define a default animation that will draw the transition for
entering a dialog
Returns
default transition
setDefaultDialogTransitionIn
public void setDefaultDialogTransitionIn(Transition defaultDialogTransitionIn)Allows us to define a default animation that will draw the transition for
entering a dialog
Parameters
defaultDialogTransitionInTransition- the default transition
getDefaultDialogTransitionOut
public Transition getDefaultDialogTransitionOut()Allows us to define a default animation that will draw the transition for
exiting a dialog
Returns
default transition
setDefaultDialogTransitionOut
public void setDefaultDialogTransitionOut(Transition defaultDialogTransitionOut)Allows us to define a default animation that will draw the transition for
exiting a dialog
Parameters
defaultDialogTransitionOutTransition- the default transition
getDefaultFormTintColor
public int getDefaultFormTintColor()Tint color is set when a form is partially covered be it by a menu or by a
dialog. A look and feel can override this default value.
Returns
default tint color
setDefaultFormTintColor
public void setDefaultFormTintColor(int defaultFormTintColor)Tint color is set when a form is partially covered be it by a menu or by a
dialog. A look and feel can override this default value.
Parameters
defaultFormTintColorint- the default tint color
getDisableColor
public int getDisableColor()This color is used to paint disable mode text color.
Returns
the color value
setDisableColor
public void setDisableColor(int disableColor)Simple setter to disable color
Parameters
disableColorint- the disable color value
isDefaultSmoothScrolling
public boolean isDefaultSmoothScrolling()Indicates whether lists and containers should have smooth scrolling by default
Returns
true if smooth scrolling should be on by default
setDefaultSmoothScrolling
public void setDefaultSmoothScrolling(boolean defaultSmoothScrolling)Indicates whether lists and containers should have smooth scrolling by default
Parameters
defaultSmoothScrollingboolean- true if smooth scrolling should be on by default
getDefaultSmoothScrollingSpeed
public int getDefaultSmoothScrollingSpeed()Indicates the default speed for smooth scrolling
Returns
speed for smooth scrollin
setDefaultSmoothScrollingSpeed
public void setDefaultSmoothScrollingSpeed(int defaultSmoothScrollingSpeed)Indicates the default speed for smooth scrolling
Parameters
defaultSmoothScrollingSpeedint- speed for smooth scrollin
isReverseSoftButtons
public boolean isReverseSoftButtons()Indicates whether softbuttons should be reversed from their default orientation
Returns
true if softbuttons should be reversed
setReverseSoftButtons
public void setReverseSoftButtons(boolean reverseSoftButtons)Indicates whether softbuttons should be reversed from their default orientation
Parameters
reverseSoftButtonsboolean- true if softbuttons should be reversed
getMenuBarClass
public Class getMenuBarClass()Deprecated. this is no longer supported, Toolbar should be used as
the extension point
This method returns the MenuBar class.
Returns
the MenuBar class.
setMenuBarClass
public void setMenuBarClass(Class menuBar)Deprecated. this is no longer supported, Toolbar should be used as
the extension point
Simple setter for the MenuBar Class
getMenuRenderer
public ListCellRenderer getMenuRenderer()Returns the Menu default renderer
Returns
default renderer for the menu
setMenuRenderer
public void setMenuRenderer(ListCellRenderer menuRenderer)Sets the Menu default renderer
Parameters
menuRendererListCellRenderer- default renderer for the menu
setMenuIcons
public void setMenuIcons(Image select, Image cancel, Image menu)Sets globally the Menu icons
Parameters
selectImage- select icon
cancelImage- cancel icon
menuImage- menu icon
getMenuIcons
public Image[] getMenuIcons()Simple getter for the menu icons
Returns
an Image array at size of 3, where the first is the select image
the second is the cancel image and the last is the menu image.
getTickerSpeed
public long getTickerSpeed()Gets the ticker speed
Returns
ticker speed in milliseconds
setTickerSpeed
public void setTickerSpeed(long tickerSpeed)Sets the ticker speed
Parameters
tickerSpeedlong- the speed in milliseconds
refreshTheme
public void refreshTheme(boolean completeClear)This method is a callback to the LookAndFeel when a theme is being
changed in the UIManager
Parameters
completeClearboolean- indicates that the theme is set and not added
isTouchMenus
public boolean isTouchMenus()Deprecated. use Display.getCommandBehavior() == Display.COMMAND_BEHAVIOR_TOUCH_MENU
Indicates whether the menu UI should target a touch based device or a
standard cell phone
Returns
true for touch menus
setTouchMenus
public void setTouchMenus(boolean touchMenus)Deprecated. use Display.setCommandBehavior(Display.COMMAND_BEHAVIOR_TOUCH_MENU)
Indicates whether the menu UI should target a touch based device or a
standard cell phone
Parameters
touchMenusboolean- true to enable touch menus false to disable
isRTL
public boolean isRTL()Use this to check if the LookAndFeel is in RTL mode
Returns
true if the LookAndFeel is in right-to-left mode, false otherwise
setRTL
public void setRTL(boolean rtl)Sets this LookAndFeel to operate in right-to-left mode.
Parameters
rtlboolean- true if right-to-left, false if left-to-right
getTactileTouchDuration
public 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).
Setting this to 0 disables tactile feedback completely
Returns
the tactileTouchDuration
setTactileTouchDuration
public 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).
Setting this to 0 disables tactile feedback completely
Parameters
tactileTouchDurationint- the duration of vibration
isDefaultEndsWith3Points
public boolean isDefaultEndsWith3Points()Indicates whether labels should end with 3 points by default
Returns
whether labels should end with 3 points by default
setDefaultEndsWith3Points
public void setDefaultEndsWith3Points(boolean defaultEndsWith3Points)Indicates whether labels should end with 3 points by default
Parameters
defaultEndsWith3Pointsboolean- True to indicates that labels should end with 3 points by default
isDefaultTensileDrag
public boolean isDefaultTensileDrag()Indicates whether tensile drag should be active by default
Returns
whether tensile drag should be active by default
setDefaultTensileDrag
public void setDefaultTensileDrag(boolean defaultTensileDrag)Indicates whether tensile drag should be active by default
Parameters
defaultTensileDragboolean- true if tensile drag should be active by default
isFocusScrolling
public 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 Codename One.
Returns
true if focus scrolling is enabled
setFocusScrolling
public 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 Codename One.
Parameters
focusScrollingboolean- true to enable focus scrolling
isFadeScrollEdge
public boolean isFadeScrollEdge()Indicates whether the edge of a scrollable area should fade out
Returns
the fadeScrollEdge
setFadeScrollEdge
public void setFadeScrollEdge(boolean fadeScrollEdge)Indicates whether the edge of a scrollable area should fade out
Parameters
fadeScrollEdgeboolean- the fadeScrollEdge to set
isFadeScrollBar
public boolean isFadeScrollBar()Indicates whether the scrollbar should fade when unused
Returns
the fadeScrollBar
setFadeScrollBar
public void setFadeScrollBar(boolean fadeScrollBar)Indicates whether the scrollbar should fade when unused
Parameters
fadeScrollBarboolean- the fadeScrollBar to set
getFadeScrollEdgeLength
public int getFadeScrollEdgeLength()Indicates the width/height of the fading edge to indicate scrolling
Returns
the fadeScrollEdgeLength
setFadeScrollEdgeLength
public void setFadeScrollEdgeLength(int fadeScrollEdgeLength)Indicates the width/height of the fading edge to indicate scrolling
Parameters
fadeScrollEdgeLengthint- the fadeScrollEdgeLength to set
getTextFieldCursorColor
public int getTextFieldCursorColor()The color of the text field cursor
Returns
the textFieldCursorColor
setTextFieldCursorColor
public void setTextFieldCursorColor(int textFieldCursorColor)The color of the text field cursor
Parameters
textFieldCursorColorint- the textFieldCursorColor to set
isDefaultSnapToGrid
public boolean isDefaultSnapToGrid()Indicates whether scrolling this component should jump to a specific location
in a grid
Returns
the defaultSnapToGrid
setDefaultSnapToGrid
public void setDefaultSnapToGrid(boolean defaultSnapToGrid)Indicates whether scrolling this component should jump to a specific location
in a grid
Parameters
defaultSnapToGridboolean- the defaultSnapToGrid to set
isDefaultAlwaysTensile
public 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)
Returns
the defaultAlwaysTensile
setDefaultAlwaysTensile
public 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)
Parameters
defaultAlwaysTensileboolean- the defaultAlwaysTensile to set
isDefaultTensileHighlight
public boolean isDefaultTensileHighlight()Indicates whether tensile highlight should be active by default
Returns
the defaultTensileHighlight
paintTensileHighlight
public void paintTensileHighlight(Component t, Graphics g, boolean top, int opacity)Paints the tensile hightlight image
Parameters
tComponent- Not documented.
gGraphics- graphics destination for the tensile highlight image
topboolean- destination of the tensile highlight image
opacityint- the opacity of the image
getFadeScrollBarSpeed
public int getFadeScrollBarSpeed()Returns
the fadeScrollBarSpeed
setFadeScrollBarSpeed
public void setFadeScrollBarSpeed(int fadeScrollBarSpeed)Notes
- This value is not milliseconds.
- Approximate fade duration in milliseconds:
durationMs ~= (255 / fadeScrollBarSpeed) * (1000 / Display.getInstance().getFrameRate()) - At 60 FPS, common values are:
5-> about850ms3-> about1400ms2-> about2100ms1-> about4250ms
Parameters
fadeScrollBarSpeedint- per-frame opacity decrement used for fading the scrollbar. Larger values fade out faster.
isScrollVisible
public boolean isScrollVisible()Returns
scrollVisible
isInteractiveScroll
public boolean isInteractiveScroll()Indicates whether scrollbars behave as interactive desktop scrollbars (grab-able
thumb, click-to-page track, always visible). Controlled by the
interactiveScrollBool theme constant.Returns
true if interactive desktop scrollbars are enabled
isBackgroundImageDetermineSize
public boolean isBackgroundImageDetermineSize()Indicates if the bg image of a style should determine the minimum preferred size according to the theme
Returns
the backgroundImageDetermineSize
setBackgroundImageDetermineSize
public void setBackgroundImageDetermineSize(boolean backgroundImageDetermineSize)Indicates if the bg image of a style should determine the minimum preferred size according to the theme
Parameters
backgroundImageDetermineSizeboolean- the backgroundImageDetermineSize to set
drawPullToRefresh
public abstract void drawPullToRefresh(Graphics g, Component cmp, boolean taskExecuted)Paints the pull to refresh
Parameters
gGraphics- graphics context
cmpComponent- the Component which we draw the pull to refresh beneath it
taskExecutedboolean- an indication if the refresh task is currently running
getPullToRefreshHeight
public abstract int getPullToRefreshHeight()Returns the required height of the pull to refresh feature