net.sf.latexdraw.actions
Class InsertPicture
java.lang.Object
org.malai.action.Action
net.sf.latexdraw.actions.DrawingAction
net.sf.latexdraw.actions.ShapeAction<IShape>
net.sf.latexdraw.actions.AddShape
net.sf.latexdraw.actions.InsertPicture
- All Implemented Interfaces:
- Modifying, Undoable
public class InsertPicture
- extends AddShape
This action asks the user to select a picture and, if valid, adds it to a drawing.
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.
20/01/2012
- Since:
- 3.0
- Author:
- Arnaud BLOUIN
Field Summary |
protected javax.swing.JFileChooser |
fileChooser
The file chooser used to select the picture to add. |
protected boolean |
loaded
Defines if the picture has been successfully loaded. |
Method Summary |
boolean |
canDo()
|
protected void |
doActionBody()
This method contains the core code to execute when the action is executed. |
boolean |
hadEffect()
|
void |
redo()
Redoes the cancelled action. |
void |
setFileChooser(javax.swing.JFileChooser fileChooser)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
fileChooser
protected javax.swing.JFileChooser fileChooser
- The file chooser used to select the picture to add.
loaded
protected boolean loaded
- Defines if the picture has been successfully loaded.
InsertPicture
public InsertPicture()
- Creates the action.
- Since:
- 3.0
doActionBody
protected void doActionBody()
- Description copied from class:
Action
- This method contains the core code to execute when the action is executed.
- Overrides:
doActionBody
in class AddShape
redo
public void redo()
- Description copied from interface:
Undoable
- Redoes the cancelled action.
- Specified by:
redo
in interface Undoable
- Overrides:
redo
in class AddShape
hadEffect
public boolean hadEffect()
- Overrides:
hadEffect
in class Action
- Returns:
- True if the execution of the action had effects on the target.
By default this function return the result of isDone. Should be overridden.
canDo
public boolean canDo()
- Overrides:
canDo
in class ShapeAction<IShape>
- Returns:
- True if the action can be executed.
setFileChooser
public void setFileChooser(javax.swing.JFileChooser fileChooser)
- Parameters:
fileChooser
- The file chooser used to select the picture to load.- Since:
- 3.0