Class Bar
Class Bar
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----Bar
- class Bar
- extends Canvas
-
Bar(int, int)
- Constructs a Bar with button count and direction
-
clearCell(Graphics, int)
- clear button
-
getButtonIndex(int, int)
- get button's index by position
-
getCellInterior(int, boolean)
- get drawing area of a button
-
getCellPos(int)
- get left top point of button's area
-
getCellRect(int)
- get area of a button
-
getDimension()
-
-
isButtonUp(int)
- return the button state
-
mouseDown(Event, int, int)
-
-
mouseMove(Event, int, int)
-
-
paint(Graphics)
- set help string
-
pressButton(int)
- called when mouse downd the button
Bar
public Bar(int count,
int direction)
- Constructs a Bar with button count and direction
- Parameters:
- count - : button's count
- direction - : bars direction (VERTICAL, HORIZONTAL)
pressButton
public abstract void pressButton(int i)
- called when mouse downd the button
- Parameters:
- g - : graphics
- i - : button index in Bar
- rc - : drawing area
isButtonUp
public abstract boolean isButtonUp(int i)
- return the button state
- Parameters:
- i - : button index in Bar
- Returns:
- : true if button is up state
getDimension
public Dimension getDimension()
paint
public void paint(Graphics g)
- set help string
- Parameters:
- help - : help String
- Overrides:
- paint in class Canvas
clearCell
public void clearCell(Graphics g,
int i)
- clear button
- Parameters:
- g - : graphics
- i - : button index in Bar
getCellRect
public Rectangle getCellRect(int i)
- get area of a button
- Parameters:
- i - : button index in Bar
- Returns:
- button's area
getCellInterior
public Rectangle getCellInterior(int i,
boolean isUp)
- get drawing area of a button
- Parameters:
- i - : button index in Bar
- isUp - : state of button
- Returns:
- button's area
getCellPos
public Point getCellPos(int i)
- get left top point of button's area
- Parameters:
- i - : button index in Bar
- Returns:
- left top point of button's area
getButtonIndex
protected int getButtonIndex(int x,
int y)
- get button's index by position
- Parameters:
- x: - x position
- y: - y position
- Returns:
- button's index
mouseDown
public boolean mouseDown(Event e,
int x,
int y)
- Overrides:
- mouseDown in class Component
mouseMove
public boolean mouseMove(Event e,
int x,
int y)
- Overrides:
- mouseMove in class Component