|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.plaf.LookAndFeel com.sun.lwuit.plaf.DefaultLookAndFeel
public class DefaultLookAndFeel
Used to render the default look of LWUIT
Constructor Summary | |
---|---|
DefaultLookAndFeel()
Creates a new instance of DefaultLookAndFeel |
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. |
void |
drawButton(Graphics g,
Button b)
Invoked for drawing a button widget |
void |
drawCheckBox(Graphics g,
Button cb)
Invoked for drawing a checkbox widget |
void |
drawComboBox(Graphics g,
List cb)
Invoked for drawing a combo box widget |
void |
drawLabel(Graphics g,
Label l)
Invoked for drawing a label widget |
protected int |
drawLabelText(Graphics g,
Label l,
java.lang.String text,
int x,
int y,
int textSpaceW)
Draws the text of a label |
void |
drawList(Graphics g,
List l)
Invoked for drawing a list widget |
void |
drawRadioButton(Graphics g,
Button rb)
Invoked for drawing the radio button widget |
void |
drawTabbedPane(Graphics g,
TabbedPane tp)
Deprecated. |
void |
drawTabbedPaneContentPane(TabbedPane tp,
Graphics g,
Rectangle rect,
Dimension cellsPreferredSize,
int numOfTabs,
int selectedTabIndex,
Dimension tabsSize,
int cellOffsetX,
int cellOffsetY)
Deprecated. |
void |
drawTextArea(Graphics g,
TextArea ta)
Draw the given text area |
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. |
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 |
focusGained(Component cmp)
Invoked when component gains focus |
void |
focusLost(Component cmp)
Invoked when component loses focus |
Dimension |
getButtonPreferredSize(Button b)
Calculate the preferred size of the component |
Image[] |
getCheckBoxFocusImages()
Returns the images used to represent the checkbox when focused |
Image[] |
getCheckBoxImages()
Returns the images used to represent the checkbox (selected followed by unselected). |
Dimension |
getCheckBoxPreferredSize(Button cb)
Calculate the preferred size of the component |
Dimension |
getComboBoxPreferredSize(List cb)
Calculate the preferred size of the component |
Dimension |
getLabelPreferredSize(Label l)
Calculate the preferred size of the component |
Dimension |
getListPreferredSize(List l)
Calculate the preferred size of the component |
Image[] |
getRadioButtonFocusImages()
Returns the images used to represent the radio button when in focused mode |
Image[] |
getRadioButtonImages()
Returns the images used to represent the radio button (selected followed by unselected). |
Dimension |
getRadioButtonPreferredSize(Button rb)
Calculate the preferred size of the component |
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. |
Dimension |
getTextAreaSize(TextArea ta,
boolean pref)
Calculate the preferred size of the component |
Dimension |
getTextFieldPreferredSize(TextArea ta)
Calculate the preferred size of the component |
protected java.lang.String |
getTextFieldString(TextArea ta)
Similar to getText() but works properly with password fields |
boolean |
isTickWhenFocused()
This method allows to set all Labels, Buttons, CheckBoxes, RadioButtons to start ticking when the text is too long. |
void |
refreshTheme()
This method is a callback to the LookAndFeel when a theme is being changed in the UIManager |
void |
setCheckBoxFocusImages(Image checked,
Image unchecked,
Image disabledChecked,
Image disabledUnchecked)
Sets images for checkbox when in focused mode |
void |
setCheckBoxImages(Image checked,
Image unchecked)
Sets images for checkbox checked/unchecked modes |
void |
setCheckBoxImages(Image checked,
Image unchecked,
Image disabledChecked,
Image disabledUnchecked)
Sets images for checkbox checked/unchecked modes |
void |
setComboBoxImage(Image picker)
Sets image for the combo box dropdown drawing |
void |
setRadioButtonFocusImages(Image selected,
Image unselected,
Image disabledSelected,
Image disabledUnselected)
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)
Sets images for radio button selected/unselected modes |
void |
setRadioButtonImages(Image selected,
Image unselected,
Image disabledSelected,
Image disabledUnselected)
Sets images for radio button selected/unselected modes |
void |
setTickWhenFocused(boolean tickWhenFocused)
This method allows to set all Labels, Buttons, CheckBoxes, RadioButtons to start ticking when the text is too long. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultLookAndFeel()
Method Detail |
---|
public void bind(Component cmp)
LookAndFeel
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 checked, Image unchecked)
checked
- the image to draw in order to represent a checked checkboxunchecked
- the image to draw in order to represent an uncheck checkboxpublic void setCheckBoxImages(Image checked, Image unchecked, Image disabledChecked, Image disabledUnchecked)
checked
- the image to draw in order to represent a checked checkboxunchecked
- 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 checked, Image unchecked, Image disabledChecked, Image disabledUnchecked)
checked
- the image to draw in order to represent a checked checkboxunchecked
- 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 Image[] getRadioButtonImages()
public Image[] getRadioButtonFocusImages()
public Image[] getCheckBoxImages()
public Image[] getCheckBoxFocusImages()
public void drawButton(Graphics g, Button b)
LookAndFeel
drawButton
in class LookAndFeel
g
- graphics contextb
- component to drawpublic void drawCheckBox(Graphics g, Button cb)
LookAndFeel
drawCheckBox
in class LookAndFeel
g
- graphics contextcb
- component to drawpublic void drawLabel(Graphics g, Label l)
LookAndFeel
drawLabel
in class LookAndFeel
g
- graphics contextl
- component to drawpublic void drawRadioButton(Graphics g, Button rb)
LookAndFeel
drawRadioButton
in class LookAndFeel
g
- graphics contextrb
- component to drawpublic void drawComboBox(Graphics g, List cb)
LookAndFeel
drawComboBox
in class LookAndFeel
g
- graphics contextcb
- component to drawpublic void drawList(Graphics g, List l)
LookAndFeel
drawList
in class LookAndFeel
g
- graphics contextl
- component to drawpublic void drawTextArea(Graphics g, TextArea ta)
LookAndFeel
drawTextArea
in class LookAndFeel
g
- graphics contextta
- component to drawpublic Dimension getButtonPreferredSize(Button b)
LookAndFeel
getButtonPreferredSize
in class LookAndFeel
b
- component whose size should be calculated
public Dimension getCheckBoxPreferredSize(Button cb)
LookAndFeel
getCheckBoxPreferredSize
in class LookAndFeel
cb
- component whose size should be calculated
public Dimension getLabelPreferredSize(Label l)
LookAndFeel
getLabelPreferredSize
in class LookAndFeel
l
- component whose size should be calculated
public Dimension getListPreferredSize(List l)
LookAndFeel
getListPreferredSize
in class LookAndFeel
l
- component whose size should be calculated
public Dimension getRadioButtonPreferredSize(Button rb)
LookAndFeel
getRadioButtonPreferredSize
in class LookAndFeel
rb
- component whose size should be calculated
public Dimension getTextAreaSize(TextArea ta, boolean pref)
LookAndFeel
getTextAreaSize
in class LookAndFeel
ta
- component whose size should be calculatedpref
- indicates whether preferred or scroll size should be returned
protected int drawLabelText(Graphics g, Label l, java.lang.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 component
public Dimension getComboBoxPreferredSize(List cb)
LookAndFeel
getComboBoxPreferredSize
in class LookAndFeel
cb
- component whose size should be calculated
public void drawTabbedPane(Graphics g, TabbedPane tp)
LookAndFeel
drawTabbedPane
in class LookAndFeel
g
- graphics contexttp
- component to drawpublic 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)
LookAndFeel
getTabbedPaneCell
in class LookAndFeel
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 void drawTabbedPaneContentPane(TabbedPane tp, Graphics g, Rectangle rect, Dimension cellsPreferredSize, int numOfTabs, int selectedTabIndex, Dimension tabsSize, int cellOffsetX, int cellOffsetY)
LookAndFeel
drawTabbedPaneContentPane
in class LookAndFeel
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 orientationprotected java.lang.String getTextFieldString(TextArea ta)
public void drawTextField(Graphics g, TextArea ta)
LookAndFeel
drawTextField
in class LookAndFeel
g
- graphics contextta
- component to drawpublic Dimension getTextFieldPreferredSize(TextArea ta)
LookAndFeel
getTextFieldPreferredSize
in class LookAndFeel
ta
- component whose size should be calculated
public void drawTextFieldCursor(Graphics g, TextArea ta)
LookAndFeel
drawTextFieldCursor
in class LookAndFeel
g
- graphics contextta
- component to drawpublic void focusGained(Component cmp)
FocusListener
focusGained
in interface FocusListener
cmp
- the component that gains focuspublic void focusLost(Component cmp)
FocusListener
focusLost
in interface FocusListener
cmp
- the component that lost focuspublic void refreshTheme()
LookAndFeel
refreshTheme
in class LookAndFeel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |