SilverStream
Application Server 3.5

com.sssw.rt.form
Class AgcButtonRaw

java.lang.Object
 |
 +--java.awt.Component
       |
       +--java.awt.Container
             |
             +--javax.swing.JComponent
                   |
                   +--javax.swing.JPanel
                         |
                         +--com.sssw.rt.atlas.AtPanel
                               |
                               +--com.sssw.rt.form.PvBasePanel
                                     |
                                     +--com.sssw.rt.form.AgcButtonRaw
All Implemented Interfaces:
Accessible, AgiControl, AgiHelpInfo, ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
AgcButtonCheck, AgcButtonImage, AgcButtonRadio

public class AgcButtonRaw
extends PvBasePanel

A SilverStream framework component.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Field Summary
static int IMAGEPOSITION_ABOVE
          The image is positioned above the button text.
static int IMAGEPOSITION_BELOW
          The image is positioned below the button text.
static int IMAGEPOSITION_BENEATH
          The image is positioned underneath the button text.
static int IMAGEPOSITION_LEFT
          The image is positioned to the left of the button text.
static int IMAGEPOSITION_RIGHT
          The image is positioned to the right of the button text.
 
Fields inherited from class com.sssw.rt.atlas.AtPanel
BGIMAGE_DRAW_CENTERED, BGIMAGE_DRAW_NORMAL, BGIMAGE_DRAW_STRETCH, BGIMAGE_DRAW_TILED
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
AgcButtonRaw()
           
 
Method Summary
 void addActionListener(ActionListener listener)
           
 String getButtonGroup()
          Get the button group.
 Image getDisabledDownImage()
          Get the Image that is displayed when the button is disabled and in the pressed state.
 Color getDisabledTextColor()
          Get the color that is used for the button text when the button is disabled.
 Image getDisabledUpImage()
          Get the Image that is displayed when the button is disabled and in the unpressed state.
 Image getDownImage()
          Get the Image that is displayed when the button is in the pressed state.
 String getDownToolTipText()
          Get the tooltip text that is displayed when the button is in the pressed state.
 Color getForeground()
          Gets the color of the button text.
 Image getHoverImage()
          Get the Image that is displayed when the mouse pointer is over the button.
 boolean getHoverMode()
          Get the hover mode.
 Color getHoverTextColor()
          Get the color used for the button text when the mouse pointer is over the button.
 int getImagePosition()
          Get the location of the button image relative to the button text.
 boolean getPush()
          Get the push type.
 boolean getRadio()
          Get the radio type.
 boolean getState()
          Get the state (pressed or unpressed) of the button.
 String getText()
          Get the button text.
 Color getTextBackgroundColor()
          Get the text background color.
 Color getTextColor()
          Deprecated. replaced by AgcButtonRaw.getForeground().
 boolean getToggle()
          Get the toggle type.
 Image getUpImage()
          Get the Image that is displayed when the button is in the unpressed state.
 Object getValue()
          Returns the user-specified Object mapped to the current button state.
 void removeActionListener(ActionListener listener)
           
 void setBackground(Color backgroundcolor)
          Set the background color.
 void setButtonGroup(String buttongroup)
          Set the button group.
 void setCheckedValue(Object value)
          Use this method to set an associated value with the checked state of a button.
 void setDisabledDownImage(Image disableddownimage)
          Set the Image that is displayed when the button is disabled and in the pressed state.
 void setDisabledTextColor(Color disabledtextcolor)
          Set the color that is used for the button text when the button is disabled.
 void setDisabledUpImage(Image disabledupimage)
          Set the Image that is displayed when the button is disabled and in the unpressed state.
 void setDownImage(Image pressedimage)
          Set the Image that is displayed when the button is in the pressed state.
 void setDownToolTipText(String text)
          Set the tooltip text that is displayed when the button is in the pressed state.
 void setForeground(Color textcolor)
          Sets the color of the button text.
 void setHoverImage(Image hoverimage)
          Set the Image that is displayed when the mouse pointer is over the button.
 void setHoverMode(boolean hovermode)
          Set the hover mode.
 void setHoverTextColor(Color hovertextcolor)
          Set the color used for the button text when the mouse pointer is over the button.
 void setImagePosition(int imageposition)
          Set the location of the button image relative to the button text.
 void setPush()
          Set the push type.
 void setRadio()
          Set the radio type.
 void setState(boolean state)
          Set the state (pressed or unpressed) of the button.
 void setText(String text)
          Set the button text.
 void setTextBackgroundColor(Color textbackgroundcolor)
          Set the text background color.
 void setTextColor(Color textcolor)
          Deprecated. use AgcButtonRaw.setForeground(Color) to set the color of the button text.
 void setToggle()
          Set the toggle type.
 void setUncheckedValue(Object value)
          Use this method to set an associated value with the unchecked state of a button.
 void setUpImage(Image image)
          Set the Image that is displayed when the button is in the unpressed state.
 void setValue(Object value)
          Sets the value for an AgcCheckBox or group of AgcButtonRadio buttons.
 void simulateClick()
          Simulate what would happen if the user clicked and released the button.
 
Methods inherited from class com.sssw.rt.form.PvBasePanel
getBackgroundColor, getFontIdentifier, setBackgroundColor, setFontIdentifier
 
Methods inherited from class com.sssw.rt.atlas.AtPanel
addImpl, addNotify, clientPaint, clientPaint, deliverMouseEvent, deliverMouseMoveEvent, doAtCommand, drawTiledImage, enableAtCommands, getBackgroundImage, getBackgroundImageMode, getHelper, getTransparent, hide, hideToolTip, imageUpdate, isFocusTraversable, isOptimizedDrawingEnabled, ownedImage, paintBorder, paintComponent, paintImmediately, paintImmediately, paintNow, preprocessKeyEvent, processEvent, reshape, setBackgroundImage, setBackgroundImageMode, setTransparent, show, showToolTip
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isLightweightComponent, isManagingFocus, isOpaque, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, print, printAll, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods implemented from interface com.sssw.rt.form.AgiControl
getComponent, getHelpInfo, setHelpInfo
 

Field Detail

IMAGEPOSITION_ABOVE

public static final int IMAGEPOSITION_ABOVE
The image is positioned above the button text.
See Also:
AgcButtonRaw.getImagePosition(), AgcButtonRaw.setImagePosition(int)

IMAGEPOSITION_BELOW

public static final int IMAGEPOSITION_BELOW
The image is positioned below the button text.
See Also:
AgcButtonRaw.getImagePosition(), AgcButtonRaw.setImagePosition(int)

IMAGEPOSITION_BENEATH

public static final int IMAGEPOSITION_BENEATH
The image is positioned underneath the button text.
See Also:
AgcButtonRaw.getImagePosition(), AgcButtonRaw.setImagePosition(int)

IMAGEPOSITION_LEFT

public static final int IMAGEPOSITION_LEFT
The image is positioned to the left of the button text. This is the default value.
See Also:
AgcButtonRaw.getImagePosition(), AgcButtonRaw.setImagePosition(int)

IMAGEPOSITION_RIGHT

public static final int IMAGEPOSITION_RIGHT
The image is positioned to the right of the button text.
See Also:
AgcButtonRaw.getImagePosition(), AgcButtonRaw.setImagePosition(int)
Constructor Detail

AgcButtonRaw

public AgcButtonRaw()
Method Detail

addActionListener

public void addActionListener(ActionListener listener)
Parameters:
listener -  

removeActionListener

public void removeActionListener(ActionListener listener)
Parameters:
listener -  

getPush

public boolean getPush()
Get the push type.

setPush

public void setPush()
Set the push type.

getToggle

public boolean getToggle()
Get the toggle type.

setToggle

public void setToggle()
Set the toggle type.

getRadio

public boolean getRadio()
Get the radio type.

setRadio

public void setRadio()
Set the radio type.

getText

public String getText()
Get the button text.
Usage:

Example:
 
See Also:
AgcButtonRaw.setText(String)

setText

public void setText(String text)
Set the button text.
Parameters:
text - the text to set.
Usage:

Example:
 
See Also:
AgcButtonRaw.getText()

getTextColor

public Color getTextColor()
Deprecated. replaced by AgcButtonRaw.getForeground().

Gets the color of the button text.
Usage:

Example:
 
See Also:
AgcButtonRaw.setForeground(Color), AgcButtonRaw.getForeground()

setTextColor

public void setTextColor(Color textcolor)
Deprecated. use AgcButtonRaw.setForeground(Color) to set the color of the button text.

Parameters:
textcolor - an instance of a java.awt.Color object.
Usage:

The text color defaults to the java.awt.Color.black value.

Example:

The following code fragment illustrates how to assign a new hover text color.

 	// Use a light shade of blue for the text color
 	Button1.setDisabledTextColor(new Color(83, 237, 237));
 
See Also:
AgcButtonRaw.getTextColor()

setForeground

public void setForeground(Color textcolor)
Sets the color of the button text.
Overrides:
setForeground in class JComponent
Parameters:
textcolor - an instance of a java.awt.Color object.
Usage:

The text color defaults to the java.awt.Color.black value.

Example:

The following code fragment illustrates how to assign a new text color to a button.

 	// Use a light shade of blue for the text color
 	Button1.setForeground(new Color(83, 237, 237));
 
See Also:
AgcButtonRaw.getForeground()

getForeground

public Color getForeground()
Gets the color of the button text.
Overrides:
getForeground in class Component
Usage:

Example:
 
See Also:
AgcButtonRaw.setForeground(Color)

getHoverTextColor

public Color getHoverTextColor()
Get the color used for the button text when the mouse pointer is over the button.
Usage:

Example:
 
See Also:
AgcButtonRaw.setHoverTextColor(Color)

setHoverTextColor

public void setHoverTextColor(Color hovertextcolor)
Set the color used for the button text when the mouse pointer is over the button.
Parameters:
hovertextcolor - an instance of a java.awt.Color object.
Usage:

The hover text color defaults to the java.awt.Color.white value. The hover text color will not be displayed unless the hover mode is set to true.

Example:

The following code fragment illustrates how to assign a new hover text color.

 	// Use a shade of purple for the hover text
 	Button1.setDisabledTextColor(new Color(129, 24, 231));
 
See Also:
AgcButtonRaw.getHoverTextColor(), AgcButtonRaw.setHoverMode(boolean), AgcButtonRaw.setHoverImage(Image)

getDisabledTextColor

public Color getDisabledTextColor()
Get the color that is used for the button text when the button is disabled.
See Also:
AgcButtonRaw.setDisabledTextColor(Color)

setDisabledTextColor

public void setDisabledTextColor(Color disabledtextcolor)
Set the color that is used for the button text when the button is disabled.
Parameters:
disabletextcolor - an instance of a java.awt.Color object.
Usage:

The disabled text color defaults to the java.awt.Color.gray value.

Example:

The following code fragment illustrates how to assign a new disabled text color.

 	// Use a dark shade of gray for the disabled text
 	Button1.setDisabledTextColor(new Color(128, 128, 128));
 
See Also:
AgcButtonRaw.getDisabledTextColor()

setBackground

public void setBackground(Color backgroundcolor)
Set the background color.
Overrides:
setBackground in class JComponent
Parameters:
backgroundcolor -  

getTextBackgroundColor

public Color getTextBackgroundColor()
Get the text background color.
Usage:

Example:
 
See Also:
AgcButtonRaw.setTextBackgroundColor(Color)

setTextBackgroundColor

public void setTextBackgroundColor(Color textbackgroundcolor)
Set the text background color.
Parameters:
textbackgroundcolor - an instance of a java.awt.Color object.
Usage:

Example:
 
See Also:
AgcButtonRaw.getTextBackgroundColor()

setCheckedValue

public void setCheckedValue(Object value)
Use this method to set an associated value with the checked state of a button.
Parameters:
value -  
Usage:

The value is returned via the getValue() call depending on what state the button is in. Used primarily for Radio and Checkbox buttons.

Example:
 
See Also:
AgcButtonRaw.setUncheckedValue(Object), AgcButtonRaw.getValue()

setUncheckedValue

public void setUncheckedValue(Object value)
Use this method to set an associated value with the unchecked state of a button.
Parameters:
value -  
Usage:

The value is returned via the getValue() call depending on what state the button is in. Used primarily for Checkbox buttons; radio buttons ignore this value.

Example:
 
See Also:
AgcButtonRaw.setCheckedValue(Object), AgcButtonRaw.getValue()

getValue

public Object getValue()
Returns the user-specified Object mapped to the current button state.
Usage:

See Also:
AgcButtonRaw.setValue(Object), AgcButtonRaw.setUncheckedValue(Object), AgcButtonRaw.setCheckedValue(Object)

setValue

public void setValue(Object value)
Sets the value for an AgcCheckBox or group of AgcButtonRadio buttons.
Parameters:
value - an Object that represents the value this button or group should be set to.
Usage:

The state of the checkbox or button group will reflect the set value. For example, for a radio button if the value is equal to the checked value, that radio button will be set, and all other buttons in the group will be unchecked. A call to getValue() on any of the buttons in the group will return this value. It may be that no radio button is checked, if the value set with this method doesn't match any of the radio buttons' checked values.

See Also:
AgcButtonRaw.getValue()

getState

public boolean getState()
Get the state (pressed or unpressed) of the button.
Usage:

The state is true if the button is pressed, false if it is unpressed.

Example:
 
See Also:
AgcButtonRaw.setState(boolean)

setState

public void setState(boolean state)
Set the state (pressed or unpressed) of the button.
Parameters:
state - a boolean value.
Usage:

If the state is set to true if the button appears pressed, if false it appears unpressed.

Example:

The following code fragment illustrates how the button state might be set to reflect a mode in the application (the button will be pressed if the application is in find mode, unpressed if it is not).

 	// call user-defined method to determine the mode
 	boolean findmode = isFindMode();
 	Button1.setState(findmode);
 
See Also:
AgcButtonRaw.getState()

getImagePosition

public int getImagePosition()
Get the location of the button image relative to the button text.
Usage:

For a list of return values, see the fields for this class.

See Also:
AgcButtonRaw.setImagePosition(int)

setImagePosition

public void setImagePosition(int imageposition)
Set the location of the button image relative to the button text.
Parameters:
imageposition - an int value.
Usage:

The image position defaults to IMAGEPOSITION_LEFT. For a list of settable values, see the fields for this class.

Example:

The following code fragment illustrates how to set the image position.

 	// Set the image position such that the button text is drawn below the button image
 	Button1.setImagePosition(AgcButtonRaw.IMAGEPOSITION_ABOVE);
 
See Also:
AgcButtonRaw.getImagePosition()

getButtonGroup

public String getButtonGroup()
Get the button group.

setButtonGroup

public void setButtonGroup(String buttongroup)
Set the button group.
Parameters:
buttongroup - a string identifier for this group.

getUpImage

public Image getUpImage()
Get the Image that is displayed when the button is in the unpressed state.
Usage:

Example:
 
See Also:
AgcButtonRaw.setUpImage(Image)

setUpImage

public void setUpImage(Image image)
Set the Image that is displayed when the button is in the unpressed state.
Parameters:
image - an instance of a java.awt.Image object.
Usage:

Example:

The following code fragment illustrates how to assign an image to a button. This example obtains the image from the current database using the getImage() method.

  Image img;
  img = getImage("up.gif");
  Button1.setUpImage(img);
 
See Also:
AgcButtonRaw.getUpImage()

getDownImage

public Image getDownImage()
Get the Image that is displayed when the button is in the pressed state.
See Also:
AgcButtonRaw.setDownImage(Image)

setDownImage

public void setDownImage(Image pressedimage)
Set the Image that is displayed when the button is in the pressed state.
Parameters:
pressedimage - an instance of a java.awt.Image object.
Usage:

Example:

The following code fragment illustrates how to assign an image to a button. This example obtains the image from the current database using the getImage() method.

  Image img;
  img = getImage("down.gif");
  Button1.setDownImage(img);
 
See Also:
AgcButtonRaw.getDownImage()

getHoverImage

public Image getHoverImage()
Get the Image that is displayed when the mouse pointer is over the button.
See Also:
AgcButtonRaw.setHoverImage(Image)

setHoverImage

public void setHoverImage(Image hoverimage)
Set the Image that is displayed when the mouse pointer is over the button.
Parameters:
hoverimage - an instance of a java.awt.Image object.
Usage:

The hover image will not be displayed unless the hover mode is set to true.

Example:

The following code fragment illustrates how to assign an image to a button. This example obtains the image from the current database using the getImage() method.

  Image img;
  img = getImage("hover.gif");
  Button1.setHoverImage(img);
 
See Also:
AgcButtonRaw.getHoverImage(), AgcButtonRaw.setHoverMode(boolean)

getDisabledUpImage

public Image getDisabledUpImage()
Get the Image that is displayed when the button is disabled and in the unpressed state.
See Also:
AgcButtonRaw.setDisabledUpImage(Image)

setDisabledUpImage

public void setDisabledUpImage(Image disabledupimage)
Set the Image that is displayed when the button is disabled and in the unpressed state.
Parameters:
disabledupimage - an instance of a java.awt.Image object.
Usage:

Example:

The following code fragment illustrates how to assign an image to a button. This example obtains the image from the current database using the getImage() method.

  Image img;
  img = getImage("disabledup.gif");
  Button1.setDisabledUpImage(img);
 
See Also:
AgcButtonRaw.getDisabledUpImage()

getDisabledDownImage

public Image getDisabledDownImage()
Get the Image that is displayed when the button is disabled and in the pressed state.
See Also:
AgcButtonRaw.setDisabledDownImage(Image)

setDisabledDownImage

public void setDisabledDownImage(Image disableddownimage)
Set the Image that is displayed when the button is disabled and in the pressed state.
Parameters:
disableddownimage - an instance of a java.awt.Image object.
Usage:

Example:

The following code fragment illustrates how to assign an image to a button. This example obtains the image from the current database using the getImage() method.

  Image img;
  img = getImage("disableddown.gif");
  Button1.setDisabledDownImage(img);
 
See Also:
AgcButtonRaw.getDisabledDownImage()

setDownToolTipText

public void setDownToolTipText(String text)
Set the tooltip text that is displayed when the button is in the pressed state.
Parameters:
text - a java.lang.String object.
Usage:

If the down tooltip text is not specified, the regular tooltip text is displayed when the button is in the pressed state.

Example:

The following code fragment illustrates how to set the down tooltip text.

 	Button1.setDownToolTipText("Turn off find mode");
 
See Also:
AgcButtonRaw.getDownToolTipText(), AgiControl.setToolTipText(String), AgiControl.getToolTipText()

getDownToolTipText

public String getDownToolTipText()
Get the tooltip text that is displayed when the button is in the pressed state.
See Also:
AgcButtonRaw.setDownToolTipText(String)

getHoverMode

public boolean getHoverMode()
Get the hover mode.
Usage:

The hover mode specifies whether the button image or button text color should change when the mouse pointer is over the button.

Example:
 
See Also:
AgcButtonRaw.setHoverMode(boolean), AgcButtonRaw.setHoverImage(Image), AgcButtonRaw.setHoverTextColor(Color)

setHoverMode

public void setHoverMode(boolean hovermode)
Set the hover mode.
Parameters:
hovermode - a boolean value.
Usage:

When the hover mode is set to true, the hover image and/or the hover text color is displayed when the mouse pointer is over the button).

Example:
 
See Also:
AgcButtonRaw.getHoverMode(), AgcButtonRaw.setHoverImage(Image), AgcButtonRaw.setHoverTextColor(Color)

simulateClick

public void simulateClick()
Simulate what would happen if the user clicked and released the button.
Specified by:
simulateClick in interface com.sssw.rt.form.AgiButton
Usage:

This method causes the application to:

  1. Press/toggle the button
  2. Invalidate the button, so it redraws
  3. Send a PUSHED event
Example:
 

SilverStream
Application Server 3.5