Inheritance diagram for IcsCanvas::
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 () |
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:
|
Get the dimension of the canvas in ICS (the unzoomed canvas).
|
|
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. |
|
Get the dimension of the canvas in CCS (the zoomed canvas).
|
|
Set the dimension of the canvas in CCS (the zoomed canvas). Is done via setDimensionICS. |
|
Get the extent of all objects on the canvas.
|
|
Set the extent of all objects on the canvas. Also does a setDimensionICS to update the size of the canvas. |
|
Get the dimension of the viewport.
|
|
This function will be called by the scrollpane upon change events. Also updates the size of the canvas via setDimensionICS. |
|
Overrides Component interface.
|
|
Overrides JComponent interface. Returns the object extent. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Draw the background color on the entire canvas.
|
|
Zoom to the given value. Will adjust the canvas size by setting the CCS extent. Reimplemented in ScribbleCanvas, and VisCanvas. |
|
Paint the component in the given graphics. This is just because paintComponent is protected. |
|
Interface for MouseListener events, called by LayeredCanvasPane.
Reimplemented in ActiveCanvas, ScribbleCanvas, and VisCanvas. |
|
Reimplemented in ActiveCanvas, ScribbleCanvas, and VisCanvas. |
|
Reimplemented in ActiveCanvas, ScribbleCanvas, and VisCanvas. |
|
|
|
|
|
Interface for MouseMotionListener events, called by LayeredCanvasPane.
Reimplemented in ActiveCanvas, ScribbleCanvas, and VisCanvas. |
|
Reimplemented in ScribbleCanvas. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|