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.
-
label
-
-
maximum
-
-
minimum
-
-
NOT_MATCHED
- returned by matchEventTarget() if a match is not made to the
input Event target.
-
scroll
-
-
SCROLLBAR
- returned by matchEventTarget() if input Event target matches
the scrollbar
-
step
-
-
value
-
-
VALUE_FIELD
- returned by matchEventTarget() if input Event target matches
the value text field
-
NumberScrollPanel(double, double, double, double, double, String)
- Create a scrollbar with label and value fields.
-
NumberScrollPanel(String)
- Create a scrollbar with label and value fields.
-
action(Event, Object)
-
-
getLabel()
- Get the label value.
-
getLineIncrement()
- Get the scrollbar's line increment value.
-
getMaximum()
- Get the scrollbar's maximum value.
-
getMinimum()
- Get the scrollbar's minimum value.
-
getOrientation()
- Get the scrollbar's orientation value.
-
getPageIncrement()
- Get the scrollbar's page increment value.
-
getValue()
- Get the scrollbar's current value.
-
getVisible()
- Get the scrollbar's visible value.
-
handleEvent(Event)
- Handle all scrollbar events.
-
matchEventTarget(Event)
- return an id indicating whether the input event target matches
either the text field or the scrollbar that makes up this component
-
matchEventTarget(Object)
- return an id indicating whether the input event target matches
either the text field or the scrollbar that makes up this component
-
mouseEnter(Event, int, int)
-
-
mouseExit(Event, int, int)
-
-
reshape(int, int, int, int)
- Make sure all components get resized.
-
setLabel(String)
- Set the label.
-
setLineIncrement(int)
- Set the scrollbar's line increment value.
-
setPageIncrement(int)
- Set the scrollbar's page increment value.
-
setScrollValue(double)
- Use a real double value to set scroll value.
-
setValue(double)
- Set the scrollbar's value.
-
setValue(int)
- Use scroll int value to set the textfield
-
setValues(int, int, int, int)
- Set several of the the scrollbar's values.
-
toString()
- Get a string representation of the extended scrollbar values.
NOT_MATCHED
public final static int NOT_MATCHED
- returned by matchEventTarget() if a match is not made to the
input Event target.
VALUE_FIELD
public final static int VALUE_FIELD
- returned by matchEventTarget() if input Event target matches
the value text field
SCROLLBAR
public final static int SCROLLBAR
- returned by matchEventTarget() if input Event target matches
the scrollbar
scroll
protected Scrollbar scroll
label
protected Label label
value
protected TextField value
minimum
protected double minimum
maximum
protected double maximum
step
protected double step
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.
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.
action
public boolean action(Event ev,
Object obj)
- Overrides:
- action in class Component
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
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
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
getLineIncrement
public int getLineIncrement()
- Get the scrollbar's line increment value.
- Returns:
- The increment value.
getMaximum
public int getMaximum()
- Get the scrollbar's maximum value.
- Returns:
- The maximum value.
getMinimum
public int getMinimum()
- Get the scrollbar's minimum value.
- Returns:
- The minimum value.
getOrientation
public int getOrientation()
- Get the scrollbar's orientation value.
- Returns:
- The orientation value.
getPageIncrement
public int getPageIncrement()
- Get the scrollbar's page increment value.
- Returns:
- The increment value.
getValue
public double getValue()
- Get the scrollbar's current value.
- Returns:
- The current value.
getVisible
public double getVisible()
- Get the scrollbar's visible value.
- Returns:
- The visible value.
mouseEnter
public boolean mouseEnter(Event event,
int x,
int y)
- Overrides:
- mouseEnter in class Component
mouseExit
public boolean mouseExit(Event event,
int x,
int y)
- Overrides:
- mouseExit in class Component
setLineIncrement
public void setLineIncrement(int l)
- Set the scrollbar's line increment value.
- Parameters:
- l - The line increment value.
setPageIncrement
public void setPageIncrement(int l)
- Set the scrollbar's page increment value.
- Parameters:
- l - The page increment value.
setScrollValue
protected void setScrollValue(double value)
- Use a real double value to set scroll value.
setValue
protected void setValue(int scrollValue)
- Use scroll int value to set the textfield
setValue
public void setValue(double value)
- Set the scrollbar's value.
- Parameters:
- l - The value.
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.
setLabel
public void setLabel(String l)
- Set the label.
- Parameters:
- l - The label value.
getLabel
public String getLabel()
- Get the label value.
- Returns:
- The label.
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
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