All Packages Class Hierarchy This Package Previous Next Index
Class calypso.clients.tv.ImageCanvas
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----calypso.clients.tv.ImageCanvas
- public class ImageCanvas
- extends Canvas
This class implements an imagemap of the remote to help demostration.
The image given in a constructor is displayed on the given canvas,
and is maped by rectangles given in the RECT array. The idea is that
a rectangle is drawn according to cordinates in an array element, if
argument given in method buttonPressed matches the first token of an the
same array element. It is used with the class EventDisplay.
- Author:
- Kim Lahti / TCM laboratory / HUT
- See Also:
- EventDisplay
-
h
- Height of the ImageCanvas.
-
image
- Image object for the canvas.
-
lastrect
- Reference to the last drawn ButtonRectangle.
-
lighton
-
Check variable indicating if the light is on.
-
minSize
- Dimension object holding the minimum size information of the canvas.
-
pappy
- The parent container of the ImageCanvas.
-
RECT
- An array containing the button windows information.
-
rects
- Vector data structure holding the rectangles.
-
t2
- Thread object of the ImageCanvas.
-
trueSizeKnown
- Check variable indicating if the true size of the ImageCanvas is known.
-
w
- Width of the ImageCanvas.
-
ImageCanvas(String, Container, int, int)
- The class constructor, gets the image and the background rectangles.
-
buttonPressed(String)
-
Method to be called when remote notifies an event.
-
dispose()
- A method used to free recourses.
-
findrect(String)
-
A method used to find the right rectangle.
-
getRectangleParameter(String)
- Parse a comma-separated list of a button name and rectangle cordinates.
-
getSize()
- Method to get the images real size.
-
paint(Graphics)
- The paint method to draw the image and the background rectangles.
-
update(Graphics)
- Overriding method update to cause less flickering.
pappy
protected Container pappy
- The parent container of the ImageCanvas.
image
protected Image image
- Image object for the canvas.
trueSizeKnown
protected boolean trueSizeKnown
- Check variable indicating if the true size of the ImageCanvas is known.
minSize
protected Dimension minSize
- Dimension object holding the minimum size information of the canvas.
w
protected int w
- Width of the ImageCanvas.
h
protected int h
- Height of the ImageCanvas.
rects
protected Vector rects
- Vector data structure holding the rectangles.
t2
protected Thread t2
- Thread object of the ImageCanvas.
lighton
protected static boolean lighton
- Check variable indicating if the light is on.
lastrect
protected static ButtonRectangle lastrect
- Reference to the last drawn ButtonRectangle.
RECT
public static final String RECT[]
- An array containing the button windows information.
ImageCanvas
public ImageCanvas(String images_,
Container parent_,
int initialWidth_,
int initialHeight_)
- The class constructor, gets the image and the background rectangles.
- Parameters:
- images_ - The name of the image to be fetched.
- parent_ - The parent container.
- initialWidth_ - The ImageCanvas width.
- initialHeight_ - The ImageCanvas height.
getSize
public synchronized Dimension getSize()
- Method to get the images real size.
- Returns:
- The dimension object holding the requested size.
- Overrides:
- getSize in class Component
paint
public void paint(Graphics g_)
- The paint method to draw the image and the background rectangles.
- Parameters:
- g_ - The graphics object to which Image is to be drawn.
- Overrides:
- paint in class Canvas
update
public void update(Graphics g_)
- Overriding method update to cause less flickering.
- Parameters:
- g_ - The graphics object to which image is to be drawn.
- Overrides:
- update in class Component
getRectangleParameter
public ButtonRectangle getRectangleParameter(String name_)
- Parse a comma-separated list of a button name and rectangle cordinates.
This method is used to parse the RECT array to ButtonRectangle objects,
which are listed into the rects vector.
- Parameters:
- name_ - The name identifying the desired button.
- Returns:
- The newly constructed ButtonRectangle object.
buttonPressed
public void buttonPressed(String command_)
- Method to be called when remote notifies an event.
This method makes the light and the rectangles around the buttons
to work properly.
- Parameters:
- command_ - Event spesific command indicating the pressed button.
findrect
public ButtonRectangle findrect(String command_)
- A method used to find the right rectangle.
- Parameters:
- command_ - Event spesific command indicating the pressed button.
dispose
public void dispose()
- A method used to free recourses.
All Packages Class Hierarchy This Package Previous Next Index