    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.
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.
mouseDrag(Event, int, int)
mouseUp(Event, int, int)
  If the cursor is within the button, calls clickAction, disarmAction.
paintComponent(Graphics)
  An internal method used to handle repaint events.
preferredHeight()
  Returns ArrowSize height.
preferredWidth()
  Returns ArrowSize width.
run()
  Sends mouseUp events if the user continues to press the button.
setArrowSize(Dimension)
  Sets the arrow's size (default: 7x4 (UP/DOWN), 4x7 (LEFT/RIGHT)).
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 final static int UP

DOWN

      public final static int DOWN

LEFT

      public final static int LEFT

RIGHT

      public final static 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

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

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)

Overrides:
  mouseDrag in class Component

mouseUp

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

  If the cursor is within the button, calls clickAction, disarmAction.

  Overrides:
    mouseUp in class JCButton

run

      public void run()

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

    All Packages  Class Hierarchy  This Package  Previous  Next  Index