|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.malai.instrument.Instrument
net.sf.latexdraw.instruments.Pencil
public class Pencil
This instrument allows to draw 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/13/10
Field Summary | |
---|---|
protected EditionChoice |
currentChoice
The current editing choice (rectangle, ellipse, etc.) of the instrument. |
protected IDrawing |
drawing
The drawing that contains the shapes. |
protected LMagneticGrid |
grid
The magnetic grid used to create shapes. |
protected IGroup |
groupParams
|
protected javax.swing.JFileChooser |
pictureFileChooser
The file chooser used to select pictures. |
protected TextSetter |
textSetter
The instrument used to add and modify texts. |
protected Zoomer |
zoomer
The zoomer that is used to give the zoom level to compute coordinates of the created shapes. |
Fields inherited from class org.malai.instrument.Instrument |
---|
activated, eventables, links, modified |
Constructor Summary | |
---|---|
Pencil(IDrawing drawing,
Zoomer zoomer,
LMagneticGrid grid,
TextSetter textSetter)
Creates a pencil. |
Method Summary | |
---|---|
IShape |
createShapeInstance()
|
IPoint |
getAdaptedPoint(java.awt.Point point)
Computes the point depending on the the zoom level and the magnetic grid. |
EditionChoice |
getCurrentChoice()
|
IGroup |
getGroupParams()
|
javax.swing.JFileChooser |
getPictureFileChooser()
|
protected void |
initialiseLinks()
Initialises the links of the instrument. |
void |
interimFeedback()
Reinitialises the interim feedback of the instrument. |
void |
setActivated(boolean activated)
Activates or deactivates the instrument. |
void |
setCurrentChoice(EditionChoice currentChoice)
Sets the current editing choice. |
void |
setShapeParameters(IShape shape)
Configures the given shape with the parameters (e.g. thickness, colours, etc.) of the pencil. |
Methods inherited from class org.malai.instrument.Instrument |
---|
addEventable, addLink, clearEvents, getLinks, getSizeLinks, hasLinks, isActivated, isModified, load, onActionAborted, onActionAdded, onActionCancelled, onActionDone, onActionExecuted, onUndoableAdded, onUndoableRedo, onUndoableUndo, reinit, removeLink, save, setModified |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected LMagneticGrid grid
protected TextSetter textSetter
protected EditionChoice currentChoice
protected IDrawing drawing
protected Zoomer zoomer
protected javax.swing.JFileChooser pictureFileChooser
protected IGroup groupParams
Constructor Detail |
---|
public Pencil(IDrawing drawing, Zoomer zoomer, LMagneticGrid grid, TextSetter textSetter)
drawing
- The drawing where the shapes are drawn.zoomer
- The instrument zoomer used to create shapes.grid
- The magnetic grid used to create shapes.textSetter
- The instrument used to add and modify texts.
java.lang.IllegalArgumentException
- If one of the given argument is null.Method Detail |
---|
public void setActivated(boolean activated)
Instrument
setActivated
in class Instrument
activated
- True = activation.public void interimFeedback()
Instrument
interimFeedback
in class Instrument
protected void initialiseLinks()
Instrument
initialiseLinks
in class Instrument
public IGroup getGroupParams()
public IShape createShapeInstance()
public void setShapeParameters(IShape shape)
shape
- The shape to configure.public javax.swing.JFileChooser getPictureFileChooser()
public EditionChoice getCurrentChoice()
public void setCurrentChoice(EditionChoice currentChoice)
currentChoice
- The new editing choice to set.public IPoint getAdaptedPoint(java.awt.Point point)
point
- The point to adapted.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |