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

Class ncsa.horizon.awt.NumberScrollPanel

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

public class NumberScrollPanel
extends Panel
This class is a labeled and value-displaying horizontal scrollbar. The value is displayed in a TextField which becomes editable or non-editalbe dynamically.

Variable Index

 o label
 o maximum
 o minimum
 o NOT_MATCHED
returned by matchEventTarget() if a match is not made to the input Event target.
 o scroll
 o SCROLLBAR
returned by matchEventTarget() if input Event target matches the scrollbar
 o step
 o value
 o VALUE_FIELD
returned by matchEventTarget() if input Event target matches the value text field

Constructor Index

 o NumberScrollPanel(double, double, double, double, double, String)
Create a scrollbar with label and value fields.
 o NumberScrollPanel(String)
Create a scrollbar with label and value fields.

Method Index

 o action(Event, Object)
 o getLabel()
Get the label value.
 o getLineIncrement()
Get the scrollbar's line increment value.
 o getMaximum()
Get the scrollbar's maximum value.
 o getMinimum()
Get the scrollbar's minimum value.
 o getOrientation()
Get the scrollbar's orientation value.
 o getPageIncrement()
Get the scrollbar's page increment value.
 o getValue()
Get the scrollbar's current value.
 o getVisible()
Get the scrollbar's visible value.
 o handleEvent(Event)
Handle all scrollbar events.
 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 reshape(int, int, int, int)
Make sure all components get resized.
 o setLabel(String)
Set the label.
 o setLineIncrement(int)
Set the scrollbar's line increment value.
 o setPageIncrement(int)
Set the scrollbar's page increment value.
 o setScrollValue(double)
Use a real double value to set scroll value.
 o setValue(double)
Set the scrollbar's value.
 o setValue(int)
Use scroll int value to set the textfield
 o setValues(int, int, int, int)
Set several of the the scrollbar's values.
 o toString()
Get a string representation of the extended scrollbar values.

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
 o SCROLLBAR
  public final static int SCROLLBAR
returned by matchEventTarget() if input Event target matches the scrollbar
 o scroll
  protected Scrollbar scroll
 o label
  protected Label label
 o value
  protected TextField value
 o minimum
  protected double minimum
 o maximum
  protected double maximum
 o step
  protected double step

Constructors

 o NumberScrollPanel
  public NumberScrollPanel(String l)
Create a scrollbar with label and value fields. The maximum value will be 100.
Parameters:
l - The label for the scrollbar.
 o NumberScrollPanel
  public NumberScrollPanel(double minimum,
                           double maximum,
                           double initialValue,
                           double step,
                           double page,
                           String l)
Create a scrollbar with label and value fields.
Parameters:
maximum - The maximum int value.
minimum - The minimum int value.
step - The step to go if clicked on the line up or line down gadget (arrow)
page - The increment to go if click on the track
l - The label for the scrollbar.

Methods

 o action
  public boolean action(Event ev,
                        Object obj)
Overrides:
action in class Component
 o handleEvent
  public boolean handleEvent(Event evt)
Handle all scrollbar events. The associated text field is updated on any scrollbar manipulation. This implementation lets the superclass handle all non-scroll events.
Parameters:
evt - The Scrollbar event to handle.
Returns:
true if event has been handled; false otherwise.
Overrides:
handleEvent 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
  • SCROLLBAR: the target matches the scrollbar
 o getLineIncrement
  public int getLineIncrement()
Get the scrollbar's line increment value.
Returns:
The increment value.
 o getMaximum
  public int getMaximum()
Get the scrollbar's maximum value.
Returns:
The maximum value.
 o getMinimum
  public int getMinimum()
Get the scrollbar's minimum value.
Returns:
The minimum value.
 o getOrientation
  public int getOrientation()
Get the scrollbar's orientation value.
Returns:
The orientation value.
 o getPageIncrement
  public int getPageIncrement()
Get the scrollbar's page increment value.
Returns:
The increment value.
 o getValue
  public double getValue()
Get the scrollbar's current value.
Returns:
The current value.
 o getVisible
  public double getVisible()
Get the scrollbar's visible value.
Returns:
The visible value.
 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 setLineIncrement
  public void setLineIncrement(int l)
Set the scrollbar's line increment value.
Parameters:
l - The line increment value.
 o setPageIncrement
  public void setPageIncrement(int l)
Set the scrollbar's page increment value.
Parameters:
l - The page increment value.
 o setScrollValue
  protected void setScrollValue(double value)
Use a real double value to set scroll value.
 o setValue
  protected void setValue(int scrollValue)
Use scroll int value to set the textfield
 o setValue
  public void setValue(double value)
Set the scrollbar's value.
Parameters:
l - The value.
 o setValues
  public void setValues(int _value,
                        int visible,
                        int minimum,
                        int maximum)
Set several of the the scrollbar's values.
Parameters:
_value - The value.
visible - The visibility value.
minimum - The minimum value.
maximum - The maximum value.
 o setLabel
  public void setLabel(String l)
Set the label.
Parameters:
l - The label value.
 o getLabel
  public String getLabel()
Get the label value.
Returns:
The label.
 o toString
  public String toString()
Get a string representation of the extended scrollbar values.
Returns:
The values of the label and scrollbar.
Overrides:
toString in class Component
 o reshape
  public void reshape(int x,
                      int y,
                      int width,
                      int height)
Make sure all components get resized.
Overrides:
reshape in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index