Horus Doc || Java GUI Reference || Doxygen's quick Index  

ViewerEvent Class Reference

Indicates that something happened in a CanvasViewer. More...

List of all members.

Public Methods

 ViewerEvent (Object sourceCanvas, Object viewer, CanvasObject cObj, int objID, double x, double y)
 Construct viewer event with given parameters. More...

Object getViewer ()
 Get the canvas viewer where the event occured. More...

int getCanvasType ()
 Get the canvas type where the event occured. More...

String getCanvasTypeName ()
 Get the name of canvas type where the event occured. More...

void setCanvasType (int t)
 Set the type of the canvas where the event occured. More...

CanvasObject getCanvasObject ()
 Get the CanvasObject that is the subject of the event. More...

int getObjectID ()
 Get the ID of the object that is the subject to the event. More...

double getXPos ()
 Get the x coordinate of the point where the event occured in the Image Coordinate System. More...

double getYPos ()
 Get the y coordinate of the point where the event occured in the Image Coordinate System. More...

int getXPosPcs ()
 Get the x coordinate of the point where the event occured in the pixel coordinate system, i.e. More...

int getYPosPcs ()
 Get the y coordinate of the point where the event occured in the pixel coordinate system, i.e. More...

int getPoint ()
 Get the point of the figure where the event occured. More...

void setPoint (int p)
 Set the point of the figure where the event occured. More...

String getProp ()
 Get the name of the visual property that changed. More...

void setProp (String p)
 Set the name of the visual property that changed. More...


Static Public Attributes

final int VISUALIZER = 1
 The visualizer canvas. More...

final int EDITOR = 2
 The editor canvas. More...


Detailed Description

Indicates that something happened in a CanvasViewer.


Constructor & Destructor Documentation

ViewerEvent::ViewerEvent Object    sourceCanvas,
Object    viewer,
CanvasObject    cObj,
int    objID,
double    x,
double    y
[inline]
 

Construct viewer event with given parameters.

00036 {
00037     super(sourceCanvas);
00038     _viewer = viewer;
00039     _canvasObj = cObj;
00040     _objID = objID;
00041     _xPos  = x;
00042     _yPos  = y;
00043 }


Member Function Documentation

Object ViewerEvent::getViewer   [inline]
 

Get the canvas viewer where the event occured.

The object is an instance of CanvasViewer.

00050 {
00051     return _viewer;
00052 }

int ViewerEvent::getCanvasType   [inline]
 

Get the canvas type where the event occured.

00058 {
00059     return _canvasType;
00060 }

String ViewerEvent::getCanvasTypeName   [inline]
 

Get the name of canvas type where the event occured.

00066 {
00067     switch (_canvasType) {
00068         case VISUALIZER:    return new String("Visualizer");
00069         case EDITOR:        return new String("Editor");
00070     }
00071     return new String("Unknown");
00072 }

void ViewerEvent::setCanvasType int    t [inline]
 

Set the type of the canvas where the event occured.

00078 {
00079     _canvasType = t;
00080 }

CanvasObject ViewerEvent::getCanvasObject   [inline]
 

Get the CanvasObject that is the subject of the event.

Keep only for the visualization object as the editor may change the object reference.

00088 {
00089     return _canvasObj;
00090 }

int ViewerEvent::getObjectID   [inline]
 

Get the ID of the object that is the subject to the event.

TODO: The ID is invalid (== -1) if the subject is a visualization.

00097 {
00098     return _objID;
00099 }

double ViewerEvent::getXPos   [inline]
 

Get the x coordinate of the point where the event occured in the Image Coordinate System.

00106 {
00107     return _xPos;
00108 }

double ViewerEvent::getYPos   [inline]
 

Get the y coordinate of the point where the event occured in the Image Coordinate System.

00115 {
00116     return _yPos;
00117 }

int ViewerEvent::getXPosPcs   [inline]
 

Get the x coordinate of the point where the event occured in the pixel coordinate system, i.e.

the integer coordinates of the pixel.

00124 {
00125     return Converter.ICStoPCS(_xPos);
00126 }

int ViewerEvent::getYPosPcs   [inline]
 

Get the y coordinate of the point where the event occured in the pixel coordinate system, i.e.

the integer coordinates of the pixel.

00133 {
00134     return Converter.ICStoPCS(_yPos);
00135 }

int ViewerEvent::getPoint   [inline]
 

Get the point of the figure where the event occured.

00141 {
00142     return _point;
00143 }

void ViewerEvent::setPoint int    p [inline]
 

Set the point of the figure where the event occured.

00149 {
00150     _point = p;
00151 }

String ViewerEvent::getProp   [inline]
 

Get the name of the visual property that changed.

00157 {
00158     return _prop;
00159 }

void ViewerEvent::setProp String    p [inline]
 

Set the name of the visual property that changed.

00165 {
00166     _prop = p;
00167 }


Member Data Documentation

final int ViewerEvent::VISUALIZER = 1 [static]
 

The visualizer canvas.

final int ViewerEvent::EDITOR = 2 [static]
 

The editor canvas.


The documentation for this class was generated from the following file:
Generated on Mon Jan 27 15:11:28 2003 for JavaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001