safehome.device
Interface interfaceCamera

All Known Implementing Classes:
DeviceCamera

public interface interfaceCamera

Interface interfaceCamera specifies common methods for a virtual camera class. You may implement this interface if you introduce a new camera class

Author:
cs550 TA

Method Summary
 int getID()
          Gets an camera ID
 BufferedImage getView()
          Gets a current camera view.
 boolean panLeft()
          Turns a camera view left and changes camera angle information.
 boolean panRight()
          Turns a camera view right and changes camera angle information.
 void setID(int id)
          Sets an camera ID and loads an image file for a camera.
 boolean zoomIn()
          Zooms a camera view in and changes camera zoom information.
 boolean zoomOut()
          Zooms a camera view out and changes camera zoom information.
 

Method Detail

setID

void setID(int id)
Sets an camera ID and loads an image file for a camera. The name of a camera image file is camera[ID].jpg. The image file should be in the current working directory. If the image file is not found or loaded, an error message will be shown.

Parameters:
id - a camera ID

getID

int getID()
Gets an camera ID

Returns:
a camera ID

getView

BufferedImage getView()
Gets a current camera view. This method may be periodically invoked to implement a camera movie.

Returns:
an image representing a current camera view and camera information.

panRight

boolean panRight()
Turns a camera view right and changes camera angle information. The limit and step of pan angle depend on the implementing class.

Returns:
true if a camera turns right successfully. Otherwise, false.

panLeft

boolean panLeft()
Turns a camera view left and changes camera angle information. The limit and step of pan angle depend on the implementing class.

Returns:
true if a camera turns left successfully. Otherwise, false.

zoomIn

boolean zoomIn()
Zooms a camera view in and changes camera zoom information. The limit and step of zoom depend on the implementing class.

Returns:
true if a camera zooms in successfully. Otherwise, false.

zoomOut

boolean zoomOut()
Zooms a camera view out and changes camera zoom information. The limit and step of zoom depend on the implementing class

Returns:
true if a camera zooms out successfully. Otherwise, false.