|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.dtv.lwuit.plaf.LookAndFeel
public abstract class LookAndFeel
Allows a UI developer to completely customize the look of the application by overriding drawing/sizing methods appropriately.
Constructor Summary | |
---|---|
LookAndFeel()
|
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. |
abstract void |
drawButton(Graphics g,
Button b)
Invoked for drawing a button widget. |
abstract void |
drawCheckBox(Graphics g,
CheckBox cb)
Invoked for drawing a checkbox widget. |
abstract void |
drawComboBox(Graphics g,
ComboBox 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 |
drawMonthView(Graphics g,
Calendar cal,
Component mv)
Invoked for drawing a month view widget. |
abstract void |
drawRadioButton(Graphics g,
RadioButton 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 content pane painter. |
abstract void |
drawTextArea(Graphics g,
TextArea ta)
Invoked for drawing the text area widget. |
abstract void |
drawTextField(Graphics g,
TextField tf)
Draws the text field without its cursor which is drawn in a separate method. |
abstract void |
drawTextFieldCursor(Graphics g,
TextField tf)
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 long |
findDayAt(int x,
int y,
Calendar cal,
Component mv)
Returns the day of the month in the month view at the given relative component X/Y offsets. |
abstract Dimension |
getButtonPreferredSize(Button b)
Returns the preferred size for the button. |
abstract Dimension |
getCheckBoxPreferredSize(CheckBox cb)
Returns the preferred size for the checkbox. |
abstract Dimension |
getComboBoxPreferredSize(ComboBox box)
Returns the preferred size for the combo box. |
Transition |
getDefaultDialogTransitionIn()
Retrieves default animation that will draw the transition for entering a dialog. |
Transition |
getDefaultDialogTransitionOut()
Retrieves the default animation that will draw the transition for exiting a dialog. |
Color |
getDefaultFormTintColor()
Tint color is set when a form is partially covered be it by a menu or by a dialog. |
Transition |
getDefaultFormTransitionIn()
Retrieves the default animation that will draw the transition for entering a form. |
Transition |
getDefaultFormTransitionOut()
Retrieves the default animation that will draw the transition for entering a form. |
Transition |
getDefaultMenuTransitionIn()
Retrieves default animation that will draw the transition for entering a Menu. |
Transition |
getDefaultMenuTransitionOut()
Retrieves default animation that will draw the transition for exiting a Menu. |
int |
getDefaultSmoothScrollingSpeed()
Indicates the default speed for smooth scrolling. |
Color |
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)
Returns the preferred size for the label. |
abstract Dimension |
getListPreferredSize(List l)
Returns the preferred size for the list. |
Image[] |
getMenuIcons()
Simple getter for the menu icons. |
ListCellRenderer |
getMenuRenderer()
Returns the Menu default renderer. |
abstract Dimension |
getMonthViewPreferredSize(Component mv)
Returns the preferred size for the month view component. |
abstract Dimension |
getRadioButtonPreferredSize(RadioButton rb)
Returns the preferred size for the radio button. |
abstract Component |
getTabbedPaneCell(TabbedPane tp,
String text,
Image icon,
boolean isSelected,
boolean cellHasFocus,
Style cellStyle,
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. |
abstract Dimension |
getTextAreaPreferredSize(TextArea ta)
Returns the preferred size for the text area. |
abstract Dimension |
getTextFieldPreferredSize(TextField tf)
Returns the preferred size for the text field. |
int |
getVerticalScrollWidth()
Returns the default width of a vertical scroll bar. |
boolean |
isDefaultSmoothScrolling()
Indicates whether lists and containers should have smooth scrolling by default. |
boolean |
isReverseSoftButtons()
Indicates whether softbuttons should be reversed from their default orientation. |
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 |
setDefaultFormTintColor(Color 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 |
setDisableColor(Color 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 |
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 |
uninstall()
Invoked when a look and feel is removed, allows a look and feel to release resources related to binding components. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LookAndFeel()
Method Detail |
---|
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
- the Graphics objectb
- the buttonpublic abstract void drawCheckBox(Graphics g, CheckBox cb)
g
- the Graphics objectcb
- the check boxpublic abstract void drawComboBox(Graphics g, ComboBox cb)
g
- the Graphics objectcb
- the combo boxpublic abstract void drawLabel(Graphics g, Label l)
g
- the Graphics objectl
- the labelpublic abstract void drawList(Graphics g, List l)
g
- the Graphics objectl
- the listpublic abstract void drawMonthView(Graphics g, Calendar cal, Component mv)
g
- the Graphics objectcal
- the calendarmv
- the month view componentpublic abstract long findDayAt(int x, int y, Calendar cal, Component mv)
x
- x coordinate of offsety
- y coordinate of offsetcal
- the calendarmv
- the month view component
public abstract void drawRadioButton(Graphics g, RadioButton rb)
g
- the Graphics objectrb
- the radio buttonpublic abstract void drawTextArea(Graphics g, TextArea ta)
g
- the Graphics objectta
- the text areapublic abstract void drawTextField(Graphics g, TextField tf)
g
- the Graphics objecttf
- the text fieldpublic abstract void drawTextFieldCursor(Graphics g, TextField tf)
g
- the Graphics objecttf
- the text fieldpublic abstract void drawTabbedPane(Graphics g, TabbedPane tp)
g
- the Graphics objecttp
- the tabbed panepublic abstract Dimension getButtonPreferredSize(Button b)
b
- the button
public abstract Dimension getCheckBoxPreferredSize(CheckBox cb)
cb
- the checkbox
public abstract Dimension getLabelPreferredSize(Label l)
l
- the label
public abstract Dimension getListPreferredSize(List l)
l
- the list
public abstract Dimension getMonthViewPreferredSize(Component mv)
mv
- the month view component
public abstract Dimension getRadioButtonPreferredSize(RadioButton rb)
rb
- the radio button
public abstract Dimension getTextAreaPreferredSize(TextArea ta)
ta
- the text area
public abstract Dimension getTextFieldPreferredSize(TextField tf)
tf
- the text field
public abstract Dimension getComboBoxPreferredSize(ComboBox box)
box
- the combo box
public void drawVerticalScroll(Graphics g, Component c, float offsetRatio, float blockSizeRatio)
g
- the Graphics objectc
- the componentoffsetRatio
- the offset ratioblockSizeRatio
- the block size ratiopublic void drawHorizontalScroll(Graphics g, Component c, float offsetRatio, float blockSizeRatio)
g
- the Graphics objectc
- the componentoffsetRatio
- the offset ratioblockSizeRatio
- the block size ratiopublic void setFG(Graphics g, Component c)
g
- the Graphics objectc
- the componentpublic int getVerticalScrollWidth()
public int getHorizontalScrollHeight()
public abstract Component getTabbedPaneCell(TabbedPane tp, String text, Image icon, boolean isSelected, boolean cellHasFocus, Style cellStyle, 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 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 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()
setDefaultFormTransitionIn(com.sun.dtv.lwuit.animations.Transition)
public void setDefaultFormTransitionIn(Transition defaultFormTransitionIn)
defaultFormTransitionIn
- the default animationgetDefaultFormTransitionIn()
public Transition getDefaultFormTransitionOut()
setDefaultFormTransitionOut(com.sun.dtv.lwuit.animations.Transition)
public void setDefaultFormTransitionOut(Transition defaultFormTransitionOut)
defaultFormTransitionOut
- the default animationgetDefaultFormTransitionOut()
public Transition getDefaultMenuTransitionIn()
setDefaultMenuTransitionIn(com.sun.dtv.lwuit.animations.Transition)
public void setDefaultMenuTransitionIn(Transition defaultMenuTransitionIn)
defaultMenuTransitionIn
- the default animationgetDefaultMenuTransitionIn()
public Transition getDefaultMenuTransitionOut()
setDefaultMenuTransitionOut(com.sun.dtv.lwuit.animations.Transition)
public void setDefaultMenuTransitionOut(Transition defaultMenuTransitionOut)
defaultMenuTransitionOut
- the default animationgetDefaultMenuTransitionOut()
public Transition getDefaultDialogTransitionIn()
setDefaultDialogTransitionIn(com.sun.dtv.lwuit.animations.Transition)
public void setDefaultDialogTransitionIn(Transition defaultDialogTransitionIn)
defaultDialogTransitionIn
- the default animationgetDefaultDialogTransitionIn()
public Transition getDefaultDialogTransitionOut()
setDefaultDialogTransitionOut(com.sun.dtv.lwuit.animations.Transition)
public void setDefaultDialogTransitionOut(Transition defaultDialogTransitionOut)
defaultDialogTransitionOut
- the default animationgetDefaultDialogTransitionOut()
public Color getDefaultFormTintColor()
setDefaultFormTintColor(java.awt.Color)
public void setDefaultFormTintColor(Color defaultFormTintColor)
defaultFormTintColor
- the tint colorgetDefaultFormTintColor()
public Color getDisableColor()
setDisableColor(java.awt.Color)
public void setDisableColor(Color disableColor)
disableColor
- the disable color valuegetDisableColor()
public boolean isDefaultSmoothScrolling()
setDefaultSmoothScrolling(boolean)
public void setDefaultSmoothScrolling(boolean defaultSmoothScrolling)
defaultSmoothScrolling
- Indicates whether lists and containers
should have smooth scrolling by defaultisDefaultSmoothScrolling()
public int getDefaultSmoothScrollingSpeed()
setDefaultSmoothScrollingSpeed(int)
public void setDefaultSmoothScrollingSpeed(int defaultSmoothScrollingSpeed)
defaultSmoothScrollingSpeed
- the default speedgetDefaultSmoothScrollingSpeed()
public boolean isReverseSoftButtons()
setReverseSoftButtons(boolean)
public void setReverseSoftButtons(boolean reverseSoftButtons)
reverseSoftButtons
- Indicates whether softbuttons should be
reversed from their default orientationisReverseSoftButtons()
public ListCellRenderer getMenuRenderer()
setMenuRenderer(com.sun.dtv.lwuit.list.ListCellRenderer)
public void setMenuRenderer(ListCellRenderer menuRenderer)
menuRenderer
- the Menu default renderergetMenuRenderer()
public void setMenuIcons(Image select, Image cancel, Image menu)
select
- the select iconcancel
- the cancel iconmenu
- the menu icongetMenuIcons()
public Image[] getMenuIcons()
setMenuIcons(com.sun.dtv.lwuit.Image, com.sun.dtv.lwuit.Image, com.sun.dtv.lwuit.Image)
|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |