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
-
filter
- Object filter.
-
msg_processor
- A reference to the message processor.
-
rgb
- Reference to the main RGB coordinates.
-
rgbLocal
- Local RGB coordinates used to update components.
-
this_window
- ID assigned to this object when instantiated.
-
updatableComponents
- A Vector of registered updatable components.
-
ColorSpaceFrame(short, RGBCoord, MessageProcessor)
- Constructs the color space framework.
-
handleEvent(Event)
- This method overrides the default event handler.
-
informOthers(int)
- This method is called by a component when it has been changed.
-
receiveObject(Object)
- This method implements the ObjectReceiver interface.
-
recomputeCoordinates()
- This method is called from the ColorSpaceFrame when this frame has to be updated
due to an external event (i.e.
-
registerComponent(UpdatableComponentImpl)
- Registers an updatable component for this frame.
-
updateColorSpaceFrame()
- This method is called when the message processor dispatches
frame-update events.
this_window
protected short this_window
- ID assigned to this object when instantiated.
rgb
protected RGBCoord rgb
- Reference to the main RGB coordinates.
- See Also:
- RGBCoord
rgbLocal
protected RGBCoord rgbLocal
- Local RGB coordinates used to update components.
- See Also:
- RGBCoord
msg_processor
protected MessageProcessor msg_processor
- A reference to the message processor.
- See Also:
- MessageProcessor
updatableComponents
protected Vector updatableComponents
- A Vector of registered updatable components.
filter
public Filter filter
- Object filter. Used to filter mouse motion events.
- See Also:
- Filter
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
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).
registerComponent
protected void registerComponent(UpdatableComponentImpl comp)
- Registers an updatable component for this frame.
- See Also:
- UpdatableComponentImpl
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.
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
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.
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