Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

IcsCanvas Class Reference

The root of the canvas hierarchy. More...

Inheritance diagram for IcsCanvas::

LayeredCanvas VisCanvas ActiveCanvas ScribbleCanvas ThumbnailCanvas List of all members.

Public Methods

Dimension getDimensionICS ()
 Get the dimension of the canvas in ICS (the unzoomed canvas). More...

void setDimensionICS (Dimension d)
 Set the dimension of the canvas in ICS (the unzoomed canvas). More...

Dimension getDimensionCCS ()
 Get the dimension of the canvas in CCS (the zoomed canvas). More...

void setDimensionCCS (Dimension d)
 Set the dimension of the canvas in CCS (the zoomed canvas). More...

Dimension getObjectExtent ()
 Get the extent of all objects on the canvas. More...

void setObjectExtent (Dimension d)
 Set the extent of all objects on the canvas. More...

Dimension getViewportSize ()
 Get the dimension of the viewport. More...

void checkViewportSize (Dimension d)
 This function will be called by the scrollpane upon change events. More...

Dimension getMinimumSize ()
 Overrides Component interface. More...

Dimension getPreferredSize ()
 Overrides JComponent interface. More...

int getID ()
double getZoomFactor ()
void setZoomFactor (double zoomFactor)
Color getBackgroundColor ()
void setBackgroundColor (Color c)
Color getDefaultDrawColor ()
void setDefaultDrawColor (Color color)
void setUser (IcsCanvasUser user)
void drawBackground ()
 Draw the background color on the entire canvas. More...

void zoom (double zoomVal)
 Zoom to the given value. More...

void doPaintComponent (Graphics bufGraphics)
 Paint the component in the given graphics. More...

void handleMousePress (MouseEvent e)
 Interface for MouseListener events, called by LayeredCanvasPane. More...

void handleMouseEnter (MouseEvent e)
void handleMouseExit (MouseEvent e)
void handleMouseClick (MouseEvent e)
void handleMouseRelease (MouseEvent e)
void handleMouseMove (MouseEvent e)
 Interface for MouseMotionListener events, called by LayeredCanvasPane. More...

void handleMouseDrag (MouseEvent e)

Static Public Attributes

final Color STD_BCOLOR = Color.white
final Color STD_DCOLOR = Color.red
final int MIN_SIZE = 3
final int EXT_MARGIN = 0
final double STD_ZOOM = 1.0f
boolean DEBUG_LAYOUT = false
boolean DEBUG_EVENTS = false

Protected Methods

void dump ()

Detailed Description

The root of the canvas hierarchy.

IcsCanvas takes care of the sizing of all canvas specializations. It also "communicates" the screen size to "Swing", typically in conjunction with LayeredCanvasPane. For IcsCanvas, this is done typically via getPreferredSize, handleSetSize, and setSize.

The "size" of a canvas has many interpretations that should all be kept in sync: _dimICS : the size of the canvas in the Image Coordinate System (ICS) _dimCCS : the size of the canvas in the Canvas Coordinate System (CCS) _objectExtent : the extent of all objects on the canvas (in ICS) _viewportSize : the size of the viewport on the screen (in CCS)

Upon construction, a canvas may have a default size in ICS. Also, the size may declared to be fixed. The ICS dimension of a fixed size canvas will not change during its lifetime. This is typically used for thumbnails.

The following rules define the sizing behaviour of the canvas:


Member Function Documentation

Dimension IcsCanvas::getDimensionICS   [inline]
 

Get the dimension of the canvas in ICS (the unzoomed canvas).

void IcsCanvas::setDimensionICS Dimension    d [inline]
 

Set the dimension of the canvas in ICS (the unzoomed canvas).

Actually, the "set" may not succeed at all (e.g. if the canvas is fixed) or only partially. In any case, the CCS will be adjusted accordingly. Also calls super.setSize to inform Java of changes.

Dimension IcsCanvas::getDimensionCCS   [inline]
 

Get the dimension of the canvas in CCS (the zoomed canvas).

void IcsCanvas::setDimensionCCS Dimension    d [inline]
 

Set the dimension of the canvas in CCS (the zoomed canvas).

Is done via setDimensionICS.

Dimension IcsCanvas::getObjectExtent   [inline]
 

Get the extent of all objects on the canvas.

void IcsCanvas::setObjectExtent Dimension    d [inline]
 

Set the extent of all objects on the canvas.

Also does a setDimensionICS to update the size of the canvas.

Dimension IcsCanvas::getViewportSize   [inline]
 

Get the dimension of the viewport.

void IcsCanvas::checkViewportSize Dimension    d [inline]
 

This function will be called by the scrollpane upon change events.

Also updates the size of the canvas via setDimensionICS.

Dimension IcsCanvas::getMinimumSize   [inline]
 

Overrides Component interface.

Dimension IcsCanvas::getPreferredSize   [inline]
 

Overrides JComponent interface.

Returns the object extent.

int IcsCanvas::getID   [inline]
 

double IcsCanvas::getZoomFactor   [inline]
 

void IcsCanvas::setZoomFactor double    zoomFactor [inline]
 

Color IcsCanvas::getBackgroundColor   [inline]
 

void IcsCanvas::setBackgroundColor Color    c [inline]
 

Color IcsCanvas::getDefaultDrawColor   [inline]
 

void IcsCanvas::setDefaultDrawColor Color    color [inline]
 

void IcsCanvas::setUser IcsCanvasUser    user [inline]
 

void IcsCanvas::drawBackground   [inline]
 

Draw the background color on the entire canvas.

void IcsCanvas::zoom double    zoomVal [inline]
 

Zoom to the given value.

Will adjust the canvas size by setting the CCS extent.

Reimplemented in ScribbleCanvas, and VisCanvas.

void IcsCanvas::doPaintComponent Graphics    bufGraphics [inline]
 

Paint the component in the given graphics.

This is just because paintComponent is protected.

void IcsCanvas::handleMousePress MouseEvent    e [inline]
 

Interface for MouseListener events, called by LayeredCanvasPane.

Reimplemented in ActiveCanvas, ScribbleCanvas, and VisCanvas.

void IcsCanvas::handleMouseEnter MouseEvent    e [inline]
 

Reimplemented in ActiveCanvas, ScribbleCanvas, and VisCanvas.

void IcsCanvas::handleMouseExit MouseEvent    e [inline]
 

Reimplemented in ActiveCanvas, ScribbleCanvas, and VisCanvas.

void IcsCanvas::handleMouseClick MouseEvent    e [inline]
 

void IcsCanvas::handleMouseRelease MouseEvent    e [inline]
 

void IcsCanvas::handleMouseMove MouseEvent    e [inline]
 

Interface for MouseMotionListener events, called by LayeredCanvasPane.

Reimplemented in ActiveCanvas, ScribbleCanvas, and VisCanvas.

void IcsCanvas::handleMouseDrag MouseEvent    e [inline]
 

Reimplemented in ScribbleCanvas.

void IcsCanvas::dump   [inline, protected]
 


Member Data Documentation

final Color IcsCanvas::STD_BCOLOR = Color.white [static]
 

final Color IcsCanvas::STD_DCOLOR = Color.red [static]
 

final int IcsCanvas::MIN_SIZE = 3 [static]
 

final int IcsCanvas::EXT_MARGIN = 0 [static]
 

final double IcsCanvas::STD_ZOOM = 1.0f [static]
 

boolean IcsCanvas::DEBUG_LAYOUT = false [static]
 

boolean IcsCanvas::DEBUG_EVENTS = false [static]
 


The documentation for this class was generated from the following file:
Generated on Tue Jan 8 14:14:25 2002 for JavaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001