public class DefaultLookAndFeel extends LookAndFeel implements FocusListener
Constructor and Description |
---|
DefaultLookAndFeel(UIManager manager)
Deprecated.
Creates a new instance of DefaultLookAndFeel
|
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.
|
TextSelection.Span |
calculateLabelSpan(TextSelection sel,
Label l)
Deprecated.
Calculates the text selection spans for a given label
|
TextSelection.Span |
calculateSpanForLabelText(TextSelection sel,
Label l,
String text,
int x,
int y,
int textSpaceW)
Deprecated.
|
TextSelection.Spans |
calculateTextAreaSpan(TextSelection sel,
TextArea ta)
Deprecated.
Calculates the Spans used in text selection for a given text area.
|
TextSelection.Spans |
calculateTextFieldSpan(TextSelection sel,
TextArea ta)
Deprecated.
Calculates the Spans used in text selection for a given text field.
|
void |
drawButton(Graphics g,
Button b)
Deprecated.
this method is no longer used by the implementation, we shifted code away to improve performance
|
void |
drawCheckBox(Graphics g,
Button cb)
Deprecated.
Invoked for drawing a checkbox widget
|
void |
drawComboBox(Graphics g,
List cb)
Deprecated.
Invoked for drawing a combo box widget
|
void |
drawLabel(Graphics g,
Label l)
Deprecated.
this method is no longer used by the implementation, we shifted code away to improve performance
|
protected int |
drawLabelText(Graphics g,
Label l,
String text,
int x,
int y,
int textSpaceW)
Deprecated.
Draws the text of a label
|
void |
drawList(Graphics g,
List l)
Deprecated.
Invoked for drawing a list widget
|
void |
drawPullToRefresh(Graphics g,
Component cmp,
boolean taskExecuted)
Deprecated.
Paints the pull to refresh
|
void |
drawRadioButton(Graphics g,
Button rb)
Deprecated.
Invoked for drawing the radio button widget
|
void |
drawTextArea(Graphics g,
TextArea ta)
Deprecated.
Draw the given text area
|
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.
|
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 |
focusGained(Component cmp)
Deprecated.
Invoked when component gains focus
|
void |
focusLost(Component cmp)
Deprecated.
Invoked when component loses focus
|
Dimension |
getButtonPreferredSize(Button b)
Deprecated.
Calculate the preferred size of the component
|
Image[] |
getCheckBoxFocusImages()
Deprecated.
Returns the images used to represent the checkbox when focused
|
Image[] |
getCheckBoxImages()
Deprecated.
Returns the images used to represent the checkbox (selected followed by unselected).
|
Dimension |
getCheckBoxPreferredSize(Button cb)
Deprecated.
Calculate the preferred size of the component
|
Dimension |
getComboBoxPreferredSize(List cb)
Deprecated.
Calculate the preferred size of the component
|
Dimension |
getLabelPreferredSize(Label l)
Deprecated.
Calculate the preferred size of the component
|
Dimension |
getListPreferredSize(List l)
Deprecated.
Calculate the preferred size of the component
|
int |
getPullToRefreshHeight()
Deprecated.
Returns the required height of the pull to refresh feature
|
Image[] |
getRadioButtonFocusImages()
Deprecated.
Returns the images used to represent the radio button when in focused mode
|
Image[] |
getRadioButtonImages()
Deprecated.
Returns the images used to represent the radio button (selected followed by unselected).
|
Dimension |
getRadioButtonPreferredSize(Button rb)
Deprecated.
Calculate the preferred size of the component
|
Dimension |
getTextAreaSize(TextArea ta,
boolean pref)
Deprecated.
Calculate the preferred size of the component
|
Dimension |
getTextFieldPreferredSize(TextArea ta)
Deprecated.
Calculate the preferred size of the component
|
protected String |
getTextFieldString(TextArea ta)
Deprecated.
Similar to getText() but works properly with password fields
|
boolean |
isTickWhenFocused()
Deprecated.
This method allows to set all Labels, Buttons, CheckBoxes, RadioButtons
to start ticking when the text is too long.
|
void |
refreshTheme(boolean b)
Deprecated.
This method is a callback to the LookAndFeel when a theme is being
changed in the UIManager
|
void |
setCheckBoxFocusImages(Image checkedX,
Image uncheckedX,
Image disabledChecked,
Image disabledUnchecked)
Deprecated.
Sets images for checkbox when in focused mode
|
void |
setCheckBoxImages(Image checkedX,
Image uncheckedX)
Deprecated.
Sets images for checkbox checked/unchecked modes
|
void |
setCheckBoxImages(Image checkedX,
Image uncheckedX,
Image disabledChecked,
Image disabledUnchecked)
Deprecated.
Sets images for checkbox checked/unchecked modes
|
void |
setComboBoxImage(Image picker)
Deprecated.
Sets image for the combo box dropdown drawing
|
void |
setPasswordChar(char c)
Deprecated.
Sets the password character to display in the TextArea and the TextField
|
void |
setRadioButtonFocusImages(Image selected,
Image unselected,
Image disabledSelected,
Image disabledUnselected)
Deprecated.
Sets images for radio button selected/unselected and disabled modes, when the radio button has focus, these are entirely optional
|
void |
setRadioButtonImages(Image selected,
Image unselected)
Deprecated.
Sets images for radio button selected/unselected modes
|
void |
setRadioButtonImages(Image selected,
Image unselected,
Image disabledSelected,
Image disabledUnselected)
Deprecated.
Sets images for radio button selected/unselected modes
|
void |
setTickWhenFocused(boolean tickWhenFocused)
Deprecated.
This method allows to set all Labels, Buttons, CheckBoxes, RadioButtons
to start ticking when the text is too long.
|
drawHorizontalScroll, drawVerticalScroll, getDefaultDialogTransitionIn, getDefaultDialogTransitionOut, getDefaultFormTintColor, getDefaultFormTransitionIn, getDefaultFormTransitionOut, getDefaultMenuTransitionIn, getDefaultMenuTransitionOut, getDefaultSmoothScrollingSpeed, getDisableColor, getFadeScrollBarSpeed, getFadeScrollEdgeLength, getHorizontalScrollHeight, getMenuBarClass, getMenuIcons, getMenuRenderer, getTactileTouchDuration, getTextFieldCursorColor, getTickerSpeed, getVerticalScrollWidth, isBackgroundImageDetermineSize, isDefaultAlwaysTensile, isDefaultEndsWith3Points, isDefaultSmoothScrolling, isDefaultSnapToGrid, isDefaultTensileDrag, isDefaultTensileHighlight, isFadeScrollBar, isFadeScrollEdge, isFocusScrolling, isReverseSoftButtons, isRTL, isScrollVisible, isTouchMenus, paintTensileHighlight, setBackgroundImageDetermineSize, setDefaultAlwaysTensile, setDefaultDialogTransitionIn, setDefaultDialogTransitionOut, setDefaultEndsWith3Points, setDefaultFormTintColor, setDefaultFormTransitionIn, setDefaultFormTransitionOut, setDefaultMenuTransitionIn, setDefaultMenuTransitionOut, setDefaultSmoothScrolling, setDefaultSmoothScrollingSpeed, setDefaultSnapToGrid, setDefaultTensileDrag, setDisableColor, setFadeScrollBar, setFadeScrollBarSpeed, setFadeScrollEdge, setFadeScrollEdgeLength, setFG, setFocusScrolling, setMenuBarClass, setMenuIcons, setMenuRenderer, setReverseSoftButtons, setRTL, setTactileTouchDuration, setTextFieldCursorColor, setTickerSpeed, setTouchMenus, uninstall
public DefaultLookAndFeel(UIManager manager)
public void bind(Component cmp)
bind
in class LookAndFeel
cmp
- component instance that may be customized by the look and feelpublic void setTickWhenFocused(boolean tickWhenFocused)
tickWhenFocused
- public boolean isTickWhenFocused()
public void setCheckBoxImages(Image checkedX, Image uncheckedX)
checkedX
- the image to draw in order to represent a checked checkboxuncheckedX
- the image to draw in order to represent an uncheck checkboxpublic void setCheckBoxImages(Image checkedX, Image uncheckedX, Image disabledChecked, Image disabledUnchecked)
checkedX
- the image to draw in order to represent a checked checkboxuncheckedX
- the image to draw in order to represent an uncheck checkboxdisabledChecked
- same as checked for the disabled statedisabledUnchecked
- same as unchecked for the disabled statepublic void setCheckBoxFocusImages(Image checkedX, Image uncheckedX, Image disabledChecked, Image disabledUnchecked)
checkedX
- the image to draw in order to represent a checked checkboxuncheckedX
- the image to draw in order to represent an uncheck checkboxdisabledChecked
- same as checked for the disabled statedisabledUnchecked
- same as unchecked for the disabled statepublic void setComboBoxImage(Image picker)
picker
- picker imagepublic void setRadioButtonImages(Image selected, Image unselected)
selected
- the image to draw in order to represent a selected radio buttonunselected
- the image to draw in order to represent an unselected radio buttonpublic void setRadioButtonImages(Image selected, Image unselected, Image disabledSelected, Image disabledUnselected)
selected
- the image to draw in order to represent a selected radio buttonunselected
- the image to draw in order to represent an unselected radio buttondisabledSelected
- same as selected for the disabled statedisabledUnselected
- same as unselected for the disabled statepublic void setRadioButtonFocusImages(Image selected, Image unselected, Image disabledSelected, Image disabledUnselected)
selected
- the image to draw in order to represent a selected radio buttonunselected
- the image to draw in order to represent an unselected radio buttondisabledSelected
- same as selected for the disabled statedisabledUnselected
- same as unselected for the disabled statepublic void setPasswordChar(char c)
the
- char to displaypublic Image[] getRadioButtonImages()
public Image[] getRadioButtonFocusImages()
public Image[] getCheckBoxImages()
public Image[] getCheckBoxFocusImages()
public void drawButton(Graphics g, Button b)
drawButton
in class LookAndFeel
g
- graphics contextb
- component to drawpublic void drawCheckBox(Graphics g, Button cb)
drawCheckBox
in class LookAndFeel
g
- graphics contextcb
- component to drawpublic void drawLabel(Graphics g, Label l)
drawLabel
in class LookAndFeel
g
- graphics contextl
- component to drawpublic TextSelection.Span calculateLabelSpan(TextSelection sel, Label l)
LookAndFeel
calculateLabelSpan
in class LookAndFeel
sel
- TextSelection instancel
- LabelTextSelection
public void drawRadioButton(Graphics g, Button rb)
drawRadioButton
in class LookAndFeel
g
- graphics contextrb
- component to drawpublic void drawComboBox(Graphics g, List cb)
drawComboBox
in class LookAndFeel
g
- graphics contextcb
- component to drawpublic void drawList(Graphics g, List l)
drawList
in class LookAndFeel
g
- graphics contextl
- component to drawpublic TextSelection.Spans calculateTextAreaSpan(TextSelection sel, TextArea ta)
LookAndFeel
calculateTextAreaSpan
in class LookAndFeel
sel
- The current TextSelection instance.ta
- The TextArea to calculate spans for.public void drawTextArea(Graphics g, TextArea ta)
drawTextArea
in class LookAndFeel
g
- graphics contextta
- component to drawpublic Dimension getButtonPreferredSize(Button b)
getButtonPreferredSize
in class LookAndFeel
b
- component whose size should be calculatedpublic Dimension getCheckBoxPreferredSize(Button cb)
getCheckBoxPreferredSize
in class LookAndFeel
cb
- component whose size should be calculatedpublic Dimension getLabelPreferredSize(Label l)
getLabelPreferredSize
in class LookAndFeel
l
- component whose size should be calculatedpublic Dimension getListPreferredSize(List l)
getListPreferredSize
in class LookAndFeel
l
- component whose size should be calculatedpublic Dimension getRadioButtonPreferredSize(Button rb)
getRadioButtonPreferredSize
in class LookAndFeel
rb
- component whose size should be calculatedpublic Dimension getTextAreaSize(TextArea ta, boolean pref)
getTextAreaSize
in class LookAndFeel
ta
- component whose size should be calculatedpref
- indicates whether preferred or scroll size should be returnedprotected int drawLabelText(Graphics g, Label l, String text, int x, int y, int textSpaceW)
g
- graphics contextl
- label componenttext
- the text for the labelx
- position for the labely
- position for the labeltextSpaceW
- the width available for the componentpublic Dimension getComboBoxPreferredSize(List cb)
getComboBoxPreferredSize
in class LookAndFeel
cb
- component whose size should be calculatedprotected String getTextFieldString(TextArea ta)
public TextSelection.Spans calculateTextFieldSpan(TextSelection sel, TextArea ta)
LookAndFeel
calculateTextFieldSpan
in class LookAndFeel
sel
- The current TextSelection instance.ta
- The textfield to calculate spans for.public void drawTextField(Graphics g, TextArea ta)
drawTextField
in class LookAndFeel
g
- graphics contextta
- component to drawpublic Dimension getTextFieldPreferredSize(TextArea ta)
getTextFieldPreferredSize
in class LookAndFeel
ta
- component whose size should be calculatedpublic void drawTextFieldCursor(Graphics g, TextArea ta)
drawTextFieldCursor
in class LookAndFeel
g
- graphics contextta
- component to drawpublic void drawPullToRefresh(Graphics g, Component cmp, boolean taskExecuted)
drawPullToRefresh
in class LookAndFeel
g
- graphics contextcmp
- the Component which we draw the pull to refresh beneath ittaskExecuted
- an indication if the refresh task is currently runningpublic int getPullToRefreshHeight()
getPullToRefreshHeight
in class LookAndFeel
public void focusGained(Component cmp)
focusGained
in interface FocusListener
cmp
- the component that gains focuspublic void focusLost(Component cmp)
focusLost
in interface FocusListener
cmp
- the component that lost focuspublic void refreshTheme(boolean b)
refreshTheme
in class LookAndFeel
b
- indicates that the theme is set and not addedpublic TextSelection.Span calculateSpanForLabelText(TextSelection sel, Label l, String text, int x, int y, int textSpaceW)