net.sf.latexdraw.glib.ui
Interface ICanvas

All Superinterfaces:
ActionHandler, ConcretePresentation, Eventable, Modifiable, Pickable, Picker, Preferenciable, Reinitialisable, Scrollable, UndoHandler, ViewsSynchroniserHandler, Zoomable
All Known Implementing Classes:
LCanvas

public interface ICanvas
extends Zoomable, ConcretePresentation, Scrollable, Eventable, ViewsSynchroniserHandler, ActionHandler, Picker, Pickable

Defines an interface for 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/15/2010

Since:
3.0
Author:
Arnaud BLOUIN

Field Summary
 
Fields inherited from interface org.malai.properties.Zoomable
MAX_ZOOM, MIN_ZOOM, ZOOM_INCREMENT
 
Method Summary
 Border getBorderInstrument()
           
 IDrawing getDrawing()
           
 LMagneticGrid getMagneticGrid()
           
 IViewShape getTempView()
           
 IViewShape getViewAt(double x, double y)
           
 java.util.List<IViewShape> getViews()
           
 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 requestFocus()
          Requests the focus to the canvas.
 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 setCursor(java.awt.Cursor cursor)
          Changes the cursor of the canvas.
 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 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 interface org.malai.properties.Zoomable
getZoom, getZoomedPoint, getZoomedPoint, setZoom
 
Methods inherited from interface org.malai.preferences.Preferenciable
load, save
 
Methods inherited from interface org.malai.properties.Modifiable
isModified, setModified
 
Methods inherited from interface org.malai.properties.Reinitialisable
reinit
 
Methods inherited from interface org.malai.widget.Scrollable
getScrollpane, hasScrollPane
 
Methods inherited from interface org.malai.interaction.Eventable
getEventManager, hasEventManager
 
Methods inherited from interface net.sf.latexdraw.glib.views.synchroniser.ViewsSynchroniserHandler
getBottomLeftDrawingPoint, getOriginDrawingPoint, getPPCDrawing, getTopRightDrawingPoint
 
Methods inherited from interface org.malai.action.ActionHandler
onActionAborted, onActionAdded, onActionCancelled, onActionDone, onActionExecuted
 
Methods inherited from interface org.malai.undo.UndoHandler
onUndoableAdded, onUndoableRedo, onUndoableUndo
 
Methods inherited from interface org.malai.picking.Picker
contains, getPickableAt, getPickerAt, getRelativePoint
 
Methods inherited from interface org.malai.picking.Pickable
contains, getPicker
 

Method Detail

setCursor

void setCursor(java.awt.Cursor cursor)
Changes the cursor of the canvas.

Parameters:
cursor - The new canvas. Cannot be null.
Since:
3.0

getDrawing

IDrawing getDrawing()
Returns:
The model of the canvas.
Since:
3.0

setAntiAliasing

void setAntiAliasing(java.lang.Object antiAliasingValue)
Sets the anti aliasing value.

Parameters:
antiAliasingValue - The new anti-aliasing value.
Since:
3.0

setRendering

void setRendering(java.lang.Object renderingValue)
Sets the rendering value.

Parameters:
renderingValue - The new rendering value.
Since:
3.0

setColorRendering

void setColorRendering(java.lang.Object colorRenderingValue)
Sets the colour rendering value.

Parameters:
colorRenderingValue - The new colour rendering value.
Since:
3.0

setAlphaInterpolation

void setAlphaInterpolation(java.lang.Object alphaInterpolValue)
Sets the alpha interpolation value.

Parameters:
alphaInterpolValue - The new alpha interpolation value.
Since:
3.0

paint

void paint(java.awt.Graphics g)
Paints the shapes.

Parameters:
g - The graphics used to paint the shapes.
Since:
3.0

paintViews

void paintViews(java.awt.Graphics2D g,
                boolean withZoom,
                boolean withGrid)
Paints the shapes.

Parameters:
g - The graphics.
withZoom - True: the zoom will be considered.
withGrid - True: the grid will be considered.
Throws:
java.lang.NullPointerException - If g is null.

update

void update()
Updates the canvas.

Specified by:
update in interface ConcretePresentation

updateBorder

void updateBorder()
Updates the border of the views.

Since:
3.0

updatePreferredSize

void updatePreferredSize()
Defines the dimensions of the canvas (needed for the scrollers).


getViewAt

IViewShape getViewAt(double x,
                     double y)
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.
Since:
3.0

getViews

java.util.List<IViewShape> getViews()
Returns:
The list of views.
Since:
3.0

setTempView

void setTempView(IViewShape view)
Sets the temporary view.

Parameters:
view - The new temporary view.
Since:
3.0

getTempView

IViewShape getTempView()
Returns:
The temporary view contained by the canvas.
Since:
3.0

setTempUserSelectionBorder

void setTempUserSelectionBorder(java.awt.geom.Rectangle2D rect)
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.

Parameters:
rect - The rectangle to display.
Since:
3.0

refresh

void refresh()
Repaints the canvas.

Since:
3.0

getBorderInstrument

Border getBorderInstrument()
Returns:
The instrument that managing selected views.
Since:
3.0

getMagneticGrid

LMagneticGrid getMagneticGrid()
Returns:
The magnetic grid of the canvas.
Since:
3.0

requestFocus

void requestFocus()
Requests the focus to the canvas.

Since:
3.0