public class Form extends Container
Top level component that serves as the root for the UI, this Container
subclass works in concert with the Toolbar
to create menus. By default a
forms main content area (the content pane) is scrollable on the Y axis and has a FlowLayout
as is the default.
Form contains a title bar area which in newer application is replaced by the Toolbar
.
Calling Container.add(com.codename1.ui.Component)
or all similar methods on the Form
delegates to the contenPane so calling form.add(cmp)
is equivalent to
form.getContentPane().add(cmp)
. Normally this shouldn't matter, however in some cases such as
animation we need to use the content pane directly e.g. form.getContentPane().animateLayout(200)
will work whereas form.animateLayout(200)
will fail.
Modifier and Type | Class and Description |
---|---|
class |
Form.TabIterator
Iterates through the components on this form in traversal order.
|
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, CROSSHAIR_CURSOR, DEFAULT_CURSOR, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_Y, 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, E_RESIZE_CURSOR, HAND_CURSOR, LEFT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NW_RESIZE_CURSOR, RIGHT, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, TOP, W_RESIZE_CURSOR, WAIT_CURSOR
Constructor and Description |
---|
Form()
Default constructor creates a simple form
|
Form(Layout contentPaneLayout)
Constructor that accepts a layout
|
Form(String title)
Sets the title after invoking the constructor
|
Form(String title,
Layout contentPaneLayout)
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)
Deprecated.
Please use
Toolbar.addCommandToLeftBar(com.codename1.ui.Command) or similar methods |
void |
addCommand(Command cmd,
int offset)
Deprecated.
Please use
Toolbar.addCommandToLeftBar(com.codename1.ui.Command) or similar methods |
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
|
<C extends Component> |
addComponentAwaitingRelease(C c) |
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 |
addPasteListener(ActionListener l)
Adds a listener to be notified when the user has initiated a paste event.
|
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 |
animateHierarchy(int duration)
Animates a pending hierarchy of components into place, this effectively replaces revalidate with
a more visual form of animation
|
void |
animateHierarchyAndWait(int duration)
Animates a pending hierarchy of components into place, this effectively replaces revalidate with
a more visual form of animation.
|
void |
animateHierarchyFade(int duration,
int startingOpacity)
Animates a pending hierarchy of components into place, this effectively replaces revalidate with
a more visual form of animation
|
void |
animateHierarchyFadeAndWait(int duration,
int startingOpacity)
Animates a pending hierarchy of components into place, this effectively replaces revalidate with
a more visual form of animation.
|
void |
animateLayout(int duration)
Animates a pending layout into place, this effectively replaces revalidate with a more visual form of animation
See: |
void |
animateLayoutAndWait(int duration)
Animates a pending layout into place, this effectively replaces revalidate with a more visual form of animation.
|
void |
animateLayoutFade(int duration,
int startingOpacity)
Animates a pending layout into place, this effectively replaces revalidate with a more visual form of animation
|
void |
animateLayoutFadeAndWait(int duration,
int startingOpacity)
Animates a pending layout into place, this effectively replaces revalidate with a more visual form of animation.
|
void |
animateUnlayout(int duration,
int opacity,
Runnable callback)
This method is the exact reverse of animateLayout, when completed it leaves the container in
an invalid state.
|
void |
animateUnlayoutAndWait(int duration,
int opacity)
This method is the exact reverse of animateLayoutAndWait, when completed it leaves the container in
an invalid state.
|
void |
clearComponentsAwaitingRelease() |
protected Component |
createStatusBar()
Subclasses can override this method to control the creation of the status bar component.
|
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
|
void |
dispatchPaste(ActionEvent l)
Fires a paste event to the paste listeners.
|
Component |
findCurrentlyEditingComponent()
Returns the component on this form that is currently being edited, or null
if no component is currently being edited.
|
Component |
findNextFocusHorizontal(boolean right)
This method returns the next focusable Component horizontally
|
Component |
findNextFocusVertical(boolean down)
This method returns the next focusable Component vertically
|
AnimationManager |
getAnimationManager()
Returns the animation manager instance responsible for this form, this can be used to track/queue
animations
|
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()
Deprecated.
Please use
Container.getComponentCount() or similar methods |
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
|
VirtualInputDevice |
getCurrentInputDevice()
Returns the current virtual input device in the form.
|
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.
|
TextArea |
getEditOnShow()
A text component that will receive focus and start editing immediately as the form is shown
|
Component |
getFocused()
Returns the current focus component for this form
|
Container |
getFormLayeredPane(Class c,
boolean top)
Returns the layered pane for the class and if one doesn't exist a new one is created
dynamically and returned.
|
protected Container |
getFormLayeredPaneIfExists()
Gets the form layered pane of the container without trying to create it.
|
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.
|
int |
getInvisibleAreaUnderVKB()
In some virtual keyboard implementations (notably iOS) this value is used to determine the height of
the virtual keyboard
|
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.
|
Container |
getLayeredPane(Class c,
boolean top)
Returns the layered pane for the class and if one doesn't exist a new one is created dynamically and returned
|
Container |
getLayeredPane(Class c,
int zIndex)
Returns the layered pane for the class and if one doesn't exist a new one is created dynamically and returned
|
protected Container |
getLayeredPaneIfExists()
Gets the layered pane of the container without trying to create it.
|
Layout |
getLayout()
Returns the layout manager of the form's content pane.
|
MenuBar |
getMenuBar()
Returns the associated Menu Bar object
|
Style |
getMenuStyle()
Returns the style of the menu
|
Component |
getNextComponent(Component current)
Gets the next component in focus traversal order.
|
Component |
getPreviousComponent(Component current)
Gets the previous component in focus traversal order.
|
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
|
Rectangle |
getSafeArea()
This method returns a rectangle defining the "safe" area of the display, which excludes
areas on the screen that are covered by notches, task bars, rounded corners, etc.
|
int |
getScrollAnimationSpeed()
Scroll animation speed in milliseconds allowing a developer to slow down or accelerate
the smooth animation mode
|
int |
getSideGap()
The form itself should
|
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()
|
Command |
getSourceCommand()
Gets the source command that was used to navigate to this form.
|
Form.TabIterator |
getTabIterator(Component start)
Returns an iterator that iterates over all of the components in this form, ordered
by their tab index.
|
TextSelection |
getTextSelection()
Gets TextSelection support for this form.
|
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 |
grabAnimationLock()
Deprecated.
this is effectively invalidated by the newer animation framework
|
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 |
initGlobalToolbar()
Allows subclasses to disable the global toolbar for a specific form by overriding this method
|
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 |
isEditing()
Checks if the component is currently being edited.
|
boolean |
isEnableCursors()
Checks if custom cursors are enabled on this form.
|
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 |
isScrollableX()
Indicates whether the component should/could scroll on the X axis
|
boolean |
isScrollableY()
Indicates whether the component should/could scroll on the Y axis
|
boolean |
isScrollVisible()
Indicate whether this component scroll is visible
|
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 void |
paintScrollbars(Graphics g)
Paints the UI for the scrollbars on the component, this will be invoked only
for scrollable components.
|
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 |
releaseAnimationLock()
Deprecated.
this is effectively invalidated by the newer animation framework
|
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
|
<C extends Component> |
removeComponentAwaitingRelease(C c) |
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 |
removePasteListener(ActionListener l)
Removes listener from being notified when the user has initiated a paste event.
|
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.
|
protected boolean |
resumeDragAfterScrolling(int x,
int y)
This method fixes this tensile drag issue.
|
void |
scrollComponentToVisible(Component c)
Makes sure the component is visible in the scroll if this container
is scrollable
|
void |
setAllowEnableLayoutOnPaint(boolean allow)
Enabling "layoutOnPaint" behaviour.
|
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.
|
Command |
setBackCommand(String name,
Image icon,
ActionListener ev)
Shorthand for
setBackCommand(com.codename1.ui.Command) that
dynamically creates the command using Command.create(java.lang.String, com.codename1.ui.Image, com.codename1.ui.events.ActionListener) . |
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 |
setCurrentInputDevice(VirtualInputDevice device)
Sets the current virtual input device for the 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 |
setEditOnShow(TextArea editOnShow)
A text component that will receive focus and start editing immediately as the form is shown
|
void |
setEnableCursors(boolean e)
Enable or disable custom cursors on this form.
|
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
|
void |
setOverrideInvisibleAreaUnderVKB(int invisibleAreaUnderVKB)
Overrides the invisible area under the virtual keyboard with a given value.
|
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 |
setSafeAreaChanged()
Causes the display safe area to be recalculated the next time the form list laid out.
|
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 |
setScrollVisible(boolean isScrollVisible)
Set whether this component scroll is visible
|
void |
setSmoothScrolling(boolean smoothScrolling)
Indicates that scrolling through the component should work as an animation
|
void |
setSourceCommand(Command sourceCommand)
Sets the source command that was used to navigate to this form.
|
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 |
setToolBar(Toolbar toolbar)
Deprecated.
use setToolbar instead (lower case b)
|
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 |
shouldPaintStatusBar()
This method returns the value of the theme constant
paintsTitleBarBool and it is
invoked internally in the code. |
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.
|
void |
stopEditing(Runnable onFinish)
Stops any active editing on the form.
|
add, add, add, add, add, add, addAll, applyRTL, calcPreferredSize, cancelRepaints, clearClientProperties, constrainHeightWhenScrollable, constrainWidthWhenScrollable, contains, createAnimateHierarchy, createAnimateHierarchyFade, createAnimateLayout, createAnimateLayoutFade, createAnimateLayoutFadeAndWait, createAnimateMotion, createAnimateUnlayout, createReplaceTransition, dragInitiated, drop, encloseIn, encloseIn, findDropTargetAt, findFirstFocusable, fireClicked, flushReplace, forceRevalidate, getBottomGap, getChildrenAsList, getClosestComponentTo, getComponentAt, getComponentAt, getComponentCount, getGridPosX, getGridPosY, getLayoutHeight, getLayoutWidth, getLeadComponent, getLeadParent, getResponderAt, getSafeAreaRoot, getScrollIncrement, invalidate, isEnabled, isSafeArea, isSafeAreaRoot, isSelectableInteraction, isSurface, iterator, iterator, layoutContainer, morph, morphAndWait, paintBorderBackground, paintComponentBackground, paintGlass, replace, replaceAndWait, replaceAndWait, revalidate, revalidateLater, revalidateWithAnimationSafety, setCellRenderer, setEnabled, setLeadComponent, setSafeArea, setSafeAreaRoot, setScrollIncrement, setShouldCalcPreferredSize, setShouldLayout, updateTabIndices
addDragFinishedListener, addDragOverListener, addDropListener, addFocusListener, addLongPressListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, addStateChangeListener, bindProperty, blocksSideSwipe, calcScrollSize, contains, containsOrOwns, createStyleAnimation, deinitialize, deinitializeCustomStyle, dragEnter, dragExit, dragFinished, draggingOver, drawDraggedImage, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getAllStyles, getBaseline, getBaselineResizeBehavior, getBindablePropertyNames, getBindablePropertyTypes, getBorder, getBoundPropertyValue, getBounds, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentState, getCursor, getDefaultDragTransparency, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragSpeed, getDragTransparency, getEditingDelegate, getHeight, getInlineAllStyles, getInlineDisabledStyles, getInlinePressedStyles, getInlineSelectedStyles, getInlineStylesTheme, getInlineUnselectedStyles, getInnerHeight, getInnerPreferredH, getInnerPreferredW, getInnerWidth, getInnerX, getInnerY, getLabelForComponent, getName, getNativeOverlay, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getOuterHeight, getOuterPreferredH, getOuterPreferredW, getOuterWidth, getOuterX, getOuterY, getOwner, getParent, getPreferredH, getPreferredSize, getPreferredSizeStr, getPreferredTabIndex, getPreferredW, getPressedStyle, getSameHeight, getSameWidth, getScrollable, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedRect, getSelectedStyle, getStyle, getTabIndex, getTensileLength, getTextSelectionSupport, getTooltip, getUIID, getUnselectedStyle, getVisibleBounds, getVisibleBounds, getWidth, getX, getY, growShrink, handlesInput, hasFixedPreferredSize, hasFocus, hideNativeOverlay, initComponent, initCustomStyle, initDisabledStyle, initPressedStyle, initSelectedStyle, initUnselectedStyle, installDefaultPainter, isBlockLead, isCellRenderer, isChildOf, isDragActivated, isDragAndDropOperation, isDraggable, isDropTarget, isEditable, isFlatten, isFocusable, isGrabsPointerEvents, isHidden, isHidden, isHideInLandscape, isHideInPortrait, isIgnorePointerEvents, isInClippingRegion, isInitialized, isOpaque, isOwnedBy, isPinchBlocksDragAndDrop, isRippleEffect, isRTL, isSetCursorSupported, isSnapToGrid, isStickyDrag, isTactileTouch, isTactileTouch, isTensileDragEnabled, isTraversable, isVisible, laidOut, onScrollX, onScrollY, paintBackgrounds, paintBorder, paintComponent, paintComponent, paintIntersectingComponentsAbove, paintLock, paintLockRelease, paintRippleOverlay, paintScrollbarX, paintScrollbarY, paintShadows, parsePreferredSize, pinch, pinch, pinchReleased, pointerPressed, pointerReleased, putClientProperty, refreshTheme, refreshTheme, remove, removeDragFinishedListener, removeDragOverListener, removeDropListener, removeFocusListener, removeLongPressListener, removePointerDraggedListener, removePointerPressedListener, removePointerReleasedListener, removeScrollListener, removeStateChangeListener, repaint, repaint, requestFocus, resetFocusable, respondsToPointerEvents, scrollRectToVisible, scrollRectToVisible, setBlockLead, setBoundPropertyValue, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setCursor, setDefaultDragTransparency, setDirtyRegion, setDisabledStyle, setDraggable, setDragTransparency, setDropTarget, setEditingDelegate, setFlatten, setFocus, setFocusable, setGrabsPointerEvents, setHandlesInput, setHeight, setHidden, setHidden, setHideInLandscape, setHideInPortrait, setIgnorePointerEvents, setInitialized, setInlineAllStyles, setInlineDisabledStyles, setInlinePressedStyles, setInlineSelectedStyles, setInlineStylesTheme, setInlineUnselectedStyles, setIsScrollVisible, setLabelForComponent, setName, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setOpaque, setOwner, setPinchBlocksDragAndDrop, setPreferredH, setPreferredSize, setPreferredSizeStr, setPreferredTabIndex, setPreferredW, setPressedStyle, setRippleEffect, setSameHeight, setSameSize, setSameWidth, setScrollOpacityChangeSpeed, setScrollSize, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setSize, setSnapToGrid, setTabIndex, setTactileTouch, setTensileDragEnabled, setTensileLength, setTooltip, setTraversable, setUIID, setUIID, setUnselectedStyle, setWidth, setX, setY, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, shouldRenderComponentSelection, showNativeOverlay, startEditingAsync, stripMarginAndPadding, styleChanged, toImage, toString, unbindProperty, updateNativeOverlay, visibleBoundsContains
protected boolean focusScrolling
public Form()
public Form(Layout contentPaneLayout)
contentPaneLayout
- the layout for the content panepublic Form(String title)
title
- the form titlepublic void setAllowEnableLayoutOnPaint(boolean allow)
Enabling "layoutOnPaint" behaviour. Setting this flag to true will cause this form and all of its containers to lay themselves out whenever they are painted. This carries a performance penalty.
Historical Note: "layoutOnPaint" behaviour has been "on" since the original commit to Google code in 2012, but it isn't clear, now, why it was necessary. It was likely to fix an edge case in certain layouts that is no longer relevant. As of 7.0, we are disabling this behaviour by default because it carries such performance penalties, but allowing developers to opt-in to it using this method.
allow
- Whether to allow layoutOnPaint behaviour in this this form and it's containers.Container.enableLayoutOnPaint
public void addPasteListener(ActionListener l)
The event will be fired after the paste action has updated the clipboard contents, so you can
access the clipboard contents via Display.getPasteDataFromClipboard()
.
l
- Listener registered to receive paste events.public void removePasteListener(ActionListener l)
l
- Listener to unregister to receive paste events.addPasteListener(com.codename1.ui.events.ActionListener)
public void dispatchPaste(ActionEvent l)
l
- The paste event. Includes no useful data currently.addPasteListener(com.codename1.ui.events.ActionListener)
,
removePasteListener(com.codename1.ui.events.ActionListener)
public TextSelection getTextSelection()
public boolean isEnableCursors()
setEnableCursors(boolean)
,
Component.setCursor(int)
public void setEnableCursors(boolean e)
e
- True to enable cursors. False to disable them.Component.setCursor(int)
public void setSourceCommand(Command sourceCommand)
sourceCommand
- The source command.public Command getSourceCommand()
public void setCurrentInputDevice(VirtualInputDevice device) throws Exception
AutoCloseable.close()
method of the current input device, and then set device as the new current input device.
Some examples of virtual input devices are the Picker widget and the virtual keyboard.
device
- Exception
public VirtualInputDevice getCurrentInputDevice()
setCurrentInputDevice(com.codename1.ui.VirtualInputDevice)
protected void initGlobalToolbar()
public void setOverrideInvisibleAreaUnderVKB(int invisibleAreaUnderVKB)
setFormBottomPaddingEditingMode(boolean)
.
Warning: This setting is generally for internal use only, and should only be used if you know what you are doing. After setting this value to a non-negative value, it will override the "real" area under the VKB if the read VKB is shown.
To reset this after the lightweight component is hidden, set the value to -1.
invisibleAreaUnderVKB
- The area hidden by the VKB in pixels.public int getInvisibleAreaUnderVKB()
setOverrideInvisibleAreaUnderVKB(int)
public AnimationManager getAnimationManager()
getAnimationManager
in class Component
public void setFormBottomPaddingEditingMode(boolean b)
b
- true to enable false to disablepublic boolean isFormBottomPaddingEditingMode()
public Rectangle getSafeArea()
This feature was primarily added to deal with the task bar on the iPhone X, which is displayed on the screen near the bottom edge, and can interfere with components that are laid out at the bottom of the screen.
Most platforms will simply return a Rectangle with bounds (0, 0, displayWidth, displayHeight). iPhone X will return a rectangle that excludes the notch, and task bar regions.
CodenameOneImplementation#getDisplaySafeArea(com.codename1.ui.geom.Rectangle)
,
Container.setSafeArea(boolean)
,
Container.isSafeArea()
protected boolean shouldPaintStatusBar()
paintsTitleBarBool
and it is
invoked internally in the code. You can override this method to toggle the appearance of the status
bar on a per-form basispaintsTitleBarBool
theme constantprotected Component createStatusBar()
public boolean isAlwaysTensile()
isAlwaysTensile
in class Component
public boolean grabAnimationLock()
public void releaseAnimationLock()
public Component findCurrentlyEditingComponent()
Component.isEditing()
public void setAlwaysTensile(boolean alwaysTensile)
setAlwaysTensile
in class Component
alwaysTensile
- the alwaysTensile to setpublic Container getTitleArea()
public UIManager getUIManager()
Container
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 setSafeAreaChanged()
getSafeArea()
public 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. This is useful for watermarks or special effects (such as tinting) it is also useful for generic drawing of validation errors etc... A glass pane is generally transparent or translucent and allows the the UI below to be seen.
The example shows a glasspane running on top of a field to show a validation hint,
notice that for real world usage you should probably look into Validator
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()
Allows a developer that doesn't derive from the form to draw on top of the form regardless of underlying changes or animations. This is useful for watermarks or special effects (such as tinting) it is also useful for generic drawing of validation errors etc... A glass pane is generally transparent or translucent and allows the the UI below to be seen.
The example shows a glasspane running on top of a field to show a validation hint,
notice that for real world usage you should probably look into Validator
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)
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 setBackCommand(String name, Image icon, ActionListener ev)
setBackCommand(com.codename1.ui.Command)
that
dynamically creates the command using Command.create(java.lang.String, com.codename1.ui.Image, com.codename1.ui.events.ActionListener)
.name
- the name/title of the commandicon
- the icon for the commandev
- the even handlerpublic Command getBackCommand()
public Container getContentPane()
public Container getLayeredPane()
public Container getLayeredPane(Class c, boolean top)
c
- the class with which this layered pane is associated, null for the global layered pane which
is always on the bottomtop
- if created this indicates whether the layered pane should be added on top or bottompublic Container getLayeredPane(Class c, int zIndex)
c
- the class with which this layered pane is associated, null for the global layered pane which
is always on the bottomzIndex
- if created this indicates the zIndex at which the pane is placed. Higher z values in front of lower z values.public Container getFormLayeredPane(Class c, boolean top)
c
- the class with which this layered pane is associated, null for the global layered pane which
is always on the bottomtop
- if created this indicates whether the layered pane should be added on top or bottomprotected Container getLayeredPaneIfExists()
getLayeredPane()
hasn't been called yet for the form, then the layered pane will be null.protected Container getFormLayeredPaneIfExists()
getFormLayeredPane(java.lang.Class, boolean)
hasn't been called yet for the form, then the layered pane will be null.public void removeAll()
public void setBgImage(Image bgImage)
bgImage
- the background imagepublic void setLayout(Layout layout)
public void stopEditing(Runnable onFinish)
stopEditing
in interface Editable
stopEditing
in class Component
onFinish
- Callback to run on finish.Component.startEditingAsync()
,
Component.isEditing()
,
Component.isEditable()
,
Component.getEditingDelegate()
,
Component.setEditingDelegate(com.codename1.ui.Editable)
public boolean isEditing()
Component
isEditing
in interface Editable
isEditing
in class Component
Component.startEditingAsync()
,
Component.stopEditing(java.lang.Runnable)
,
Component.isEditable()
,
Component.getEditingDelegate()
,
Component.setEditingDelegate(com.codename1.ui.Editable)
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)
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)
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)
public void replaceAndWait(Component current, Component next, Transition t)
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 void animateHierarchy(int duration)
animateHierarchy
in class Container
duration
- the duration in milliseconds for the animationpublic void animateHierarchyAndWait(int duration)
animateHierarchyAndWait
in class Container
duration
- the duration in milliseconds for the animationpublic void animateHierarchyFade(int duration, int startingOpacity)
animateHierarchyFade
in class Container
duration
- the duration in milliseconds for the animationstartingOpacity
- the initial opacity to give to the animated componentspublic void animateHierarchyFadeAndWait(int duration, int startingOpacity)
animateHierarchyFadeAndWait
in class Container
duration
- the duration in milliseconds for the animationstartingOpacity
- the initial opacity to give to the animated componentspublic void animateLayout(int duration)
Animates a pending layout into place, this effectively replaces revalidate with a more visual form of animation
See:
animateLayout
in class Container
duration
- the duration in milliseconds for the animationpublic void animateLayoutAndWait(int duration)
animateLayoutAndWait
in class Container
duration
- the duration in milliseconds for the animationpublic void animateLayoutFade(int duration, int startingOpacity)
animateLayoutFade
in class Container
duration
- the duration in milliseconds for the animationstartingOpacity
- the initial opacity to give to the animated componentspublic void animateLayoutFadeAndWait(int duration, int startingOpacity)
animateLayoutFadeAndWait
in class Container
duration
- the duration in milliseconds for the animationstartingOpacity
- the initial opacity to give to the animated componentspublic void animateUnlayout(int duration, int opacity, Runnable callback)
This method is the exact reverse of animateLayout, when completed it leaves the container in an invalid state. It is useful to invoke this in order to remove a component, transition to a different form or provide some other interaction. E.g.:
animateUnlayout
in class Container
duration
- the duration of the animationopacity
- the opacity to which the layout will reach, allows fading out the componentscallback
- if not null will be invoked when unlayouting is completepublic void animateUnlayoutAndWait(int duration, int opacity)
This method is the exact reverse of animateLayoutAndWait, when completed it leaves the container in an invalid state. It is useful to invoke this in order to remove a component, transition to a different form or provide some other interaction. E.g.:
animateUnlayoutAndWait
in class Container
duration
- the duration of the animationopacity
- the opacity to which the layout will reach, allows fading out the componentspublic 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()
Display
class.public int getSideGap()
getSideGap
in class Container
protected void paintScrollbars(Graphics g)
Component
paintScrollbars
in class Component
g
- the component graphicspublic void refreshTheme(boolean merge)
refreshTheme
in class Container
merge
- indicates if the current styles should be merged with the new stylespublic void paintBackground(Graphics g)
paintBackground
in class Container
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)
setSmoothScrolling
in class Component
smoothScrolling
- indicates if a component uses smooth scrollingpublic boolean isSmoothScrolling()
isSmoothScrolling
in class Component
public int getScrollAnimationSpeed()
getScrollAnimationSpeed
in class Component
public void setScrollAnimationSpeed(int animationSpeed)
setScrollAnimationSpeed
in class Component
animationSpeed
- scroll animation speed in millisecondsprotected void onShow()
protected void onShowCompleted()
public final Form getComponentForm()
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)
longKeyPress
in class Component
keyCode
- the key code value to indicate a physical key.public void longPointerPress(int x, int y)
longPointerPress
in class Component
protected boolean shouldSendPointerReleaseToOtherForm()
public Component getNextComponent(Component current)
Component.getNextFocusRight()
if it is set. If not, it will return Component.getNextFocusDown()
if it is set. If not, it will
return the next component according to the traversal order.current
- The current component.public Component getPreviousComponent(Component current)
Component.getNextFocusLeft()
if it is set. If not, it will return Component.getNextFocusUp()
if it is set. If not, it will
return the previous component according to the traversal order defined by getTabIterator(com.codename1.ui.Component)
.current
- The current component.public Form.TabIterator getTabIterator(Component start)
start
- The start position. The iterator will automatically initialized such that ListIterator.next()
will return the next component in the traversal order, and the ListIterator.previous()
returns the previous
component in traversal order.getNextComponent(com.codename1.ui.Component)
,
getPreviousComponent(com.codename1.ui.Component)
,
Component.getPreferredTabIndex()
,
Component.setPreferredTabIndex(int)
public void keyPressed(int keyCode)
keyPressed
in class Container
keyCode
- the key code value to indicate a physical key.public Layout getLayout()
getLayout
in class Container
For the actual layout of the form.
public boolean isMinimizeOnBack()
public void setMinimizeOnBack(boolean minimizeOnBack)
minimizeOnBack
- the minimizeOnBack to setpublic void keyReleased(int keyCode)
keyReleased
in class Container
keyCode
- the key code value to indicate a physical key.public void keyRepeated(int keyCode)
keyRepeated
in class Component
keyCode
- the key code value to indicate a physical key.protected boolean resumeDragAfterScrolling(int x, int y)
x
- the x position of a pointer press operationy
- the y position of a pointer press operationpublic void pointerPressed(int x, int y)
pointerPressed
in class Container
x
- the pointer x coordinatey
- the pointer y coordinatepublic <C extends Component> void addComponentAwaitingRelease(C c)
public <C extends Component> void removeComponentAwaitingRelease(C c)
public void clearComponentsAwaitingRelease()
public void pointerDragged(int x, int y)
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)
pointerHoverReleased
in class Component
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerHoverPressed(int[] x, int[] y)
pointerHoverPressed
in class Component
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerHover(int[] x, int[] y)
pointerHover
in class Component
x
- the pointer x coordinatey
- the pointer y coordinatepublic boolean isSingleFocusMode()
public void pointerReleased(int x, int y)
pointerReleased
in class Component
x
- the pointer x coordinatey
- the pointer y coordinatepublic void setScrollableY(boolean scrollableY)
setScrollableY
in class Container
scrollableY
- whether the component should/could scroll on the Y axispublic void setScrollableX(boolean scrollableX)
setScrollableX
in class Container
scrollableX
- whether the component should/could scroll on the X axispublic void setScrollVisible(boolean isScrollVisible)
setScrollVisible
in class Component
isScrollVisible
- Indicate whether this component scroll is visiblepublic boolean isScrollVisible()
isScrollVisible
in class Component
public int getComponentIndex(Component cmp)
getComponentIndex
in class Container
cmp
- the component to search forpublic void addCommand(Command cmd, int offset)
Toolbar.addCommandToLeftBar(com.codename1.ui.Command)
or similar methodscmd
- the Form command to be addedoffset
- position in which the command is addedpublic int getCommandCount()
Container.getComponentCount()
or similar methodspublic Command getCommand(int index)
index
- offset of the commandpublic void addCommand(Command cmd)
Toolbar.addCommandToLeftBar(com.codename1.ui.Command)
or similar methodscmd
- 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)
NOTE: This method does NOT make use of Component.getNextFocusDown()
or Component.getNextFocusUp()
.
It simply finds the next focusable component on the form based solely on absolute Y coordinate.
down
- if true will the return the next focusable on the bottom else
on the toppublic Component findNextFocusHorizontal(boolean right)
NOTE: This method does NOT make use of Component.getNextFocusLeft()
or Component.getNextFocusRight()
.
It simply finds the next focusable component on the form based solely on absolute X coordinate.
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)
public void paint(Graphics g)
public void setScrollable(boolean scrollable)
setScrollable
in class Container
scrollable
- whether the component should/could scroll on the
X and Y axispublic boolean isScrollable()
isScrollable
in class Component
public boolean isScrollableX()
isScrollableX
in class Container
public boolean isScrollableY()
isScrollableY
in class Container
public void setVisible(boolean visible)
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()
null
.paramString
in class Container
public MenuBar getMenuBar()
public void setMenuBar(MenuBar menuBar)
menuBar
- public void setToolBar(Toolbar toolbar)
toolbar
- 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()
getPropertyNames
in class Component
public Class[] getPropertyTypes()
getPropertyTypes
in class Component
public String[] getPropertyTypeNames()
getPropertyTypeNames
in class Component
public Object getPropertyValue(String name)
getPropertyValue
in class Component
name
- the name of the propertypublic String setPropertyValue(String name, Object value)
setPropertyValue
in class Component
name
- the name of the propertyvalue
- new value for the propertypublic TextArea getEditOnShow()
public void setEditOnShow(TextArea editOnShow)
editOnShow
- text component to edit when the form is shown