net.sf.latexdraw.glib.ui
Class LCanvas

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.malai.widget.MPanel
                      extended by net.sf.latexdraw.glib.ui.LCanvas
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, ICanvas, ViewsSynchroniserHandler, ActionHandler, Eventable, Pickable, Picker, Preferenciable, ConcretePresentation, Modifiable, Reinitialisable, Zoomable, UndoHandler, Scrollable

public class LCanvas
extends MPanel
implements ICanvas

Defines a canvas that draw the drawing and manages the selected shapes.

This file is part of LaTeXDraw.
Copyright (c) 2005-2012 Arnaud BLOUIN

LaTeXDraw is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
LaTeXDraw is distributed without any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

05/09/2010

Since:
3.0
Author:
Arnaud BLOUIN
See Also:
Serialized Form

Nested Class Summary
protected  class LCanvas.TooltipDisplayer
          This kind of instrument manages the tooltips displayed on some views.
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  java.lang.Object alphaInterpolValue
          The value of the alpha-interpolation ( cf.
protected  java.lang.Object antiAliasingValue
          The value of the antialiasing (cf.
protected  java.awt.geom.Rectangle2D border
          The border of the drawing.
protected  Border borderIns
          The instrument that manages selected views.
protected  java.lang.Object colorRenderingValue
          The value of the colour rendering (cf.
protected  IDrawing drawing
          The model of the view.
protected  LMagneticGrid magneticGrid
          The magnetic grid of the canvas.
protected  boolean modified
          Defined if the canvas has been modified.
protected  java.lang.Object renderingValue
          The value of the rendering (cf.
private static long serialVersionUID
           
static java.awt.BasicStroke STROKE_USER_SELECTION_BORDER
          This stroke is used to show the rectangle made by the user to select some shapes.
protected  IUnary<IViewShape> tempView
          The temporary view that the canvas may contain.
protected  java.util.List<ToolTipable> tooltipableView
          This list contains a subset of the list 'view'.
protected  java.awt.geom.Rectangle2D userSelectionBorder
          This rectangle is used as interim feedback to show the rectangle made by the user to select some shapes.
protected  IActiveList<IViewShape> views
          The shapes of the canvas.
protected  IUnary<java.lang.Double> zoom
          The zoom applied on the canvas.
 
Fields inherited from class org.malai.widget.MPanel
eventManager, scrollpane
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface org.malai.properties.Zoomable
MAX_ZOOM, MIN_ZOOM, ZOOM_INCREMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
LCanvas(IDrawing drawing)
          Creates an initialises a canvas.
 
Method Summary
 boolean contains(double x, double y)
          Tests if the given point is into the pickable object.
 Border getBorderInstrument()
           
 IPoint getBottomLeftDrawingPoint()
           
 IDrawing getDrawing()
           
 LMagneticGrid getMagneticGrid()
           
 IPoint getOriginDrawingPoint()
           
 Pickable getPickableAt(double x, double y)
           
 Picker getPicker()
           
 Picker getPickerAt(double x, double y)
           
 int getPPCDrawing()
           
 IViewShape getTempView()
           
 IPoint getTopRightDrawingPoint()
           
 IUnary<IViewShape> getUnaryTempView()
           
 IViewShape getViewAt(double x, double y)
           
 java.util.List<IViewShape> getViews()
           
 double getZoom()
           
 java.awt.geom.Point2D getZoomedPoint(double x, double y)
          Transforms the given point in a point which coordinates have been modified to take account of the zoom level.
 java.awt.geom.Point2D getZoomedPoint(java.awt.Point pt)
          Transforms the given point in a point which coordinates have been modified to take account of the zoom level.
 IUnary<java.lang.Double> getZoomUnary()
           
 boolean isModified()
           
 void load(boolean generalPreferences, java.lang.String nsURI, org.w3c.dom.Element meta)
          Loads data save in an XML document.
 void onActionAborted(Action action)
          Notifies the handler when the given action is aborted.
 void onActionAdded(Action action)
          Notifies the handler when the given action is added to the registry.
 void onActionCancelled(Action action)
          Notifies the handler when the given action is cancelled.
 void onActionDone(Action action)
          Notifies the handler when the given action is done.
 void onActionExecuted(Action action)
          Notifies the handler when the given action is executed.
 void onUndoableAdded(Undoable undoable)
          Actions to do when an undoable object is added to the undo register.
 void onUndoableRedo(Undoable undoable)
          Actions to do when an undoable object is redone.
 void onUndoableUndo(Undoable undoable)
          Actions to do when an undoable object is undone.
 void paint(java.awt.Graphics g)
          Paints the shapes.
 void paintViews(java.awt.Graphics2D g, boolean withZoom, boolean withGrid)
          Paints the shapes.
 void refresh()
          Repaints the canvas.
 void reinit()
          Reinitialises the object.
 void save(boolean generalPreferences, java.lang.String nsURI, org.w3c.dom.Document document, org.w3c.dom.Element root)
          Saves the parameters of the instrument into an XML tag.
 void setAlphaInterpolation(java.lang.Object alphaInterpolValue)
          Sets the alpha interpolation value.
 void setAntiAliasing(java.lang.Object antiAliasingValue)
          Sets the anti aliasing value.
 void setColorRendering(java.lang.Object colorRenderingValue)
          Sets the colour rendering value.
 void setModified(boolean modified)
          Sets the Modifiable object as modified.
 void setRendering(java.lang.Object renderingValue)
          Sets the rendering value.
 void setTempUserSelectionBorder(java.awt.geom.Rectangle2D rect)
          Sets the rectangle corresponding to the rectangle that performs users to select shapes.
 void setTempView(IViewShape view)
          Sets the temporary view.
 void setZoom(double x, double y, double z)
          Zooms in the zoomable object.
 void update()
          Updates the canvas.
 void updateBorder()
          Updates the border of the views.
 void updatePreferredSize()
          Defines the dimensions of the canvas (needed for the scrollers).
 
Methods inherited from class org.malai.widget.MPanel
add, add, add, add, add, contains, getEventManager, getRelativePoint, getScrollbar, getScrollpane, hasEventManager, hasScrollPane, isHorizontalScrollbarVisible, isVerticalScrollbarVisible, scroll, scrollHorizontally, scrollVertically
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.latexdraw.glib.ui.ICanvas
requestFocus, setCursor
 
Methods inherited from interface org.malai.widget.Scrollable
getScrollpane, hasScrollPane
 
Methods inherited from interface org.malai.interaction.Eventable
getEventManager, hasEventManager
 
Methods inherited from interface org.malai.picking.Picker
contains, getRelativePoint
 

Field Detail

STROKE_USER_SELECTION_BORDER

public static final java.awt.BasicStroke STROKE_USER_SELECTION_BORDER
This stroke is used to show the rectangle made by the user to select some shapes.


serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

views

protected IActiveList<IViewShape> views
The shapes of the canvas.


tempView

protected IUnary<IViewShape> tempView
The temporary view that the canvas may contain.


tooltipableView

protected java.util.List<ToolTipable> tooltipableView
This list contains a subset of the list 'view'. It contains the tooltipable views of 'views'. This attribute is used only to avoid a full exploration of the list 'views' (that can be huge).


border

protected java.awt.geom.Rectangle2D border
The border of the drawing.


zoom

protected IUnary<java.lang.Double> zoom
The zoom applied on the canvas.


antiAliasingValue

protected java.lang.Object antiAliasingValue
The value of the antialiasing (cf. RenderingHints.VALUE_ANTIALIAS_ON/OFF)


renderingValue

protected java.lang.Object renderingValue
The value of the rendering (cf. RenderingHints.VALUE_RENDER_QUALITY/SPEED)


colorRenderingValue

protected java.lang.Object colorRenderingValue
The value of the colour rendering (cf. RenderingHints.VALUE_COLOR_RENDER_QUALITY/SPEED)


alphaInterpolValue

protected java.lang.Object alphaInterpolValue
The value of the alpha-interpolation ( cf. RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY/SPEED)


userSelectionBorder

protected java.awt.geom.Rectangle2D userSelectionBorder
This rectangle is used as interim feedback to show the rectangle made by the user to select some shapes.


borderIns

protected Border borderIns
The instrument that manages selected views.


magneticGrid

protected LMagneticGrid magneticGrid
The magnetic grid of the canvas.


modified

protected boolean modified
Defined if the canvas has been modified.


drawing

protected IDrawing drawing
The model of the view.

Constructor Detail

LCanvas

public LCanvas(IDrawing drawing)
Creates an initialises a canvas.

Parameters:
drawing - The model of the canvas.
Since:
3.0
Method Detail

reinit

public void reinit()
Description copied from interface: Reinitialisable
Reinitialises the object.

Specified by:
reinit in interface Reinitialisable

paint

public void paint(java.awt.Graphics g)
Description copied from interface: ICanvas
Paints the shapes.

Specified by:
paint in interface ICanvas
Overrides:
paint in class javax.swing.JComponent
Parameters:
g - The graphics used to paint the shapes.

paintViews

public void paintViews(java.awt.Graphics2D g,
                       boolean withZoom,
                       boolean withGrid)
Description copied from interface: ICanvas
Paints the shapes.

Specified by:
paintViews in interface ICanvas
Parameters:
g - The graphics.
withZoom - True: the zoom will be considered.
withGrid - True: the grid will be considered.

update

public void update()
Description copied from interface: ICanvas
Updates the canvas.

Specified by:
update in interface ICanvas
Specified by:
update in interface ConcretePresentation

updateBorder

public void updateBorder()
Description copied from interface: ICanvas
Updates the border of the views.

Specified by:
updateBorder in interface ICanvas

updatePreferredSize

public void updatePreferredSize()
Description copied from interface: ICanvas
Defines the dimensions of the canvas (needed for the scrollers).

Specified by:
updatePreferredSize in interface ICanvas

getViewAt

public IViewShape getViewAt(double x,
                            double y)
Specified by:
getViewAt in interface ICanvas
Parameters:
x - The x-coordinate of the point to test.
y - The y-coordinate of the point to test.
Returns:
The view at the given point or null.

getPickableAt

public Pickable getPickableAt(double x,
                              double y)
Specified by:
getPickableAt in interface Picker
Overrides:
getPickableAt in class MPanel
Parameters:
x - The x-coordinate of the position used to get the pickable object.
y - The y-coordinate of the position used to get the pickable object.
Returns:
The pickable object at the given position.

getPickerAt

public Picker getPickerAt(double x,
                          double y)
Specified by:
getPickerAt in interface Picker
Overrides:
getPickerAt in class MPanel
Parameters:
x - The x-coordinate of the position used to get the picker object.
y - The y-coordinate of the position used to get the picker object.
Returns:
The pickable object at the given position.

getZoom

public double getZoom()
Specified by:
getZoom in interface Zoomable
Returns:
The zoom level.

setZoom

public void setZoom(double x,
                    double y,
                    double z)
Description copied from interface: Zoomable
Zooms in the zoomable object.

Specified by:
setZoom in interface Zoomable
Parameters:
x - The X-coordinate of the location to zoom.
y - The Y-coordinate of the location to zoom.
z - The zooming level.

getViews

public java.util.List<IViewShape> getViews()
Specified by:
getViews in interface ICanvas
Returns:
The list of views.

getTempView

public IViewShape getTempView()
Specified by:
getTempView in interface ICanvas
Returns:
The temporary view contained by the canvas.

setTempView

public void setTempView(IViewShape view)
Description copied from interface: ICanvas
Sets the temporary view.

Specified by:
setTempView in interface ICanvas
Parameters:
view - The new temporary view.

getUnaryTempView

public IUnary<IViewShape> getUnaryTempView()
Returns:
The unary relation that contains the temporary view.
Since:
3.0

getTopRightDrawingPoint

public IPoint getTopRightDrawingPoint()
Specified by:
getTopRightDrawingPoint in interface ViewsSynchroniserHandler
Returns:
The top right point of the current drawing.

getBottomLeftDrawingPoint

public IPoint getBottomLeftDrawingPoint()
Specified by:
getBottomLeftDrawingPoint in interface ViewsSynchroniserHandler
Returns:
The bottom left point of the current drawing.

getOriginDrawingPoint

public IPoint getOriginDrawingPoint()
Specified by:
getOriginDrawingPoint in interface ViewsSynchroniserHandler
Returns:
The origin point of the current drawing.

getPPCDrawing

public int getPPCDrawing()
Specified by:
getPPCDrawing in interface ViewsSynchroniserHandler
Returns:
The number of pixels per centimetre of the current drawing.

save

public void save(boolean generalPreferences,
                 java.lang.String nsURI,
                 org.w3c.dom.Document document,
                 org.w3c.dom.Element root)
Description copied from interface: Preferenciable
Saves the parameters of the instrument into an XML tag.

Specified by:
save in interface Preferenciable
Parameters:
generalPreferences - True: this operation is called to save the general preferences of the interactive system. Otherwise, it is called to save a presentation in a document. This parameter is useful when different information must be saved during a presentation backup or a general preferences backup.
nsURI - The namespace that must be added to tags corresponding to the instrument's parameters.
document - The XML document.
root - The root element that will contains the instrument's parameters.

load

public void load(boolean generalPreferences,
                 java.lang.String nsURI,
                 org.w3c.dom.Element meta)
Description copied from interface: Preferenciable
Loads data save in an XML document.

Specified by:
load in interface Preferenciable
Parameters:
generalPreferences - True: this operation is called to load the general preferences of the interactive system. Otherwise, it is called to load a presentation in a document. This parameter is useful when different information must be loaded during a presentation backup or a general preferences backup.
nsURI - The namespace that must be added to tags corresponding to the instrument's parameters.
meta - The meta data element.

contains

public boolean contains(double x,
                        double y)
Description copied from interface: Pickable
Tests if the given point is into the pickable object.

Specified by:
contains in interface Pickable
Parameters:
x - The x-coordinate of the point to test.
y - The y-coordinate of the point to test.
Returns:
True if the given point is into the pickable object.

getPicker

public Picker getPicker()
Specified by:
getPicker in interface Pickable
Returns:
The picker object that contains the pickable object.

setTempUserSelectionBorder

public void setTempUserSelectionBorder(java.awt.geom.Rectangle2D rect)
Description copied from interface: ICanvas
Sets the rectangle corresponding to the rectangle that performs users to select shapes. Can be null. This rectangle, if not null, is then displayed to provide users with feedback on the selection he is performing.

Specified by:
setTempUserSelectionBorder in interface ICanvas
Parameters:
rect - The rectangle to display.

refresh

public void refresh()
Description copied from interface: ICanvas
Repaints the canvas.

Specified by:
refresh in interface ICanvas

getBorderInstrument

public Border getBorderInstrument()
Specified by:
getBorderInstrument in interface ICanvas
Returns:
The instrument that managing selected views.

getZoomUnary

public IUnary<java.lang.Double> getZoomUnary()
Returns:
The unary relation that contains the zoom value.
Since:
3.0

getMagneticGrid

public LMagneticGrid getMagneticGrid()
Specified by:
getMagneticGrid in interface ICanvas
Returns:
The magnetic grid of the canvas.

setAntiAliasing

public void setAntiAliasing(java.lang.Object antiAliasingValue)
Description copied from interface: ICanvas
Sets the anti aliasing value.

Specified by:
setAntiAliasing in interface ICanvas
Parameters:
antiAliasingValue - The new anti-aliasing value.

setRendering

public void setRendering(java.lang.Object renderingValue)
Description copied from interface: ICanvas
Sets the rendering value.

Specified by:
setRendering in interface ICanvas
Parameters:
renderingValue - The new rendering value.

setColorRendering

public void setColorRendering(java.lang.Object colorRenderingValue)
Description copied from interface: ICanvas
Sets the colour rendering value.

Specified by:
setColorRendering in interface ICanvas
Parameters:
colorRenderingValue - The new colour rendering value.

setAlphaInterpolation

public void setAlphaInterpolation(java.lang.Object alphaInterpolValue)
Description copied from interface: ICanvas
Sets the alpha interpolation value.

Specified by:
setAlphaInterpolation in interface ICanvas
Parameters:
alphaInterpolValue - The new alpha interpolation value.

isModified

public boolean isModified()
Specified by:
isModified in interface Modifiable
Returns:
True: the object has been modified. False otherwise.

setModified

public void setModified(boolean modified)
Description copied from interface: Modifiable
Sets the Modifiable object as modified.

Specified by:
setModified in interface Modifiable
Parameters:
modified - True: the element is will tagged as modified.

getDrawing

public IDrawing getDrawing()
Specified by:
getDrawing in interface ICanvas
Returns:
The model of the canvas.

getZoomedPoint

public java.awt.geom.Point2D getZoomedPoint(double x,
                                            double y)
Description copied from interface: Zoomable
Transforms the given point in a point which coordinates have been modified to take account of the zoom level.

Specified by:
getZoomedPoint in interface Zoomable
Parameters:
x - The X-coordinate of the point to modify.
y - The Y-coordinate of the point to modify.
Returns:
The transformed point.

getZoomedPoint

public java.awt.geom.Point2D getZoomedPoint(java.awt.Point pt)
Description copied from interface: Zoomable
Transforms the given point in a point which coordinates have been modified to take account of the zoom level.

Specified by:
getZoomedPoint in interface Zoomable
Parameters:
pt - The point to transform.
Returns:
The transformed point. Returns (0,0) if the given point is null.

onActionCancelled

public void onActionCancelled(Action action)
Description copied from interface: ActionHandler
Notifies the handler when the given action is cancelled.

Specified by:
onActionCancelled in interface ActionHandler
Parameters:
action - The cancelled action.

onActionAdded

public void onActionAdded(Action action)
Description copied from interface: ActionHandler
Notifies the handler when the given action is added to the registry.

Specified by:
onActionAdded in interface ActionHandler
Parameters:
action - The added action.

onActionAborted

public void onActionAborted(Action action)
Description copied from interface: ActionHandler
Notifies the handler when the given action is aborted.

Specified by:
onActionAborted in interface ActionHandler
Parameters:
action - The aborted action.

onActionExecuted

public void onActionExecuted(Action action)
Description copied from interface: ActionHandler
Notifies the handler when the given action is executed.

Specified by:
onActionExecuted in interface ActionHandler
Parameters:
action - The executed action.

onUndoableAdded

public void onUndoableAdded(Undoable undoable)
Description copied from interface: UndoHandler
Actions to do when an undoable object is added to the undo register.

Specified by:
onUndoableAdded in interface UndoHandler
Parameters:
undoable - The undoable object added to the undo register.

onUndoableUndo

public void onUndoableUndo(Undoable undoable)
Description copied from interface: UndoHandler
Actions to do when an undoable object is undone.

Specified by:
onUndoableUndo in interface UndoHandler
Parameters:
undoable - The undone object.

onUndoableRedo

public void onUndoableRedo(Undoable undoable)
Description copied from interface: UndoHandler
Actions to do when an undoable object is redone.

Specified by:
onUndoableRedo in interface UndoHandler
Parameters:
undoable - The redone object.

onActionDone

public void onActionDone(Action action)
Description copied from interface: ActionHandler
Notifies the handler when the given action is done.

Specified by:
onActionDone in interface ActionHandler
Parameters:
action - The action that ends.