All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.havi.ui.HVisible Maven / Gradle / Ivy

package org.havi.ui;

/*
 * Copyright 2000-2003 by HAVi, Inc. Java is a trademark of Sun
 * Microsystems, Inc. All rights reserved.  
 */

import java.awt.Image;
import java.awt.Dimension;

/**
  The {@link org.havi.ui.HVisible} class is the base class
  for all non-interactive components. 

  

If a layout manager is associated with the Container into which a {@link org.havi.ui.HVisible} component is placed, the size and location of the component will be controlled by the layout manager.

{@link org.havi.ui.HVisible} provides the following features for the use of subclasses:

  • support for interaction states.
  • a mechanism to associate the component with a pluggable {@link org.havi.ui.HLook} class to which all drawing is delegated.
  • support for state-related content which is drawn by the associated {@link org.havi.ui.HLook}.
  • support for scalable and alignable content.
  • support for private look data.
  • support for preferred sizes when used with a layout manager.
  • control over the background painting behavior.
  • a pluggable text layout management mechanism.
Some of these features are discussed in more detail below.

Interaction State

Interaction states for {@link org.havi.ui.HVisible} components are defined in the {@link org.havi.ui.HState} interface. The only interaction states valid for a plain (un-subclassed) {@link org.havi.ui.HVisible} are:

  • {@link org.havi.ui.HState#NORMAL_STATE} - indicating that the component is in its normal interaction state.
  • {@link org.havi.ui.HState#DISABLED_STATE} - indicating that the component is disabled. While this has no effect on user interaction with a plain {@link org.havi.ui.HVisible HVisible} (since there is no user interaction) it will affect the visual appearance.

Subclasses of {@link org.havi.ui.HVisible} may use other states. However, {@link org.havi.ui.HVisible#setInteractionState} 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 {@link org.havi.ui.HVisible} must not manipulate state in other ways.

The {@link org.havi.ui.HVisible#getInteractionState getInteractionState} method is provided to allow any class to read the current state of a component.

State-based content

Specific content may be set for any interaction state defined in {@link org.havi.ui.HState}, irrespective of whether the subclass of {@link org.havi.ui.HVisible} can ever be in that state.

Note that content is set on the various STATE constants defined in {@link org.havi.ui.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 {@link org.havi.ui.HLook} should use content from the nearest matching state as defined below:

StateContent if missingExample style
{@link org.havi.ui.HState#NORMAL_STATE} noneno special style
{@link org.havi.ui.HState#FOCUSED_STATE} {@link org.havi.ui.HState#NORMAL_STATE} highlighted
{@link org.havi.ui.HState#ACTIONED_STATE} {@link org.havi.ui.HState#FOCUSED_STATE} pushed in
{@link org.havi.ui.HState#ACTIONED_FOCUSED_STATE} {@link org.havi.ui.HState#FOCUSED_STATE}highlighted & pushed in
{@link org.havi.ui.HState#DISABLED_STATE} {@link org.havi.ui.HState#NORMAL_STATE} grayed out
{@link org.havi.ui.HState#DISABLED_FOCUSED_STATE} {@link org.havi.ui.HState#DISABLED_STATE}grayed out & highlighted
{@link org.havi.ui.HState#DISABLED_ACTIONED_STATE} {@link org.havi.ui.HState#ACTIONED_STATE}grayed out & pushed in
{@link org.havi.ui.HState#DISABLED_ACTIONED_FOCUSED_STATE} {@link org.havi.ui.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. {@link org.havi.ui.HStaticAnimation} and {@link org.havi.ui.HAnimation}) may be asynchronously referencing their content (i.e. through a separate implementation-specific animation thread). Therefore the following restrictions apply to the {@link org.havi.ui.HVisible#setAnimateContent} method when the instance of {@link org.havi.ui.HVisible} on which it is invoked implements the {@link org.havi.ui.HAnimateEffect} interface:

  • The method must be synchronized with any implementation-specific animation thread such that content cannot be changed while a different thread is using it.
  • If the animation was running the method should stop the animation in a synchronized manner before changing content.
  • The method should reset the animation to a starting position defined by the current play mode. The repeat count of the animation should be reset to 0.
  • If the animation was running the method should start the animation.
Alternative platform-specific animation schemes which do not use {@link org.havi.ui.HAnimateEffect} are outside the scope of this document. However, a similar strategy should be employed to avoid synchronization problems.

Content Scaling and Alignment

Where state-based content is used, it is an implementation option to support scaling of the content to fit the HVisible. Some looks also support alignment of content. See the class description of {@link org.havi.ui.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:

  • {@link org.havi.ui.HVisible#setHorizontalAlignment}
  • {@link org.havi.ui.HVisible#setVerticalAlignment}
  • {@link org.havi.ui.HVisible#getHorizontalAlignment}
  • {@link org.havi.ui.HVisible#getVerticalAlignment}
The following methods are used to get and set the scaling of content. Scaling support is optional, however all implementations must support the {@link org.havi.ui.HVisible#RESIZE_NONE} scaling mode. Platforms are not required to support scaling of textual content by default.
  • {@link org.havi.ui.HVisible#setResizeMode}
  • {@link org.havi.ui.HVisible#getResizeMode}

Repaint Hints

An associated HLook provides a mechanism of efficiently repainting an {@link org.havi.ui.HVisible HVisible}, based on a hint which provides data about the change which triggered the redrawing. The {@link org.havi.ui.HLook#widgetChanged} method should be called in preference to repaint whenever the HVisible requires a redraw to change its appearance.

The {@link org.havi.ui.HLook#widgetChanged} method requires an array of one or more {@link org.havi.ui.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
{@link org.havi.ui.HVisible#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]
{@link org.havi.ui.HVisible#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]
{@link org.havi.ui.HVisible#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]
{@link org.havi.ui.HVisible#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]
{@link org.havi.ui.HVisible#STATE_CHANGE} IntegeroldState
{@link org.havi.ui.HVisible#CARET_POSITION_CHANGE} IntegeroldPosition
{@link org.havi.ui.HVisible#ECHO_CHAR_CHANGE} CharacteroldEcho
{@link org.havi.ui.HVisible#EDIT_MODE_CHANGE} BooleanoldEditMode
{@link org.havi.ui.HVisible#MIN_MAX_CHANGE} Integer[2][oldMin, oldMax]
{@link org.havi.ui.HVisible#THUMB_OFFSETS_CHANGE} Integer[2][oldMin, oldMax]
{@link org.havi.ui.HVisible#ORIENTATION_CHANGE} IntegeroldOrientation
{@link org.havi.ui.HVisible#ITEM_VALUE_CHANGE} IntegeroldValue
{@link org.havi.ui.HVisible#ADJUSTMENT_VALUE_CHANGE} IntegeroldIndex
{@link org.havi.ui.HVisible#LIST_CONTENT_CHANGE} HListElement[] oldContent
{@link org.havi.ui.HVisible#LIST_ICONSIZE_CHANGE} Dimension oldSize
{@link org.havi.ui.HVisible#LIST_LABELSIZE_CHANGE} Dimension oldSize
{@link org.havi.ui.HVisible#LIST_MULTISELECTION_CHANGE} Boolean oldSelection
{@link org.havi.ui.HVisible#LIST_SCROLLPOSITION_CHANGE} Integer oldScrollPosition
{@link org.havi.ui.HVisible#SIZE_CHANGE } IntegeroldSize
{@link org.havi.ui.HVisible#BORDER_CHANGE} BooleanoldBorderMode
{@link org.havi.ui.HVisible#REPEAT_COUNT_CHANGE} IntegeroldRepeatCount
{@link org.havi.ui.HVisible#ANIMATION_POSITION_CHANGE} IntegeroldValue
{@link org.havi.ui.HVisible#LIST_SELECTION_CHANGE} HListElement[] oldSelectedElements
{@link org.havi.ui.HVisible#UNKNOWN_CHANGE} IntegerUNKNOWN_CHANGE

Note that implementations of {@link org.havi.ui.HLook} may not actually implement more efficient drawing code for a given hint. In particular, simply repainting the entire {@link org.havi.ui.HVisible} is a valid implementation option.

The following code for the {@link org.havi.ui.HStaticRange#setRange} method demonstrates how hint objects are used. Note that the values passed in the hint are always the old values, since the {@link org.havi.ui.HLook} can always retrieve the new values as needed from the {@link org.havi.ui.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;
}

Private HLook data

Private data for the use of an associated {@link org.havi.ui.HLook} to optimize the redraw of the component may be set on any {@link org.havi.ui.HVisible}. Examples of such data are:
  • cached bitmap representations of complex drawing operations
  • scrolling metrics and positions
  • cached layout data
Data is set using the {@link org.havi.ui.HVisible#setLookData} method, and retrieved with the {@link org.havi.ui.HVisible#getLookData} method.

To keep the on-screen representation of an {@link org.havi.ui.HVisible} synchronized with its state, any class may call {@link org.havi.ui.HVisible#setLookData} with a parameter of null to invalidate any cached data. Instances of {@link org.havi.ui.HLook} must be able to regenerate any data they store on {@link org.havi.ui.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, {@link org.havi.ui.HVisible#getLookData} shall always return null and {@link org.havi.ui.HVisible#setLookData} shall do nothing. Interoperable systems shall not assume that this mechanism is implemented.

Preferred Sizes

The {@link org.havi.ui.HVisible#setDefaultSize} and {@link org.havi.ui.HVisible#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 {@link org.havi.ui.HLook#getPreferredSize} method and if set overrides any look-specific value based on content calculated by the {@link org.havi.ui.HLook}.

Note that the interpretation of the size passed to {@link org.havi.ui.HVisible#setDefaultSize} 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 {@link org.havi.ui.HLook#getMinimumSize}, {@link org.havi.ui.HLook#getPreferredSize} and {@link org.havi.ui.HLook#getMaximumSize} in {@link org.havi.ui.HLook} for details of the exact algorithm used.

Note that constructors of {@link org.havi.ui.HVisible} and subclasses which accept width and height parameters shall set the default size to [width, height] as if these parameters were passed to {@link org.havi.ui.HVisible#setDefaultSize}. 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 {@link org.havi.ui.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.

Background Painting

Normally the associated {@link org.havi.ui.HLook} does not paint the background of the {@link org.havi.ui.HVisible}, allowing for non-rectangular components and text overlaying bitmaps. However, {@link org.havi.ui.HVisible} provides for components which require their background to be painted through the setBackgroundMode method. Note that if the mode is set to {@link org.havi.ui.HVisible#BACKGROUND_FILL} the return value of the {@link org.havi.ui.HComponent#isOpaque} method may be true, depending on whether the current background color of the {@link org.havi.ui.HVisible} is opaque. If the background mode is set to {@link org.havi.ui.HVisible#NO_BACKGROUND_FILL} the {@link org.havi.ui.HComponent#isOpaque} method must return false.

Event Handling

While implementations of {@link org.havi.ui.HVisible} may enable certain java.awt.AWTEvents, applications should assume that an {@link org.havi.ui.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 {@link org.havi.ui.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 {@link org.havi.ui.HComponent}, implement the {@link org.havi.ui.HActionInputPreferred} interface and handle {@link org.havi.ui.event.HActionEvent} events in the {@link org.havi.ui.HActionInputPreferred#processHActionEvent} method, instead of overriding java.awt.Component#processEvent or similar.


The parameters to the constructors are as follows, in cases where parameters are not used, then the constructor should use the default values.

Default parameter values exposed in the constructors

ParameterDescriptionDefault value Set methodGet 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

Default parameter values not exposed in the constructors

DescriptionDefault valueSet method Get method
Associated matte ({@link org.havi.ui.HMatte HMatte}). none (i.e. getMatte() returns null) {@link org.havi.ui.HComponent#setMatte setMatte} {@link org.havi.ui.HComponent#getMatte getMatte}
The text layout manager responsible for text formatting. An {@link org.havi.ui.HDefaultTextLayoutManager} object. {@link org.havi.ui.HVisible#setTextLayoutManager} {@link org.havi.ui.HVisible#getTextLayoutManager}
The background painting mode {@link org.havi.ui.HVisible#NO_BACKGROUND_FILL} {@link org.havi.ui.HVisible#setBackgroundMode} {@link org.havi.ui.HVisible#getBackgroundMode}
The default preferred size not set (i.e. NO_DEFAULT_SIZE) unless specified by width and height parameters {@link org.havi.ui.HVisible#setDefaultSize} {@link org.havi.ui.HVisible#getDefaultSize}
The horizontal content alignment {@link org.havi.ui.HVisible#HALIGN_CENTER} {@link org.havi.ui.HVisible#setHorizontalAlignment} {@link org.havi.ui.HVisible#getHorizontalAlignment}
The vertical content alignment {@link org.havi.ui.HVisible#VALIGN_CENTER} {@link org.havi.ui.HVisible#setVerticalAlignment} {@link org.havi.ui.HVisible#getVerticalAlignment}
The content scaling mode {@link org.havi.ui.HVisible#RESIZE_NONE} {@link org.havi.ui.HVisible#setResizeMode} {@link org.havi.ui.HVisible#getResizeMode}
The border mode true {@link org.havi.ui.HVisible#setBordersEnabled} {@link org.havi.ui.HVisible#getBordersEnabled}
*/ public class HVisible extends HComponent implements HState { /** * A constant for use with the {@link * org.havi.ui.HVisible#setHorizontalAlignment} * method of {@link org.havi.ui.HVisible} which indicates * that content should be left aligned. */ public static final int HALIGN_LEFT = 0; /** * A constant for use with the {@link * org.havi.ui.HVisible#setHorizontalAlignment} * method of {@link org.havi.ui.HVisible} which indicates * that content should be centered horizontally. */ public static final int HALIGN_CENTER = 1; /** * A constant for use with the {@link * org.havi.ui.HVisible#setHorizontalAlignment} * method of {@link org.havi.ui.HVisible} which indicates * that content should be right aligned. */ public static final int HALIGN_RIGHT = 2; /** * A constant for use with the {@link * org.havi.ui.HVisible#setHorizontalAlignment} * method of {@link org.havi.ui.HVisible} which indicates * that content should be fully justified (horizontally). */ public static final int HALIGN_JUSTIFY = 3; /** * A constant for use with the {@link * org.havi.ui.HVisible#setVerticalAlignment} * method of {@link org.havi.ui.HVisible} which indicates * that content should be vertically aligned to the top of the component. */ public static final int VALIGN_TOP = 0; /** * A constant for use with the {@link * org.havi.ui.HVisible#setVerticalAlignment} * method of {@link org.havi.ui.HVisible} which indicates * that content should be centered vertically. */ public static final int VALIGN_CENTER = 4; /** * A constant for use with the {@link * org.havi.ui.HVisible#setVerticalAlignment} * method of {@link org.havi.ui.HVisible} which indicates * that content should be vertically aligned to the bottom of the * component. */ public static final int VALIGN_BOTTOM = 8; /** * A constant for use with the {@link * org.havi.ui.HVisible#setVerticalAlignment} * method of {@link org.havi.ui.HVisible} which indicates * that content should be fully justified (vertically). */ public static final int VALIGN_JUSTIFY = 12; /** * A constant for use with the {@link * org.havi.ui.HVisible#setResizeMode} * method of {@link org.havi.ui.HVisible} which indicates * that content should not be scaled to fit the component. */ public final static int RESIZE_NONE = 0; /** * A constant for use with the {@link * org.havi.ui.HVisible#setResizeMode} method of * {@link org.havi.ui.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_PRESERVE_ASPECT = 1; /** * A constant for use with the {@link * org.havi.ui.HVisible#setResizeMode} method of * {@link org.havi.ui.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 RESIZE_ARBITRARY = 2; /** * A constant for use with the {@link * org.havi.ui.HVisible#setBackgroundMode} * method of {@link org.havi.ui.HVisible} which indicates * that an associated {@link org.havi.ui.HLook} should not * fill the bounding rectangle of the {@link org.havi.ui.HVisible} * with its current background color before drawing any * content. Therefore any previous content will NOT necessarily be * erased during the repainting of the {@link org.havi.ui.HVisible}. */ public static final int NO_BACKGROUND_FILL = 0; /** * A constant for use with the {@link * org.havi.ui.HVisible#setBackgroundMode} * method of {@link org.havi.ui.HVisible} which indicates * that an associated {@link org.havi.ui.HLook} should fill * the bounding rectangle of the {@link org.havi.ui.HVisible} * with its current background color before drawing any * content. Any previous content will be erased during the * repainting of the {@link org.havi.ui.HVisible}. */ public static final int BACKGROUND_FILL = 1; /** * A constant which indicates the first change value for use with * the hinting mechanism. */ public static final int FIRST_CHANGE = 0; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.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 TEXT_CONTENT_CHANGE = 0; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.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 GRAPHIC_CONTENT_CHANGE = 1; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.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 ANIMATE_CONTENT_CHANGE = 2; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.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 CONTENT_CHANGE = 3; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.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 STATE_CHANGE = 4; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.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 CARET_POSITION_CHANGE = 5; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.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 ECHO_CHAR_CHANGE = 6; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.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 EDIT_MODE_CHANGE = 7; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.HLook}). This hint indicates that the range * of an {@link org.havi.ui.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 MIN_MAX_CHANGE = 8; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.HLook}). This hint indicates that the thumb * offsets of an {@link org.havi.ui.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 THUMB_OFFSETS_CHANGE = 9; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.HLook}). This hint indicates that the value * of an {@link org.havi.ui.HAdjustmentValue} * component has changed. The value for this hint is a * java.lang.Integer which contains the old index. */ public static final int ADJUSTMENT_VALUE_CHANGE = 13; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.HLook}). This hint indicates that the * orientation of an {@link org.havi.ui.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 ORIENTATION_CHANGE = 10; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.HLook}). This hint indicates that the value * of an {@link org.havi.ui.HTextValue} * component has changed. The value for this hint is a * java.lang.Integer which contains the old value. * @deprecated This constant shall not be used for the hinting * mechanism. Looks shall treat it as {@link #UNKNOWN_CHANGE}. * See also {@link #CARET_POSITION_CHANGE} and {@link * #TEXT_CONTENT_CHANGE}. */ public static final int TEXT_VALUE_CHANGE = 11; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.HLook}). This hint indicates that the value * of an {@link org.havi.ui.HItemValue} * 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 = 12; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.HLook}). This hint indicates that the content * of an {@link org.havi.ui.HListGroup} * component has changed. The value for this hint is a * java.lang.Integer which contains the old content. */ public static final int LIST_CONTENT_CHANGE = 14; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.HLook}). This hint indicates that the iconsize * of an {@link org.havi.ui.HListGroup} * component has changed. The value for this hint is a * java.lang.Integer which contains the old size. */ public static final int LIST_ICONSIZE_CHANGE = 15; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.HLook}). This hint indicates that the labelsize * of an {@link org.havi.ui.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 = 16; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.HLook}). This hint indicates that the multiselection setting * of an {@link org.havi.ui.HListGroup} * component has changed. The value for this hint is a * java.lang.Integer which contains the old setting. */ public static final int LIST_MULTISELECTION_CHANGE = 17; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.HLook}). This hint indicates that the scrollposition * of an {@link org.havi.ui.HListGroup} * component has changed. The value for this hint is a * java.lang.Integer which contains the old position. */ public static final int LIST_SCROLLPOSITION_CHANGE = 18; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.HLook}). This hint indicates that the size * of an {@link org.havi.ui.HVisible} * component has changed. The value for this hint is a * java.lang.Dimension which contains the old size. */ public static final int SIZE_CHANGE = 19; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.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 BORDER_CHANGE = 20; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.HLook}). This hint indicates that {@link * org.havi.ui.HAnimateEffect#setRepeatCount} 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 REPEAT_COUNT_CHANGE = 21; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.HLook}). This hint indicates that the value * of an {@link org.havi.ui.HStaticAnimation} * component has changed. The value for this hint is a * java.lang.Integer which contains the old value. */ public static final int ANIMATION_POSITION_CHANGE = 22; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.HLook}). This hint indicates that the selection * in {@link org.havi.ui.HListGroup} was changed. * The value for this hint is an {@link org.havi.ui.HListElement}[] * or null for the old selection. */ public static final int LIST_SELECTION_CHANGE = 23; /** * A constant for use with the hinting mechanism (see the {@link * org.havi.ui.HLook#widgetChanged} method in {@link * org.havi.ui.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 UNKNOWN_CHANGE = 24; /** * A constant which indicates the last defined value for use with * the hinting mechanism. */ public static final int LAST_CHANGE = UNKNOWN_CHANGE; /** * A constant for use with the {@link * org.havi.ui.HVisible#setDefaultSize} and {@link * org.havi.ui.HVisible#getDefaultSize} * methods of {@link org.havi.ui.HVisible} which indicates * that no default width is desired for the {@link org.havi.ui.HVisible}. */ public static final int NO_DEFAULT_WIDTH = -1; /** * A constant for use with the {@link * org.havi.ui.HVisible#setDefaultSize} and {@link * org.havi.ui.HVisible#getDefaultSize} * methods of {@link org.havi.ui.HVisible} which indicates * that no default height is desired for the {@link org.havi.ui.HVisible}. */ public static final int NO_DEFAULT_HEIGHT = -1; /** * A constant for use with the {@link * org.havi.ui.HVisible#setDefaultSize} and {@link * org.havi.ui.HVisible#getDefaultSize} * methods of {@link org.havi.ui.HVisible} which indicates * that no default size is desired for the {@link org.havi.ui.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 static final java.awt.Dimension NO_DEFAULT_SIZE = new java.awt.Dimension(NO_DEFAULT_WIDTH,NO_DEFAULT_HEIGHT); /** * Creates an {@link org.havi.ui.HVisible} component with * no {@link org.havi.ui.HLook}. See the class description for * details of constructor parameters and default values. */ public HVisible() { } /** * Creates an {@link org.havi.ui.HVisible} component with * the given {@link org.havi.ui.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. * * @param hlook The {@link org.havi.ui.HLook} associated with the * {@link org.havi.ui.HVisible} component. */ public HVisible(HLook hlook) { super(); } /** * Creates an {@link org.havi.ui.HVisible} component with * the given {@link org.havi.ui.HLook} and the specified * location and size. See the class description for details of * constructor parameters and default values. * * @param hlook The {@link org.havi.ui.HLook} associated * with the {@link org.havi.ui.HVisible} component. * @param x the x-coordinate of the {@link org.havi.ui.HVisible} * component within its Container. * @param y the y-coordinate of the {@link org.havi.ui.HVisible} * component within its Container. * @param width the width of the {@link org.havi.ui.HVisible} * component in pixels. * @param height the height of the {@link org.havi.ui.HVisible} * component in pixels. */ public HVisible(HLook hlook, int x, int y, int width, int height) { super(x, y, width, height); } /** * By default an {@link org.havi.ui.HVisible} component * is not focus-traversable. * * @return false * @see java.awt.Component#isFocusTraversable */ public boolean isFocusTraversable() { return(false); } /** * Draws the current state of the component, by calling the {@link * org.havi.ui.HLook#showLook} method of the associated * {@link org.havi.ui.HLook}. If no {@link org.havi.ui.HLook} * is associated with the component, (i.e. the {@link * org.havi.ui.HVisible} was created with a null {@link * org.havi.ui.HLook} or the look has been set to null using * {@link org.havi.ui.HVisible#setLook}) then the paint * method should do nothing. This mechanism may be used for * components that wish to extend {@link org.havi.ui.HVisible}, * and override the paint method, without supporting * the {@link org.havi.ui.HLook} interface. * * @param g the graphics context to use for painting. */ public void paint(java.awt.Graphics g) { } /** * The update() method in {@link org.havi.ui.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. * * @param g the graphics context to use for updating. */ public void update(java.awt.Graphics g) { } /** * Sets a single piece of text content for this component, per * state. Different (single pieces of) content can be associated * with the different states of a component. *

* If the {@link org.havi.ui.HVisible} has an associated * {@link org.havi.ui.HLook}, then it should repaint itself. * * @param string The content. If the content is null, then any * currently assigned content shall be removed for the specified * state. * @param 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 {@link * org.havi.ui.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 setTextContent(String string, int state) { } /** * Sets a single piece of graphical content for this component, * per state. Different (single pieces of) content can be * associated with the different states of a component.

Note * that the content is not copied, merely its object reference. *

* If the {@link org.havi.ui.HVisible} has an associated * {@link org.havi.ui.HLook}, then it should repaint itself. * * @param image The content. If the content is null, then any * currently assigned content shall be removed for the specified * state. * @param 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 {@link * org.havi.ui.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) { } /** * Sets an array of graphical content (primarily used for * animation), per state. Different (single arrays of) content * can be associated with the different states of a component.

* Note that the content is not copied, merely its object * reference. *

* If the {@link org.havi.ui.HVisible} has an associated * {@link org.havi.ui.HLook}, then it should repaint itself. * * @param 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. * @param 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 {@link * org.havi.ui.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) { } /** * Sets a single piece of content for this component, per * state. Different (single pieces of) content can be associated * with the different states of a component.

Note that the * content is not copied, merely its object reference. *

* If the {@link org.havi.ui.HVisible} has an associated * {@link org.havi.ui.HLook}, then it should repaint itself. * * @param object The content. If the content is null, then any * currently assigned content shall be removed for the specified * state. * @param 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 {@link * org.havi.ui.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) { } /** * Gets the text content for this component. * * @param state The state for which content is to be retrieved. * Note that content is set on the XXX_STATE * constants defined in {@link org.havi.ui.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. * @return The text content associated with the specified * state. If no text content has been set for the specified state, * then null is returned. */ public String getTextContent(int state) { return(null); } /** * Gets the graphic content for this component. * * @param state The state for which content is to be retrieved. * Note that content is set on the XXX_STATE * constants defined in {@link org.havi.ui.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. * @return The graphical content associated with the specified * state. If no graphical content has been set for the specified * state, then null is returned. */ public Image getGraphicContent(int state) { return(null); } /** * Gets the animate content for this component. * * @param state The state for which content is to be retrieved. * Note that content is set on the XXX_STATE * constants defined in {@link org.havi.ui.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. * @return The animate content associated with the specified * state. If no animate content has been set for the specified * state, then null is returned. */ public Image[] getAnimateContent(int state) { return (null); } /** * Gets the content for this component. * * @param state The state for which content is to be retrieved. * Note that content is set on the XXX_STATE * constants defined in {@link org.havi.ui.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. * @return The content associated with the specified state. If no * content has been set for the specified state, then * null is returned. */ public Object getContent(int state) { return (null); } /** * Sets the {@link org.havi.ui.HLook} for this component. * * @param hlook The {@link org.havi.ui.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. * @exception 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 void setLook(HLook hlook) throws HInvalidLookException { } /** * Gets the {@link org.havi.ui.HLook} for this component. * * @return the {@link org.havi.ui.HLook} that is being used * by this component - if no {@link org.havi.ui.HLook} has * been set, then returns null. */ public HLook getLook() { return (null); } /** * Gets the preferred size of the {@link org.havi.ui.HVisible}. * The getPreferredSize method of the {@link * org.havi.ui.HLook} that is associated with this {@link * org.havi.ui.HVisible} will be called to calculate the * dimensions. * * @return A dimension object indicating this {@link * org.havi.ui.HVisible}'s preferred size - if no * {@link org.havi.ui.HLook} has been associated with the * {@link org.havi.ui.HVisible}, then the current {@link * org.havi.ui.HVisible} dimensions as determined with * getSize will be returned. * @see org.havi.ui.HLook#getPreferredSize */ public Dimension getPreferredSize() { return (null); } /** * Gets the maximum size of the {@link org.havi.ui.HVisible}. * The getMaximumSize method of the {@link * org.havi.ui.HLook} that is associated with this {@link * org.havi.ui.HVisible} will be called to calculate the * dimensions. * * @return A dimension object indicating this {@link * org.havi.ui.HVisible}'s maximum size - if no {@link * org.havi.ui.HLook} has been associated with the {@link * org.havi.ui.HVisible}, then the current {@link * org.havi.ui.HVisible} dimensions as determined with * getSize will be returned. * @see org.havi.ui.HLook#getMaximumSize */ public Dimension getMaximumSize() { return (null); } /** * Gets the minimum size of the {@link org.havi.ui.HVisible}. * The getMinimumSize method of the {@link * org.havi.ui.HLook} that is associated with this {@link * org.havi.ui.HVisible} will be called to calculate the * dimensions. * * @return A dimension object indicating this {@link * org.havi.ui.HVisible}'s minimum size - if no {@link * org.havi.ui.HLook} has been associated with the {@link * org.havi.ui.HVisible}, then the current {@link * org.havi.ui.HVisible} dimensions as determined with * getSize will be returned. * @see org.havi.ui.HLook#getMinimumSize */ public Dimension getMinimumSize() { return (null); } /** * Set the interaction state for this component. This method is * provided for the use by subclasses of {@link * org.havi.ui.HVisible} to change the interaction state * of the {@link org.havi.ui.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. * * @param state the interaction state for this component. A * java.lang.IllegalArgumentException will be thrown * if a STATE_BIT rather than a STATE is * passed. * @see org.havi.ui.HState */ protected void setInteractionState(int state) { } /** * Return the interaction state the component is currently in. * * @return the interaction state the component is currently in. * @see org.havi.ui.HState */ public int getInteractionState() { return (0); } /** * Sets the text layout manager that should be used to layout the * text for this component. * * @param manager the {@link org.havi.ui.HTextLayoutManager} * to be used by this component. */ public void setTextLayoutManager(HTextLayoutManager manager) { } /** * Gets the text layout manager that is being used to layout this * text. * * @return The {@link org.havi.ui.HTextLayoutManager} * that is being used by this component. */ public HTextLayoutManager getTextLayoutManager() { return (null); } /** * Get the background mode of this {@link org.havi.ui.HVisible}. * The return value specifies how the look should draw * the background (i.e. a rectangle filling the bounds of the * {@link org.havi.ui.HVisible}). * * @return one of {@link org.havi.ui.HVisible#NO_BACKGROUND_FILL} * or {@link * org.havi.ui.HVisible#BACKGROUND_FILL}. */ public int getBackgroundMode() { return (NO_BACKGROUND_FILL); } /** * Set the background drawing mode. The value specifies how the * look should draw the background (i.e. a rectangle filling the * bounds of the {@link org.havi.ui.HVisible}). * * @param mode one of {@link * org.havi.ui.HVisible#NO_BACKGROUND_FILL} * or {@link org.havi.ui.HVisible#BACKGROUND_FILL} */ public void setBackgroundMode(int mode) { } /** * Returns true if the entire {@link org.havi.ui.HVisible} * area, as given by the java.awt.Component#getBounds * method, is fully opaque, i.e. its {@link org.havi.ui.HLook} * guarantees that all pixels are painted in an opaque * Color. *

* This method will call the {@link org.havi.ui.HLook#isOpaque} * method of an associated {@link org.havi.ui.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 {@link * org.havi.ui.HVisible}. The consequences of an invalid * overridden value are implementation specific. * * @return true if all the pixels with the * java.awt.Component#getBounds method are fully opaque, i.e. its * associated {@link org.havi.ui.HLook} guarantees that all * pixels are painted in an opaque Color. */ public boolean isOpaque() { return (false); } /** * Set the preferred default size for this component when a layout * manager is in use. *

* 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 {@link * org.havi.ui.HLook#getPreferredSize} * 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 {@link * org.havi.ui.HVisible#NO_DEFAULT_SIZE}, and Dimensions containing {@link * org.havi.ui.HVisible#NO_DEFAULT_WIDTH} or {@link * org.havi.ui.HVisible#NO_DEFAULT_HEIGHT}. * * @param 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 void setDefaultSize(Dimension defaultSize) { } /** * Returns the default preferred size to be used for this component * when a layout manager is in use. If no default size has been * set using the {@link org.havi.ui.HVisible#setDefaultSize} * method {@link * org.havi.ui.HVisible#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. * * @return the default preferred size to be used for this component * when a layout manager is in use. */ public java.awt.Dimension getDefaultSize() { return (null); } /** * Retrieve a look-specific private data object. Instances of * {@link org.havi.ui.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. * * @param 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. * @return a private data object as previously set using {@link * org.havi.ui.HVisible#setLookData}, or * null. * @see org.havi.ui.HLook * @see org.havi.ui.HVisible#setLookData */ public java.lang.Object getLookData(java.lang.Object key) { return (null); } /** * Set a look-specific private data object. Instances of {@link * org.havi.ui.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 {@link * org.havi.ui.HVisible#getLookData} 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. * * @param 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. * @param data a private data object, or null to remove any * current object set on this HVisible. * @see org.havi.ui.HLook * @see org.havi.ui.HVisible#getLookData */ public void setLookData(java.lang.Object key, java.lang.Object data) { } /** * Set the horizontal alignment of any state-based content * rendered by an associated {@link org.havi.ui.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. * * @param halign the new horizontal alignment mode, one of {@link * org.havi.ui.HVisible#HALIGN_LEFT}, {@link * org.havi.ui.HVisible#HALIGN_CENTER}, {@link * org.havi.ui.HVisible#HALIGN_RIGHT} or {@link * org.havi.ui.HVisible#HALIGN_JUSTIFY}. */ public void setHorizontalAlignment(int halign) { } /** * Set the vertical alignment of any state-based content * rendered by an associated {@link org.havi.ui.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. * * @param valign the new vertical alignment mode, one of {@link * org.havi.ui.HVisible#VALIGN_TOP}, {@link * org.havi.ui.HVisible#VALIGN_CENTER}, {@link * org.havi.ui.HVisible#VALIGN_BOTTOM} or {@link * org.havi.ui.HVisible#VALIGN_JUSTIFY}. */ public void setVerticalAlignment(int valign) { } /** * Get the horizontal alignment of any state-based content * rendered by an associated {@link org.havi.ui.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. * * @return the current horizontal alignment mode, one of {@link * org.havi.ui.HVisible#HALIGN_LEFT}, {@link * org.havi.ui.HVisible#HALIGN_CENTER}, {@link * org.havi.ui.HVisible#HALIGN_RIGHT} or {@link * org.havi.ui.HVisible#HALIGN_JUSTIFY}. */ public int getHorizontalAlignment() { return (0); } /** * Get the vertical alignment of any state-based content * rendered by an associated {@link org.havi.ui.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. * * @return the current vertical alignment mode, one of {@link * org.havi.ui.HVisible#VALIGN_TOP}, {@link * org.havi.ui.HVisible#VALIGN_CENTER}, {@link * org.havi.ui.HVisible#VALIGN_BOTTOM} or {@link * org.havi.ui.HVisible#VALIGN_JUSTIFY}. */ public int getVerticalAlignment() { return (0); } /** * Set the resize mode of this HVisible. If the * associated HLook does not render content or if * scaling is not supported, changing the mode may have no visible effect. * * @param resize the new scaling mode, one of {@link * org.havi.ui.HVisible#RESIZE_NONE}, {@link * org.havi.ui.HVisible#RESIZE_PRESERVE_ASPECT} or {@link * org.havi.ui.HVisible#RESIZE_ARBITRARY} */ public void setResizeMode(int resize) { } /** * Get the scaling mode for scaling any state-based content * rendered by an associated {@link org.havi.ui.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. * * @return the current scaling mode, one of {@link * org.havi.ui.HVisible#RESIZE_NONE}, {@link * org.havi.ui.HVisible#RESIZE_PRESERVE_ASPECT} or {@link * org.havi.ui.HVisible#RESIZE_ARBITRARY} */ public int getResizeMode() { return (0); } /** * Modifies the {@link org.havi.ui.HState} of this * {@link org.havi.ui.HVisible} by calling setInteractionState, * depending on the value of b. This method should invoke the superclass * method. * * @param b If true, this * {@link org.havi.ui.HVisible} is enabled; otherwise this * {@link org.havi.ui.HVisible} is disabled. */ public void setEnabled(boolean b) { } /** * The method en- or disables rendering of platform-specific borders. * If enable is true, the associated * {@link org.havi.ui.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 * {@link org.havi.ui.HLook#getInsets} will be zero. *

* The setting shall only be used by {@link org.havi.ui.HAnimateLook}, * {@link org.havi.ui.HGraphicLook} and * {@link org.havi.ui.HTextLook}. Only for these looks shall * {@link org.havi.ui.HLook#widgetChanged} with * {@link org.havi.ui.HVisible#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. * @param enable the new border mode to enable or disable border * rendering * @see #getBordersEnabled */ public void setBordersEnabled(boolean enable) {} /** * Returns the current border mode. Applications should rather call * {@link org.havi.ui.HLook#getInsets} to find out, if any * borders are rendered. * @return the current border mode * @see #setBordersEnabled */ public boolean getBordersEnabled() { return true; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy