Class ncsa.horizon.awt.LabeledField
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.horizon.awt.LabeledField

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----ncsa.horizon.awt.LabeledField

public class LabeledField
extends Panel
A labeled text field.

Variable Index

 o NOT_MATCHED
returned by matchEventTarget() if a match is not made to the input Event target.
 o VALUE_FIELD
returned by matchEventTarget() if input Event target matches the value text field

Constructor Index

 o LabeledField(String)
Create a new labeled text field.
 o LabeledField(String, int)
Create a new labeled text field.

Method Index

 o enable()
Set the textfield sensitive to user input
 o enable(boolean)
Set the textfield sensitive or not sensitive to user input.
 o getLabel()
Get the label.
 o getValue()
Get the text field value.
 o highlight()
 o isEditable()
 o matchEventTarget(Event)
return an id indicating whether the input event target matches either the text field or the scrollbar that makes up this component
 o matchEventTarget(Object)
return an id indicating whether the input event target matches either the text field or the scrollbar that makes up this component
 o mouseEnter(Event, int, int)
 o mouseExit(Event, int, int)
 o setEditable(boolean)
 o setHighlight(boolean)
 o setLabel(String)
Set the label.
 o setValue(double)
Set the text field value.
 o setValue(int)
Set the text field value.
 o setValue(String)
Set the text field value.
 o toString()
Return a String version of the conmponent.

Variables

 o NOT_MATCHED
  public final static int NOT_MATCHED
returned by matchEventTarget() if a match is not made to the input Event target.
 o VALUE_FIELD
  public final static int VALUE_FIELD
returned by matchEventTarget() if input Event target matches the value text field

Constructors

 o LabeledField
  public LabeledField(String l)
Create a new labeled text field.
Parameters:
l - The label for the text field.
 o LabeledField
  public LabeledField(String l,
                      int w)
Create a new labeled text field.
Parameters:
l - The label for the text field.
w - The width of the TextField.

Methods

 o enable
  public void enable()
Set the textfield sensitive to user input
Overrides:
enable in class Component
 o enable
  public void enable(boolean b)
Set the textfield sensitive or not sensitive to user input.
Parameters:
b - If true, set the textfield sensitive to user input. Otherwise, set the textfield insensitive to user input.
Overrides:
enable in class Component
 o getLabel
  public String getLabel()
Get the label.
Returns:
The label for the text field.
 o getValue
  public String getValue()
Get the text field value.
Returns:
The value of the text field.
 o highlight
  public void highlight()
 o isEditable
  public boolean isEditable()
 o mouseEnter
  public boolean mouseEnter(Event event,
                            int x,
                            int y)
Overrides:
mouseEnter in class Component
 o mouseExit
  public boolean mouseExit(Event event,
                           int x,
                           int y)
Overrides:
mouseExit in class Component
 o matchEventTarget
  public int matchEventTarget(Object target)
return an id indicating whether the input event target matches either the text field or the scrollbar that makes up this component
Parameters:
Object - the target object, usually the value of Event.target
Returns:
s int one of the following:
  • NOT_MATCHED: neither component matches the target
  • VALUE_FIELD: the target matches the value field
  • SCROLLBAR: the target matches the scrollbar
 o matchEventTarget
  public int matchEventTarget(Event ev)
return an id indicating whether the input event target matches either the text field or the scrollbar that makes up this component
Parameters:
Event - the event whose target will be checked
Returns:
s int one of the following:
  • NOT_MATCHED: neither component matches the target
  • VALUE_FIELD: the target matches the value field
 o setEditable
  public void setEditable(boolean b)
 o setHighlight
  public void setHighlight(boolean b)
 o setLabel
  public void setLabel(String l)
Set the label.
Parameters:
l - The label for the text field.
 o setValue
  public void setValue(String l)
Set the text field value.
Parameters:
l - The value of the text field.
 o setValue
  public void setValue(double n)
Set the text field value.
Parameters:
n - The value of the text field.
 o setValue
  public void setValue(int n)
Set the text field value.
Parameters:
n - The value of the text field.
 o toString
  public String toString()
Return a String version of the conmponent.
Returns:
The value of the label and text fields.
Overrides:
toString in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index