Class ColorSpaceFrame

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Frame
                                   |
                                   +----ColorSpaceFrame

public class ColorSpaceFrame
extends Frame
implements ObjectReceiver
Class from which all color space frames are derived. It communicates with the message processor and maintains a list of registered updatable components.

See Also:
ObjectReceiver

Variable Index

 o filter
Object filter.
 o msg_processor
A reference to the message processor.
 o rgb
Reference to the main RGB coordinates.
 o rgbLocal
Local RGB coordinates used to update components.
 o this_window
ID assigned to this object when instantiated.
 o updatableComponents
A Vector of registered updatable components.

Constructor Index

 o ColorSpaceFrame(short, RGBCoord, MessageProcessor)
Constructs the color space framework.

Method Index

 o handleEvent(Event)
This method overrides the default event handler.
 o informOthers(int)
This method is called by a component when it has been changed.
 o receiveObject(Object)
This method implements the ObjectReceiver interface.
 o recomputeCoordinates()
This method is called from the ColorSpaceFrame when this frame has to be updated due to an external event (i.e.
 o registerComponent(UpdatableComponentImpl)
Registers an updatable component for this frame.
 o updateColorSpaceFrame()
This method is called when the message processor dispatches frame-update events.

Variables

 o this_window
 protected short this_window
ID assigned to this object when instantiated.

 o rgb
 protected RGBCoord rgb
Reference to the main RGB coordinates.

See Also:
RGBCoord
 o rgbLocal
 protected RGBCoord rgbLocal
Local RGB coordinates used to update components.

See Also:
RGBCoord
 o msg_processor
 protected MessageProcessor msg_processor
A reference to the message processor.

See Also:
MessageProcessor
 o updatableComponents
 protected Vector updatableComponents
A Vector of registered updatable components.

 o filter
 public Filter filter
Object filter. Used to filter mouse motion events.

See Also:
Filter

Constructors

 o ColorSpaceFrame
 public ColorSpaceFrame(short this_window,
                        RGBCoord rgb,
                        MessageProcessor msg_processor)
Constructs the color space framework.

Parameters:
this_window - ID assigned to this frame
rgb - reference to the main RGB coordinates
msg_processor - reference to the message processor
See Also:
RGBCoord, MessageProcessor

Methods

 o recomputeCoordinates
 protected void recomputeCoordinates()
This method is called from the ColorSpaceFrame when this frame has to be updated due to an external event (i.e. other frame sent a message). Must be overridden in a subclass. This method uses rgbLocal, not rgb (which is volatile).

 o registerComponent
 protected void registerComponent(UpdatableComponentImpl comp)
Registers an updatable component for this frame.

See Also:
UpdatableComponentImpl
 o updateColorSpaceFrame
 public void updateColorSpaceFrame()
This method is called when the message processor dispatches frame-update events. Computes space-dependent coordinates and updates only if changed and valid.

 o informOthers
 void informOthers(int from_id)
This method is called by a component when it has been changed. If the change resulted in valid RGB values, a filtered event will be dispatched to the message processor.

See Also:
ColorSpaceMsg
 o receiveObject
 public void receiveObject(Object obj)
This method implements the ObjectReceiver interface. A thinned event is passed to the message processor.

Parameters:
obj - an instance of ColorSpaceMsg.
 o handleEvent
 public boolean handleEvent(Event e)
This method overrides the default event handler. It is used to catch WINDOW_DESTROY events and notify the message processor to dispose of this window.

Overrides:
handleEvent in class Component