All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pinball.player.adjustable.AdjustableFlippers

java.lang.Object
   |
   +----pinball.player.adjustable.Adjustments
           |
           +----pinball.player.adjustable.AdjustableFlippers

public class AdjustableFlippers
extends Adjustments
The flipper's zone can be adjusted by the user. Clicking the mouse on the screen, the user can define the zone for the left and right flippers. When the ball goes into the flipper's zone, that flipper flips.


Variable Index

 o fileFound
Was the file found.
 o flippers
The flipper's flip zones.
 o in
Input file, for flipper locations.
 o LEFT
Left flipper.
 o login
Input file, for flipper locations.
 o logout
Output file, for flipper locations.
 o out
Output file, for flipper locations.
 o parent
Who's the canvas to draw on.
 o polygonFilename
File name of the flipper zones.
 o RIGHT
Right flipper.
 o which
Which flipper is being edited.

Constructor Index

 o AdjustableFlippers()

Method Index

 o flipperAddPoint(int, int)
Add a point to the fliper.
 o flipperDelete()
Delete the points for the flipper.
 o flippersSave()
Save the flipper's zones.
 o getLeft()
Get the left flipper.
 o getRight()
Get the right flipper.
 o keyPressed(KeyEvent)
 o keyReleased(KeyEvent)
 o keyTyped(KeyEvent)
Keys are pressed, check them.
 o mouseClicked(MouseEvent)
 o mouseEntered(MouseEvent)
When the mouse is window, make sure the canvas has focus.
 o mouseExited(MouseEvent)
 o mousePressed(MouseEvent)
Mouse is pressed add the location of the mouse to the flipper zone.
 o mouseReleased(MouseEvent)
 o setParent(AdjustableDrawingCanvas)
Set the parent of this object.

Variables

 o LEFT
 private final int LEFT
Left flipper.

 o RIGHT
 private final int RIGHT
Right flipper.

 o which
 private char which
Which flipper is being edited.

 o flippers
 private Polygon flippers[]
The flipper's flip zones.

 o parent
 private AdjustableDrawingCanvas parent
Who's the canvas to draw on.

 o out
 private FileOutputStream out
Output file, for flipper locations.

 o logout
 private ObjectOutputStream logout
Output file, for flipper locations.

 o in
 private FileInputStream in
Input file, for flipper locations.

 o login
 private ObjectInputStream login
Input file, for flipper locations.

 o polygonFilename
 private String polygonFilename
File name of the flipper zones.

 o fileFound
 private boolean fileFound
Was the file found.

Constructors

 o AdjustableFlippers
 public AdjustableFlippers()

Methods

 o setParent
 public void setParent(AdjustableDrawingCanvas parent)
Set the parent of this object. Used to set the focus on the canvas for events.

Parameters:
parent - Window who has the flippers image.
 o mousePressed
 public void mousePressed(MouseEvent event)
Mouse is pressed add the location of the mouse to the flipper zone.

Parameters:
event - the mouse was pressed.
Overrides:
mousePressed in class Adjustments
 o mouseClicked
 public void mouseClicked(MouseEvent event)
Overrides:
mouseClicked in class Adjustments
 o mouseReleased
 public void mouseReleased(MouseEvent event)
Overrides:
mouseReleased in class Adjustments
 o mouseExited
 public void mouseExited(MouseEvent event)
Overrides:
mouseExited in class Adjustments
 o keyPressed
 public void keyPressed(KeyEvent key)
Overrides:
keyPressed in class Adjustments
 o keyReleased
 public void keyReleased(KeyEvent key)
Overrides:
keyReleased in class Adjustments
 o mouseEntered
 public void mouseEntered(MouseEvent event)
When the mouse is window, make sure the canvas has focus.

Parameters:
event - Mouse has entered the window.
Overrides:
mouseEntered in class Adjustments
 o keyTyped
 public void keyTyped(KeyEvent key)
Keys are pressed, check them.

Parameters:
key - the key pressed.
Overrides:
keyTyped in class Adjustments
 o flipperDelete
 private void flipperDelete()
Delete the points for the flipper.

 o flipperAddPoint
 private void flipperAddPoint(int x,
                              int y)
Add a point to the fliper.

Parameters:
x - x location of the point.
y - y location of the point.
 o getLeft
 public Polygon getLeft()
Get the left flipper.

Returns:
the left flipper.
 o getRight
 public Polygon getRight()
Get the right flipper.

Returns:
the right flipper.
 o flippersSave
 public void flippersSave()
Save the flipper's zones.


All Packages  Class Hierarchy  This Package  Previous  Next  Index