public class Component extends Object implements Animation, StyleListener, Editable
The component class is the basis of all UI widgets in Codename One, to arrange multiple components together we use the Container class which itself "IS A" Component subclass. The Container is a Component that contains Components effectively allowing us to nest Containers infinitely to build any type of visual hierarchy we want by nesting Containers.
Styles fire a change event for each style change that occurs. Component
listens to all changes events
of its styles, and adjusts some of its properties accordingly. Currently (as of 6.0) each style change will trigger
a Container.revalidate()
call on the Style's Component's parent container, which is expensive. You can disable this
Container.revalidate()
call by calling CN.setProperty("Component.revalidateOnStyleChange", "false")
. This will
likely be the default behavior in a future version, so we recommend you disable this explicitly for both performance reasons, and
to avoid regressions when the default is changed.
Container
Modifier and Type | Field and Description |
---|---|
static int |
BASELINE
Alignment to the baseline constraint
|
static int |
BOTTOM
Box-orientation constant used to specify the bottom of a box.
|
static int |
BRB_CENTER_OFFSET
Baseline resize behavior constant used to properly align components.
|
static int |
BRB_CONSTANT_ASCENT
Baseline resize behavior constant used to properly align components.
|
static int |
BRB_CONSTANT_DESCENT
Baseline resize behavior constant used to properly align components.
|
static int |
BRB_OTHER
Baseline resize behavior constant used to properly align components.
|
static int |
CENTER
Indicates a Component center alignment
|
static int |
CROSSHAIR_CURSOR
The crosshair cursor type.
|
static int |
DEFAULT_CURSOR
The default cursor
|
static int |
DRAG_REGION_IMMEDIATELY_DRAG_X
Used by getDragRegionStatus to indicate immediate dragability
|
static int |
DRAG_REGION_IMMEDIATELY_DRAG_XY
Used by getDragRegionStatus to indicate immediate dragability
|
static int |
DRAG_REGION_IMMEDIATELY_DRAG_Y
Used by getDragRegionStatus to indicate immediate dragability
|
static int |
DRAG_REGION_LIKELY_DRAG_X
Used by getDragRegionStatus to indicate likely dragability
|
static int |
DRAG_REGION_LIKELY_DRAG_XY
Used by getDragRegionStatus to indicate likely dragability
|
static int |
DRAG_REGION_LIKELY_DRAG_Y
Used by getDragRegionStatus to indicate likely dragability
|
static int |
DRAG_REGION_NOT_DRAGGABLE
Used by getDragRegionStatus to indicate no dragability
|
static int |
DRAG_REGION_POSSIBLE_DRAG_X
Used by getDragRegionStatus to indicate limited dragability
|
static int |
DRAG_REGION_POSSIBLE_DRAG_XY
Used by getDragRegionStatus to indicate limited dragability
|
static int |
DRAG_REGION_POSSIBLE_DRAG_Y
Used by getDragRegionStatus to indicate limited dragability
|
static int |
E_RESIZE_CURSOR
The east-resize cursor type.
|
static int |
HAND_CURSOR
The hand cursor type.
|
static int |
LEFT
Box-orientation constant used to specify the left side of a box.
|
static int |
MOVE_CURSOR
The move cursor type.
|
static int |
N_RESIZE_CURSOR
The north-resize cursor type.
|
static int |
NE_RESIZE_CURSOR
The north-east-resize cursor type.
|
static int |
NW_RESIZE_CURSOR
The north-west-resize cursor type.
|
static int |
RIGHT
Box-orientation constant used to specify the right side of a box.
|
static int |
S_RESIZE_CURSOR
The south-resize cursor type.
|
static int |
SE_RESIZE_CURSOR
The south-east-resize cursor type.
|
static int |
SW_RESIZE_CURSOR
The south-west-resize cursor type.
|
static int |
TEXT_CURSOR
The text cursor type.
|
static int |
TOP
Box-orientation constant used to specify the top of a box.
|
static int |
W_RESIZE_CURSOR
The west-resize cursor type.
|
static int |
WAIT_CURSOR
The wait cursor type.
|
Modifier | Constructor and Description |
---|---|
protected |
Component()
Creates a new instance of Component
|
Modifier and Type | Method and Description |
---|---|
void |
addDragFinishedListener(ActionListener l)
Adds a listener to the dragFinished event
|
void |
addDragOverListener(ActionListener l)
Broadcasts an event when dragging over a component
|
void |
addDropListener(ActionListener l)
Binds an action listener to drop events which are invoked when this component is dropped on a target
|
void |
addFocusListener(FocusListener l)
Registers interest in receiving callbacks for focus gained events, a focus event
is invoked when the component accepts the focus.
|
void |
addLongPressListener(ActionListener l)
Adds a listener to the pointer event
|
void |
addPointerDraggedListener(ActionListener l)
Adds a listener to the pointer event
|
void |
addPointerPressedListener(ActionListener l)
Adds a listener to the pointer event
|
void |
addPointerReleasedListener(ActionListener l)
Adds a listener to the pointer event
|
void |
addPullToRefresh(Runnable task)
This method adds a refresh task to the Component, the task will be
executed if the user has pulled the scroll beyond a certain height.
|
void |
addScrollListener(ScrollListener l)
Registers interest in receiving callbacks for scroll gained events,
a scroll event is invoked when the component is scrolled.
|
void |
addStateChangeListener(ActionListener<ComponentStateChangeEvent> l)
Adds a listener to be notified when the state of this component is changed
to and from initialized.
|
boolean |
animate()
Allows the animation to reduce "repaint" calls when it returns false.
|
void |
bindProperty(String prop,
BindTarget target)
Deprecated.
this mapped to an older iteration of properties that is no longer used
|
boolean |
blocksSideSwipe()
A component that might need side swipe such as the slider
could block it from being used for some other purpose when
on top of said component.
|
protected Dimension |
calcPreferredSize()
Calculates the preferred size based on component content.
|
protected Dimension |
calcScrollSize()
Method that can be overriden to represent the actual size of the component
when it differs from the desireable size for the viewport
|
protected void |
cancelRepaints()
remove this component from the painting queue
|
void |
clearClientProperties()
Clears all client properties from this Component
|
boolean |
contains(int x,
int y)
Returns true if the given absolute coordinate is contained in the Component
|
boolean |
containsOrOwns(int x,
int y)
Checks to see if this component either contains the given point, or
if it owns the component that contains the given point.
|
ComponentAnimation |
createStyleAnimation(String destUIID,
int duration)
Creates an animation that will transform the current component to the styling of the destination UIID when
completed.
|
protected void |
deinitialize()
Invoked to indicate that the component initialization is being reversed
since the component was detached from the container hierarchy.
|
protected void |
deinitializeCustomStyle(Style s)
Allows components to create a style of their own, this method cleans up
state for the given style
|
protected void |
dragEnter(Component dragged)
This callback method indicates that a component drag has just entered this component
|
protected void |
dragExit(Component dragged)
This callback method provides an indication for a drop target that a drag operation is exiting the bounds of
this component and it should clear all relevant state if such state exists.
|
protected void |
dragFinished(int x,
int y)
Callback indicating that the drag has finished either via drop or by releasing the component
|
protected boolean |
draggingOver(Component dragged,
int x,
int y)
This method allows a component to indicate if it is a drop target for the given component at the given x/y location
(in component coordiate space).
|
protected void |
dragInitiated()
Invoked on the focus component to let it know that drag has started on the parent container
for the case of a component that doesn't support scrolling
|
protected void |
drawDraggedImage(Graphics g,
Image img,
int x,
int y)
Draws the given image at x/y, this method can be overriden to draw additional information such as positive
or negative drop indication
|
void |
drop(Component dragged,
int x,
int y)
Performs a drop operation of the component at the given X/Y location in coordinate space, this method
should be overriden by subclasses to perform all of the logic related to moving a component, by default
this method does nothing and so dragging a component and dropping it has no effect
|
protected void |
fireClicked()
When working in 3 softbutton mode "fire" key (center softbutton) is sent to this method
in order to allow 3 button devices to work properly.
|
protected void |
focusGained()
Callback allowing a developer to track wheh the component gains focus
|
protected void |
focusLost()
Callback allowing a developer to track wheh the component loses focus
|
int |
getAbsoluteX()
Returns the absolute X location based on the component hierarchy, this method
calculates a location on the screen for the component rather than a relative
location as returned by getX()
|
int |
getAbsoluteY()
Returns the absolute Y location based on the component hierarchy, this method
calculates a location on the screen for the component rather than a relative
location as returned by getX()
|
Style |
getAllStyles()
Returns a "meta style" that allows setting styles once to all the different Style objects, the getters for this
style will be meaningless and will return 0 values.
|
AnimationManager |
getAnimationManager()
Returns the animation manager of the parent form or null if this component isn't currently associated with a form
|
int |
getBaseline(int width,
int height)
The baseline for the component text according to which it should be aligned
with other components for best visual look.
|
int |
getBaselineResizeBehavior()
Returns a constant indicating how the baseline varies with the size
of the component.
|
String[] |
getBindablePropertyNames()
Deprecated.
this mapped to an older iteration of properties that is no longer used
|
Class[] |
getBindablePropertyTypes()
Deprecated.
this mapped to an older iteration of properties that is no longer used
|
protected Border |
getBorder()
Normally returns getStyle().getBorder() but some subclasses might use this
to programmatically replace the border in runtime e.g.
|
int |
getBottomGap()
Returns the gap to be left for the bottom scrollbar on the X axis.
|
Object |
getBoundPropertyValue(String prop)
Deprecated.
this mapped to an older iteration of properties that is no longer used
|
protected Rectangle |
getBounds()
Returns the component bounds which is sometimes more convenient than invoking
getX/Y/Width/Height.
|
Rectangle |
getBounds(Rectangle rect)
Returns the bounds of this component in the provided Rectangle.
|
Object |
getClientProperty(String key)
Client properties allow the association of meta-data with a component, this
is useful for some applications that construct GUI's on the fly and need
to track the connection between the UI and the data.
|
String |
getCloudBoundProperty()
Deprecated.
this mapped to an older iteration of properties that is no longer used
|
String |
getCloudDestinationProperty()
Deprecated.
this mapped to an older iteration of properties that is no longer used
|
Form |
getComponentForm()
Returns the Component Form or null if this Component
is not added yet to a form
|
Object |
getComponentState()
Some components may optionally generate a state which can then be restored
using setCompnentState().
|
int |
getCursor()
Gets the custom cursor for this component.
|
static byte |
getDefaultDragTransparency()
Returns the default translucency used in the
getDragImage() method. |
Rectangle |
getDirtyRegion()
gets the Component dirty region, this method is for internal use only and SHOULD NOT be invoked by user code.
|
Style |
getDisabledStyle()
Returns the Component Style for the disabled state allowing us to manipulate
the look of the component when its disabled
|
int |
getDraggedx()
Gets the current dragged x values when the Component is being dragged
|
int |
getDraggedy()
Gets the current dragged y values when the Component is being dragged
|
protected Image |
getDragImage()
This method returns an image representing the dragged component, it can be overriden by subclasses to customize the look
of the image, the image will be overlaid on top of the form during a drag and drop operation
|
protected 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.
|
protected float |
getDragSpeed(boolean vertical)
This method returns the dragging speed based on the latest dragged
events
|
byte |
getDragTransparency()
Returns the translucency used in the
getDragImage() method. |
Editable |
getEditingDelegate()
Gets the delegate that handles the editing of this component.
|
protected int |
getGridPosX()
This method should be implemented correctly by subclasses to make snap to grid functionality work
as expected.
|
protected int |
getGridPosY()
This method should be implemented correctly by subclasses to make snap to grid functionality work
as expected.
|
int |
getHeight()
Returns the component height
|
String |
getInlineAllStyles()
Gets inline styles that are to be applied to all states of this component.
|
String |
getInlineDisabledStyles()
Gets inline styles that are to be applied to the disabled state of this component.
|
String |
getInlinePressedStyles()
Gets inline styles that are to be applied to the pressed state of this component.
|
String |
getInlineSelectedStyles()
Gets inline styles that are to be applied to the selected state of this component.
|
Resources |
getInlineStylesTheme()
Gets the theme that is used by inline styles to reference images.
|
String |
getInlineUnselectedStyles()
Gets inline styles that are to be applied to the unselected state of this component.
|
int |
getInnerHeight()
Gets the inner height of this component.
|
int |
getInnerPreferredH()
Gets the preferred height removing vertical padding.
|
int |
getInnerPreferredW()
Gets the preferred width removing horizontal padding.
|
int |
getInnerWidth()
Gets the inner width of this component.
|
int |
getInnerX()
Gets x-coordinate of the inner bounds of this component.
|
int |
getInnerY()
Gets the inner y-coordinate of the inner bounds of this component.
|
Label |
getLabelForComponent()
Allows us to indicate the label associated with this component thus providing
visual feedback related for this component e.g.
|
String |
getName()
A component name allows us to easily identify the component within a dynamic
UI.
|
Object |
getNativeOverlay()
Gets the native overlay for this component.
|
Component |
getNextFocusDown()
Allows us to determine which component will receive focus next when traversing
with the down key
|
Component |
getNextFocusLeft()
Allows us to determine which component will receive focus next when traversing
with the left key.
|
Component |
getNextFocusRight()
Allows us to determine which component will receive focus next when traversing
with the right key
|
Component |
getNextFocusUp()
Allows us to determine which component will receive focus next when traversing
with the up key.
|
int |
getOuterHeight()
Gets the outer height of this component.
|
int |
getOuterPreferredH()
Gets the preferred height including the vertical margins.
|
int |
getOuterPreferredW()
Gets the preferred width including horizontal margins.
|
int |
getOuterWidth()
Gets the outer width of this component.
|
int |
getOuterX()
Gets the x-coordinate of the outer bounds of this component.
|
int |
getOuterY()
Gets the Y-coordinate of the outer bounds of this component.
|
Component |
getOwner()
Gets the "owner" of this component as set by
setOwner(com.codename1.ui.Component) . |
Container |
getParent()
Returns the container in which this component is contained
|
int |
getPreferredH()
Helper method to retrieve the preferred height of the component.
|
Dimension |
getPreferredSize()
Returns the Component Preferred Size, there is no guarantee the Component will
be sized at its Preferred Size.
|
String |
getPreferredSizeStr()
Deprecated.
This method is primarily for use by the GUI builder. Use
getPreferredSize() to find
the preferred size of a component. |
int |
getPreferredTabIndex()
Gets the preferred tab index of this component.
|
int |
getPreferredW()
Helper method to retrieve the preferred width of the component.
|
Style |
getPressedStyle()
Returns the Component Style for the pressed state allowing us to manipulate
the look of the component when it is pressed
|
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
|
Component[] |
getSameHeight()
Returns the array of components that have an equal height
|
Component[] |
getSameWidth()
Returns the array of components that have an equal width
|
Component |
getScrollable()
Returns the scrollable parent of this component
|
int |
getScrollAnimationSpeed()
Scroll animation speed in milliseconds allowing a developer to slow down or accelerate
the smooth animation mode
|
Dimension |
getScrollDimension()
Returns the Components dimension in scrolling, this is very similar to the
preferred size aspect only it represents actual scrolling limits.
|
int |
getScrollOpacity()
This method is used internally by the look and feel to implement the fading scrollbar
behavior.
|
int |
getScrollOpacityChangeSpeed()
Indicates the decrement units for the scroll opacity
|
int |
getScrollX()
Indicates the X position of the scrolling, this number is relative to the
component position and so a position of 0 would indicate the x position
of the component.
|
int |
getScrollY()
Indicates the Y position of the scrolling, this number is relative to the
component position and so a position of 0 would indicate the y position
of the component.
|
String |
getSelectCommandText()
Allows determining the text for the select command used in the 3rd softbutton
mode.
|
Rectangle |
getSelectedRect()
Returns the component bounds with absolute screen coordinates, for components that include an internal selection behavior
and are not containers (currently only List) this method allows returning the position of the selection
itself which is useful for things such as the popup dialog and similar UI's that need to reference the
position of the selection externally
|
Style |
getSelectedStyle()
Returns the Component Style for the selected state allowing us to manipulate
the look of the component when it owns focus
|
int |
getSideGap()
Returns the gap to be left for the side scrollbar on the Y axis.
|
Style |
getStyle()
Returns the current Component Style allowing code to draw the current component, you
should normally use getUnselected/Pressed/DisabledStyle() and not this method since
it will return different values based on component state.
|
int |
getTabIndex()
Deprecated.
This method is used internally when querying the traversal order of the form. Use
getPreferredTabIndex() to get the preferred tab index. |
int |
getTensileLength()
Recommended length for the tensile, -1 for default
|
TextSelection.TextSelectionSupport |
getTextSelectionSupport()
Returns text selection support object for this component.
|
String |
getTooltip() |
String |
getUIID()
Unique identifier for a component.
|
UIManager |
getUIManager()
This method should be used by the Component to retrieve the correct UIManager to work with
|
Style |
getUnselectedStyle()
Returns the Component Style for the unselected mode allowing us to manipulate
the look of the component
|
protected Rectangle |
getVisibleBounds()
Returns the component bounds for scrolling which might differ from the getBounds for large components
e.g.
|
Rectangle |
getVisibleBounds(Rectangle rect)
Returns the component bounds for scrolling which might differ from the getBounds for large components
into the provided rectangle.
|
int |
getWidth()
Returns the component width
|
int |
getX()
Returns the current component x location relatively to its parent container
|
int |
getY()
Returns the component y location relatively to its parent container
|
void |
growShrink(int duration)
Grows or shrinks this component to its new preferred size, this method
essentially takes a component whose preferred size has changed and creates a "growing"
effect that lasts for the duration.
|
boolean |
handlesInput()
Prevents key events from being grabbed for focus traversal.
|
boolean |
hasFixedPreferredSize()
Checks if this component has a fixed preferred size either via an explicit call to
setPreferredH(int) and setPreferredW(int) , or via a preferred
size style string. |
boolean |
hasFocus()
Returns true if the component has focus
|
protected void |
hideNativeOverlay()
Hides the native overlay for this component.
|
protected void |
initComponent()
Allows subclasses to bind functionality that relies on fully initialized and
"ready for action" component state
|
protected void |
initCustomStyle(Style s)
Allows components to create a style of their own, this method binds the listener
to the style and installs a bg painter
|
protected void |
initDisabledStyle(Style disabledStyle)
Can be overridden by subclasses to perform initialization when the disabled style is set to a new value.
|
protected void |
initLaf(UIManager uim)
This method initializes the Component defaults constants
|
protected void |
initPressedStyle(Style pressedStyle)
Can be overridden by subclasses to perform initialization when the pressed style is set to a new value.
|
protected void |
initSelectedStyle(Style selectedStyle)
Can be overridden by subclasses to perform initialization when the selected style is set to a new value.
|
protected void |
initUnselectedStyle(Style unselectedStyle)
Can be overridden by subclasses to perform initialization when the unselected style is set to a new value.
|
protected void |
installDefaultPainter(Style s)
Allows subclasses to create their own custom style types and install the background painter into them
|
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 |
isBlockLead()
Prevent a lead component hierarchy from this specific component, this allows a component within that
hierarchy to still act as a standalone component
|
boolean |
isCellRenderer()
Used as an optimization to mark that this component is currently being
used as a cell renderer
|
boolean |
isChildOf(Container cnt)
Searches the hierarchy of the component recursively to see if the given
Container is one of the parents of this component
|
protected boolean |
isDragActivated()
Indicates whether we are in the middle of a drag operation, this method allows
developers overriding the pointer released events to know when this is a drag
operation.
|
protected boolean |
isDragAndDropOperation(int x,
int y)
This method allows a developer to define only a specific portion of a component as draggable
by default it returns true if the component is defined as "draggable"
|
boolean |
isDraggable()
Indicates whether this component can be dragged in a drag and drop operation rather than scroll the parent
|
protected boolean |
isDragRegion(int x,
int y)
Deprecated.
replaced with getDragRegionStatus
|
boolean |
isDropTarget()
Indicates whether this component can receive dropped components into it, notice that when dropping on a component
or container the parents will be checked recursively to find a valid drop target
|
boolean |
isEditable()
Checks to see if the component is editable.
|
boolean |
isEditing()
Checks if the component is currently being edited.
|
boolean |
isEnabled()
Indicates whether component is enabled or disabled thus allowing us to prevent
a component from receiving input events and indicate so visually
|
boolean |
isFlatten()
Makes the component effectively opaque by blending the backgrounds into an image in memory so the layer of underlying components
is only drawn once when this component is repainted.
|
boolean |
isFocusable()
Returns true if this component can receive focus and is enabled
|
boolean |
isGrabsPointerEvents()
This property is useful for blocking in z-order touch events, sometimes we might want to grab touch events in
a specific component without making it focusable.
|
boolean |
isHidden()
Returns true if the component was explicitly hidden by the user.
|
boolean |
isHidden(boolean checkParent)
Checks if the component is hidden.
|
boolean |
isHideInLandscape()
Indicates that this component and all its children should be hidden when the device is switched to landscape mode
|
boolean |
isHideInPortrait()
Indicates that this component and all its children should be hidden when the device is switched to portrait mode
|
boolean |
isIgnorePointerEvents() |
protected boolean |
isInClippingRegion(Graphics g) |
protected boolean |
isInitialized()
Indicates if the component is in the initialized state, a component is initialized
when its initComponent() method was invoked.
|
boolean |
isOpaque()
Checks whether the component's background should be painted.
|
boolean |
isOwnedBy(Component cmp)
Checks to see if this component is owned by the given other component.
|
boolean |
isPinchBlocksDragAndDrop()
returns true if pinch will block drag and drop
|
boolean |
isRippleEffect()
Indicates whether the component displays the material design ripple effect
|
boolean |
isRTL()
Is the component a bidi RTL component
|
protected 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
|
protected boolean |
isSelectableInteraction()
This method allows a component to indicate that it is interested in an "implicit" select
command to appear in the "fire" button when 3 softbuttons are defined in a device.
|
static boolean |
isSetCursorSupported()
Checks to see if this platform supports cursors.
|
boolean |
isSmoothScrolling()
Indicates that scrolling through the component should work as an animation
|
boolean |
isSnapToGrid()
Indicates whether scrolling this component should jump to a specific location
in a grid
|
protected boolean |
isStickyDrag()
Returns true if the component is interested in receiving drag/pointer release events even
after the gesture exceeded its boundaries.
|
boolean |
isTactileTouch()
Indicates whether the component should "trigger" tactile touch when pressed by the user
in a touch screen UI.
|
protected boolean |
isTactileTouch(int x,
int y)
Elaborate components might not provide tactile feedback for all their areas (e.g.
|
boolean |
isTensileDragEnabled()
Indicates whether tensile drag (dragging beyond the boundry of the component and
snapping back) is enabled for this component.
|
boolean |
isTraversable()
Checks if this component should be traversable using the keyboard using tab, next, previous keys.
|
boolean |
isVisible()
Returns whether the component is visible or not
|
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 |
laidOut()
This is a callback method to inform the Component when it's been laidout
on the parent Container
|
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 |
onScrollX(int scrollX)
This method can be overriden to receive scroll events, unlike overriding setScrollX
it will receive all calls for scrolling.
|
protected void |
onScrollY(int scrollY)
This method can be overriden to receive scroll events, unlike overriding setScrollY
it will receive all calls for scrolling.
|
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.
|
protected void |
paintBackground(Graphics g)
This method paints the Component background, it should be overriden
by subclasses to perform custom background drawing.
|
void |
paintBackgrounds(Graphics g)
This method paints all the parents Components Background.
|
protected void |
paintBorder(Graphics g)
Draws the component border if such a border exists.
|
protected void |
paintBorderBackground(Graphics g)
Draws the component border background if such a border exists.
|
void |
paintComponent(Graphics g)
Paints this component as a root by going to all the parent components and
setting the absolute translation based on coordinates and scroll status.
|
void |
paintComponent(Graphics g,
boolean background)
Paints this component as a root by going to all the parent components and
setting the absolute translation based on coordinates and scroll status.
|
void |
paintIntersectingComponentsAbove(Graphics g)
Deprecated.
For internal use only
|
Image |
paintLock(boolean hardLock)
This method locks the component so it will always paint the given image
instead of running through its paint logic.
|
void |
paintLockRelease()
Releases the paint lock image to allow paint to work as usual, see paintLock(boolean)
for details
|
void |
paintRippleOverlay(Graphics g,
int x,
int y,
int position)
Invoked to draw the ripple effect overlay in Android where the finger of the user causes a growing
circular overlay over time.
|
protected void |
paintScrollbars(Graphics g)
Paints the UI for the scrollbars on the component, this will be invoked only
for scrollable components.
|
protected void |
paintScrollbarX(Graphics g)
Paints the UI for the scrollbar on the X axis, this method allows component
subclasses to customize the look of a scrollbar
|
protected void |
paintScrollbarY(Graphics g)
Paints the UI for the scrollbar on the Y axis, this method allows component
subclasses to customize the look of a scrollbar
|
void |
paintShadows(Graphics g,
int relativeX,
int relativeY)
Paints the drop-shadow projections for this component based on its elevation value.
|
protected String |
paramString()
Returns a string representing the state of this component.
|
static Dimension |
parsePreferredSize(String preferredSize,
Dimension baseSize)
Parses the preferred size given as a string
|
protected boolean |
pinch(float scale)
Invoked by subclasses interested in handling pinch to zoom events, if true is returned
other drag events will not be broadcast
|
protected boolean |
pinch(int[] x,
int[] y)
Invoked by subclasses interested in handling pinch to do their own actions based on the position of the two fingers, if true is returned
other drag events will not be broadcast
|
protected void |
pinchReleased(int x,
int y)
To be implemented by subclasses interested in being notified when a pinch zoom has
ended (i.e the user has removed one of their fingers, but is still dragging).
|
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 |
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 |
pointerReleased(int x,
int y)
If this Component is focused, the pointer released event
will call this method
|
void |
putClientProperty(String key,
Object value)
Client properties allow the association of meta-data with a component, this
is useful for some applications that construct GUI's on the fly and need
to track the connection between the UI and the data.
|
void |
refreshTheme()
Makes sure the component is up to date with the current theme, ONLY INVOKE THIS METHOD IF YOU CHANGED THE THEME!
|
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!
|
protected void |
refreshTheme(String id,
boolean merge)
Makes sure the component is up to date with the given UIID
|
void |
remove()
This method will remove the Component from its parent.
|
void |
removeDragFinishedListener(ActionListener l)
Removes the listener from the drag finished event
|
void |
removeDragOverListener(ActionListener l)
Removes an action listener to drag over events
|
void |
removeDropListener(ActionListener l)
Removes an action listener to drop events which are invoked when this component is dropped on a target
|
void |
removeFocusListener(FocusListener l)
Deregisters interest in receiving callbacks for focus gained events
|
void |
removeLongPressListener(ActionListener l)
Removes the listener from the pointer event
|
void |
removePointerDraggedListener(ActionListener l)
Removes the listener from the pointer event
|
void |
removePointerPressedListener(ActionListener l)
Removes the listener from the pointer event
|
void |
removePointerReleasedListener(ActionListener l)
Removes the listener from the pointer event
|
void |
removeScrollListener(ScrollListener l)
Deregisters interest in receiving callbacks for scroll gained events
|
void |
removeStateChangeListener(ActionListener<ComponentStateChangeEvent> l)
Removes a listener from being notified when the state of this component is
changed to and from initialized.
|
void |
repaint()
Repaint this Component, the repaint call causes a callback of the paint
method on the event dispatch thread.
|
void |
repaint(int x,
int y,
int w,
int h)
Repaints a specific region within the component
|
void |
requestFocus()
Changes the current component to the focused component, will work only
for a component that belongs to a parent form.
|
protected void |
resetFocusable()
Restores the state of the focusable flag to its default state
|
boolean |
respondsToPointerEvents()
Checks if the component responds to pointer events.
|
void |
scrollRectToVisible(int x,
int y,
int width,
int height,
Component coordinateSpace)
Makes sure the component is visible in the scroll if this container
is scrollable
|
protected void |
scrollRectToVisible(Rectangle rect,
Component coordinateSpace)
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 |
setBlockLead(boolean blockLead)
Prevent a lead component hierarchy from this specific component, this allows a component within that
hierarchy to still act as a standalone component
|
void |
setBoundPropertyValue(String prop,
Object value)
Deprecated.
this mapped to an older iteration of properties that is no longer used
|
void |
setCellRenderer(boolean cellRenderer)
Used as an optimization to mark that this component is currently being
used as a cell renderer
|
void |
setCloudBoundProperty(String cloudBoundProperty)
Deprecated.
this mapped to an older iteration of properties that is no longer used
|
void |
setCloudDestinationProperty(String cloudDestinationProperty)
Deprecated.
this mapped to an older iteration of properties that is no longer used
|
void |
setComponentState(Object state)
If getComponentState returned a value the setter can update the value and restore
the prior state.
|
void |
setCursor(int cursor)
Sets a custom mouse cursor for this component if the platform supports mouse cursors, notice that this isn't applicable for touch devices.
|
static void |
setDefaultDragTransparency(byte defaultDragTransparency)
Sets the default translucency of the
getDragImage() method. |
void |
setDirtyRegion(Rectangle dirty)
sets the Component dirty region, this method is for internal use only and SHOULD NOT be invoked by user code.
|
void |
setDisabledStyle(Style style)
Changes the Component disalbed Style by replacing the Component Style with the given Style
|
void |
setDraggable(boolean draggable)
Indicates whether this component can be dragged in a drag and drop operation rather than scroll the parent
|
void |
setDragTransparency(byte dragTransparency)
Sets the translucency of the
getDragImage() method. |
void |
setDropTarget(boolean dropTarget)
Indicates whether this component can receive dropped components into it, notice that when dropping on a component
or container the parents will be checked recursively to find a valid drop target
|
void |
setEditingDelegate(Editable editable)
Sets the editing delegate for this component.
|
void |
setEnabled(boolean enabled)
Indicates whether component is enabled or disabled thus allowing us to prevent
a component from receiving input events and indicate so visually
|
void |
setFlatten(boolean flatten)
Makes the component effectively opaque by blending the backgrounds into an image in memory so the layer of underlying components
is only drawn once when this component is repainted.
|
void |
setFocus(boolean focused)
Deprecated.
this method shouldn't be invoked by user code, use requestFocus() instead
|
void |
setFocusable(boolean focusable)
A simple setter to determine if this Component can get focused
|
void |
setGrabsPointerEvents(boolean grabsPointerEvents)
This property is useful for blocking in z-order touch events, sometimes we might want to grab touch events in
a specific component without making it focusable.
|
void |
setHandlesInput(boolean handlesInput)
Prevents key events from being grabbed for focus traversal.
|
void |
setHeight(int height)
Sets the Component height, this method is exposed for the purpose of
external layout managers and should not be invoked directly.
If a user wishes to affect the component size, setPreferredSize should be used. |
void |
setHidden(boolean b)
Makes the components preferred size equal 0 when hidden and restores it to the default size when not.
|
void |
setHidden(boolean b,
boolean changeMargin)
Makes the components preferred size equal 0 when hidden and restores it to the default size when not.
|
void |
setHideInLandscape(boolean hideInLandscape)
Indicates that this component and all its children should be hidden when the device is switched to landscape mode
|
void |
setHideInPortrait(boolean hideInPortrait)
Indicates that this component and all its children should be hidden when the device is switched to portrait mode
|
void |
setIgnorePointerEvents(boolean ignorePointerEvents) |
protected void |
setInitialized(boolean initialized)
Indicates if the component is in the initialized state, a component is initialized
when its initComponent() method was invoked.
|
void |
setInlineAllStyles(String styles)
Registers inline styles that should be applied to all states of the component.
|
void |
setInlineDisabledStyles(String styles)
Registers inline styles that should be applied to the disabled state of the component.
|
void |
setInlinePressedStyles(String styles)
Registers inline styles that should be applied to the pressed state of the component.
|
void |
setInlineSelectedStyles(String styles)
Registers inline styles that should be applied to the selected state of the component.
|
void |
setInlineStylesTheme(Resources inlineStylesTheme)
Sets the theme that is used by inline styles to reference images.
|
void |
setInlineUnselectedStyles(String styles)
Registers inline styles that should be applied to the unselected state of the component.
|
void |
setIsScrollVisible(boolean isScrollVisible)
Deprecated.
replaced by setScrollVisible to match the JavaBeans spec
|
void |
setLabelForComponent(Label componentLabel)
Allows us to indicate the label associated with this component thus providing
visual feedback related for this component e.g.
|
void |
setName(String name)
A component name allows us to easily identify the component within a dynamic
UI.
|
void |
setNextFocusDown(Component nextFocusDown)
Allows us to determine which component will receive focus next when traversing
with the down key
|
void |
setNextFocusLeft(Component nextFocusLeft)
Allows us to determine which component will receive focus next when traversing
with the left key, this method doesn't affect the general focus behavior.
|
void |
setNextFocusRight(Component nextFocusRight)
Allows us to determine which component will receive focus next when traversing
with the right key
|
void |
setNextFocusUp(Component nextFocusUp)
Allows us to determine which component will receive focus next when traversing
with the up key, this method doesn't affect the general focus behavior.
|
void |
setOpaque(boolean opaque)
Sets whether or not to paint the component background.
|
void |
setOwner(Component owner)
Sets the owner of this component to the specified component.
|
void |
setPinchBlocksDragAndDrop(boolean block)
If a component supports pinch as well as drag and drop the two may conflict (if one finger is placed a bit before the other, the drag
timer will be initiated and may trigger drag even if the second finger has been placed before).
|
void |
setPreferredH(int preferredH)
Deprecated.
this method shouldn't be used, use sameWidth/Height, padding, margin or override calcPeferredSize
to reach similar functionality
|
void |
setPreferredSize(Dimension d)
Deprecated.
this method shouldn't be used, use sameWidth/Height, padding, margin or override calcPeferredSize
to reach similar functionality
|
void |
setPreferredSizeStr(String value)
Deprecated.
this method shouldn't be used, use sameWidth/Height, padding, margin or override calcPeferredSize
to reach similar functionality
|
void |
setPreferredTabIndex(int index)
Sets the preferred tab index of the component.
|
void |
setPreferredW(int preferredW)
Deprecated.
this method shouldn't be used, use sameWidth/Height, padding, margin or override calcPeferredSize
to reach similar functionality
|
void |
setPressedStyle(Style style)
Sets the Component Style for the pressed state allowing us to manipulate
the look of the component when it is pressed
|
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 |
setRippleEffect(boolean rippleEffect)
Indicates whether the component displays the material design ripple effect
|
void |
setRTL(boolean rtl)
Is the component a bidi RTL component
|
static void |
setSameHeight(Component... c)
Places all of these components in the same height group, to remove a component from
the group invoke this method with that component only.
|
static void |
setSameSize(Component... c)
This is identical to invoking
sameWidth followed by sameHeight |
static void |
setSameWidth(Component... c)
Places all of these components in the same width group, to remove a component from
the group invoke this method with that component only.
|
void |
setScrollAnimationSpeed(int animationSpeed)
Scroll animation speed in milliseconds allowing a developer to slow down or accelerate
the smooth animation mode
|
void |
setScrollOpacityChangeSpeed(int scrollOpacityChangeSpeed)
Indicates the decrement units for the scroll opacity
|
void |
setScrollSize(Dimension d)
Set the size for the scroll area
|
void |
setScrollVisible(boolean isScrollVisible)
Set whether this component scroll is visible
|
protected void |
setScrollX(int scrollX)
Indicates the X position of the scrolling, this number is relative to the
component position and so a position of 0 would indicate the x position
of the component.
|
protected void |
setScrollY(int scrollY)
Indicates the Y position of the scrolling, this number is relative to the
component position and so a position of 0 would indicate the y position
of the component.
|
void |
setSelectCommandText(String selectText)
Allows determining the text for the select command used in the 3rd softbutton
mode.
|
void |
setSelectedStyle(Style style)
Changes the Component selected Style by replacing the Component Style with the given Style
|
void |
setShouldCalcPreferredSize(boolean shouldCalcPreferredSize)
Indicates the values within the component have changed and preferred
size should be recalculated
|
void |
setSize(Dimension d)
Sets the Component size, this method is exposed for the purpose of
external layout managers and should not be invoked directly.
If a user wishes to affect the component size, setPreferredSize should be used. |
void |
setSmoothScrolling(boolean smoothScrolling)
Indicates that scrolling through the component should work as an animation
|
void |
setSnapToGrid(boolean snapToGrid)
|
void |
setTabIndex(int index)
Deprecated.
This method is called internally by the layout manager each time the traversal order of the form is queried. Use
setPreferredTabIndex(int) instead. |
void |
setTactileTouch(boolean tactileTouch)
Indicates whether the component should "trigger" tactile touch when pressed by the user
in a touch screen UI.
|
void |
setTensileDragEnabled(boolean tensileDragEnabled)
Indicates whether tensile drag (dragging beyond the boundry of the component and
snapping back) is enabled for this component.
|
void |
setTensileLength(int tensileLength)
Recommended length for the tensile, -1 for default
|
void |
setTooltip(String tooltip) |
void |
setTraversable(boolean traversable)
Sets whether this component is traversable using the keyboard using tab, next, previous keys.
|
void |
setUIID(String id)
This method sets the Component the Unique identifier.
|
void |
setUIID(String portraitUiid,
String landscapeUiid)
This method sets the Component the Unique identifier.
|
void |
setUnselectedStyle(Style style)
Changes the Component Style by replacing the Component Style with the given Style
|
void |
setVisible(boolean visible)
Toggles visibility of the component
|
void |
setWidth(int width)
Sets the Component width, this method is exposed for the purpose of
external layout managers and should not be invoked directly.
If a user wishes to affect the component size, setPreferredSize should be used. |
void |
setX(int x)
Sets the Component x location relative to the parent container, this method
is exposed for the purpose of external layout managers and should not be invoked
directly.
|
void |
setY(int y)
Sets the Component y location relative to the parent container, this method
is exposed for the purpose of external layout managers and should not be invoked
directly.
|
protected boolean |
shouldBlockSideSwipe()
A component that might need side swipe such as the slider
could block it from being used for some other purpose when
on top of said component.
|
protected boolean |
shouldBlockSideSwipeLeft()
A component that might need side swipe such as the tabs
could block it from being used for some other purpose when
on top of said component.
|
protected boolean |
shouldBlockSideSwipeRight()
A component that might need side swipe such as the tabs
could block it from being used for some other purpose when
on top of said component.
|
protected boolean |
shouldRenderComponentSelection()
A component can indicate whether it is interested in rendering it's selection explicitly, this defaults to
true in non-touch UI's and false in touch UI's except for the case where a user clicks the screen.
|
protected void |
showNativeOverlay()
Creates the native overlay for this component.
|
void |
startEditingAsync()
If the component
isEditable() , then this will start the editing
process. |
void |
stopEditing(Runnable onFinish)
Stops the editing process.
|
Component |
stripMarginAndPadding()
Convenience method that strips margin and padding from the component, and
returns itself for chaining.
|
void |
styleChanged(String propertyName,
Style source)
Invoked to indicate a change in a propertyName of a Style
|
Image |
toImage()
Returns the component as an image.
|
String |
toString()
Overriden to return a useful value for debugging purposes
|
void |
unbindProperty(String prop,
BindTarget target)
Deprecated.
this mapped to an older iteration of properties that is no longer used
|
protected void |
updateNativeOverlay()
Updates the native overlay for this component.
|
boolean |
visibleBoundsContains(int x,
int y)
Returns true if the given absolute coordinate is contained inside the visible bounds
of the component.
|
public static final int DEFAULT_CURSOR
public static final int CROSSHAIR_CURSOR
public static final int TEXT_CURSOR
public static final int WAIT_CURSOR
public static final int SW_RESIZE_CURSOR
public static final int SE_RESIZE_CURSOR
public static final int NW_RESIZE_CURSOR
public static final int NE_RESIZE_CURSOR
public static final int N_RESIZE_CURSOR
public static final int S_RESIZE_CURSOR
public static final int W_RESIZE_CURSOR
public static final int E_RESIZE_CURSOR
public static final int HAND_CURSOR
public static final int MOVE_CURSOR
public static final int DRAG_REGION_NOT_DRAGGABLE
public static final int DRAG_REGION_POSSIBLE_DRAG_X
public static final int DRAG_REGION_POSSIBLE_DRAG_Y
public static final int DRAG_REGION_POSSIBLE_DRAG_XY
public static final int DRAG_REGION_LIKELY_DRAG_X
public static final int DRAG_REGION_LIKELY_DRAG_Y
public static final int DRAG_REGION_LIKELY_DRAG_XY
public static final int DRAG_REGION_IMMEDIATELY_DRAG_X
public static final int DRAG_REGION_IMMEDIATELY_DRAG_Y
public static final int DRAG_REGION_IMMEDIATELY_DRAG_XY
public static final int BRB_CONSTANT_ASCENT
getBaselineResizeBehavior()
,
Constant Field Valuespublic static final int BRB_CONSTANT_DESCENT
getBaselineResizeBehavior()
,
Constant Field Valuespublic static final int BRB_CENTER_OFFSET
getBaselineResizeBehavior()
,
Constant Field Valuespublic static final int BRB_OTHER
getBaselineResizeBehavior()
,
Constant Field Valuespublic static final int CENTER
public static final int TOP
public static final int LEFT
public static final int BOTTOM
public static final int RIGHT
public static final int BASELINE
public void setEditingDelegate(Editable editable)
isEditable()
, isEditing()
, startEditingAsync()
, and stopEditing(java.lang.Runnable)
will be delegated to the delegate object.editable
- An editable delegate.public Editable getEditingDelegate()
public void setCursor(int cursor)
isSetCursorSupported()
to find out.
Note: Since cursors incur some overhead, they are turned off at the form level by default.
If you want your custom cursors to be used, then you'll need to enable cursors in the form using Form.setEnableCursors(boolean)
.
cursor
- The cursor to set on this component. One of DEFAULT_CURSOR
, CROSSHAIR_CURSOR
, TEXT_CURSOR
,
WAIT_CURSOR
, SW_RESIZE_CURSOR
, SE_RESIZE_CURSOR
, S_RESIZE_CURSOR
, NE_RESIZE_CURSOR
,
NW_RESIZE_CURSOR
, W_RESIZE_CURSOR
, HAND_CURSOR
, or MOVE_CURSOR
.Form.setEnableCursors(boolean)
,
Form.isEnableCursors()
public int getCursor()
isSetCursorSupported()
to find out.DEFAULT_CURSOR
, CROSSHAIR_CURSOR
, TEXT_CURSOR
,
WAIT_CURSOR
, SW_RESIZE_CURSOR
, SE_RESIZE_CURSOR
, S_RESIZE_CURSOR
, NE_RESIZE_CURSOR
,
NW_RESIZE_CURSOR
, W_RESIZE_CURSOR
, HAND_CURSOR
, or MOVE_CURSOR
.public static void setSameSize(Component... c)
sameWidth
followed by sameHeight
c
- the components to group together, this will override all previous width/height groupingpublic static void setSameWidth(Component... c)
c
- the components to group together, this will override all previous width groupingprotected void showNativeOverlay()
protected void hideNativeOverlay()
protected void updateNativeOverlay()
showNativeOverlay()
,
hideNativeOverlay()
,
getNativeOverlay()
public Object getNativeOverlay()
public static boolean isSetCursorSupported()
setCursor(int)
will simply be ignored.public Style getAllStyles()
public Component[] getSameWidth()
public static void setSameHeight(Component... c)
c
- the components to group together, this will override all previous height groupingpublic Component[] getSameHeight()
protected void initLaf(UIManager uim)
public UIManager getUIManager()
public int getX()
public int getOuterX()
x - leftMargin
).public int getInnerX()
x + leftPadding
.public int getY()
public int getOuterY()
y - leftMargin
.public int getInnerY()
y + leftPadding
.public boolean isVisible()
public Object getClientProperty(String key)
key
- the key used for putClientPropertypublic Component stripMarginAndPadding()
Style.stripMarginAndPadding()
public void clearClientProperties()
public void putClientProperty(String key, Object value)
key
- arbitrary key for the propertyvalue
- the value assigned to the given client propertypublic final Rectangle getDirtyRegion()
public final void setDirtyRegion(Rectangle dirty)
dirty
- the region that needs repainting or null for the whole componentpublic void setVisible(boolean visible)
visible
- true if component is visible; otherwise falsepublic void setOpaque(boolean opaque)
opaque
- False to not paint the component's background.public boolean isOpaque()
public int getWidth()
public int getOuterWidth()
public int getInnerWidth()
public int getHeight()
public int getOuterHeight()
public int getInnerHeight()
public void setX(int x)
x
- the current x coordinate of the components originpublic void setY(int y)
y
- the current y coordinate of the components originprotected boolean isDragRegion(int x, int y)
x
- x location for the touchy
- y location for the touchprotected int getDragRegionStatus(int x, int y)
x
- x location for the touchy
- y location for the touchpublic int getBaseline(int width, int height)
width
- the component widthheight
- the component heightpublic int getBaselineResizeBehavior()
public void setPreferredSize(Dimension d)
d
- the component dimensionpublic void setPreferredSizeStr(String value)
value
- The preferred size to set in format "width height", where width and height can be a scalar
value with px or mm units. Or the special value "inherit" which will just inherit the default preferred size.public String getPreferredSizeStr()
getPreferredSize()
to find
the preferred size of a component.calcPreferredSize()
.public static Dimension parsePreferredSize(String preferredSize, Dimension baseSize)
preferredSize
- a string representing a width/height preferred size using common units e.g. mm, px etc.baseSize
- used as the starting point for the calculation, typically the preferred size of the componentpublic Dimension getPreferredSize()
public Dimension getScrollDimension()
protected Dimension calcScrollSize()
public void setScrollSize(Dimension d)
d
- dimension of the scroll areapublic void setPreferredW(int preferredW)
preferredW
- the preferred width of the componentsetPreferredSize(com.codename1.ui.geom.Dimension)
public void setPreferredH(int preferredH)
preferredH
- the preferred height of the componentsetPreferredSize(com.codename1.ui.geom.Dimension)
public int getPreferredW()
getPreferredSize()
public int getPreferredH()
getPreferredSize()
public int getOuterPreferredH()
public int getInnerPreferredH()
public int getOuterPreferredW()
public int getInnerPreferredW()
public void setWidth(int width)
width
- the width of the componentsetPreferredSize(com.codename1.ui.geom.Dimension)
public void setHeight(int height)
height
- the height of the componentsetPreferredSize(com.codename1.ui.geom.Dimension)
public void setSize(Dimension d)
d
- the component dimensionsetPreferredSize(com.codename1.ui.geom.Dimension)
public String getUIID()
public void setUIID(String id)
id
- UIID unique identifier for component typepublic void setUIID(String portraitUiid, String landscapeUiid)
portraitUiid
- UIID unique identifier for component type in portrait modelandscapeUiid
- UIID unique identifier for component type in landscape modepublic String getInlineAllStyles()
public String getInlineSelectedStyles()
public String getInlineUnselectedStyles()
public String getInlineDisabledStyles()
public String getInlinePressedStyles()
public void setInlineAllStyles(String styles)
styles
- a style in the format of "fgColor:ff0000; font:18mm; border: 1px solid ff0000; bgType:none; padding: 3mm; margin: 1mm"
public void setInlineUnselectedStyles(String styles)
styles
- style formatsetInlineAllStyles(String)
public void setInlineSelectedStyles(String styles)
styles
- style formatsetInlineAllStyles(String)
public void setInlineDisabledStyles(String styles)
styles
- style formatsetInlineAllStyles(String)
public void setInlinePressedStyles(String styles)
styles
- style formatsetInlineAllStyles(String)
public void remove()
public Container getParent()
public void setOwner(Component owner)
This is used by InteractionDialog.setDisposeWhenPointerOutOfBounds(boolean)
to figure out whether a
pointer event actually occurred outside the bounds of the dialog. The containsOrOwns(int, int)
method
is used instead of contains(int, int)
so that it can cover the case where the pointer event occurred
on a component that is logically a child of the dialog, but not physically.
owner
- The component to set as the owner of this component.isOwnedBy(com.codename1.ui.Component)
,
containsOrOwns(int, int)
public Component getOwner()
setOwner(com.codename1.ui.Component)
.public boolean isOwnedBy(Component cmp)
cmp
- the ownersetOwner(com.codename1.ui.Component)
,
containsOrOwns(int, int)
public boolean containsOrOwns(int x, int y)
x
- X-coordinate in absolute coordinates.y
- Y-coordinate in absolute coordinates.setOwner(com.codename1.ui.Component)
,
isOwnedBy(com.codename1.ui.Component)
public void addFocusListener(FocusListener l)
l
- listener interface implementing the observable patternpublic void removeFocusListener(FocusListener l)
l
- listener interface implementing the observable patternpublic void addScrollListener(ScrollListener l)
l
- listener interface implementing the observable patternpublic void removeScrollListener(ScrollListener l)
l
- listener interface implementing the observable patternprotected void fireClicked()
protected boolean isSelectableInteraction()
public void setSelectCommandText(String selectText)
selectText
- text for the interaction with the softkeypublic String getSelectCommandText()
public void setLabelForComponent(Label componentLabel)
componentLabel
- a label associated with this componentpublic Label getLabelForComponent()
protected void focusGained()
protected void focusLost()
public void paintBackgrounds(Graphics g)
g
- the graphics objectpublic void paintShadows(Graphics g, int relativeX, int relativeY)
This is called by the ancestor "surface" container of the component, after it paints its background, but
before painting its children. If the Style.getElevation()
of the component is 0, then no shadow
will be painted. Similarly, if the component has no ancestor container which is a surface (i.e. Container.isSurface()
is true,
the shadow will not be painted.
NOTE: It is also possible that the shadow will not be visible if other opaque components are painted in front of the ancestor surface container. This is one of the limitations of this approach for simulating elevation.
Note: Not all platforms support drawing shadows. Use CodenameOneImplementation#isDrawShadowSupported()
to check
for support at runtime.
g
- The graphics context onto which the shadow should be painted.relativeX
- The relative X coordinate onto which the shadow should be drawn.relativeY
- The relative Y coordinate onto which the shadow should be drawn.Container.paintElevatedPane(Graphics)
,
Container.isSurface()
,
Style.getElevation()
public int getAbsoluteX()
getX()
public int getAbsoluteY()
getY()
protected boolean isInClippingRegion(Graphics g)
public void paintIntersectingComponentsAbove(Graphics g)
g
- Graphics contextprotected void paintScrollbars(Graphics g)
g
- the component graphicsprotected void paintScrollbarX(Graphics g)
g
- the component graphicspublic int getScrollOpacity()
public Rectangle getSelectedRect()
protected void paintScrollbarY(Graphics g)
g
- the component graphicspublic final void paintComponent(Graphics g)
Paints this component as a root by going to all the parent components and
setting the absolute translation based on coordinates and scroll status.
Restores translation when the painting is finished.
One of the uses of this method is to create a "screenshot" as is demonstrated in the code below
that creates an image for sharing on social media
g
- the graphics to paint this Component onpublic final void paintComponent(Graphics g, boolean background)
Paints this component as a root by going to all the parent components and
setting the absolute translation based on coordinates and scroll status.
Restores translation when the painting is finished.
One of the uses of this method is to create a "screenshot" as is demonstrated in the code below
that creates an image for sharing on social media
g
- the graphics to paint this Component onbackground
- if true paints all parents backgroundprotected Border getBorder()
public Component getScrollable()
protected void paintBackground(Graphics g)
g
- the component graphicspublic void paint(Graphics g)
protected boolean isScrollable()
public boolean isScrollableX()
public boolean isScrollableY()
public int getScrollX()
public int getScrollY()
protected void onScrollX(int scrollX)
scrollX
- the X position of the scrollingprotected void onScrollY(int scrollY)
scrollY
- the Y position of the scrollingprotected void setScrollX(int scrollX)
scrollX
- the X position of the scrollingprotected void setScrollY(int scrollY)
scrollY
- the Y position of the scrollingpublic int getDraggedx()
public int getDraggedy()
public int getBottomGap()
public int getSideGap()
public boolean contains(int x, int y)
NOTE: This will return true upon a "hit" even if the component is not
visible, or if that part of the component is currently clipped by a parent
component. To check if a point is contained in the visible component bounds
use visibleBoundsContains(int, int)
x
- the given absolute x coordinatey
- the given absolute y coordinatevisibleBoundsContains(int, int)
public boolean visibleBoundsContains(int x, int y)
contains(int, int)
in that it will
return false if the component or any of its ancestors are not visible,
or if (x, y) are contained inside the bounds of the component, but are clipped.x
- the given absolute x coordinatey
- the given absolute y coordinatecontains(int, int)
protected Dimension calcPreferredSize()
public boolean hasFixedPreferredSize()
setPreferredH(int)
and setPreferredW(int)
, or via a preferred
size style string.protected Rectangle getBounds()
getX()
,
getY()
,
getBounds(com.codename1.ui.geom.Rectangle)
public Rectangle getBounds(Rectangle rect)
rect
- An "out" parameter to store the component bounds in. Cannot be null.getBounds()
protected Rectangle getVisibleBounds()
getX()
,
getY()
,
getVisibleBounds(com.codename1.ui.geom.Rectangle)
public Rectangle getVisibleBounds(Rectangle rect)
rect
- An "out" parameter to store the bounds in. Cannot be null.getVisibleBounds()
public boolean isFocusable()
protected void resetFocusable()
public void setFocusable(boolean focusable)
focusable
- indicate whether this component can get focusedpublic void setTabIndex(int index)
setPreferredTabIndex(int)
instead.setPreferredTabIndex(int)
index
- The tab index.getPreferredTabIndex()
,
setPreferredTabIndex(int)
,
getTabIndex()
,
Form.getTabIterator(com.codename1.ui.Component)
public int getTabIndex()
getPreferredTabIndex()
to get the preferred tab index.Form.getTabIterator(com.codename1.ui.Component)
on the
form or Container.updateTabIndices(int)
in the parent component.getPreferredTabIndex()
,
setTabIndex(int)
,
setPreferredTabIndex(int)
,
Form.getTabIterator(com.codename1.ui.Component)
,
Container.updateTabIndices(int)
public void setPreferredTabIndex(int index)
index
- The preferred tab indexgetPreferredTabIndex()
,
Form.getTabIterator(com.codename1.ui.Component)
,
Container.updateTabIndices(int)
public int getPreferredTabIndex()
Tab index meanings work similar to the HTML tabIndex attribute. A tab Index of -1 (the default value) results in the field not being traversable using the keyboard (or using the next/prev buttons in devices' virtual keyboards). A tab index of 0 results in the component's traversal order being dictated by the natural traversal order of the form.
Use Form.getTabIterator(com.codename1.ui.Component)
to obtain the complete traversal order for
all components in the form.
Best practice is to only explicitly set preferred tabIndex values of 0 if you want the component to be traversable, or -1 if you don't want the component to be traversable. Explicitly setting a positive preferred tab index may result in unexpected results.
When the user tries to "tab" to the next field (or presses the "Next" button on the virtual keyboard), this
triggers a call to Form.getTabIterator(com.codename1.ui.Component)
, crawls the component hierarchy and
returns a ListIterator
of all of the traversable fields in the form in the order they should
be traversed. This order is determined by the layout managers on the form. The core layout managers define
sensible traversal orders by default. If you have a custom layout manager, you can override its traversal
order by implementing the Layout.overridesTabIndices(com.codename1.ui.Container)
and
Layout.getChildrenInTraversalOrder(com.codename1.ui.Container)
methods.
public final void setTraversable(boolean traversable)
setPreferredTabIndex(int)
that sets the tab index to 0 if the component
should be traversable, and -1 if it shouldn't be.
Note: This method is marked final because this is just a convenience wrapper around setPreferredTabIndex(int)
traversable
- True to make the component traversable.public final boolean isTraversable()
Note: This method is marked final because it is just a convenience wrapper around getPreferredTabIndex()
public void setShouldCalcPreferredSize(boolean shouldCalcPreferredSize)
shouldCalcPreferredSize
- indicate whether this component need to
recalculate his preferred sizepublic boolean handlesInput()
public void setHandlesInput(boolean handlesInput)
handlesInput
- indicates whether key events can be grabbed for
focus traversalpublic boolean hasFocus()
requestFocus()
public void setFocus(boolean focused)
focused
- sets the state that determines what colors from the
Style should be used when painting a focused componentrequestFocus()
public Form getComponentForm()
public void repaint()
Display
public void repaint(int x, int y, int w, int h)
x
- boundary of the region to repaint in absolute screen coordinates not component coordinatesy
- boundary of the region to repaint in absolute screen coordinates not component coordinatesw
- boundary of the region to repainth
- boundary of the region to repaintprotected void longKeyPress(int keyCode)
keyCode
- the key code value to indicate a physical key.public void keyPressed(int keyCode)
keyCode
- the key code value to indicate a physical key.public void keyReleased(int keyCode)
keyCode
- the key code value to indicate a physical key.public void keyRepeated(int keyCode)
keyCode
- the key code value to indicate a physical key.public AnimationManager getAnimationManager()
public int getScrollAnimationSpeed()
public boolean isBlockLead()
public void setBlockLead(boolean blockLead)
blockLead
- the blockLead to setpublic boolean isIgnorePointerEvents()
public void setIgnorePointerEvents(boolean ignorePointerEvents)
ignorePointerEvents
- the ignorePointerEvents to setpublic boolean isRippleEffect()
public void setRippleEffect(boolean rippleEffect)
rippleEffect
- the rippleEffect to setpublic Resources getInlineStylesTheme()
setInlineStylesTheme(com.codename1.ui.util.Resources)
,
getInlineAllStyles()
,
getInlineSelectedStyles()
,
getInlinePressedStyles()
,
getInlineUnselectedStyles()
,
getInlineDisabledStyles()
public void setInlineStylesTheme(Resources inlineStylesTheme)
inlineStylesTheme
- the theme that inline styles use to reference images.getInlineStylesTheme()
,
setInlineAllStyles(java.lang.String)
,
setInlinePressedStyles(java.lang.String)
,
setInlineSelectedStyles(java.lang.String)
,
setInlineDisabledStyles(java.lang.String)
,
setInlineUnselectedStyles(java.lang.String)
protected boolean shouldRenderComponentSelection()
public boolean isHideInLandscape()
public void setHideInLandscape(boolean hideInLandscape)
hideInLandscape
- the hideInLandscape to setpublic ComponentAnimation createStyleAnimation(String destUIID, int duration)
destUIID
- the UIID to which this component will gradually shiftduration
- the duration of the animation or the number of stepspublic void setScrollAnimationSpeed(int animationSpeed)
animationSpeed
- scroll animation speed in millisecondspublic boolean isSmoothScrolling()
public void setSmoothScrolling(boolean smoothScrolling)
smoothScrolling
- indicates if a component uses smooth scrollingpublic void pointerHover(int[] x, int[] y)
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerHoverReleased(int[] x, int[] y)
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerHoverPressed(int[] x, int[] y)
x
- the pointer x coordinatey
- the pointer y coordinateprotected boolean pinch(float scale)
scale
- the scaling of the pinch operation a number larger than 1 means scaling up and smaller than 1 means scaling down.
It is recommended that code would threshold the number (so a change between 1.0 and 1.02 shouldn't necessarily trigger zoom).
Notice that this number is relevant to current zoom levels and unaware of them so you should also enforce limits of maximum/minimum
zoom levels.protected void pinchReleased(int x, int y)
x
- The x-coordinate of the remaining finger in the drag. (Absolute)y
- The y-coordinate of the remaining finger in the drag. (Absolute)protected boolean pinch(int[] x, int[] y)
x
- the pointer x coordinatey
- the pointer y coordinatepublic void setPinchBlocksDragAndDrop(boolean block)
block
- if true will prevent drag and drop to trigger if two fingers are placed to pinch before the drag is initiatedpublic boolean isPinchBlocksDragAndDrop()
public void pointerDragged(int[] x, int[] y)
x
- the pointer x coordinatey
- the pointer y coordinateprotected Image getDragImage()
public void setDragTransparency(byte dragTransparency)
getDragImage()
method.dragTransparency
- a number between 0 and 255 where 255
indicates an opaque image.public byte getDragTransparency()
getDragImage()
method.public static void setDefaultDragTransparency(byte defaultDragTransparency)
getDragImage()
method.defaultDragTransparency
- a number between 0 and 255 where 255
indicates an opaque image.public static byte getDefaultDragTransparency()
getDragImage()
method.public Image toImage()
protected void dragInitiated()
protected void drawDraggedImage(Graphics g, Image img, int x, int y)
g
- the graphics contextimg
- the imagex
- x positiony
- y positionprotected boolean draggingOver(Component dragged, int x, int y)
dragged
- the component being draggedx
- the x location over the componenty
- the y location over the componentprotected void dragEnter(Component dragged)
dragged
- the component being draggedprotected void dragExit(Component dragged)
dragged
- the component being draggedpublic void drop(Component dragged, int x, int y)
dragged
- the component being droppedx
- the x coordinate of the dropy
- the y coordinate of the droppublic void addPullToRefresh(Runnable task)
This method adds a refresh task to the Component, the task will be executed if the user has pulled the scroll beyond a certain height.
task
- the refresh task to execute.public boolean respondsToPointerEvents()
isGrabsPointerEvents()
flag true.public void pointerDragged(int x, int y)
x
- the pointer x coordinatey
- the pointer y coordinateprotected boolean isStickyDrag()
public void pointerPressed(int[] x, int[] y)
x
- the pointer x coordinatey
- the pointer y coordinateprotected boolean isDragAndDropOperation(int x, int y)
x
- the x coordinate relative to the componenty
- the y coordinate relative to the componentpublic void pointerPressed(int x, int y)
x
- the pointer x coordinatey
- the pointer y coordinatepublic void pointerReleased(int[] x, int[] y)
x
- the pointer x coordinatey
- the pointer y coordinatepublic void longPointerPress(int x, int y)
public void pointerReleased(int x, int y)
x
- the pointer x coordinatey
- the pointer y coordinatepublic void setTensileDragEnabled(boolean tensileDragEnabled)
tensileDragEnabled
- true to enable tensile dragpublic boolean isTensileDragEnabled()
public TextSelection.TextSelectionSupport getTextSelectionSupport()
public void addDropListener(ActionListener l)
l
- the callbackpublic void removeDropListener(ActionListener l)
l
- the callbackpublic void addDragOverListener(ActionListener l)
l
- the listenerpublic void removeDragOverListener(ActionListener l)
l
- the callbackprotected void dragFinished(int x, int y)
x
- the x locationy
- the y locationpublic void addDragFinishedListener(ActionListener l)
l
- callback to receive drag finished events eventspublic void addStateChangeListener(ActionListener<ComponentStateChangeEvent> l)
l
- Listener to be subscribed.public void removeStateChangeListener(ActionListener<ComponentStateChangeEvent> l)
l
- Listener to be unsubscribed.public void addPointerPressedListener(ActionListener l)
l
- callback to receive pointer eventspublic void addLongPressListener(ActionListener l)
l
- callback to receive pointer eventspublic void paintRippleOverlay(Graphics g, int x, int y, int position)
g
- the graphics object for the component clipped to the backgroundx
- the x position of the touchy
- the y position of the touchposition
- a value between 0 and 1000 with 0 indicating the beginning of the ripple effect and 1000
indicating the completion of itpublic void removePointerPressedListener(ActionListener l)
l
- callback to removepublic void removeLongPressListener(ActionListener l)
l
- callback to removepublic void removeDragFinishedListener(ActionListener l)
l
- callback to removepublic void addPointerReleasedListener(ActionListener l)
l
- callback to receive pointer eventspublic void removePointerReleasedListener(ActionListener l)
l
- callback to removepublic void addPointerDraggedListener(ActionListener l)
l
- callback to receive pointer eventspublic void removePointerDraggedListener(ActionListener l)
l
- callback to removeprotected float getDragSpeed(boolean vertical)
vertical
- indicates what axis speed is requiredpublic Style getStyle()
public Style getPressedStyle()
protected void initUnselectedStyle(Style unselectedStyle)
unselectedStyle
- The unselected style.protected void initPressedStyle(Style pressedStyle)
unselectedStyle
- The pressed style.protected void initDisabledStyle(Style disabledStyle)
unselectedStyle
- The disabled style.protected void initSelectedStyle(Style selectedStyle)
unselectedStyle
- The selected style.public void setPressedStyle(Style style)
style
- the component Style objectpublic Style getUnselectedStyle()
public Style getSelectedStyle()
public Style getDisabledStyle()
public void setUnselectedStyle(Style style)
style
- the component Style objectpublic void setSelectedStyle(Style style)
style
- the component Style objectpublic void setDisabledStyle(Style style)
style
- the component Style objectprotected void installDefaultPainter(Style s)
s
- the custom stylepublic void requestFocus()
public String toString()
protected String paramString()
null
.public void refreshTheme()
public void refreshTheme(boolean merge)
merge
- indicates if the current styles should be merged with the new stylesprotected void refreshTheme(String id, boolean merge)
id
- The Style Id to update the Component withmerge
- indicates if the current styles should be merged with the new stylesprotected boolean isDragActivated()
protected int getGridPosY()
protected int getGridPosX()
public boolean animate()
Display
class.protected void scrollRectToVisible(Rectangle rect, Component coordinateSpace)
rect
- the rectangle that need to be visiblecoordinateSpace
- the component according to whose coordinates
rect is defined. Rect's x/y are relative to that component
(they are not absolute).public void scrollRectToVisible(int x, int y, int width, int height, Component coordinateSpace)
x
- y
- width
- height
- coordinateSpace
- the component according to whose coordinates
rect is defined. Rect's x/y are relative to that component
(they are not absolute).protected void paintBorder(Graphics g)
g
- graphics context on which the border is paintedprotected void paintBorderBackground(Graphics g)
g
- graphics context on which the border is paintedpublic void setCellRenderer(boolean cellRenderer)
cellRenderer
- indicate whether this component is currently being
used as a cell rendererpublic boolean isCellRenderer()
public boolean isScrollVisible()
public void setScrollVisible(boolean isScrollVisible)
isScrollVisible
- Indicate whether this component scroll is visiblepublic void setIsScrollVisible(boolean isScrollVisible)
isScrollVisible
- Indicate whether this component scroll is visiblepublic void startEditingAsync()
isEditable()
, then this will start the editing
process. For TextFields, this results in showing the keyboard and allowing
the user to edit the input. For the Picker, this will display the popup.startEditingAsync
in interface Editable
stopEditing(java.lang.Runnable)
,
isEditing()
,
isEditable()
,
getEditingDelegate()
,
setEditingDelegate(com.codename1.ui.Editable)
public void stopEditing(Runnable onFinish)
stopEditing
in interface Editable
onFinish
- Callback called when the editing is complete.startEditingAsync()
,
isEditing()
,
isEditable()
,
getEditingDelegate()
,
setEditingDelegate(com.codename1.ui.Editable)
public boolean isEditing()
isEditing
in interface Editable
startEditingAsync()
,
stopEditing(java.lang.Runnable)
,
isEditable()
,
getEditingDelegate()
,
setEditingDelegate(com.codename1.ui.Editable)
public boolean isEditable()
isEditable
in interface Editable
getEditingDelegate()
,
setEditingDelegate(com.codename1.ui.Editable)
,
isEditing()
,
startEditingAsync()
,
stopEditing(java.lang.Runnable)
protected void laidOut()
protected void deinitialize()
protected void initComponent()
protected boolean isInitialized()
protected void setInitialized(boolean initialized)
initialized
- Indicates if the component is in the initialized statepublic void styleChanged(String propertyName, Style source)
NOTE By default this will trigger a call to Container.revalidate()
on the parent
container, which is expensive. You can disable this behavior by calling CN.setProperty("Component.revalidateOnStyleChange", "false")
.
The intention is to change this behavior so that the default is to "not" revalidate on style change, so we encourage you to
set this to "false" to ensure for future compatibility.
styleChanged
in interface StyleListener
propertyName
- the property name that was changedsource
- The changed Style objectpublic Component getNextFocusDown()
public void setNextFocusDown(Component nextFocusDown)
nextFocusDown
- the next focus componentpublic Component getNextFocusUp()
public void setNextFocusUp(Component nextFocusUp)
nextFocusUp
- next focus componentpublic Component getNextFocusLeft()
public void setNextFocusLeft(Component nextFocusLeft)
nextFocusLeft
- the next focus componentpublic Component getNextFocusRight()
public void setNextFocusRight(Component nextFocusRight)
nextFocusRight
- the next focus componentpublic boolean isEnabled()
public void setEnabled(boolean enabled)
enabled
- true to enable false to disablepublic String getName()
public void setName(String name)
name
- a name for the componentprotected void initCustomStyle(Style s)
s
- style to initializeprotected void deinitializeCustomStyle(Style s)
s
- style no longer usedpublic boolean isRTL()
public void setRTL(boolean rtl)
rtl
- true if the component should work in a right to left modeprotected boolean isTactileTouch(int x, int y)
x
- the x positiony
- the y positionpublic boolean isTactileTouch()
public void setTactileTouch(boolean tactileTouch)
tactileTouch
- true to trigger vibration when the component is pressedpublic String[] getPropertyNames()
public Class[] getPropertyTypes()
public String[] getPropertyTypeNames()
public Object getPropertyValue(String name)
name
- the name of the propertypublic String setPropertyValue(String name, Object value)
name
- the name of the propertyvalue
- new value for the propertypublic void paintLockRelease()
public Image paintLock(boolean hardLock)
Duplicate calls to this method won't produce duplicate locks, in case of a soft lock the return value will always be null.
hardLock
- indicates whether the lock uses a hard or a soft reference to the imagepublic boolean isSnapToGrid()
public void setSnapToGrid(boolean snapToGrid)
snapToGrid
- the snapToGrid to setprotected boolean shouldBlockSideSwipe()
protected boolean shouldBlockSideSwipeLeft()
protected boolean shouldBlockSideSwipeRight()
public final boolean blocksSideSwipe()
shouldBlockSideSwipe()
.public boolean isFlatten()
public void setFlatten(boolean flatten)
flatten
- the flatten valuepublic int getTensileLength()
public void setTensileLength(int tensileLength)
tensileLength
- length for tensile dragpublic boolean isGrabsPointerEvents()
public void setGrabsPointerEvents(boolean grabsPointerEvents)
grabsPointerEvents
- the grabsPointerEvents to setpublic int getScrollOpacityChangeSpeed()
public void setScrollOpacityChangeSpeed(int scrollOpacityChangeSpeed)
scrollOpacityChangeSpeed
- the scrollOpacityChangeSpeed to setpublic void growShrink(int duration)
duration
- the duration in milliseconds for the grow/shrink animationpublic boolean isAlwaysTensile()
public void setAlwaysTensile(boolean alwaysTensile)
alwaysTensile
- the alwaysTensile to setpublic boolean isDraggable()
public void setDraggable(boolean draggable)
draggable
- the draggable to setpublic boolean isDropTarget()
public void setDropTarget(boolean dropTarget)
dropTarget
- the dropTarget to setpublic boolean isChildOf(Container cnt)
cnt
- a potential parent of this componentpublic boolean isHideInPortrait()
public void setHideInPortrait(boolean hideInPortrait)
hideInPortrait
- set to true in order to hide when in portraitprotected void cancelRepaints()
public String[] getBindablePropertyNames()
public Class[] getBindablePropertyTypes()
public void bindProperty(String prop, BindTarget target)
prop
- the property nametarget
- the target binderpublic void unbindProperty(String prop, BindTarget target)
prop
- the property namestarget
- the target binderpublic Object getBoundPropertyValue(String prop)
prop
- the propertypublic void setBoundPropertyValue(String prop, Object value)
prop
- the property whose value should be setvalue
- the valuepublic String getCloudBoundProperty()
public void setCloudBoundProperty(String cloudBoundProperty)
cloudBoundProperty
- the cloudBoundProperty to setpublic String getCloudDestinationProperty()
public void setCloudDestinationProperty(String cloudDestinationProperty)
cloudDestinationProperty
- the cloudDestinationProperty to setpublic Object getComponentState()
public void setHidden(boolean b, boolean changeMargin)
b
- true to hide the component and false to show itchangeMargin
- indicates margin should be set to 0public void setHidden(boolean b)
b
- true to hide the component and false to show itpublic boolean isHidden()
isHidden(boolean)
with true
to check also if the parent is hidden.public boolean isHidden(boolean checkParent)
checkParent
- True to check if parent is hidden also.public void setComponentState(Object state)
state
- the non-null statepublic String getTooltip()
public void setTooltip(String tooltip)
tooltip
- the tooltip to set