Class Slider
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Slider

public class netscape.application.Slider
    extends netscape.application.View
{
    /* Constructors
     */
    public Slider();
    public Slider(Rect);
    public Slider(int, int, int, int);

    /* Methods
     */
    public Color backgroundColor();
    public Border border();
    public String command();
    public void decode(Decoder);
    public void describeClassInfo(ClassInfo);
    public void didSizeBy(int, int);
    public void drawView(Graphics);
    public void drawViewGroove(Graphics);
    public void drawViewKnob(Graphics);
    public void encode(Encoder);
    public void finishDecoding();
    public int grooveHeight();
    public Image image();
    public int imageDisplayStyle();
    public boolean isEnabled();
    public int knobHeight();
    public Image knobImage();
    public Rect knobRect();
    public int knobWidth();
    public int maxValue();
    public Size minSize();
    public int minValue();
    public boolean mouseDown(MouseEvent);
    public void mouseDragged(MouseEvent);
    public void sendCommand();
    public void setBackgroundColor(Color);
    public void setBorder(Border);
    public void setCommand(String);
    public void setEnabled(boolean);
    public void setGrooveHeight(int);
    public void setImage(Image);
    public void setImageDisplayStyle(int);
    public void setKnobHeight(int);
    public void setKnobImage(Image);
    public void setLimits(int, int);
    public void setTarget(Target);
    public void setValue(int);
    public Target target();
    public int value();
}
View subclass that implements a "slider," an analog control device that allows the user to drag a knob to select the Slider's value. As the Slider changes its value, it sends a command to its Target.

Constructors

Slider

  public Slider()
Constructs a Slider with origin (0, 0) and zero width and height.

Slider

  public Slider(Rect rect)
Constructs a Slider with bounds rect.

Slider

  public Slider(int x,
                int y,
                int width,
                int height)
Constructs a Slider with bounds (x, y, width, height).

Methods

minSize

  public Size minSize()
Overridden to return the Slider's minimum size.
Overrides:
minSize in class View

setLimits

  public void setLimits(int minValue,
                        int maxValue)
Sets the Slider's minimum and maximum values. Modifies the Slider's current value to fit within this new range (if outside of the range).

minValue

  public int minValue()
Returns the Slider's minimum value.
See Also:
setLimits

maxValue

  public int maxValue()
Returns the Slider's maximum value.
See Also:
setLimits

setKnobImage

  public void setKnobImage(Image anImage)
Sets the Image displayed by the Slider as its "knob." If set, the Slider will display this Image rather than draw a bezeled knob.

knobImage

  public Image knobImage()
Returns the Image displayed by the Slider as its "knob."
See Also:
setKnobImage

setBackgroundColor

  public void setBackgroundColor(Color aColor)
Sets the Color the Slider displays within its groove if it has no image.

backgroundColor

  public Color backgroundColor()
Returns the Color the Slider displays within its groove.
See Also:
setBackgroundColor

setImage

  public void setImage(Image anImage)
Sets the Image the Slider displays within its groove.

image

  public Image image()
Returns the Image the Slider displays within its groove.
See Also:
setImage

setImageDisplayStyle

  public void setImageDisplayStyle(int aStyle)
Tells the Slider how to display its Image (Image.CENTERED, Image.TILED, or Image.SCALED).
See Also:
setImage

imageDisplayStyle

  public int imageDisplayStyle()
Returns the style the Slider uses to display its Image.
See Also:
setImageDisplayStyle

setTarget

  public void setTarget(Target aTarget)
Sets the Slider's Target, the object the Slider notifies when the user changes its value.
See Also:
Target

target

  public Target target()
Returns the Slider's Target.
See Also:
setTarget

setCommand

  public void setCommand(String command)
Sets the command the Slider sends to its Target.
See Also:
setTarget

command

  public String command()
Returns the command the Slider sends to its Target.
See Also:
setCommand

sendCommand

  public void sendCommand()
Called by the Slider to send its command to its Target.
See Also:
setTarget

setEnabled

  public void setEnabled(boolean enabled)
Sets the Slider's "enabled" state and then calls the Slider's draw() method to redraw it. A disabled Slider does not respond to mouse clicks or drags.

isEnabled

  public boolean isEnabled()
Returns true is the Slider is enabled.
See Also:
setEnabled

knobWidth

  public int knobWidth()
Returns the width of the Slider's knob. Override when subclassing if you want to draw a special knob.

setKnobHeight

  public void setKnobHeight(int anInt)
Sets the Slider's knob height.

knobHeight

  public int knobHeight()
Returns the Slider's knob height.
See Also:
setKnobHeight

setGrooveHeight

  public void setGrooveHeight(int anInt)
Sets the Slider's groove height.

grooveHeight

  public int grooveHeight()
Returns the Slider's groove height.
See Also:
setKnobHeight

setBorder

  public void setBorder(Border newBorder)
Sets the Border the Slider draws around its groove.

border

  public Border border()
Returns the Border the Slider draws around its groove.
See Also:
setBorder

setValue

  public void setValue(int aValue)
Sets the Slider's value and redraws the Slider. If less than minValue() or greater than maxValue(), does nothing.

value

  public int value()
Returns the Slider's value.
See Also:
setValue

drawViewGroove

  public void drawViewGroove(Graphics g)
Draws the Slider's groove, which includes its Border and contents. You never call this method directly, but should override it to implement custom groove drawing.

knobRect

  public Rect knobRect()
Returns a Rect containing the Slider's knob.

drawViewKnob

  public void drawViewKnob(Graphics g)
Draws the Slider's knob. You never call this method directly, but should override it to implement custom knob drawing.

drawView

  public void drawView(Graphics g)
Draws the Slider. Calls drawViewGroove() and drawViewKnob().
Overrides:
drawView in class View
See Also:
drawViewGroove, drawViewKnob

didSizeBy

  public void didSizeBy(int deltaWidth,
                        int deltaHeight)
Overridden to reposition the Slider's knob when resized.
Overrides:
didSizeBy in class View

mouseDown

  public boolean mouseDown(MouseEvent event)
Overridden to implement knob dragging and send the Slider's command to its Target.
Overrides:
mouseDown in class View
See Also:
sendCommand

mouseDragged

  public void mouseDragged(MouseEvent event)
Overridden to implement knob dragging and send the Slider's command to its Target.
Overrides:
mouseDragged in class View
See Also:
sendCommand

describeClassInfo

  public void describeClassInfo(ClassInfo info)
Describes the Slider class' information.
Overrides:
describeClassInfo in class View
See Also:
describeClassInfo

encode

  public void encode(Encoder encoder) throws CodingException
Encodes the Slider instance.
Overrides:
encode in class View
See Also:
encode

decode

  public void decode(Decoder decoder) throws CodingException
Decodes the Slider instance.
Overrides:
decode in class View
See Also:
decode

finishDecoding

  public void finishDecoding() throws CodingException
Finishes the Slider instance decoding. Initializes the Slider's value.
Overrides:
finishDecoding in class View
See Also:
finishDecoding

All Packages  Class Hierarchy  This Package  Previous  Next  Index