public class CheckBox extends Button
STATE_DEFAULT, STATE_PRESSED, STATE_ROLLOVER
BASELINE, BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_POSSIBLE_DRAG_Y, LEFT, RIGHT, TOP
Constructor and Description |
---|
CheckBox()
Constructs a checkbox with no text
|
CheckBox(Image icon)
Constructs a checkbox with the given icon
|
CheckBox(String text)
Constructs a checkbox with the given text
|
CheckBox(String text,
Image icon)
Constructs a checkbox with the given text and icon
|
Modifier and Type | Method and Description |
---|---|
void |
bindProperty(String prop,
BindTarget target)
Binds the given property name to the given bind target
|
protected Dimension |
calcPreferredSize()
Calculates the preferred size based on component content.
|
String[] |
getBindablePropertyNames()
Returns the names of the properties within this component that can be bound for persistence,
the order of these names mean that the first one will be the first bound
|
Class[] |
getBindablePropertyTypes()
Returns the types of the properties that are bindable within this component
|
Object |
getBoundPropertyValue(String prop)
Allows the binding code to extract the value of the property
|
boolean |
isOppositeSide()
Places the check box on the opposite side at the far end
|
boolean |
isSelected()
Return true if the checkbox is selected
|
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 String |
paramString()
Returns a string representing the state of this component.
|
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 |
released(int x,
int y)
Invoked to change the state of the button to the released state
|
void |
setBoundPropertyValue(String prop,
Object value)
Sets the value of a bound property within this component, notice that this method MUST NOT fire
the property change event when invoked to prevent recursion!
|
void |
setOppositeSide(boolean oppositeSide)
Places the check box on the opposite side at the far end
|
void |
setSelected(boolean selected)
Selects the current checkbox
|
void |
unbindProperty(String prop,
BindTarget target)
Removes a bind target from the given property name
|
addActionListener, animate, dragInitiated, fireClicked, getActionListeners, getBorder, getCommand, getDisabledIcon, getIconFromState, getListeners, getPressedIcon, getReleaseRadius, getRolloverIcon, getRolloverPressedIcon, getState, isSelectableInteraction, isToggle, keyPressed, keyReleased, keyRepeated, pointerDragged, pointerHover, pointerHoverReleased, pointerPressed, pointerReleased, pressed, released, removeActionListener, resetFocusable, setAlignment, setCommand, setDisabledIcon, setPressedIcon, setReleaseRadius, setRolloverIcon, setRolloverPressedIcon, setToggle
getAlignment, getBaseline, getBaselineResizeBehavior, getGap, getIcon, getMask, getMaskedIcon, getMaskName, getPropertyNames, getPropertyTypeNames, getPropertyTypes, getPropertyValue, getShiftMillimeters, getShiftText, getText, getTextPosition, getVerticalAlignment, isDefaultTickerEnabled, isEndsWith3Points, isShouldLocalize, isTickerEnabled, isTickerRunning, setDefaultTickerEnabled, setEndsWith3Points, setGap, setIcon, setMask, setMaskName, setPropertyValue, setShiftMillimeters, setShiftText, setShouldLocalize, setText, setTextPosition, setTickerEnabled, setVerticalAlignment, shouldTickerStart, startTicker, startTicker, stopTicker
addDragOverListener, addDropListener, addFocusListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, calcScrollSize, cancelRepaints, clearClientProperties, contains, deinitialize, deinitializeCustomStyle, dragEnter, dragExit, draggingOver, drawDraggedImage, drop, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getBottomGap, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentForm, getComponentState, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragRegionStatus, getDragSpeed, getGridPosX, getGridPosY, getHeight, getLabelForComponent, getName, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getParent, getPreferredH, getPreferredSize, getPreferredW, getPressedStyle, getSameHeight, getSameWidth, getScrollable, getScrollAnimationSpeed, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedRect, getSelectedStyle, getSideGap, getStyle, getTensileLength, getUIID, getUIManager, getUnselectedStyle, getVisibleBounds, getWidth, getX, getY, growShrink, handlesInput, hasFocus, initComponent, initCustomStyle, initLaf, installDefaultPainter, isAlwaysTensile, isCellRenderer, isDragActivated, isDragAndDropOperation, isDraggable, isDragRegion, isDropTarget, isEnabled, isFlatten, isFocusable, isGrabsPointerEvents, isHideInPortrait, isInClippingRegion, isInitialized, isRTL, isScrollable, isScrollableX, isScrollableY, isScrollVisible, isSmoothScrolling, isSnapToGrid, isStickyDrag, isTactileTouch, isTactileTouch, isTensileDragEnabled, isVisible, laidOut, longKeyPress, longPointerPress, onScrollX, onScrollY, paintBackground, paintBackgrounds, paintBorder, paintComponent, paintComponent, paintLock, paintLockRelease, paintScrollbars, paintScrollbarX, paintScrollbarY, pinch, pointerDragged, pointerHoverPressed, pointerPressed, pointerReleased, putClientProperty, refreshTheme, refreshTheme, removeDragOverListener, removeDropListener, removeFocusListener, removePointerDraggedListener, removePointerPressedListener, removePointerReleasedListener, removeScrollListener, repaint, repaint, requestFocus, scrollRectToVisible, scrollRectToVisible, setAlwaysTensile, setCellRenderer, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setDirtyRegion, setDisabledStyle, setDraggable, setDropTarget, setEnabled, setFlatten, setFocus, setFocusable, setGrabsPointerEvents, setHandlesInput, setHeight, setHideInPortrait, setInitialized, setIsScrollVisible, setLabelForComponent, setName, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setPreferredH, setPreferredSize, setPreferredW, setPressedStyle, setRTL, setSameHeight, setSameWidth, setScrollAnimationSpeed, setScrollOpacityChangeSpeed, setScrollSize, setScrollVisible, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setShouldCalcPreferredSize, setSize, setSmoothScrolling, setSnapToGrid, setTactileTouch, setTensileDragEnabled, setTensileLength, setUIID, setUnselectedStyle, setVisible, setWidth, setX, setY, shouldBlockSideSwipe, styleChanged, toString
public CheckBox(String text)
text
- to display next to the checkboxpublic CheckBox()
public CheckBox(Image icon)
icon
- icon to display next to the checkboxpublic boolean isSelected()
isSelected
in class Button
public void setSelected(boolean selected)
selected
- value for selectionpublic void released(int x, int y)
Button
public void paint(Graphics g)
Component
protected Dimension calcPreferredSize()
Component
calcPreferredSize
in class Button
protected String paramString()
Component
null
.paramString
in class Label
public void refreshTheme(boolean merge)
Component
refreshTheme
in class Component
merge
- indicates if the current styles should be merged with the new stylespublic boolean isOppositeSide()
isOppositeSide
in class Button
public void setOppositeSide(boolean oppositeSide)
oppositeSide
- the oppositeSide to setpublic String[] getBindablePropertyNames()
Component
getBindablePropertyNames
in class Label
public Class[] getBindablePropertyTypes()
Component
getBindablePropertyTypes
in class Label
public void bindProperty(String prop, BindTarget target)
Component
bindProperty
in class Label
prop
- the property nametarget
- the target binderpublic void unbindProperty(String prop, BindTarget target)
Component
unbindProperty
in class Label
prop
- the property namestarget
- the target binderpublic Object getBoundPropertyValue(String prop)
Component
getBoundPropertyValue
in class Label
prop
- the propertypublic void setBoundPropertyValue(String prop, Object value)
Component
setBoundPropertyValue
in class Label
prop
- the property whose value should be setvalue
- the value