org.jdesktop.wonderland.client.hud
Interface HUD

All Superinterfaces:
HUDEventSource, HUDObject

public interface HUD
extends HUDObject

A HUD is a 2D region of the Wonderland client window on which HUD components can be displayed. A client may have multiple HUDs. For example, a Status HUD which displays status information about the user's session, and an Audio HUD for audio controls. A HUD contains HUD components which are visual objects such as a 2D control panel or a representation of a 3D object. HUD components are laid out within a HUD by a HUDLayoutManager.

Author:
nsimpson

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jdesktop.wonderland.client.hud.HUDObject
HUDObject.DisplayMode
 
Method Summary
 void addComponent(HUDComponent component)
          Adds a HUD component to the HUD
 HUDButton createButton(java.lang.String label)
          Creates a new HUD button
 HUDComponent createComponent()
          Creates a new HUD component
 HUDComponent createComponent(HUDDisplayable displayable)
          Creates a new HUD component bound to a HUD displayable
 HUDComponent createComponent(javax.swing.JComponent component)
          Creates a new HUD component bound to a Swing component
 HUDComponent createComponent(javax.swing.JComponent component, Cell cell)
          Creates a new HUD component bound to a Swing component and associated with a Cell
 HUDDialog createDialog(java.lang.String text)
          Creates a new HUD dialog configured as type INFO, with OK and Cancel buttons
 HUDDialog createDialog(java.lang.String text, HUDDialog.MESSAGE_TYPE type, HUDDialog.BUTTONS buttons)
          Creates a new HUD dialog with the specified configuration
 HUDComponent createImageComponent(javax.swing.ImageIcon imageIcon)
          Creates a new HUD component to display an image
 HUDMessage createMessage(java.lang.String message)
          Creates a new HUD message configured as type INFO, with no buttons
 HUDMessage createMessage(java.lang.String text, HUDDialog.MESSAGE_TYPE type, HUDDialog.BUTTONS buttons)
          Creates a new HUD message with the specified configuration
 java.util.Iterator<HUDComponent> getComponents()
          Gets an iterator that will iterate over the HUD's components
 java.awt.Dimension getDisplayBounds()
          Gets the bounds of the display
 java.awt.geom.Rectangle2D.Float getScalableBounds()
          Gets the scalable bounds of the HUD.
 boolean hasComponent(HUDComponent component)
          Gets whether this HUD contains the specified HUD component
 boolean hasComponents()
          Gets whether this HUD has one or more HUD components
 boolean hasScalableBounds()
          Gets whether the HUD bounds are expressed using scalable units.
 void removeComponent(HUDComponent component)
          Removes a component from the HUD
 void setDisplayBounds(java.awt.Dimension displayBounds)
          Sets the bounds of the display that the HUD will be displayed on.
 void setScalableBounds(java.awt.geom.Rectangle2D.Float scalableBounds)
          Sets the bounds of the HUD using percentages of the display bounds, where the x and width are expressed as percentages of the display width (in pixels) and y and height are expressed as percentages of the display height.
 
Methods inherited from interface org.jdesktop.wonderland.client.hud.HUDObject
changeTransparency, changeTransparency, getBounds, getDecoratable, getDisplayMode, getHeight, getIcon, getLocation, getName, getPreferredLocation, getPreferredTransparency, getSize, getTransparency, getWidth, getWorldLocation, getX, getY, hasControl, isEnabled, isMinimized, isVisible, isWorldVisible, setBounds, setBounds, setClosed, setDecoratable, setDisplayMode, setEnabled, setHeight, setIcon, setLocation, setLocation, setLocation, setMaximized, setMinimized, setName, setPreferredLocation, setPreferredTransparency, setSize, setSize, setTransparency, setVisible, setVisible, setWidth, setWorldLocation, setWorldVisible, setWorldVisible, setX, setY
 
Methods inherited from interface org.jdesktop.wonderland.client.hud.HUDEventSource
addEventListener, getEventListeners, notifyEventListeners, notifyEventListeners, removeEventListener
 

Method Detail

setDisplayBounds

void setDisplayBounds(java.awt.Dimension displayBounds)
Sets the bounds of the display that the HUD will be displayed on.

Parameters:
displayBounds - the width and height of the display

getDisplayBounds

java.awt.Dimension getDisplayBounds()
Gets the bounds of the display

Returns:
the display bounds

setScalableBounds

void setScalableBounds(java.awt.geom.Rectangle2D.Float scalableBounds)
Sets the bounds of the HUD using percentages of the display bounds, where the x and width are expressed as percentages of the display width (in pixels) and y and height are expressed as percentages of the display height. Percentages are in range 0.0 - 1.0.

Parameters:
scalableBounds - the bounds of the HUD in percentages

getScalableBounds

java.awt.geom.Rectangle2D.Float getScalableBounds()
Gets the scalable bounds of the HUD.

Returns:
the bounds of the HUD expressed in percentages

hasScalableBounds

boolean hasScalableBounds()
Gets whether the HUD bounds are expressed using scalable units.

Returns:
the scalable bounds of the HUD

createComponent

HUDComponent createComponent()
Creates a new HUD component

Returns:
a new HUD component

createComponent

HUDComponent createComponent(HUDDisplayable displayable)
Creates a new HUD component bound to a HUD displayable

Parameters:
displayable - a displayable to display in this HUD component
Returns:
a new HUD component

createComponent

HUDComponent createComponent(javax.swing.JComponent component)
Creates a new HUD component bound to a Swing component

Parameters:
component - a Swing component to display in this HUD component
Returns:
a new HUD component

createComponent

HUDComponent createComponent(javax.swing.JComponent component,
                             Cell cell)
Creates a new HUD component bound to a Swing component and associated with a Cell

Parameters:
component - a Swing component to display in this HUD component
cell - the cell associated with this HUD component
Returns:
a new HUD component

createDialog

HUDDialog createDialog(java.lang.String text)
Creates a new HUD dialog configured as type INFO, with OK and Cancel buttons

Parameters:
text - the text to display in the dialog
Returns:
a new HUD dialog component

createDialog

HUDDialog createDialog(java.lang.String text,
                       HUDDialog.MESSAGE_TYPE type,
                       HUDDialog.BUTTONS buttons)
Creates a new HUD dialog with the specified configuration

Parameters:
text - the text to display in the dialog
type - the dialog type: INFO, WARNING, ERROR, or QUERY
buttons - which buttons to display: NONE, OK, OK_CANCEL
Returns:
a new HUD dialog component

createMessage

HUDMessage createMessage(java.lang.String message)
Creates a new HUD message configured as type INFO, with no buttons

Parameters:
message - the message to display
Returns:
a new HUD message component

createMessage

HUDMessage createMessage(java.lang.String text,
                         HUDDialog.MESSAGE_TYPE type,
                         HUDDialog.BUTTONS buttons)
Creates a new HUD message with the specified configuration

Parameters:
text - the message to display
type - the dialog type: INFO, WARNING, ERROR, or QUERY
buttons - which buttons to display: NONE, OK, OK_CANCEL
Returns:
a new HUD message component

createButton

HUDButton createButton(java.lang.String label)
Creates a new HUD button

Parameters:
label - the label to display on the button
Returns:
a new HUD button component

createImageComponent

HUDComponent createImageComponent(javax.swing.ImageIcon imageIcon)
Creates a new HUD component to display an image

Parameters:
imageIcon - the image to display
Returns:
a new HUD image component

addComponent

void addComponent(HUDComponent component)
Adds a HUD component to the HUD

Parameters:
component - the component to add

removeComponent

void removeComponent(HUDComponent component)
Removes a component from the HUD

Parameters:
component - the component to remove

getComponents

java.util.Iterator<HUDComponent> getComponents()
Gets an iterator that will iterate over the HUD's components

Returns:
an iterator for HUD components

hasComponent

boolean hasComponent(HUDComponent component)
Gets whether this HUD contains the specified HUD component

Returns:
true if the HUD has the component, false otherwise

hasComponents

boolean hasComponents()
Gets whether this HUD has one or more HUD components

Returns:
true if the HUD has HUD components, false otherwise


Open Wonderland - http://openwonderland.org