org.havi.ui
Class HComponent

java.lang.Object
  extended byjava.awt.Component
      extended byorg.havi.ui.HComponent
All Implemented Interfaces:
HMatteLayer, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, TestOpacity
Direct Known Subclasses:
HVideoComponent, HVisible

public abstract class HComponent
extends java.awt.Component
implements HMatteLayer, TestOpacity

The HComponent class extends the java.awt.Component class by implementing the HMatteLayer interface.


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 (HMatte). none (i.e. getMatte() returns null) setMatte getMatte

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
HComponent()
          Creates an HComponent object.
HComponent(int x, int y, int width, int height)
          Creates an HComponent object.
 
Method Summary
 HMatte getMatte()
          Get any HMatte currently associated with this component.
 boolean isDoubleBuffered()
          Returns true if all the drawing done during the update and paint methods for this specific HComponent object is automatically double buffered.
 boolean isEnabled()
          Determines whether this HComponent is enabled.
 boolean isOpaque()
          Returns true if the entire HComponent area, as given by the java.awt.Component#getBounds method, is fully opaque, i.e. its paint method (or surrogate methods) guarantee that all pixels are painted in an opaque Color.
protected  void processEvent(java.awt.AWTEvent evt)
          The implementation of the method HComponent.processEvent() shall ensure that key events which are translated to HAVi events shall not be reported to processKeyEvent() or reported to KeyListeners.
 void setEnabled(boolean b)
          Enables or disables this component, depending on the value of the parameter b.
 void setMatte(HMatte m)
          Applies an HMatte to this component, for matte compositing.
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, bounds, checkImage, checkImage, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, getAlignmentX, getAlignmentY, getBackground, getBounds, getColorModel, getComponentAt, getComponentAt, getCursor, getFont, getFontMetrics, getForeground, getGraphics, getLocale, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, invalidate, isFocusTraversable, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setCursor, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HComponent

public HComponent()
Creates an HComponent object. See the class description for details of constructor parameters and default values.


HComponent

public HComponent(int x,
                  int y,
                  int width,
                  int height)
Creates an HComponent object. See the class description for details of constructor parameters and default values.

Method Detail

setMatte

public void setMatte(HMatte m)
              throws HMatteException
Applies an HMatte to this component, for matte compositing. Any existing animated matte must be stopped before this method is called or an HMatteException will be thrown.

Specified by:
setMatte in interface HMatteLayer
Parameters:
m - The HMatte to be applied to this component -- note that only one matte may be associated with the component, thus any previous matte will be replaced. If m is null, then any matte associated with the component is removed and further calls to getMatte() shall return null. The component shall behave as if it had a fully opaque HFlatMatte associated with it (i.e an HFlatMatte with the default value of 1.0.)
Throws:
HMatteException - if the HMatte cannot be associated with the component. This can occur:
  • if the specific matte type is not supported
  • if the platform does not support any matte type
  • if the component is associated with an already running HFlatEffectMatte or HImageEffectMatte. The exception is thrown even if m is null.
See Also:
HMatte

getMatte

public HMatte getMatte()
Get any HMatte currently associated with this component.

Specified by:
getMatte in interface HMatteLayer
Returns:
the HMatte currently associated with this component or null if there is no associated matte.

isDoubleBuffered

public boolean isDoubleBuffered()
Returns true if all the drawing done during the update and paint methods for this specific HComponent object is automatically double buffered.

Returns:
true if all the drawing done during the update and paint methods for this specific HComponent object is automatically double buffered, or false if drawing is not double buffered. The default value for the double buffering setting is platform-specific.

isOpaque

public boolean isOpaque()
Returns true if the entire HComponent area, as given by the java.awt.Component#getBounds method, is fully opaque, i.e. its paint method (or surrogate methods) guarantee that all pixels are painted in an opaque Color.

By default, the return value is false. The return value should be overridden by subclasses that can guarantee full opacity. The consequences of an invalid overridden value are implementation specific.

Specified by:
isOpaque in interface TestOpacity
Returns:
true if all the pixels within the area given by the java.awt.Component#getBounds method are fully opaque, i.e. its paint method (or surrogate methods) guarantee that all pixels are painted in an opaque Color, otherwise false.

setEnabled

public void setEnabled(boolean b)
Enables or disables this component, depending on the value of the parameter b. HComponents which are disabled will still generate and respond to HFocusEvent if they implement HNavigationInputPreferred. They will not generate or respond to HActionEvent, HAdjustmentEvent, HItemEvent, HKeyEvent or HTextEvent. (This method should not invoke the superclass method.) HComponents are enabled initially by default.

If a widget implementing HKeyboardInputPreferred is disabled while in edit mode, it will automatically set edit mode to false and generate an HTextEvent.TEXT_END_CHANGE. Calls to setEditMode() should be ignored while being disabled.

If a widget implementing HAdjustmentInputPreferred is disabled while in adjust mode, it will automatically set adjust mode to false and generate an HAdjustmentEvent.ADJUST_END_CHANGE. Calls to setAdjustMode() should be ignored while being disabled.

If a widget implementing HSelectionInputPreferred is disabled while in selection mode, it will automatically set selection mode to false and generate an HItemEvent.ITEM_END_CHANGE. Calls to setSelectionMode() should be ignored while being disabled.

Parameters:
b - If true, this HComponent is enabled; otherwise this HComponent is disabled.

isEnabled

public boolean isEnabled()
Determines whether this HComponent is enabled. An HComponent may be enabled or disabled by calling its setEnabled method.

Returns:
true if the HComponent is enabled; false otherwise.

processEvent

protected void processEvent(java.awt.AWTEvent evt)
The implementation of the method HComponent.processEvent() shall ensure that key events which are translated to HAVi events shall not be reported to processKeyEvent() or reported to KeyListeners. Key events which are not translated to HAVi events shall be reported to processKeyEvent() and KeyListeners as defined in the Java specification.

NOTE: If applications override processEvent they may terminally disturb these processes. Applications should not do this without extreme care, as the results may be very implementation dependent.

Parameters:
evt - the java.awt.AWTEvent to handle.