SilverStream
Application Server 3.5

com.sssw.rt.form
Class AgcButtonText

java.lang.Object
 |
 +--java.awt.Component
       |
       +--java.awt.Button
             |
             +--com.sssw.rt.atlas.AtButton
                   |
                   +--com.sssw.rt.form.AgcButtonText
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class AgcButtonText
extends com.sssw.rt.atlas.AtButton

The AgcButtonText control (Text Button), unlike the other buttons in the SilverStream control set, is not a data bound control. Text Button controls let users execute actions.

Typically the programmer defines the actions that execute on the button's actionPerformed event. A Text Button control might be used in a database application where the user presses buttons to add, delete, or navigate records.

Properties:
Cancel Button, Caption Expression, Caption Text, Control Type, Default Button, Enabled, Font Name, Font Size, Font Style, Height, Help Page, Left, Name, Tool Tip, Top, Visible, Width
Events:
actionPerformed, focusGained, focusLost, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased
See Also:
Serialized Form

Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
AgcButtonText()
           
 
Method Summary
 Color getBackgroundColor()
          Deprecated. replaced by Component.getBackground().
 AgoFontIdentifier getFontIdentifier()
          Returns the SilverStream font object (AgoFontIdentifier) for the control's text.
 String getText()
          Gets the text that is displayed on the button.
 Color getTextColor()
          Deprecated. replaced by Component.getForeground().
 void setBackgroundColor(Color backgroundcolor)
          Deprecated. replaced by Component.setBackground(Color).
 void setFontIdentifier(AgoFontIdentifier fontidentifier)
          Assigns the SilverStream font object (AgoFontIdentifier) to the control's text.
 void setText(String text)
          Sets the text that is displayed on the button.
 void setTextColor(Color color)
          Deprecated. replaced by Component.setForeground(Color).
 void simulateClick()
          Simulates the user pressing the text button.
 
Methods inherited from class com.sssw.rt.atlas.AtButton
deliverMouseEvent, deliverMouseMoveEvent, doAtCommand, enableAtCommands, fireActionPerformed, getHelper, getToolTipText, getToolTipText, grabFocus, isFocusTraversable, isRequestFocusEnabled, preprocessKeyEvent, processActionEvent, processEvent, requestFocus, setRequestFocusEnabled, setToolTipText
 
Methods inherited from class java.awt.Button
addActionListener, addNotify, getActionCommand, getLabel, paramString, removeActionListener, setActionCommand, setLabel
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isLightweight, isOpaque, 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, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, 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

AgcButtonText

public AgcButtonText()
Method Detail

getFontIdentifier

public AgoFontIdentifier getFontIdentifier()
Returns the SilverStream font object (AgoFontIdentifier) for the control's text.
Usage:

The AgoFontIdentifier object consists of three parts: a Font Name, a Font Style and a Font Size. The Font Name can be one of these values: Dialog, SansSerif, Serif, Monospaced, Helvetica, TimesRoman, Courier, DialogInput, Zapfdingbats. At runtime, Java translates this value to the appropriate font installed on the system.

The Font Style can be one of these values:

  • AgoFontIdentifier.PLAIN
  • AgoFontIdentifier.BOLD
  • AgoFontIdentifier.ITALIC
  • AgoFontIdentifier.BOLD + AgoFontIdentifier.ITALIC

The Font Size can be any integer.

Example:

The following code fragment illustrates how to construct a new AgoFontIdentifier object (called newFont) and how to call the getFontIdentifier() method:

  AgoFontIdentifier font;
  font = ControlName1.getFontIdentifier();
 
See Also:
AgcButtonText.setFontIdentifier(AgoFontIdentifier)

setFontIdentifier

public void setFontIdentifier(AgoFontIdentifier fontidentifier)
Assigns the SilverStream font object (AgoFontIdentifier) to the control's text.
Parameters:
fontidentifier - specifies the AgoFontIdentifier object that assigns the font for the control.
Usage:

The AgoFontIdentifier object consists of three parts: a Font Name, a Font Style and a Font Size. The Font Name can be one of these values: Dialog, SansSerif, Serif, Monospaced, Helvetica, TimesRoman, Courier, DialogInput, Zapfdingbats. At runtime, Java translates this value to the appropriate font installed on the system.

The Font Style can be one of these values:

  • AgoFontIdentifier.PLAIN
  • AgoFontIdentifier.BOLD
  • AgoFontIdentifier.ITALIC
  • AgoFontIdentifier.BOLD + AgoFontIdentifier.ITALIC

The Font Size can be any integer.

Example:

This code fragment illustrates how to construct a new AgoFontIdentifier object (called newFont) and how to call the setFontIdentifier() method:

  AgoFontIdentifier     newFont;
  String                newName;
  int                   newSize;
  int                   newStyle;
 
  newName="TimesRoman";
  newSize=20;
  newStyle=AgoFontIdentifier.ITALIC;
  newFont=new AgoFontIdentifier(newName, newStyle, newSize);
 
  ControlName1.setFontIdentifier(newFont);
 
See Also:
AgcButtonText.getFontIdentifier()

getText

public String getText()
Gets the text that is displayed on the button. This method is synonymous with the getLabel() method from java.awt.Button.
Overrides:
getText in class com.sssw.rt.atlas.AtButton

setText

public void setText(String text)
Sets the text that is displayed on the button. This method is synonymous with the setLabel() method from java.awt.Button.
Overrides:
setText in class com.sssw.rt.atlas.AtButton

getBackgroundColor

public Color getBackgroundColor()
Deprecated. replaced by Component.getBackground().

Returns the Color object associated with the control's background.
Usage:

Set the control's background Color at runtime using the setBackgroundColor() method.

Example:

This example illustrates how to obtain the background Color of a control.

 Color bgColor;
 bgColor = ControlName1.getBackgroundColor();
 
See Also:
AgcButtonText.setBackgroundColor(Color)

setBackgroundColor

public void setBackgroundColor(Color backgroundcolor)
Deprecated. replaced by Component.setBackground(Color).

Sets the button's background color.
Parameters:
backgroundcolor - the instance of a java.awt.Color object or one of the Color constants, for example, Color.red.
Usage:

For controls that support it, the Transparent property must be false for the background Color to show.

Example:

The following example illustrates how to set the background Color on a control using one of the Color constants:

  ControlName1.setBackgroundColor(Color.white);
 

This example illustrates how to create a new Color and then use it to set the background Color:

  Color colLabelColor = new Color(247, 247, 222);
  ControlName1.setBackgroundColor(colLabelColor);
 
See Also:
AgcButtonText.getBackgroundColor()

getTextColor

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

Gets the title color.
Example:

The following code fragment illustrates how to use the getTextColor() method.

  Color c;
  c = ControlName1.getTextColor();
 
See Also:
AgcButtonText.setTextColor(Color)

setTextColor

public void setTextColor(Color color)
Deprecated. replaced by Component.setForeground(Color).

Sets the title color as an instance of the java.awt.Color to the control's text.
Parameters:
color -  
Example:

The following code fragment illustrates how to set the text Color to red.

  ControlName1.setTextColor(Color.red);
 

simulateClick

public void simulateClick()
Simulates the user pressing the text button. The simulateClick() method causes the actionPerformed event to fire.
Specified by:
simulateClick in interface com.sssw.rt.form.AgiButton
Example:

The following code fragment illustrates how to use the simulateClick() method.

  ControlName1.simulateClick();
 

SilverStream
Application Server 3.5