public class Form extends Container
Container
handles the menus and title while placing content between them. By default a
forms central content (the content pane) is scrollable.
Form contains Title bar, MenuBar and a ContentPane.
Calling to addComponent on the Form is delegated to the contenPane.addComponent
************************** * Title * ************************** * * * * * ContentPane * * * * * ************************** * MenuBar * **************************
Modifier and Type | Field and Description |
---|---|
protected 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.
|
BASELINE, BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_POSSIBLE_DRAG_Y, LEFT, RIGHT, TOP
Constructor and Description |
---|
Form()
Default constructor creates a simple form
|
Form(String title)
Sets the title after invoking the constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
actionCommand(Command cmd)
Invoked to allow subclasses of form to handle a command from one point
rather than implementing many command instances.
|
void |
addCommand(Command cmd)
Adds a command to the menu bar softkeys.
|
void |
addCommand(Command cmd,
int offset)
Adds a command to the menu bar softkeys or into the menu dialog,
this version of add allows us to place a command in an arbitrary location.
|
void |
addCommandListener(ActionListener l)
A listener that is invoked when a command is clicked allowing multiple commands
to be handled by a single block
|
void |
addComponent(Component cmp)
Adds Component to the Form's Content Pane
|
void |
addComponent(int index,
Component cmp)
Adds Component to the Form's Content Pane
|
void |
addComponent(int index,
Object constraints,
Component cmp)
Adds a Component to the Container
|
void |
addComponent(Object constraints,
Component cmp)
Adds a Component to the Container
|
void |
addGameKeyListener(int keyCode,
ActionListener listener)
Add a game key listener to the given gamekey for a callback when the
key is released
|
void |
addKeyListener(int keyCode,
ActionListener listener)
Add a key listener to the given keycode for a callback when the key is released
|
void |
addOrientationListener(ActionListener l)
This listener is invoked when device orientation changes on devices that support orientation change
|
void |
addShowListener(ActionListener l)
This listener would be invoked when show is completed
|
void |
addSizeChangedListener(ActionListener l)
This listener is invoked when device size is changed
|
boolean |
animate()
Allows the animation to reduce "repaint" calls when it returns false.
|
void |
deregisterAnimated(Animation cmp)
Indicate that cmp would no longer like to receive animation events
|
void |
dispatchCommand(Command cmd,
ActionEvent ev)
Dispatches a command via the standard form mechanism of firing a command event
|
Component |
findNextFocusHorizontal(boolean right)
This method returns the next focusable Component horizontally
|
Component |
findNextFocusVertical(boolean down)
This method returns the next focusable Component vertically
|
Command |
getBackCommand()
Indicates the command that is defined as the back command out of this form.
|
Command |
getClearCommand()
Indicates the command that is defined as the clear command in this form.
|
Command |
getCommand(int index)
Returns the command occupying the given index
|
int |
getCommandCount()
A helper method to check the amount of commands within the form menu
|
Form |
getComponentForm()
Returns the Component Form or null if this Component
is not added yet to a form
|
int |
getComponentIndex(Component cmp)
Returns the Component index in the Container
|
Container |
getContentPane()
This method returns the Content pane instance
|
Command |
getDefaultCommand()
Default command is invoked when a user presses fire, this functionality works
well in some situations but might collide with elements such as navigation
and combo boxes.
|
int |
getDragRegionStatus(int x,
int y)
Indicates if the section within the X/Y area is a "drag region" where
we expect people to drag or press in which case we
can instantly start dragging making perceived performance faster.
|
Component |
getFocused()
Returns the current focus component for this form
|
Painter |
getGlassPane()
Allows a developer that doesn't derive from the form to draw on top of the
form regardless of underlying changes or animations.
|
Container |
getLayeredPane()
This method returns the layered pane of the Form, the layered pane is laid
on top of the content pane and is created lazily upon calling this method the layer
will be created.
|
Layout |
getLayout()
Returns the layout manager responsible for arranging this container
|
MenuBar |
getMenuBar()
Returns the associated Menu Bar object
|
Style |
getMenuStyle()
Returns the style of the menu
|
String[] |
getPropertyNames()
A component may expose mutable property names for a UI designer to manipulate, this
API is designed for usage internally by the GUI builder code
|
String[] |
getPropertyTypeNames()
This method is here to workaround an XMLVM array type bug where property types aren't
identified properly, it returns the names of the types using the following type names:
String,int,double,long,byte,short,char,String[],String[][],byte[],Image,Image[],Object[],ListModel,ListCellRenderer
|
Class[] |
getPropertyTypes()
Matches the property names method (see that method for further details).
|
Object |
getPropertyValue(String name)
Returns the current value of the property name, this method is used by the GUI builder
|
int |
getScrollAnimationSpeed()
Scroll animation speed in milliseconds allowing a developer to slow down or accelerate
the smooth animation mode
|
Button |
getSoftButton(int offset)
Returns the button representing the softbutton, this allows modifying softbutton
attributes and behavior programmatically rather than by using the command API.
|
int |
getSoftButtonCount()
Returns the number of buttons on the menu bar for use with getSoftButton()
|
int |
getTintColor()
Default color for the screen tint when a dialog or a menu is shown
|
String |
getTitle()
Returns the Form title text
|
Container |
getTitleArea()
Deprecated.
this method was exposed to allow some hacks, you are advised not to use it.
There are some alternatives such as command behavior (thru Display or the theme constants)
|
Label |
getTitleComponent()
Allows modifying the title attributes beyond style (e.g.
|
Style |
getTitleStyle()
Returns the style of the title
|
Toolbar |
getToolbar()
Gets the Form Toolbar if exists or null
|
Transition |
getTransitionInAnimator()
This property allows us to define a an animation that will draw the transition for
entering this form.
|
Transition |
getTransitionOutAnimator()
This property allows us to define a an animation that will draw the transition for
exiting this form.
|
UIManager |
getUIManager()
This method should be used by the Component to retrieve the correct UIManager to work with
|
boolean |
hasMedia()
Used by the implementation to prevent flickering when flushing the double buffer
|
protected void |
hideNotify()
This method is only invoked when the underlying canvas for the form is hidden
this method isn't called for form based events and is generally usable for
suspend/resume based behavior
|
protected void |
initLaf(UIManager uim)
This method initializes the Component defaults constants
|
boolean |
isAlwaysTensile()
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 |
isCyclicFocus()
Indicates whether focus should cycle within the form
|
boolean |
isDragRegion(int x,
int y)
Deprecated.
this method was replaced by getDragRegionStatus
|
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.
|
boolean |
isFormBottomPaddingEditingMode()
Toggles the way the virtual keyboard behaves, enabling this mode shrinks the screen but makes editing
possible when working with text fields that aren't in a scrollable container.
|
boolean |
isMinimizeOnBack()
When set to true the physical back button will minimize the application
|
boolean |
isScrollable()
Indicates whether the component should/could scroll by default a component
is not scrollable.
|
boolean |
isSingleFocusMode()
Returns true if there is only one focusable member in this form.
|
boolean |
isSmoothScrolling()
Indicates that scrolling through the component should work as an animation
|
void |
keyPressed(int keyCode)
If this Component is focused, the key pressed event
will call this method
|
void |
keyReleased(int keyCode)
If this Component is focused, the key released event
will call this method
|
void |
keyRepeated(int keyCode)
If this Component is focused, the key repeat event
will call this method.
|
protected void |
longKeyPress(int keyCode)
If this Component is focused this method is invoked when the user presses
and holds the key
|
void |
longPointerPress(int x,
int y)
If this Component is focused this method is invoked when the user presses
and holds the pointer on the Component
|
protected void |
onShow()
Allows subclasses to bind functionality that occurs when
a specific form or dialog appears on the screen
|
protected void |
onShowCompleted()
Allows subclasses to bind functionality that occurs when
a specific form or dialog is "really" showing hence when
the transition is totally complete (unlike onShow which is called
on intent).
|
void |
paint(Graphics g)
This method paints the Component on the screen, it should be overriden
by subclasses to perform custom drawing or invoke the UI API's to let
the PLAF perform the rendering.
|
void |
paintBackground(Graphics g)
Exposing the background painting for the benefit of animations
|
protected String |
paramString()
Returns a string representing the state of this component.
|
void |
pointerDragged(int[] x,
int[] y)
If this Component is focused, the pointer dragged event
will call this method
|
void |
pointerDragged(int x,
int y)
If this Component is focused, the pointer dragged event
will call this method
|
void |
pointerHover(int[] x,
int[] y)
Invoked for devices where the pointer can hover without actually clicking
the display.
|
void |
pointerHoverPressed(int[] x,
int[] y)
Invoked for devices where the pointer can hover without actually clicking
the display.
|
void |
pointerHoverReleased(int[] x,
int[] y)
Invoked for devices where the pointer can hover without actually clicking
the display.
|
void |
pointerPressed(int x,
int y)
If this Component is focused, the pointer pressed event
will call this method
|
void |
pointerReleased(int x,
int y)
If this Component is focused, the pointer released event
will call this method
|
void |
refreshTheme(boolean merge)
Makes sure the component is up to date with the current theme, ONLY INVOKE THIS METHOD IF YOU CHANGED THE THEME!
|
void |
registerAnimated(Animation cmp)
The given component is interested in animating its appearance and will start
receiving callbacks when it is visible in the form allowing it to animate
its appearance.
|
void |
removeAll()
Removes all Components from the Content Pane
|
void |
removeAllCommands()
Clear menu commands from the menu bar
|
void |
removeAllShowListeners()
Removes all Show Listeners from this Form
|
void |
removeCommand(Command cmd)
Removes the command from the menu bar softkeys
|
void |
removeCommandListener(ActionListener l)
A listener that is invoked when a command is clicked allowing multiple commands
to be handled by a single block
|
void |
removeComponent(Component cmp)
Removes a component from the Form's Content Pane
|
void |
removeGameKeyListener(int keyCode,
ActionListener listener)
Removes a game key listener from the given game keycode
|
void |
removeKeyListener(int keyCode,
ActionListener listener)
Removes a key listener from the given keycode
|
void |
removeOrientationListener(ActionListener l)
This listener is invoked when device orientation changes on devices that support orientation change
|
void |
removeShowListener(ActionListener l)
Removes the show listener
|
void |
removeSizeChangedListener(ActionListener l)
Remove SizeChangedListener
|
void |
replace(Component current,
Component next,
Transition t)
This method replaces the current Component with the next Component.
|
void |
replaceAndWait(Component current,
Component next,
Transition t)
This method replaces the current Component with the next Component.
|
void |
scrollComponentToVisible(Component c)
Makes sure the component is visible in the scroll if this container
is scrollable
|
void |
setAlwaysTensile(boolean alwaysTensile)
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 |
setBackCommand(Command backCommand)
Indicates the command that is defined as the back command out of this form.
|
void |
setBgImage(Image bgImage)
Deprecated.
Use the style directly
|
void |
setClearCommand(Command clearCommand)
Indicates the command that is defined as the clear command in this form.
|
void |
setCyclicFocus(boolean cyclicFocus)
Indicates whether focus should cycle within the form
|
void |
setDefaultCommand(Command defaultCommand)
Default command is invoked when a user presses fire, this functionality works
well in some situations but might collide with elements such as navigation
and combo boxes.
|
void |
setFocused(Component focused)
Sets the focused component and fires the appropriate events to make it so
|
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.
|
void |
setFormBottomPaddingEditingMode(boolean b)
Toggles the way the virtual keyboard behaves, enabling this mode shrinks the screen but makes editing
possible when working with text fields that aren't in a scrollable container.
|
void |
setGlassPane(Painter glassPane)
Allows a developer that doesn't derive from the form to draw on top of the
form regardless of underlying changes or animations.
|
void |
setLayout(Layout layout)
Sets the layout manager responsible for arranging this container
|
void |
setMenuBar(MenuBar menuBar)
Sets the associated MenuBar Object.
|
void |
setMenuCellRenderer(ListCellRenderer menuCellRenderer)
Determine the cell renderer used to render menu elements for themeing the
look of the menu options
|
void |
setMenuTransitions(Transition transitionIn,
Transition transitionOut)
Sets the menu transitions for showing/hiding the menu, can be null...
|
void |
setMinimizeOnBack(boolean minimizeOnBack)
When set to true the physical back button will minimize the application
|
String |
setPropertyValue(String name,
Object value)
Sets a new value to the given property, returns an error message if failed
and null if successful.
|
void |
setRTL(boolean r)
Is the component a bidi RTL component
|
void |
setScrollable(boolean scrollable)
The equivalent of calling both setScrollableY and setScrollableX
|
void |
setScrollableX(boolean scrollableX)
Sets whether the component should/could scroll on the X axis
|
void |
setScrollableY(boolean scrollableY)
Sets whether the component should/could scroll on the Y axis
|
void |
setScrollAnimationSpeed(int animationSpeed)
Scroll animation speed in milliseconds allowing a developer to slow down or accelerate
the smooth animation mode
|
void |
setSmoothScrolling(boolean smoothScrolling)
Indicates that scrolling through the component should work as an animation
|
void |
setTintColor(int tintColor)
Default color for the screen tint when a dialog or a menu is shown
|
void |
setTitle(String title)
Sets the Form title to the given text
|
void |
setTitleComponent(Label title)
Allows replacing the title with a different title component, thus allowing
developers to create more elaborate title objects.
|
void |
setTitleComponent(Label title,
Transition t)
Allows replacing the title with a different title component, thus allowing
developers to create more elaborate title objects.
|
void |
setTitleStyle(Style s)
Deprecated.
this method doesn't take into consideration multiple styles
|
void |
setToolBar(Toolbar toolbar)
Sets the Form Toolbar
|
void |
setTransitionInAnimator(Transition transitionInAnimator)
This property allows us to define a an animation that will draw the transition for
entering this form.
|
void |
setTransitionOutAnimator(Transition transitionOutAnimator)
This property allows us to define a an animation that will draw the transition for
exiting this form.
|
void |
setUIManager(UIManager uiManager)
Allows replacing the UIManager in a component hierarchy to update the look and feel
only to a specific hierarchy
|
void |
setVisible(boolean visible)
Toggles visibility of the component
|
protected boolean |
shouldSendPointerReleaseToOtherForm()
Indicates whether this form wants to receive pointerReleased events for touch
events that started in a different form
|
void |
show()
Displays the current form on the screen
|
void |
showBack()
Displays the current form on the screen, this version of the method is
useful for "back" navigation since it reverses the direction of the transition.
|
protected void |
showNotify()
This method is only invoked when the underlying canvas for the form is shown
this method isn't called for form based events and is generally usable for
suspend/resume based behavior
|
protected void |
sizeChanged(int w,
int h)
This method is only invoked when the underlying canvas for the form gets
a size changed event.
|
animateHierarchy, animateHierarchyAndWait, animateHierarchyFade, animateHierarchyFadeAndWait, animateLayout, animateLayoutAndWait, animateLayoutFade, animateLayoutFadeAndWait, animateUnlayout, animateUnlayoutAndWait, applyRTL, calcPreferredSize, cancelRepaints, clearClientProperties, contains, createAnimateMotion, dragInitiated, drop, findFirstFocusable, fireClicked, flushReplace, forceRevalidate, getBottomGap, getClosestComponentTo, getComponentAt, getComponentAt, getComponentCount, getGridPosX, getGridPosY, getLayoutHeight, getLayoutWidth, getLeadComponent, getLeadParent, getScrollIncrement, getSideGap, invalidate, isEnabled, isScrollableX, isScrollableY, isSelectableInteraction, layoutContainer, morph, morphAndWait, paintComponentBackground, paintGlass, replace, replaceAndWait, replaceAndWait, revalidate, setCellRenderer, setEnabled, setLeadComponent, setScrollIncrement, setShouldCalcPreferredSize, setShouldLayout
addDragOverListener, addDropListener, addFocusListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, bindProperty, calcScrollSize, contains, deinitialize, deinitializeCustomStyle, dragEnter, dragExit, draggingOver, drawDraggedImage, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getBaseline, getBaselineResizeBehavior, getBindablePropertyNames, getBindablePropertyTypes, getBorder, getBoundPropertyValue, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentState, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragSpeed, getHeight, getLabelForComponent, getName, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getParent, getPreferredH, getPreferredSize, getPreferredW, getPressedStyle, getSameHeight, getSameWidth, getScrollable, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedRect, getSelectedStyle, getStyle, getTensileLength, getUIID, getUnselectedStyle, getVisibleBounds, getWidth, getX, getY, growShrink, handlesInput, hasFocus, initComponent, initCustomStyle, installDefaultPainter, isCellRenderer, isDragActivated, isDragAndDropOperation, isDraggable, isDropTarget, isFlatten, isFocusable, isGrabsPointerEvents, isHideInPortrait, isInClippingRegion, isInitialized, isRTL, isScrollVisible, isSnapToGrid, isStickyDrag, isTactileTouch, isTactileTouch, isTensileDragEnabled, isVisible, laidOut, onScrollX, onScrollY, paintBackgrounds, paintBorder, paintComponent, paintComponent, paintLock, paintLockRelease, paintScrollbars, paintScrollbarX, paintScrollbarY, pinch, pointerPressed, pointerReleased, putClientProperty, refreshTheme, refreshTheme, removeDragOverListener, removeDropListener, removeFocusListener, removePointerDraggedListener, removePointerPressedListener, removePointerReleasedListener, removeScrollListener, repaint, repaint, requestFocus, resetFocusable, scrollRectToVisible, scrollRectToVisible, setBoundPropertyValue, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setDirtyRegion, setDisabledStyle, setDraggable, setDropTarget, setFlatten, setFocus, setFocusable, setGrabsPointerEvents, setHandlesInput, setHeight, setHideInPortrait, setInitialized, setIsScrollVisible, setLabelForComponent, setName, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setPreferredH, setPreferredSize, setPreferredW, setPressedStyle, setSameHeight, setSameWidth, setScrollOpacityChangeSpeed, setScrollSize, setScrollVisible, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setSize, setSnapToGrid, setTactileTouch, setTensileDragEnabled, setTensileLength, setUIID, setUnselectedStyle, setWidth, setX, setY, shouldBlockSideSwipe, styleChanged, toString, unbindProperty
protected boolean focusScrolling
public Form()
public Form(String title)
title
- the form titlepublic void setFormBottomPaddingEditingMode(boolean b)
b
- true to enable false to disablepublic boolean isFormBottomPaddingEditingMode()
public boolean isAlwaysTensile()
Component
isAlwaysTensile
in class Component
public void setAlwaysTensile(boolean alwaysTensile)
Component
setAlwaysTensile
in class Component
alwaysTensile
- the alwaysTensile to setpublic Container getTitleArea()
public UIManager getUIManager()
Component
getUIManager
in class Container
public void setUIManager(UIManager uiManager)
Container
setUIManager
in class Container
uiManager
- UIManager instancepublic void addShowListener(ActionListener l)
l
- listenerpublic void removeShowListener(ActionListener l)
l
- the listenerpublic void removeAllShowListeners()
public void addOrientationListener(ActionListener l)
l
- listenerpublic void removeOrientationListener(ActionListener l)
l
- the listenerpublic void addSizeChangedListener(ActionListener l)
l
- listenerpublic void removeSizeChangedListener(ActionListener l)
l
- the listenerprotected void hideNotify()
protected void showNotify()
protected void sizeChanged(int w, int h)
w
- the new width of the Formh
- the new height of the Formpublic void setGlassPane(Painter glassPane)
glassPane
- a new glass pane to install. It is generally recommended to
use a painter chain if more than one painter is required.public boolean isDragRegion(int x, int y)
isDragRegion
in class Component
x
- x location for the touchy
- y location for the touchpublic int getDragRegionStatus(int x, int y)
getDragRegionStatus
in class Component
x
- x location for the touchy
- y location for the touchpublic Painter getGlassPane()
PainterChain.installGlassPane(Form, com.codename1.ui.Painter)
public void setTitleStyle(Style s)
s
- new stylepublic Label getTitleComponent()
public void setTitleComponent(Label title)
title
- new title componentpublic void setTitleComponent(Label title, Transition t)
title
- new title componentt
- transition for title replacementpublic void addKeyListener(int keyCode, ActionListener listener)
keyCode
- code on which to send the eventlistener
- listener to invoke when the key code released.public void removeKeyListener(int keyCode, ActionListener listener)
keyCode
- code on which the event is sentlistener
- listener instance to removepublic void removeGameKeyListener(int keyCode, ActionListener listener)
keyCode
- code on which the event is sentlistener
- listener instance to removepublic void addGameKeyListener(int keyCode, ActionListener listener)
keyCode
- code on which to send the eventlistener
- listener to invoke when the key code released.public int getSoftButtonCount()
public Button getSoftButton(int offset)
offset
- the offest of the softbuttonpublic Style getMenuStyle()
public Style getTitleStyle()
protected void initLaf(UIManager uim)
Component
public void setDefaultCommand(Command defaultCommand)
defaultCommand
- the command to treat as defaultpublic Command getDefaultCommand()
public void setClearCommand(Command clearCommand)
clearCommand
- the command to treat as the clear Commandpublic Command getClearCommand()
public void setBackCommand(Command backCommand)
backCommand
- the command to treat as the back Commandpublic Command getBackCommand()
public Container getContentPane()
public Container getLayeredPane()
public void removeAll()
public void setBgImage(Image bgImage)
bgImage
- the background imagepublic void setLayout(Layout layout)
Container
public void setTitle(String title)
title
- the form titlepublic String getTitle()
public void addComponent(Component cmp)
addComponent
in class Container
cmp
- the added parampublic void addComponent(Object constraints, Component cmp)
Container
addComponent
in class Container
constraints
- this method is useful when the Layout requires a constraint
such as the BorderLayout.
In this case you need to specify an additional data when you add a Component,
such as "CENTER", "NORTH"...cmp
- component to addpublic void addComponent(int index, Object constraints, Component cmp)
Container
addComponent
in class Container
index
- location to insert the Componentconstraints
- this method is useful when the Layout requires a constraint
such as the BorderLayout.
In this case you need to specify an additional data when you add a Component,
such as "CENTER", "NORTH"...cmp
- component to addpublic void addComponent(int index, Component cmp)
addComponent
in class Container
cmp
- the added paramindex
- location to insert the Componentpublic void replace(Component current, Component next, Transition t)
Container
public void replaceAndWait(Component current, Component next, Transition t)
Container
replaceAndWait
in class Container
current
- a Component to remove from the Containernext
- a Component that replaces the current Componentt
- a Transition between the add and removal of the Components
a Transition can be nullpublic void removeComponent(Component cmp)
removeComponent
in class Container
cmp
- the component to be removedpublic final boolean hasMedia()
public void registerAnimated(Animation cmp)
cmp
- component that would be animatedpublic void deregisterAnimated(Animation cmp)
cmp
- component that would no longer receive animation eventspublic boolean animate()
Animation
Display
class.public void refreshTheme(boolean merge)
Component
refreshTheme
in class Container
merge
- indicates if the current styles should be merged with the new stylespublic void paintBackground(Graphics g)
paintBackground
in class Component
g
- the form graphicspublic Transition getTransitionInAnimator()
public void setTransitionInAnimator(Transition transitionInAnimator)
transitionInAnimator
- the Form in transitionpublic Transition getTransitionOutAnimator()
public void setTransitionOutAnimator(Transition transitionOutAnimator)
transitionOutAnimator
- the Form out transitionpublic void addCommandListener(ActionListener l)
l
- the command action listenerpublic void removeCommandListener(ActionListener l)
l
- the command action listenerprotected void actionCommand(Command cmd)
cmd
- the form commmand objectpublic void dispatchCommand(Command cmd, ActionEvent ev)
cmd
- The command to dispatchev
- the event to dispatchpublic void show()
public void showBack()
public void setSmoothScrolling(boolean smoothScrolling)
Component
setSmoothScrolling
in class Component
smoothScrolling
- indicates if a component uses smooth scrollingpublic boolean isSmoothScrolling()
Component
isSmoothScrolling
in class Component
public int getScrollAnimationSpeed()
Component
getScrollAnimationSpeed
in class Component
public void setScrollAnimationSpeed(int animationSpeed)
Component
setScrollAnimationSpeed
in class Component
animationSpeed
- scroll animation speed in millisecondsprotected void onShow()
protected void onShowCompleted()
public final Form getComponentForm()
Component
getComponentForm
in class Component
public void setFocused(Component focused)
focused
- the newly focused component or null for no focuspublic Component getFocused()
protected void longKeyPress(int keyCode)
Component
longKeyPress
in class Component
keyCode
- the key code value to indicate a physical key.public void longPointerPress(int x, int y)
Component
longPointerPress
in class Component
protected boolean shouldSendPointerReleaseToOtherForm()
public void keyPressed(int keyCode)
Component
keyPressed
in class Container
keyCode
- the key code value to indicate a physical key.public Layout getLayout()
Container
public boolean isMinimizeOnBack()
public void setMinimizeOnBack(boolean minimizeOnBack)
minimizeOnBack
- the minimizeOnBack to setpublic void keyReleased(int keyCode)
Component
keyReleased
in class Container
keyCode
- the key code value to indicate a physical key.public void keyRepeated(int keyCode)
Component
keyRepeated
in class Component
keyCode
- the key code value to indicate a physical key.public void pointerPressed(int x, int y)
Component
pointerPressed
in class Container
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerDragged(int x, int y)
Component
pointerDragged
in class Component
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerDragged(int[] x, int[] y)
Component
pointerDragged
in class Component
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerHoverReleased(int[] x, int[] y)
Component
pointerHoverReleased
in class Component
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerHoverPressed(int[] x, int[] y)
Component
pointerHoverPressed
in class Component
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerHover(int[] x, int[] y)
Component
pointerHover
in class Container
x
- the pointer x coordinatey
- the pointer y coordinatepublic boolean isSingleFocusMode()
public void pointerReleased(int x, int y)
Component
pointerReleased
in class Component
x
- the pointer x coordinatey
- the pointer y coordinatepublic void setScrollableY(boolean scrollableY)
Container
setScrollableY
in class Container
scrollableY
- whether the component should/could scroll on the Y axispublic void setScrollableX(boolean scrollableX)
Container
setScrollableX
in class Container
scrollableX
- whether the component should/could scroll on the X axispublic int getComponentIndex(Component cmp)
Container
getComponentIndex
in class Container
cmp
- the component to search forpublic void addCommand(Command cmd, int offset)
cmd
- the Form command to be addedoffset
- position in which the command is addedpublic int getCommandCount()
public Command getCommand(int index)
index
- offset of the commandpublic void addCommand(Command cmd)
cmd
- the Form command to be addedpublic void removeCommand(Command cmd)
cmd
- the Form command to be removedpublic void setCyclicFocus(boolean cyclicFocus)
cyclicFocus
- marks whether focus should cyclepublic Component findNextFocusVertical(boolean down)
down
- if true will the return the next focusable on the bottom else
on the toppublic Component findNextFocusHorizontal(boolean right)
right
- if true will the return the next focusable on the right else
on the leftpublic boolean isCyclicFocus()
public void scrollComponentToVisible(Component c)
scrollComponentToVisible
in class Container
c
- the componant to be visiblepublic void setMenuCellRenderer(ListCellRenderer menuCellRenderer)
menuCellRenderer
- the menu cell rendererpublic void removeAllCommands()
public void setRTL(boolean r)
Component
public void paint(Graphics g)
Component
public void setScrollable(boolean scrollable)
Container
setScrollable
in class Container
scrollable
- whether the component should/could scroll on the
X and Y axispublic boolean isScrollable()
Component
isScrollable
in class Component
public void setVisible(boolean visible)
Component
setVisible
in class Component
visible
- true if component is visible; otherwise falsepublic int getTintColor()
public void setTintColor(int tintColor)
tintColor
- the tint color when a dialog or a menu is shownpublic void setMenuTransitions(Transition transitionIn, Transition transitionOut)
transitionIn
- the transition that will play when the menu appearstransitionOut
- the transition that will play when the menu is foldedprotected String paramString()
Component
null
.paramString
in class Container
public MenuBar getMenuBar()
public void setMenuBar(MenuBar menuBar)
menuBar
- public void setToolBar(Toolbar toolbar)
toolbar
- public Toolbar getToolbar()
public boolean isFocusScrolling()
public void setFocusScrolling(boolean focusScrolling)
focusScrolling
- the new value for focus scrollingpublic String[] getPropertyNames()
Component
getPropertyNames
in class Component
public Class[] getPropertyTypes()
Component
getPropertyTypes
in class Component
public String[] getPropertyTypeNames()
Component
getPropertyTypeNames
in class Component
public Object getPropertyValue(String name)
Component
getPropertyValue
in class Component
name
- the name of the propertypublic String setPropertyValue(String name, Object value)
Component
setPropertyValue
in class Component
name
- the name of the propertyvalue
- new value for the property