Class PlaneMatch

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----UpdatableComponentImpl
                                   |
                                   +----PlaneMatch

class PlaneMatch
extends UpdatableComponentImpl
This class produces an updatable matching component. The matching component contains a color rectangle of matching color inserted in the center of a bigger rectangle of the color being matched.

See Also:
UpdatableComponentImpl

Variable Index

 o match
inner color rectangle (matching color)
 o parent
reference to parent applet

Constructor Index

 o PlaneMatch(Color, Game)
Constructs the matching component.

Method Index

 o insets()
Overrides the default insets() method.
 o minimumSize()
Overrides the default minimumSize() method.
 o preferredSize()
Overrides the default preferredSize() method.
 o reset(Color)
Resets the matching component to the background color for the outer rectangle and parent.rgbLocal color for the inner rectangle.
 o update()
Self-update method that implements UpdatableComponentIfc.
 o update(Graphics)
Overrides the default update(Graphics) method in order not to clear screen to avoid flicker.

Variables

 o parent
 Game parent
reference to parent applet

 o match
 CompColor match
inner color rectangle (matching color)

Constructors

 o PlaneMatch
 public PlaneMatch(Color bg,
                   Game parent)
Constructs the matching component.

Parameters:
bg - background color (color being matched)
parent - reference to the parent applet.

Methods

 o update
 public void update()
Self-update method that implements UpdatableComponentIfc.

Overrides:
update in class UpdatableComponentImpl
See Also:
UpdatableComponentIfc
 o reset
 public void reset(Color bg)
Resets the matching component to the background color for the outer rectangle and parent.rgbLocal color for the inner rectangle.

Parameters:
bg - new background color of the outer rectangle.
 o update
 public void update(Graphics g)
Overrides the default update(Graphics) method in order not to clear screen to avoid flicker.

Overrides:
update in class Component
 o minimumSize
 public Dimension minimumSize()
Overrides the default minimumSize() method.

Returns:
new Dimension
Overrides:
minimumSize in class Container
 o preferredSize
 public Dimension preferredSize()
Overrides the default preferredSize() method.

Returns:
new Dimension
Overrides:
preferredSize in class Container
 o insets
 public Insets insets()
Overrides the default insets() method.

Returns:
new Insets
Overrides:
insets in class Container