    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class jclass.bwt.JCArrowButton

    java.lang.Object
       |
       +----java.awt.Component
               |
               +----java.awt.Canvas
                       |
                       +----jclass.bwt.JCComponent
                               |
                               +----jclass.bwt.JCLabel
                                       |
                                       +----jclass.bwt.JCButton
                                               |
                                               +----jclass.bwt.JCArrowButton

public class JCArrowButton
extends JCButton
implements Runnable

Properties

Name | Method
--- | ---
ArrowSize | setArrowSize
Background | setBackground
DoubleBuffer | setDoubleBuffer
HighlightThickness | setHighlightThickness
InitialRepeatDelay | setInitialRepeatDelay
Insets | setInsets
Orientation | setOrientation
PreferredSize | setPreferredSize
ShadowThickness | setShadowThickness
Traversable | setTraversable
UserData | setUserData

The ShadowThickess is set to 1 and the HighlightThickness is set to 0.

Events

Class | Listener | Description
--- | --- | ---
JCActionEvent | addActionListener | Posted when the button is pressed and then released
JCButtonEvent | addButtonListener | Posted when the button is pressed and released

##

DOWN
LEFT
RIGHT
UP

##

JCArrowButton()
  Creates a DOWN button.
JCArrowButton(int)
  Creates a button with the specified orientation.
JCArrowButton(int, Applet, String)
  Creates a button which reads parameters from the applet's HTML file.

##

armAction(Event)
  Displays the button as pressed in.
disable()
  Disables the component.
disarmAction(Event)
  Displays the button normally.
drawHighlight(Graphics, boolean)
  Don't draw highlight rectangle.
drawShadow(Graphics)
  Draws the shadow (called by paint).
getArrowSize()
  Gets the arrow's size.
getDrawingArea(Rectangle)
  Gets the bounding rectangle of the component's drawing area, (its area minus the shadows and insets).
getInitialRepeatDelay()
  Gets the InitialRepeatDelay value.
getOrientation()
  Gets the direction of the arrow.
getParameters()
  Reads the parameter values from the HTML page using the component's applet.
mouseDown(Event, int, int)
  Calls armAction if btn1 was pressed.
mouseDrag(Event, int, int)
  Calls mouseEnter if cursor is dragged back in the button.
mouseMove(Event, int, int)
  If the label is being displayed in a browser and the mouse is over an URL, the cursor is changed.
mouseUp(Event, int, int)
  If btn1 was pressed and the button is armed, calls disarmAction, clickAction.
paintComponent(Graphics)
  An internal method used to handle repaint events.
preferredHeight()
  Returns ArrowSize height.
preferredWidth()
  Returns ArrowSize width.
run()
  Sends action events if the user continues to press the button.
setArrowSize(Dimension)
  Sets the arrow's size (default: 7x4 (UP/DOWN), 4x7 (LEFT/RIGHT)).
setBackground(Color)
  Sets the background color of the component.

  HTML param name/value: "Background"/Color

setInitialRepeatDelay(int)
  Sets the time (in ms) to wait before sending continuous button press events while the button is pressed and held down.
setOrientation(int)
  Sets the arrow's direction: UP, DOWN (default), LEFT, or RIGHT.

##

UP

     public static final int UP

DOWN

     public static final int DOWN

LEFT

     public static final int LEFT

RIGHT

     public static final int RIGHT

##

JCArrowButton

     public JCArrowButton()

  Creates a DOWN button. No parameters are read from an HTML file.

  See Also:
    setOrientation

JCArrowButton

     public JCArrowButton(int orientation)

  Creates a button with the specified orientation. No parameters are read from an HTML file.

  Parameters:
    orientation - UP, DOWN, LEFT, or RIGHT.
  Throws: IllegalArgumentException
    If an invalid orientation is set

JCArrowButton

     public JCArrowButton(int orientation,
                          Applet applet,
                          String name)

  Creates a button which reads parameters from the applet's HTML file.

  Parameters:
    orientation - UP, DOWN, LEFT, or RIGHT.
    applet - the applet whose PARAM tags are to be read
    name - if this is not null, only parameters preceded by this name are read
  Throws: IllegalArgumentException
    If an invalid value is set
  See Also:
    getParameter

##

getParameters

     protected void getParameters()

  Reads the parameter values from the HTML page using the component's applet. The values will override those previously set.

  Overrides:
    getParameters in class JCButton

setBackground

     public synchronized void setBackground(Color c)

  Sets the background color of the component.

  HTML param name/value: "Background"/Color

  Overrides:
    setBackground in class JCComponent
  See Also:
    toColor

getOrientation

     public int getOrientation()

  Gets the direction of the arrow.

  See Also:
    setOrientation

setOrientation

     public synchronized void setOrientation(int v)

  Sets the arrow's direction: UP, DOWN (default), LEFT, or RIGHT.

  Throws: IllegalArgumentException
    If an invalid value is set

getArrowSize

     public Dimension getArrowSize()

  Gets the arrow's size.

  See Also:
    setArrowSize

setArrowSize

     public synchronized void setArrowSize(Dimension v)

  Sets the arrow's size (default: 7x4 (UP/DOWN), 4x7 (LEFT/RIGHT)).

getInitialRepeatDelay

     public int getInitialRepeatDelay()

  Gets the InitialRepeatDelay value.

  See Also:
    setInitialRepeatDelay

setInitialRepeatDelay

     public void setInitialRepeatDelay(int v)

  Sets the time (in ms) to wait before sending continuous button press events while the button is pressed and held down. If set to BWTEnum.MAXINT (default), events are not sent after the button is pressed.

preferredWidth

     protected int preferredWidth()

  Returns ArrowSize width.

  Overrides:
    preferredWidth in class JCButton

preferredHeight

     protected int preferredHeight()

  Returns ArrowSize height.

  Overrides:
    preferredHeight in class JCButton

drawHighlight

     protected void drawHighlight(Graphics gc,
                                  boolean on)

  Don't draw highlight rectangle.

  Overrides:
    drawHighlight in class JCButton

drawShadow

     protected void drawShadow(Graphics gc)

  Draws the shadow (called by paint).

  Overrides:
    drawShadow in class JCComponent

paintComponent

     protected void paintComponent(Graphics gc)

  An internal method used to handle repaint events.

  Overrides:
    paintComponent in class JCLabel

getDrawingArea

     public void getDrawingArea(Rectangle rect)

  Gets the bounding rectangle of the component's drawing area, (its area minus the shadows and insets).

  Overrides:
    getDrawingArea in class JCComponent

disable

     public synchronized void disable()

  Disables the component.

  Overrides:
    disable in class JCComponent

armAction

     public void armAction(Event ev)

  Displays the button as pressed in. If the InitialRepeatDelay has been set, a timer is started.

  Overrides:
    armAction in class JCButton
  See Also:
    setInitialRepeatDelay

disarmAction

     public void disarmAction(Event ev)

  Displays the button normally. If the InitialRepeatDelay has been set, the timer is stopped.

  Overrides:
    disarmAction in class JCButton
  See Also:
    setInitialRepeatDelay

mouseDrag

     public boolean mouseDrag(Event ev,
                              int x,
                              int y)

  Calls mouseEnter if cursor is dragged back in the button.

  Overrides:
    mouseDrag in class JCButton

mouseMove

     public boolean mouseMove(Event ev,
                              int x,
                              int y)

  If the label is being displayed in a browser and the mouse is over an URL, the cursor is changed.

  Overrides:
    mouseMove in class JCButton

mouseDown

     public boolean mouseDown(Event ev,
                              int x,
                              int y)

  Calls armAction if btn1 was pressed.

  Overrides:
    mouseDown in class JCButton
  See Also:
    armAction

mouseUp

     public boolean mouseUp(Event ev,
                            int x,
                            int y)

  If btn1 was pressed and the button is armed, calls disarmAction, clickAction.

  Overrides:
    mouseUp in class JCButton
  See Also:
    clickAction, disarmAction

run

     public void run()

  Sends action events if the user continues to press the button.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index