public class HStaticRange extends HVisible implements HNoInputPreferred, HOrientable
HStaticRange is a user interface
component used to display a static value which is within a fixed
range, but does not permit the user to navigate (focus) upon it. By
default it uses the HRangeLook to render
itself.
| Parameter | Description | Default value | Set method | Get method |
|---|---|---|---|---|
| x | x-coordinate of top left hand corner of this component in pixels, relative to its parent container (subject to layout management). | --- | java.awt.Component#setBounds | java.awt.Component#getBounds |
| y | y-coordinate of top left hand corner of this component in pixels, relative to its parent container (subject to layout management). | --- | java.awt.Component#setBounds | java.awt.Component#getBounds |
| width | width of this component in pixels (subject to layout management). | --- | java.awt.Component#setBounds | java.awt.Component#getBounds |
| height | height of this component in pixels (subject to layout management). | --- | java.awt.Component#setBounds | java.awt.Component#getBounds |
| orientation | The "orientation" of the range object. | ORIENT_LEFT_TO_RIGHT |
setOrientation |
getOrientation |
| minimum | The minimum value that can be returned by this range object. | 0 | setRange |
getMinValue |
| maximum | The maximum value that can be returned by this range object. | 100 | setRange |
getMaxValue |
| value | The current value returned by this range object. | 0 | setValue |
getValue |
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
static int |
SCROLLBAR_BEHAVIOR
The
HStaticRange shall
behave as a scrollbar, i.e. |
static int |
SLIDER_BEHAVIOR
The
HStaticRange shall
behave as a slider, i.e. |
ADJUSTMENT_VALUE_CHANGE, ANIMATE_CONTENT_CHANGE, ANIMATION_POSITION_CHANGE, BACKGROUND_FILL, BORDER_CHANGE, CARET_POSITION_CHANGE, CONTENT_CHANGE, ECHO_CHAR_CHANGE, EDIT_MODE_CHANGE, FIRST_CHANGE, GRAPHIC_CONTENT_CHANGE, HALIGN_CENTER, HALIGN_JUSTIFY, HALIGN_LEFT, HALIGN_RIGHT, ITEM_VALUE_CHANGE, LAST_CHANGE, LIST_CONTENT_CHANGE, LIST_ICONSIZE_CHANGE, LIST_LABELSIZE_CHANGE, LIST_MULTISELECTION_CHANGE, LIST_SCROLLPOSITION_CHANGE, LIST_SELECTION_CHANGE, MIN_MAX_CHANGE, NO_BACKGROUND_FILL, NO_DEFAULT_HEIGHT, NO_DEFAULT_SIZE, NO_DEFAULT_WIDTH, ORIENTATION_CHANGE, REPEAT_COUNT_CHANGE, RESIZE_ARBITRARY, RESIZE_NONE, RESIZE_PRESERVE_ASPECT, SIZE_CHANGE, STATE_CHANGE, TEXT_CONTENT_CHANGE, TEXT_VALUE_CHANGE, THUMB_OFFSETS_CHANGE, UNKNOWN_CHANGE, VALIGN_BOTTOM, VALIGN_CENTER, VALIGN_JUSTIFY, VALIGN_TOPBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTORIENT_BOTTOM_TO_TOP, ORIENT_LEFT_TO_RIGHT, ORIENT_RIGHT_TO_LEFT, ORIENT_TOP_TO_BOTTOMACTIONED_FOCUSED_STATE, ACTIONED_STATE, ACTIONED_STATE_BIT, ALL_STATES, DISABLED_ACTIONED_FOCUSED_STATE, DISABLED_ACTIONED_STATE, DISABLED_FOCUSED_STATE, DISABLED_STATE, DISABLED_STATE_BIT, FIRST_STATE, FOCUSED_STATE, FOCUSED_STATE_BIT, LAST_STATE, NORMAL_STATEABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
HStaticRange()
Creates an
HStaticRange
object. |
HStaticRange(int orientation,
int minimum,
int maximum,
int value)
Creates an
HStaticRange
object. |
HStaticRange(int orientation,
int minimum,
int maximum,
int value,
int x,
int y,
int width,
int height)
Creates an
HStaticRange
object. |
| Modifier and Type | Method and Description |
|---|---|
int |
getBehavior()
Returns the behavior for this
HStaticRange. |
static HRangeLook |
getDefaultLook()
Returns the currently set default
HLook for HStaticRange
components. |
int |
getMaxValue()
Get the maximum value of the range
|
int |
getMinValue()
Gets the minimum of the range.
|
int |
getOrientation()
Retrieve the orientation of the
HStaticRange. |
int |
getThumbMaxOffset()
Returns the thumb offset for its maximum value.
|
int |
getThumbMinOffset()
Returns the thumb offset for its minimum value.
|
int |
getValue()
Gets the value of the control.
|
void |
setBehavior(int behavior)
Sets the behavior for this
HStaticRange. |
static void |
setDefaultLook(HRangeLook look)
Sets the default
HLook for further
HStaticRange Components. |
void |
setLook(HLook hlook)
Sets the
HLook for this component. |
void |
setOrientation(int orient)
Set the orientation of the
HStaticRange. |
boolean |
setRange(int minimum,
int maximum)
Sets the range of values for the control.
|
void |
setThumbOffsets(int minOffset,
int maxOffset)
Set the offsets for the "thumb" area on this range
control.
|
void |
setValue(int value)
Sets the value of the control, subject to its current behavior.
|
getAnimateContent, getBackgroundMode, getBordersEnabled, getContent, getDefaultSize, getGraphicContent, getHorizontalAlignment, getInteractionState, getLook, getLookData, getMaximumSize, getMinimumSize, getPreferredSize, getResizeMode, getTextContent, getTextLayoutManager, getVerticalAlignment, isFocusTraversable, isOpaque, paint, setAnimateContent, setBackgroundMode, setBordersEnabled, setContent, setDefaultSize, setEnabled, setGraphicContent, setHorizontalAlignment, setInteractionState, setLookData, setResizeMode, setTextContent, setTextLayoutManager, setVerticalAlignment, updategetMatte, isDoubleBuffered, isEnabled, processEvent, setMatteaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isFocusable, isFocusCycleRoot, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validatepublic static final int SLIDER_BEHAVIOR
HStaticRange shall
behave as a slider, i.e. the allowable values that may be
set / returned for the HStaticRange shall not be affected by the
"thumb" offsets, and hence its value shall be
able to vary between [minimum, maximum].public static final int SCROLLBAR_BEHAVIOR
HStaticRange shall
behave as a scrollbar, i.e. the allowable values that may
be set / returned for the HStaticRange shall be affected by the "thumb"
offsets, and hence its value shall be able to vary between
[minimum + minThumbOffset, maximum - maxThumbOffset].public HStaticRange()
HStaticRange
object. See the class description for details of constructor
parameters and default values.public HStaticRange(int orientation,
int minimum,
int maximum,
int value,
int x,
int y,
int width,
int height)
HStaticRange
object. See the class description for details of constructor
parameters and default values.public HStaticRange(int orientation,
int minimum,
int maximum,
int value)
HStaticRange
object. See the class description for details of constructor
parameters and default values.public void setLook(HLook hlook) throws HInvalidLookException
HLook for this component.setLook in class HVisiblehlook - The HLook that is to be
used for this component.
Note that this parameter may be null, in which case the
component will not draw itself until a look is set.HInvalidLookException - If the Look is not an HRangeLook.public static void setDefaultLook(HRangeLook look)
HLook for further
HStaticRange Components.look - The HLook that will be
used by default when creating a new HStaticRange component.
Note that this parameter may be null, in which case newly
created components shall not draw themselves until a non-null
look is set using the setLook method.public static HRangeLook getDefaultLook()
HLook for HStaticRange
components.HLook that is used by
default when creating a new HStaticRange component.public int getOrientation()
HStaticRange. The orientation controls how the associated
HLook lays out the component.getOrientation in interface HOrientableORIENT_LEFT_TO_RIGHT, ORIENT_RIGHT_TO_LEFT, ORIENT_TOP_TO_BOTTOM, or ORIENT_BOTTOM_TO_TOP.public void setOrientation(int orient)
HStaticRange. The orientation controls the layout of the component.setOrientation in interface HOrientableorient - one of ORIENT_LEFT_TO_RIGHT, ORIENT_RIGHT_TO_LEFT, ORIENT_TOP_TO_BOTTOM, or ORIENT_BOTTOM_TO_TOP.public boolean setRange(int minimum,
int maximum)
minimum - The minimum value of the range controlmaximum - The maximum value of the range controlpublic int getMinValue()
public int getMaxValue()
public void setValue(int value)
getValue().value - the value for this HStaticRangeSLIDER_BEHAVIOR,
SCROLLBAR_BEHAVIORpublic int getValue()
SLIDER_BEHAVIOR,
SCROLLBAR_BEHAVIORpublic void setThumbOffsets(int minOffset,
int maxOffset)
There is no requirement that minOffset == maxOffset. For example, both
offsets may be zero, yielding a thermometer-like range
object. All measurements are in the same units as the minimum /
maximum values on the HStaticRange object. The size of the "thumb" is the
application author's responsibility. By default the
"thumb" does not affect the range over which the
value of the HStaticRange may
be modified. It is recommended that the HRangeLook provides mechanisms to
denote the value of the HStaticRange, in addition to indicating the extent of the
thumb as defined by the offsets.
If this control's behavior is SCROLLBAR_BEHAVIOR, then the
following rules apply: If the thumb offsets are illegal,
i.e. minimum + thumbMinOffset is equal or greater
than maximum - thumbMaxOffset, then an
IllegalArgumentException shall be thrown. If the
control's value is not valid for the specified offsets, then the
value shall be changed to the closest valid value.
setBehavior(int)public int getThumbMinOffset()
public int getThumbMaxOffset()
public void setBehavior(int behavior)
HStaticRange. If the new behavior is
SCROLLBAR_BEHAVIOR and the control's settings for
range and thumb offsets are illegal, i.e. minimum +
thumbMinOffset is equal or greater than maximum -
thumbMaxOffset, then an
IllegalArgumentException shall be thrown. If the
control's value is not valid for the offsets, then the value
shall be changed to the closest valid value.behavior - the behavior for this HStaticRange (SLIDER_BEHAVIOR or
SCROLLBAR_BEHAVIOR).public int getBehavior()
HStaticRange.HStaticRange.Copyright © 2012 code4tv.com. All Rights Reserved.