public class HVisible extends HComponent implements HState
HVisible class is the base class
for all non-interactive components.
If a layout manager is associated with the Container into which a
HVisible component is placed, the size
and location of the component will be controlled by the layout
manager.
HVisible provides the following
features for the use of subclasses:
HLook class to which all drawing is delegated.
HLook.
HVisible
components are defined in the HState
interface. The only interaction states valid for a plain
(un-subclassed) HVisible are:
HState.NORMAL_STATE -
indicating that the component is in its normal interaction state.
HState.DISABLED_STATE -
indicating that the component is disabled. While this has no effect
on user interaction with a plain HVisible (since there is no user interaction) it will affect the
visual appearance.
Subclasses of HVisible may use other
states. However, setInteractionState(int)
is the only means by which state can be changed
and will throw an IllegalArgumentException if the state is not valid
for a particular component type. Subclasses of HVisible must not manipulate state in other
ways.
The getInteractionState method is provided to allow any class to read
the current state of a component.
HState, irrespective of whether the subclass of
HVisible can ever be in that state.
Note that content is set on the various STATE constants
defined in HState, and not on
the STATE_BIT constants. A
java.lang.IllegalArgumentException will be thrown by
any method which takes a state as a parameter if a
STATE_BIT rather than a STATE is passed.
By default it is possible to set content for any of eight discrete
states. However, if no content has been set for a particular state,
the associated HLook should use content
from the nearest matching state as defined below:
| State | Content if missing | Example style |
|---|---|---|
HState.NORMAL_STATE
| none | no special style |
HState.FOCUSED_STATE
| HState.NORMAL_STATE
| highlighted |
HState.ACTIONED_STATE
| HState.FOCUSED_STATE
| pushed in |
HState.ACTIONED_FOCUSED_STATE
| HState.FOCUSED_STATE | highlighted & pushed in |
HState.DISABLED_STATE
| HState.NORMAL_STATE
| grayed out |
HState.DISABLED_FOCUSED_STATE
| HState.DISABLED_STATE | grayed out & highlighted |
HState.DISABLED_ACTIONED_STATE
| HState.ACTIONED_STATE | grayed out & pushed in |
HState.DISABLED_ACTIONED_FOCUSED_STATE
| HState.DISABLED_STATE | grayed out & highlighted & pushed |
It is recommended that HLook implementations be capable of drawing components in styles that allow the interaction state to be visually distinguished even when no content is set, or the content is the same for several states.
Content for any component may be changed "on the fly"
using the setContent methods. However, some components (e.g. HStaticAnimation and HAnimation) may be asynchronously
referencing their content (i.e. through a separate
implementation-specific animation thread). Therefore the following
restrictions apply to the setAnimateContent(java.awt.Image[], int) method
when the instance of HVisible on which
it is invoked implements the HAnimateEffect
interface:
HAnimateEffect are outside the
scope of this document. However, a similar strategy should be
employed to avoid synchronization problems.
HLook for details of which looks support scaling
and alignment. See the fields description of this class for
constants which can be used to specify scaling and alignment modes.
The following methods are used to get and set alignment of content:
setHorizontalAlignment(int)
setVerticalAlignment(int)
getHorizontalAlignment()
getVerticalAlignment()
RESIZE_NONE
scaling mode. Platforms are not required
to support scaling of textual content by default.
HVisible, based on a hint which
provides data about the change which triggered the redrawing. The
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method should
be called in preference to repaint whenever the
HVisible requires a redraw to change its appearance.
The HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method
requires an array of one or more HChangeData
objects, which contain a
hint, and associated data. All keys have the type
int, with values defined as
constants in this class. The following hints are defined:
| Hint (key) | Data (value) | Data Interpretation |
|---|---|---|
TEXT_CONTENT_CHANGE
| Object[9] | [Integer changedState, String oldNORMAL_STATEtext, String oldFOCUSED_STATEtext, String oldACTIONED_STATEtext, String oldACTIONED_FOCUSED_STATEtext, String oldDISABLED_STATEtext, String oldDISABLED_FOCUSED_STATEtext, String oldDISABLED_ACTIONED_STATEtext, String oldDISABLED_ACTIONED_FOCUSED_STATEtext] |
GRAPHIC_CONTENT_CHANGE
| Object[9] | [Integer changedState, Image oldNORMAL_STATEimage, Image oldFOCUSED_STATEimage, Image oldACTIONED_STATEimage, Image oldACTIONED_FOCUSED_STATEimage, Image oldDISABLED_STATEimage, Image oldDISABLED_FOCUSED_STATEimage, Image oldDISABLED_ACTIONED_STATEimage, Image oldDISABLED_ACTIONED_FOCUSED_STATEimage] |
ANIMATE_CONTENT_CHANGE
| Object[9] | [Integer changedState, Image[] oldNORMAL_STATEanimation, Image[] oldFOCUSED_STATEanimation, Image[] oldACTIONED_STATEanimation, Image[] oldACTIONED_FOCUSED_STATEanimation, Image[] oldDISABLED_STATEanimation, Image[] oldDISABLED_FOCUSED_STATEanimation, Image[] oldDISABLED_ACTIONED_STATEanimation, Image[] oldDISABLED_ACTIONED_FOCUSED_STATEanimation] |
CONTENT_CHANGE
| Object[9] | [Integer changedState, Object oldNORMAL_STATEcontent, Object oldFOCUSED_STATEcontent, Object oldACTIONED_STATEcontent, Object oldACTIONED_FOCUSED_STATEcontent, Object oldDISABLED_STATEcontent, Object oldDISABLED_FOCUSED_STATEcontent, Object oldDISABLED_ACTIONED_STATEcontent, Object oldDISABLED_ACTIONED_FOCUSED_STATEcontent] |
STATE_CHANGE
| Integer | oldState |
CARET_POSITION_CHANGE
| Integer | oldPosition |
ECHO_CHAR_CHANGE
| Character | oldEcho |
EDIT_MODE_CHANGE
| Boolean | oldEditMode |
MIN_MAX_CHANGE
| Integer[2] | [oldMin, oldMax] |
THUMB_OFFSETS_CHANGE
| Integer[2] | [oldMin, oldMax] |
ORIENTATION_CHANGE
| Integer | oldOrientation |
ITEM_VALUE_CHANGE
| Integer | oldValue |
ADJUSTMENT_VALUE_CHANGE
| Integer | oldIndex |
LIST_CONTENT_CHANGE
| HListElement[] | oldContent |
LIST_ICONSIZE_CHANGE
| Dimension | oldSize |
LIST_LABELSIZE_CHANGE
| Dimension | oldSize |
LIST_MULTISELECTION_CHANGE
| Boolean | oldSelection |
LIST_SCROLLPOSITION_CHANGE
| Integer | oldScrollPosition |
SIZE_CHANGE
| Integer | oldSize |
BORDER_CHANGE
| Boolean | oldBorderMode |
REPEAT_COUNT_CHANGE
| Integer | oldRepeatCount |
ANIMATION_POSITION_CHANGE
| Integer | oldValue |
LIST_SELECTION_CHANGE
| HListElement[] | oldSelectedElements |
UNKNOWN_CHANGE
| Integer | UNKNOWN_CHANGE |
Note that implementations of HLook may not
actually implement more efficient drawing code for a given hint. In
particular, simply repainting the entire HVisible
is a valid implementation option.
The following code for the HStaticRange.setRange(int, int)
method demonstrates how hint objects
are used. Note that the values passed in the hint are always the
old values, since the HLook can
always retrieve the new values as needed from the HVisible. Variables starting with
"my" are member variables of the class.
public boolean setRange(int min, int max)
{
if (min >= max)
return false;
if (min != myMin || max != myMax)
{
// create hint object with the OLD values
HChangeData oldRangeData =
new HChangeData(HVisible.MIN_MAX_CHANGE,
new Integer[] { new Integer(myMin),
new Integer(myMax) });
// update the values
myMin = min;
myMax = max;
Integer oldValue = new Integer(myValue);
// behavior checking elided
if (myValue < myMin)
myValue = myMin;
else if (myValue > myMax)
myValue = myMax;
else
oldValue = null; // myValue is within new range
HChangeData[] array;
if (oldValue == null)
array = new HChangeData[] { oldRangeData };
else
array = new HChangeDate[]
{ oldRangeData,
new HChangeData( HVisible.ADJUSTMENT_VALUE_CHANGE,
oldValue )};
// tell the look to repaint as needed
if (myLook != null)
myLook.widgetChanged(this, array);
}
return true;
}
HLook
to optimize the redraw of the component may be set on any
HVisible. Examples of such data are:
setLookData(java.lang.Object, java.lang.Object)
method, and retrieved with the getLookData(java.lang.Object) method.
To keep the on-screen representation of an HVisible synchronized with its state, any
class may call setLookData(java.lang.Object, java.lang.Object)
with a parameter of null to invalidate any cached
data. Instances of HLook must be able to
regenerate any data they store on HVisible
classes at any time. This mechanism is intended for
implementation optimization only and shall not be used for storing
content.
Use of this mechanism is an implementation option. If this mechanism
is not used by an implementation, getLookData(java.lang.Object) shall always return
null and setLookData(java.lang.Object, java.lang.Object)
shall do nothing. Interoperable systems shall not
assume that this mechanism is implemented.
setDefaultSize(java.awt.Dimension) and
getDefaultSize() methods
provide support for a user-defined default preferred size to be
passed to a layout manager. This value is returned to the layout
manager through the HLook.getPreferredSize(org.havi.ui.HVisible)
method and if set overrides any
look-specific value based on content calculated by the HLook.
Note that the interpretation of the size passed to setDefaultSize(java.awt.Dimension) is not
the overall size of the component, but the area available to the
look to render the component into excluding any look-specific
borders. Therefore when a layout manager is in use the
actual size of the component is likely to be larger than
this default size. See the descriptions of HLook.getMinimumSize(org.havi.ui.HVisible), HLook.getPreferredSize(org.havi.ui.HVisible) and HLook.getMaximumSize(org.havi.ui.HVisible) in HLook for details of the exact algorithm used.
Note that constructors of HVisible and
subclasses which accept width and height
parameters shall set the default size to [width,
height] as if these parameters were passed to setDefaultSize(java.awt.Dimension). If a layout
manager is in use the actual size of the component will probably be
larger than this size after layout due to the HLook adding borders. However, if no layout
manager is used the width and height
parameters are simply used to set the actual size of the
component.
HLook does not
paint the background of the HVisible,
allowing for non-rectangular components and text overlaying bitmaps.
However, HVisible provides for components
which require their background to be painted through the
setBackgroundMode method. Note that if the mode is set to BACKGROUND_FILL the return
value of the HComponent.isOpaque() method
may be true, depending on whether the current background
color of the HVisible is opaque. If
the background mode is set to NO_BACKGROUND_FILL the
HComponent.isOpaque() method
must return false.
HVisible may
enable certain java.awt.AWTEvents, applications should assume that
an HVisible class does not generate or
respond to any java.awt.AWTEvents. If this behavior is required the
standard AWT mechanisms (i.e. processEvent and similar functions)
may be used to handle events on HVisible
or subclasses. However, it is strongly recommended that
component implementors use the HAVi events defined in the
org.havi.ui.event package where possible.
For example, a component wishing to respond to user action should
normally subclass HComponent,
implement the HActionInputPreferred
interface and handle HActionEvent events in the HActionInputPreferred.processHActionEvent(org.havi.ui.event.HActionEvent)
method, instead of overriding
java.awt.Component#processEvent or similar.
| 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 |
| Description | Default value | Set method | Get method |
|---|---|---|---|
Associated matte (HMatte). |
none (i.e. getMatte() returns null) |
setMatte |
getMatte |
| The text layout manager responsible for text formatting. | An HDefaultTextLayoutManager
object. |
setTextLayoutManager(org.havi.ui.HTextLayoutManager)
|
getTextLayoutManager()
|
| The background painting mode | NO_BACKGROUND_FILL |
setBackgroundMode(int) |
getBackgroundMode() |
| The default preferred size | not set (i.e. NO_DEFAULT_SIZE) unless specified by width
and height parameters |
setDefaultSize(java.awt.Dimension) |
getDefaultSize() |
| The horizontal content alignment | HALIGN_CENTER |
setHorizontalAlignment(int) |
getHorizontalAlignment() |
| The vertical content alignment | VALIGN_CENTER |
setVerticalAlignment(int) |
getVerticalAlignment() |
| The content scaling mode | RESIZE_NONE |
setResizeMode(int) |
getResizeMode() |
| The border mode | true |
setBordersEnabled(boolean) |
getBordersEnabled() |
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
static int |
ADJUSTMENT_VALUE_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
ANIMATE_CONTENT_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
ANIMATION_POSITION_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
BACKGROUND_FILL
A constant for use with the
setBackgroundMode(int)
method of HVisible which indicates
that an associated HLook should fill
the bounding rectangle of the HVisible
with its current background color before drawing any
content. |
static int |
BORDER_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
CARET_POSITION_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
CONTENT_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
ECHO_CHAR_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
EDIT_MODE_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
FIRST_CHANGE
A constant which indicates the first change value for use with
the hinting mechanism.
|
static int |
GRAPHIC_CONTENT_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
HALIGN_CENTER
A constant for use with the
setHorizontalAlignment(int)
method of HVisible which indicates
that content should be centered horizontally. |
static int |
HALIGN_JUSTIFY
A constant for use with the
setHorizontalAlignment(int)
method of HVisible which indicates
that content should be fully justified (horizontally). |
static int |
HALIGN_LEFT
A constant for use with the
setHorizontalAlignment(int)
method of HVisible which indicates
that content should be left aligned. |
static int |
HALIGN_RIGHT
A constant for use with the
setHorizontalAlignment(int)
method of HVisible which indicates
that content should be right aligned. |
static int |
ITEM_VALUE_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
LAST_CHANGE
A constant which indicates the last defined value for use with
the hinting mechanism.
|
static int |
LIST_CONTENT_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
LIST_ICONSIZE_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
LIST_LABELSIZE_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
LIST_MULTISELECTION_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
LIST_SCROLLPOSITION_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
LIST_SELECTION_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
MIN_MAX_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
NO_BACKGROUND_FILL
A constant for use with the
setBackgroundMode(int)
method of HVisible which indicates
that an associated HLook should not
fill the bounding rectangle of the HVisible
with its current background color before drawing any
content. |
static int |
NO_DEFAULT_HEIGHT
A constant for use with the
setDefaultSize(java.awt.Dimension) and getDefaultSize()
methods of HVisible which indicates
that no default height is desired for the HVisible. |
static Dimension |
NO_DEFAULT_SIZE
A constant for use with the
setDefaultSize(java.awt.Dimension) and getDefaultSize()
methods of HVisible which indicates
that no default size is desired for the HVisible. |
static int |
NO_DEFAULT_WIDTH
A constant for use with the
setDefaultSize(java.awt.Dimension) and getDefaultSize()
methods of HVisible which indicates
that no default width is desired for the HVisible. |
static int |
ORIENTATION_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
REPEAT_COUNT_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
RESIZE_ARBITRARY
A constant for use with the
setResizeMode(int) method of
HVisible which indicates that
content should be scaled to fit the component. |
static int |
RESIZE_NONE
A constant for use with the
setResizeMode(int)
method of HVisible which indicates
that content should not be scaled to fit the component. |
static int |
RESIZE_PRESERVE_ASPECT
A constant for use with the
setResizeMode(int) method of
HVisible which indicates that
content should be scaled to fit the component while preserving
the aspect ratio of the content. |
static int |
SIZE_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
STATE_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
TEXT_CONTENT_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
TEXT_VALUE_CHANGE
Deprecated.
This constant shall not be used for the hinting
mechanism. Looks shall treat it as
UNKNOWN_CHANGE.
See also CARET_POSITION_CHANGE and TEXT_CONTENT_CHANGE. |
static int |
THUMB_OFFSETS_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
UNKNOWN_CHANGE
A constant for use with the hinting mechanism (see the
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). |
static int |
VALIGN_BOTTOM
A constant for use with the
setVerticalAlignment(int)
method of HVisible which indicates
that content should be vertically aligned to the bottom of the
component. |
static int |
VALIGN_CENTER
A constant for use with the
setVerticalAlignment(int)
method of HVisible which indicates
that content should be centered vertically. |
static int |
VALIGN_JUSTIFY
A constant for use with the
setVerticalAlignment(int)
method of HVisible which indicates
that content should be fully justified (vertically). |
static int |
VALIGN_TOP
A constant for use with the
setVerticalAlignment(int)
method of HVisible which indicates
that content should be vertically aligned to the top of the component. |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTACTIONED_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 |
|---|
HVisible()
|
HVisible(HLook hlook)
|
HVisible(HLook hlook,
int x,
int y,
int width,
int height)
|
| Modifier and Type | Method and Description |
|---|---|
Image[] |
getAnimateContent(int state)
Gets the animate content for this component.
|
int |
getBackgroundMode()
Get the background mode of this
HVisible. |
boolean |
getBordersEnabled()
Returns the current border mode.
|
Object |
getContent(int state)
Gets the content for this component.
|
Dimension |
getDefaultSize()
Returns the default preferred size to be used for this component
when a layout manager is in use.
|
Image |
getGraphicContent(int state)
Gets the graphic content for this component.
|
int |
getHorizontalAlignment()
Get the horizontal alignment of any state-based content
rendered by an associated
HLook. |
int |
getInteractionState()
Return the interaction state the component is currently in.
|
HLook |
getLook()
Gets the
HLook for this component. |
Object |
getLookData(Object key)
Retrieve a look-specific private data object.
|
Dimension |
getMaximumSize()
Gets the maximum size of the
HVisible. |
Dimension |
getMinimumSize()
Gets the minimum size of the
HVisible. |
Dimension |
getPreferredSize()
Gets the preferred size of the
HVisible. |
int |
getResizeMode()
Get the scaling mode for scaling any state-based content
rendered by an associated
HLook. |
String |
getTextContent(int state)
Gets the text content for this component.
|
HTextLayoutManager |
getTextLayoutManager()
Gets the text layout manager that is being used to layout this
text.
|
int |
getVerticalAlignment()
Get the vertical alignment of any state-based content
rendered by an associated
HLook. |
boolean |
isFocusTraversable()
By default an
HVisible component
is not focus-traversable. |
boolean |
isOpaque()
Returns true if the entire
HVisible
area, as given by the java.awt.Component#getBounds
method, is fully opaque, i.e. |
void |
paint(Graphics g)
Draws the current state of the component, by calling the
HLook.showLook(java.awt.Graphics, org.havi.ui.HVisible, int) method of the associated
HLook. |
void |
setAnimateContent(Image[] imageArray,
int state)
Sets an array of graphical content (primarily used for
animation), per state.
|
void |
setBackgroundMode(int mode)
Set the background drawing mode.
|
void |
setBordersEnabled(boolean enable)
The method en- or disables rendering of platform-specific borders.
|
void |
setContent(Object object,
int state)
Sets a single piece of content for this component, per
state.
|
void |
setDefaultSize(Dimension defaultSize)
Set the preferred default size for this component when a layout
manager is in use.
|
void |
setEnabled(boolean b)
|
void |
setGraphicContent(Image image,
int state)
Sets a single piece of graphical content for this component,
per state.
|
void |
setHorizontalAlignment(int halign)
Set the horizontal alignment of any state-based content
rendered by an associated
HLook. |
protected void |
setInteractionState(int state)
Set the interaction state for this component.
|
void |
setLook(HLook hlook)
Sets the
HLook for this component. |
void |
setLookData(Object key,
Object data)
Set a look-specific private data object.
|
void |
setResizeMode(int resize)
Set the resize mode of this
HVisible. |
void |
setTextContent(String string,
int state)
Sets a single piece of text content for this component, per
state.
|
void |
setTextLayoutManager(HTextLayoutManager manager)
Sets the text layout manager that should be used to layout the
text for this component.
|
void |
setVerticalAlignment(int valign)
Set the vertical alignment of any state-based content
rendered by an associated
HLook. |
void |
update(Graphics g)
The update() method in
HVisible
overrides that in Component and does not clear the background
of the component, it simply modifies the current Color of the
Graphics object to match that of the components background Color,
and calls the paint() method. |
getMatte, 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 HALIGN_LEFT
setHorizontalAlignment(int)
method of HVisible which indicates
that content should be left aligned.public static final int HALIGN_CENTER
setHorizontalAlignment(int)
method of HVisible which indicates
that content should be centered horizontally.public static final int HALIGN_RIGHT
setHorizontalAlignment(int)
method of HVisible which indicates
that content should be right aligned.public static final int HALIGN_JUSTIFY
setHorizontalAlignment(int)
method of HVisible which indicates
that content should be fully justified (horizontally).public static final int VALIGN_TOP
setVerticalAlignment(int)
method of HVisible which indicates
that content should be vertically aligned to the top of the component.public static final int VALIGN_CENTER
setVerticalAlignment(int)
method of HVisible which indicates
that content should be centered vertically.public static final int VALIGN_BOTTOM
setVerticalAlignment(int)
method of HVisible which indicates
that content should be vertically aligned to the bottom of the
component.public static final int VALIGN_JUSTIFY
setVerticalAlignment(int)
method of HVisible which indicates
that content should be fully justified (vertically).public static final int RESIZE_NONE
setResizeMode(int)
method of HVisible which indicates
that content should not be scaled to fit the component.public static final int RESIZE_PRESERVE_ASPECT
setResizeMode(int) method of
HVisible which indicates that
content should be scaled to fit the component while preserving
the aspect ratio of the content. Areas of the component that
are not filled by the content will be look dependent.public static final int RESIZE_ARBITRARY
setResizeMode(int) method of
HVisible which indicates that
content should be scaled to fit the component. Aspect ratios of
the content need not be preserved.public static final int NO_BACKGROUND_FILL
setBackgroundMode(int)
method of HVisible which indicates
that an associated HLook should not
fill the bounding rectangle of the HVisible
with its current background color before drawing any
content. Therefore any previous content will NOT necessarily be
erased during the repainting of the HVisible.public static final int BACKGROUND_FILL
setBackgroundMode(int)
method of HVisible which indicates
that an associated HLook should fill
the bounding rectangle of the HVisible
with its current background color before drawing any
content. Any previous content will be erased during the
repainting of the HVisible.public static final int FIRST_CHANGE
public static final int TEXT_CONTENT_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the text
content has changed. The value for this hint is an array,
java.lang.Object[9], which contains the state for
which the content changed (a java.lang.Integer)
and the old content (a java.lang.String) for all 8 states.public static final int GRAPHIC_CONTENT_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the graphical
content has changed. The value for this hint is an array,
java.lang.Object[9], which contains the state for
which the content changed (a java.lang.Integer)
and the old content (a java.awt.Image) for all 8 states.public static final int ANIMATE_CONTENT_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the animated
content has changed. The value for this hint is an array,
java.lang.Object[9], which contains the state for
which the content changed (a java.lang.Integer)
and the old content (a java.awt.Image[]) for all 8 states.public static final int CONTENT_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the miscellaneous
content has changed. The value for this hint is an array,
java.lang.Object[9], which contains the state for
which the content changed (a java.lang.Integer)
and the old content (a java.lang.Object) for all 8 states.public static final int STATE_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the
interaction state has changed. The value for this hint is a
java.lang.Integer which has the value of the
old state.public static final int CARET_POSITION_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the
caret position has changed. The value for this hint is a
java.lang.Integer which has the value of the
old caret position.public static final int ECHO_CHAR_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the
echo character has changed. The value for this hint is a
java.lang.Character which has the value of the
old echo character.public static final int EDIT_MODE_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the editing mode,
adjustment mode or selection mode of the widget has changed. The value
for this hint is a java.lang.Boolean which has the value of
the old mode.public static final int MIN_MAX_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the range
of an HAdjustmentValue
component has changed. The value for this hint is an array,
java.lang.Object[2], which contains the old
minimum and maximum extents of the range as
java.lang.Integer.public static final int THUMB_OFFSETS_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the thumb
offsets of an HAdjustmentValue
component have changed. The value for this
hint is an array, java.lang.Object[2], which
contains the old minimum and maximum thumb offsets as
java.lang.Integer.public static final int ADJUSTMENT_VALUE_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the value
of an HAdjustmentValue
component has changed. The value for this hint is a
java.lang.Integer which contains the old index.public static final int ORIENTATION_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the
orientation of an HOrientable
component has changed. The value for this hint is a
java.lang.Integer which has the value of the old
orientation.public static final int TEXT_VALUE_CHANGE
UNKNOWN_CHANGE.
See also CARET_POSITION_CHANGE and TEXT_CONTENT_CHANGE.HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the value
of an HTextValue
component has changed. The value for this hint is a
java.lang.Integer which contains the old value.public static final int ITEM_VALUE_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the value
of an HItemValue
component has changed. The value for this hint is a
java.lang.Integer which contains the old value.public static final int LIST_CONTENT_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the content
of an HListGroup
component has changed. The value for this hint is a
java.lang.Integer which contains the old content.public static final int LIST_ICONSIZE_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the iconsize
of an HListGroup
component has changed. The value for this hint is a
java.lang.Integer which contains the old size.public static final int LIST_LABELSIZE_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the labelsize
of an HListGroup
component has changed. The value for this hint is a
java.lang.Integer which contains the old size.public static final int LIST_MULTISELECTION_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the multiselection setting
of an HListGroup
component has changed. The value for this hint is a
java.lang.Integer which contains the old setting.public static final int LIST_SCROLLPOSITION_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the scrollposition
of an HListGroup
component has changed. The value for this hint is a
java.lang.Integer which contains the old position.public static final int SIZE_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the size
of an HVisible
component has changed. The value for this hint is a
java.lang.Dimension which contains the old size.public static final int BORDER_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the
border mode has changed. The value for this hint is a
java.lang.Boolean which has the value of the
old border mode.public static final int REPEAT_COUNT_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that HAnimateEffect.setRepeatCount(int) was
called. Note that this hint is also used, when the actual value has
not changed. This is to notify a reset of an internal counter.
The value for this hint is a java.lang.Integer which
has the value of the old repeat count.public static final int ANIMATION_POSITION_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the value
of an HStaticAnimation
component has changed. The value for this hint is a
java.lang.Integer which contains the old value.public static final int LIST_SELECTION_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that the selection
in HListGroup was changed.
The value for this hint is an HListElement[]
or null for the old selection.public static final int UNKNOWN_CHANGE
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) method in HLook). This hint indicates that some
unspecified change has occurred. The value for this hint is a
java.lang.Integer which also has the value
UNKNOWN_CHANGE.public static final int LAST_CHANGE
public static final int NO_DEFAULT_WIDTH
setDefaultSize(java.awt.Dimension) and getDefaultSize()
methods of HVisible which indicates
that no default width is desired for the HVisible.public static final int NO_DEFAULT_HEIGHT
setDefaultSize(java.awt.Dimension) and getDefaultSize()
methods of HVisible which indicates
that no default height is desired for the HVisible.public static final Dimension NO_DEFAULT_SIZE
setDefaultSize(java.awt.Dimension) and getDefaultSize()
methods of HVisible which indicates
that no default size is desired for the HVisible.
The contents of the Dimension object cannot be relied upon. Comparisons must always be done using object identity, i.e. using the "==" operator.
public HVisible()
public HVisible(HLook hlook)
HVisible component with
the given HLook. See the class
description for details of constructor parameters and default
values.
Applications shall not use HLooks with this
constructor unless those HLooks are specified as
working with HVisible. If an HLook is used which is
specified as only working with specific sub-classes of
HVisible then the failure mode is implementation
dependent.
public HVisible(HLook hlook, int x, int y, int width, int height)
HVisible component with
the given HLook and the specified
location and size. See the class description for details of
constructor parameters and default values.hlook - The HLook associated
with the HVisible component.x - the x-coordinate of the HVisible
component within its Container.y - the y-coordinate of the HVisible
component within its Container.width - the width of the HVisible
component in pixels.height - the height of the HVisible
component in pixels.public boolean isFocusTraversable()
HVisible component
is not focus-traversable.isFocusTraversable in class ComponentComponent.isFocusTraversable()public void paint(Graphics g)
HLook.showLook(java.awt.Graphics, org.havi.ui.HVisible, int) method of the associated
HLook. If no HLook
is associated with the component, (i.e. the HVisible was created with a null HLook or the look has been set to null using
setLook(org.havi.ui.HLook)) then the paint
method should do nothing. This mechanism may be used for
components that wish to extend HVisible,
and override the paint method, without supporting
the HLook interface.public void update(Graphics g)
HVisible
overrides that in Component and does not clear the background
of the component, it simply modifies the current Color of the
Graphics object to match that of the components background Color,
and calls the paint() method.public void setTextContent(String string, int state)
If the HVisible has an associated
HLook, then it should repaint itself.
string - The content. If the content is null, then any
currently assigned content shall be removed for the specified
state.state - The state of the component for which this content
should be displayed. Note that content is set on the
XXX_STATE constants defined in HState, and not on the
XXX_STATE_BIT constants. A
java.lang.IllegalArgumentException will be thrown
if a STATE_BIT rather than a STATE is
passed.public void setGraphicContent(Image image, int state)
Note that the content is not copied, merely its object reference.
If the HVisible has an associated
HLook, then it should repaint itself.
image - The content. If the content is null, then any
currently assigned content shall be removed for the specified
state.state - The state of the component for which this content
should be displayed. Note that content is set on the
XXX_STATE constants defined in HState, and not on the
XXX_STATE_BIT constants. A
java.lang.IllegalArgumentException will be thrown
if a STATE_BIT rather than a STATE is
passed.public void setAnimateContent(Image[] imageArray, int state)
Note that the content is not copied, merely its object reference.
If the HVisible has an associated
HLook, then it should repaint itself.
imageArray - An array of images that make up the
animation. If the array is null, then any currently assigned
content shall be removed for the specified state.state - The state of the component for which this content
should be displayed. Note that content is set on the
XXX_STATE constants defined in HState, and not on the
XXX_STATE_BIT constants. A
java.lang.IllegalArgumentException will be thrown
if a STATE_BIT rather than a STATE is
passed.public void setContent(Object object, int state)
Note that the content is not copied, merely its object reference.
If the HVisible has an associated
HLook, then it should repaint itself.
object - The content. If the content is null, then any
currently assigned content shall be removed for the specified
state.state - The state of the component for which this content
should be displayed. Note that content is set on the
XXX_STATE constants defined in HState, and not on the
XXX_STATE_BIT constants. A
java.lang.IllegalArgumentException will be thrown
if a STATE_BIT rather than a STATE is
passed.public String getTextContent(int state)
state - The state for which content is to be retrieved.
Note that content is set on the XXX_STATE
constants defined in HState, and
not on the XXX_STATE_BIT constants. A
java.lang.IllegalArgumentException will be thrown
if a STATE_BIT rather than a STATE is
passed.null is returned.public Image getGraphicContent(int state)
state - The state for which content is to be retrieved.
Note that content is set on the XXX_STATE
constants defined in HState, and
not on the XXX_STATE_BIT constants. A
java.lang.IllegalArgumentException will be thrown
if a STATE_BIT rather than a STATE is
passed.null is returned.public Image[] getAnimateContent(int state)
state - The state for which content is to be retrieved.
Note that content is set on the XXX_STATE
constants defined in HState, and
not on the XXX_STATE_BIT constants. A
java.lang.IllegalArgumentException will be thrown
if a STATE_BIT rather than a STATE is
passed.null is returned.public Object getContent(int state)
state - The state for which content is to be retrieved.
Note that content is set on the XXX_STATE
constants defined in HState, and
not on the XXX_STATE_BIT constants. A
java.lang.IllegalArgumentException will be thrown
if a STATE_BIT rather than a STATE is
passed.null is returned.public void setLook(HLook hlook) throws HInvalidLookException
HLook for this component.hlook - 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 compatible
with this type of component, for example a graphic look being
set on a text component, an HInvalidLookException is thrown.
Note that HVisible itself will never throw this exception, but
it may be thrown by a subclass which has overridden this method.public Dimension getPreferredSize()
HVisible.
The getPreferredSize method of the HLook that is associated with this HVisible will be called to calculate the
dimensions.getPreferredSize in class ComponentHVisible's preferred size - if no
HLook has been associated with the
HVisible, then the current HVisible dimensions as determined with
getSize will be returned.HLook.getPreferredSize(org.havi.ui.HVisible)public Dimension getMaximumSize()
HVisible.
The getMaximumSize method of the HLook that is associated with this HVisible will be called to calculate the
dimensions.getMaximumSize in class ComponentHVisible's maximum size - if no HLook has been associated with the HVisible, then the current HVisible dimensions as determined with
getSize will be returned.HLook.getMaximumSize(org.havi.ui.HVisible)public Dimension getMinimumSize()
HVisible.
The getMinimumSize method of the HLook that is associated with this HVisible will be called to calculate the
dimensions.getMinimumSize in class ComponentHVisible's minimum size - if no HLook has been associated with the HVisible, then the current HVisible dimensions as determined with
getSize will be returned.HLook.getMinimumSize(org.havi.ui.HVisible)protected void setInteractionState(int state)
HVisible to change the interaction state
of the HVisible. Subclasses
MUST NOT manipulate the state by any other mechanism.
Attempts to set states which are not valid for the subclass
will cause an java.lang.IllegalArgumentException
to be thrown. See the class descriptions of each component for
the definitions of which states are valid.
state - the interaction state for this component. A
java.lang.IllegalArgumentException will be thrown
if a STATE_BIT rather than a STATE is
passed.HStatepublic int getInteractionState()
HStatepublic void setTextLayoutManager(HTextLayoutManager manager)
manager - the HTextLayoutManager
to be used by this component.public HTextLayoutManager getTextLayoutManager()
HTextLayoutManager
that is being used by this component.public int getBackgroundMode()
HVisible.
The return value specifies how the look should draw
the background (i.e. a rectangle filling the bounds of the
HVisible).NO_BACKGROUND_FILL
or BACKGROUND_FILL.public void setBackgroundMode(int mode)
HVisible).mode - one of NO_BACKGROUND_FILL
or BACKGROUND_FILLpublic boolean isOpaque()
HVisible
area, as given by the java.awt.Component#getBounds
method, is fully opaque, i.e. its HLook
guarantees that all pixels are painted in an opaque
Color.
This method will call the HLook.isOpaque(org.havi.ui.HVisible)
method of an associated HLook
if one is set. If no HLook is associated this method
returns false.
The default return value is implementation specific and depends
on the background painting mode of the given HVisible. The consequences of an invalid
overridden value are implementation specific.
isOpaque in interface TestOpacityisOpaque in class HComponentHLook guarantees that all
pixels are painted in an opaque Color.public void setDefaultSize(Dimension defaultSize)
Note that the size set with this method is not a
guaranteed size; if set it will be passed to the
layout manager through the HLook.getPreferredSize(org.havi.ui.HVisible)
method. The default size of a component is to be interpreted
as the area in which the component can be rendered, excluding
look-specific borders.
Valid arguments include NO_DEFAULT_SIZE, and Dimensions containing NO_DEFAULT_WIDTH or NO_DEFAULT_HEIGHT.
defaultSize - specifies the default preferred size. If this
parameter is null a java.lang.NullPointerException
will be thrown. If this parameter specifies a size smaller than an implementation-defined minimum size, the preferred size of this component shall be set to that implementation-defined minimum size.
public Dimension getDefaultSize()
setDefaultSize(java.awt.Dimension)
method NO_DEFAULT_SIZE is returned.
If the parent Container into which the HVisible is placed has no layout manager the default preferred size has no effect.
The default size of a component is to be interpreted as the area in which the component can be rendered, excluding look-specific borders.
public Object getLookData(Object key)
HLook may use this method to retrieve
private data (e.g. layout hints, cached images etc.) from the
HVisible. Use of this mechanism is an implementation option. If
this mechanism is not used by an implementation, or no data has
been set for the specified key this method returns
null.key - an object which uniquely identifies the type of
look for which the private data is to be retrieved. Keys need
not be unique across different instances of the same look
class.setLookData(java.lang.Object, java.lang.Object), or
null.HLook,
setLookData(java.lang.Object, java.lang.Object)public void setLookData(Object key, Object data)
HLook may use this method to set private
data (e.g. layout hints, cached images etc.) on the
HVisible. Use of this mechanism is an implementation option. If
this mechanism is not used by an implementation, this method
will have no effect and calls to getLookData(java.lang.Object) shall return
null. If for this specified key a data object has
been set,the old data object shall be replaced with the new one.key - an object which uniquely identifies the type of
look for which the private data is to be retrieved. Keys need
not be unique across different instances of the same look
class.data - a private data object, or null to remove any
current object set on this HVisible.HLook,
getLookData(java.lang.Object)public void setHorizontalAlignment(int halign)
HLook. If
content is not used in the rendering of this HVisible calls to
this method shall change the current alignment mode, but this
will not affect the rendered representation.halign - the new horizontal alignment mode, one of HALIGN_LEFT, HALIGN_CENTER, HALIGN_RIGHT or HALIGN_JUSTIFY.public void setVerticalAlignment(int valign)
HLook. If
content is not used in the rendering of this HVisible calls to
this method shall change the current alignment mode, but this
will not affect the rendered representation.valign - the new vertical alignment mode, one of VALIGN_TOP, VALIGN_CENTER, VALIGN_BOTTOM or VALIGN_JUSTIFY.public int getHorizontalAlignment()
HLook. If
content is not used in the rendering of this HVisible the value
returned shall be valid, but has no affect on the rendered
representation.HALIGN_LEFT, HALIGN_CENTER, HALIGN_RIGHT or HALIGN_JUSTIFY.public int getVerticalAlignment()
HLook. If
content is not used in the rendering of this HVisible the value
returned shall be valid, but has no affect on the rendered
representation.VALIGN_TOP, VALIGN_CENTER, VALIGN_BOTTOM or VALIGN_JUSTIFY.public void setResizeMode(int resize)
HVisible. If the
associated HLook does not render content or if
scaling is not supported, changing the mode may have no visible effect.resize - the new scaling mode, one of RESIZE_NONE, RESIZE_PRESERVE_ASPECT or RESIZE_ARBITRARYpublic int getResizeMode()
HLook. If
content is not used in the rendering of this HVisible the value
returned shall be valid, but has no affect on the rendered
representation.RESIZE_NONE, RESIZE_PRESERVE_ASPECT or RESIZE_ARBITRARYpublic void setEnabled(boolean b)
HState of this
HVisible by calling setInteractionState,
depending on the value of b. This method should invoke the superclass
method.setEnabled in class HComponentb - If true, this
HVisible is enabled; otherwise this
HVisible is disabled.public void setBordersEnabled(boolean enable)
enable is true, the associated
HLook may render borders, if supported. If the
specified parameter is false, no borders will be
rendered and the whole area is available to the content
Additionally, all values of the insets objects returned by
HLook.getInsets(org.havi.ui.HVisible) will be zero.
The setting shall only be used by HAnimateLook,
HGraphicLook and
HTextLook. Only for these looks shall
HLook.widgetChanged(org.havi.ui.HVisible, org.havi.ui.HChangeData[]) with
BORDER_CHANGE be called.
All other looks shall ignore this value and the method shall not be
called. The behavior of third party looks is not defined. The
default value is true.
enable - the new border mode to enable or disable border
renderinggetBordersEnabled()public boolean getBordersEnabled()
HLook.getInsets(org.havi.ui.HVisible) to find out, if any
borders are rendered.setBordersEnabled(boolean)Copyright © 2012 code4tv.com. All Rights Reserved.