org.havi.ui.HToggleButton 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.Dimension;
import java.awt.Graphics;
import java.awt.Image;
/**
The {@link org.havi.ui.HToggleButton} is a user interface
component representing a "check box", or with the support
of the {@link org.havi.ui.HToggleGroup} class,
"radio buttons". It displays static read-only graphical
content. This component can be navigated to, i.e. it can have the
input focus, and it can be actioned as defined by the {@link
org.havi.ui.HSwitchable HSwitchable} interface. This means that the
interaction state persists after {@link
org.havi.ui.event.HActionEvent} event processing is
complete.
The current switchable state can be manipulated using {@link
org.havi.ui.HToggleButton#setSwitchableState}
and {@link org.havi.ui.HToggleButton#getSwitchableState}
By default it uses the {@link org.havi.ui.HGraphicLook} class to
render itself.
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
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
image
The image to be used as the content for every
state of this component.
null
{@link org.havi.ui.HVisible#setGraphicContent setGraphicContent}
{@link org.havi.ui.HVisible#getGraphicContent getGraphicContent}
imageNormal
The image to be used as the content for the {@link
org.havi.ui.HState#NORMAL_STATE HState.NORMAL_STATE} state of
this component.
null
{@link org.havi.ui.HVisible#setGraphicContent setGraphicContent}
{@link org.havi.ui.HVisible#getGraphicContent getGraphicContent}
imageFocused
The image to be used as the content for the
{@link HState#FOCUSED_STATE} and
{@link HState#DISABLED_FOCUSED_STATE} states of this component.
null
{@link org.havi.ui.HVisible#setGraphicContent setGraphicContent}
{@link org.havi.ui.HVisible#getGraphicContent getGraphicContent}
imageActioned
The image to be used as the content for the
{@link HState#ACTIONED_FOCUSED_STATE} and
{@link HState#DISABLED_ACTIONED_FOCUSED_STATE} states of this
component.
null
{@link org.havi.ui.HVisible#setGraphicContent setGraphicContent}
{@link org.havi.ui.HVisible#getGraphicContent getGraphicContent}
imageNormalActioned
The image to be used as the content for the
{@link HState#ACTIONED_STATE} and
{@link HState#DISABLED_ACTIONED_STATE} states of this component.
null
{@link org.havi.ui.HVisible#setGraphicContent setGraphicContent}
{@link org.havi.ui.HVisible#getGraphicContent getGraphicContent}
state
The switchable state of this {@link org.havi.ui.HToggleButton}.
false
{@link org.havi.ui.HToggleButton#setSwitchableState}
{@link org.havi.ui.HToggleButton#getSwitchableState}
group
The {@link org.havi.ui.HToggleGroup} with which to
associate this {@link org.havi.ui.HToggleButton}.
null
{@link org.havi.ui.HToggleButton#setToggleGroup}
{@link org.havi.ui.HToggleButton#getToggleGroup}
Default parameter values not exposed in the constructors
Description Default value Set 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}
The default "look" for this class.
A platform specific {@link org.havi.ui.HGraphicLook HGraphicLook}
{@link org.havi.ui.HToggleButton#setDefaultLook HToggleButton.setDefaultLook}
{@link org.havi.ui.HToggleButton#getDefaultLook HToggleButton.getDefaultLook}
The "look" for this object.
The {@link org.havi.ui.HGraphicLook HGraphicLook} returned from
HToggleButton.getDefaultLook when this object was created.
{@link org.havi.ui.HToggleButton#setLook HToggleButton.setLook}
{@link org.havi.ui.HToggleButton#getLook HToggleButton.getLook}
The gain focus sound.
null
{@link org.havi.ui.HToggleButton#setGainFocusSound setGainFocusSound}
{@link org.havi.ui.HToggleButton#getGainFocusSound getGainFocusSound}
The lose focus sound.
null
{@link org.havi.ui.HToggleButton#setLoseFocusSound setLoseFocusSound}
{@link org.havi.ui.HToggleButton#getLoseFocusSound getLoseFocusSound}
The action sound.
null
{@link org.havi.ui.HToggleButton#setActionSound setActionSound}
{@link org.havi.ui.HToggleButton#getActionSound getActionSound}
The unset action sound.
null
{@link org.havi.ui.HToggleButton#setUnsetActionSound setUnsetActionSound}
{@link org.havi.ui.HToggleButton#getUnsetActionSound getUnsetActionSound}
@see HStaticIcon
@see HIcon
@see HNavigable
@see HActionable
@see HSwitchable
*/
public class HToggleButton
extends HGraphicButton
implements HSwitchable
{
/**
* Creates an {@link org.havi.ui.HToggleButton}
* object. See the class description for details of constructor
* parameters and default values.
*/
public HToggleButton()
{
}
/**
* Creates an {@link org.havi.ui.HToggleButton}
* object. See the class description for details of constructor
* parameters and default values.
*/
public HToggleButton(Image image, int x, int y, int width, int height)
{
}
/**
* Creates an {@link org.havi.ui.HToggleButton}
* object. See the class description for details of constructor
* parameters and default values.
*/
public HToggleButton(Image image)
{
}
/**
* Creates an {@link org.havi.ui.HToggleButton}
* object. See the class description for details of constructor
* parameters and default values.
*/
public HToggleButton(Image image, int x, int y, int width, int height,
boolean state)
{
}
/**
* Creates an {@link org.havi.ui.HToggleButton}
* object. See the class description for details of constructor
* parameters and default values.
*/
public HToggleButton(Image imageNormal, Image imageFocused,
Image imageActioned, Image imageNormalActioned,
int x, int y, int width, int height, boolean state)
{
}
/**
* Creates an {@link org.havi.ui.HToggleButton}
* object. See the class description for details of constructor
* parameters and default values.
*/
public HToggleButton(Image imageNormal, Image imageFocused,
Image imageActioned, Image imageNormalActioned,
boolean state)
{
}
/**
* Creates an {@link org.havi.ui.HToggleButton}
* object. See the class description for details of constructor
* parameters and default values.
*/
public HToggleButton(Image image, int x, int y, int width, int height,
boolean state, HToggleGroup group)
{
}
/**
* Creates an {@link org.havi.ui.HToggleButton}
* object. See the class description for details of constructor
* parameters and default values.
*/
public HToggleButton(Image image, boolean state, HToggleGroup group)
{
}
/**
* Creates an {@link org.havi.ui.HToggleButton}
* object. See the class description for details of constructor
* parameters and default values.
*/
public HToggleButton(Image imageNormal, Image imageFocused,
Image imageActioned, Image imageNormalActioned,
int x, int y, int width, int height, boolean state,
HToggleGroup group)
{
}
/**
* Creates an {@link org.havi.ui.HToggleButton}
* object. See the class description for details of constructor
* parameters and default values.
*/
public HToggleButton(Image imageNormal, Image imageFocused,
Image imageActioned, Image imageNormalActioned,
boolean state, HToggleGroup group)
{
}
/**
* Associates the {@link org.havi.ui.HToggleButton}
* with an {@link org.havi.ui.HToggleGroup}. If this
* {@link org.havi.ui.HToggleButton} is already in a
* different {@link org.havi.ui.HToggleGroup}, it is
* first taken out of that group.
*
* @param group The {@link org.havi.ui.HToggleGroup}
* the {@link org.havi.ui.HToggleButton} is to be
* associated with.
*/
public void setToggleGroup(HToggleGroup group)
{
}
/**
* Gets the {@link org.havi.ui.HToggleGroup} the
* {@link org.havi.ui.HToggleButton} is associated
* with.
*
* @return The {@link org.havi.ui.HToggleGroup} the
* {@link org.havi.ui.HToggleButton} is associated
* with, or null if the {@link org.havi.ui.HToggleButton}
* is not associated with an {@link
* org.havi.ui.HToggleGroup}.
*/
public HToggleGroup getToggleGroup()
{
return (null);
}
/**
* Removes the button from the toggle group that it has been added
* to. This method does nothing if the button had not been
* previously added to an {@link org.havi.ui.HToggleGroup}.
*/
public void removeToggleGroup()
{
}
/**
* Sets the default {@link org.havi.ui.HLook} for further {@link
* org.havi.ui.HToggleButton} components.
*
* @param hlook The {@link org.havi.ui.HLook} that will be
* used by default when creating a new {@link
* org.havi.ui.HToggleButton} component.
* Note that this parameter may be null, in which case newly
* created components shall not draw themselves until a non-null
* look is set using the {@link
* org.havi.ui.HStaticIcon#setLook} method.
*/
public static void setDefaultLook(HGraphicLook hlook)
{
}
/**
* Returns the currently set default {@link org.havi.ui.HLook}
* for {@link org.havi.ui.HToggleButton}
* components.
*
* @return The {@link org.havi.ui.HLook} that is used by
* default when creating a new {@link org.havi.ui.HToggleButton}
* component.
*/
public static HGraphicLook getDefaultLook()
{
return (null);
}
/**
* Returns the current switchable state of this {@link
* org.havi.ui.HSwitchable HSwitchable}.
*
* @return the current switchable state of this {@link
* org.havi.ui.HSwitchable HSwitchable}.
*/
public boolean getSwitchableState()
{
return(false);
}
/**
* Sets the current state of the button. Note that ActionListeners
* are only called when an ACTION_PERFORMED event is received, or
* if they are called directly, e.g. via processActionEvent
,
* they are not called by {@link
* org.havi.ui.HToggleButton#setSwitchableState
* setSwitchableState}.
*/
public void setSwitchableState(boolean state)
{
return;
}
/**
* Associate a sound to be played when the interaction state of
* the {@link org.havi.ui.HSwitchable HSwitchable} makes the
* following transitions:
*
* - {@link org.havi.ui.HState#ACTIONED_STATE ACTIONED_STATE} to {@link org.havi.ui.HState#NORMAL_STATE NORMAL_STATE}
*
- {@link org.havi.ui.HState#ACTIONED_FOCUSED_STATE ACTIONED_FOCUSED_STATE} to {@link org.havi.ui.HState#FOCUSED_STATE FOCUSED_STATE}
*
*
* @param sound a sound to be played when the {@link
* org.havi.ui.HSwitchable HSwitchable} transitions from an
* actioned state. If sound content is already set, the original
* content is replaced. To remove the sound specify a null {@link
* org.havi.ui.HSound HSound}.
*/
public void setUnsetActionSound(HSound sound)
{
return;
}
/**
* Get the sound to be played when the interaction state of
* the {@link org.havi.ui.HSwitchable HSwitchable} makes the
* following transitions:
*
* - {@link org.havi.ui.HState#ACTIONED_STATE ACTIONED_STATE} to {@link org.havi.ui.HState#NORMAL_STATE NORMAL_STATE}
*
- {@link org.havi.ui.HState#ACTIONED_FOCUSED_STATE ACTIONED_FOCUSED_STATE} to {@link org.havi.ui.HState#FOCUSED_STATE FOCUSED_STATE}
*
*
* @return the sound to be played when the {@link
* org.havi.ui.HSwitchable HSwitchable} transitions from an
* actioned state.
*/
public HSound getUnsetActionSound()
{
return(null);
}
}