|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.malai.action.Action
net.sf.latexdraw.actions.DrawingAction
net.sf.latexdraw.actions.ShapeAction<IGroup>
net.sf.latexdraw.actions.ScaleShapes
public class ScaleShapes
This action scales the selected shapes of 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.
29/11/2011
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.malai.action.Action |
---|
Action.ActionStatus |
Field Summary | |
---|---|
private java.awt.geom.Rectangle2D |
bound
The bound of the selected shapes used to perform the scaling. |
protected double |
newX
The new X position used to compute the scale factor. |
protected double |
newY
The new Y position used to compute the scale factor. |
private double |
oldHeight
The old height of the selection. |
private double |
oldWidth
The old width of the selection. |
protected IShape.Position |
refPosition
The direction of the scaling. |
Fields inherited from class net.sf.latexdraw.actions.ShapeAction |
---|
shape |
Fields inherited from class net.sf.latexdraw.actions.DrawingAction |
---|
drawing |
Fields inherited from class org.malai.action.Action |
---|
status |
Constructor Summary | |
---|---|
ScaleShapes()
Creates the action. |
Method Summary | |
---|---|
boolean |
canDo()
|
protected void |
doActionBody()
This method contains the core code to execute when the action is executed. |
IShape.Position |
getRefPosition()
|
private double |
getScaledHeight()
|
private double |
getScaledWidth()
|
java.lang.String |
getUndoName()
|
boolean |
isRegisterable()
Specifies if the action must be saved in the action register. |
private boolean |
isValidScale(double scale)
|
private boolean |
isValidScales()
|
void |
redo()
Redoes the cancelled action. |
void |
setNewX(double newX)
|
void |
setNewY(double newY)
|
void |
setRefPosition(IShape.Position refPosition)
|
void |
setShape(IGroup shape)
Sets the shape to add. |
void |
undo()
Cancels the action. |
private void |
updateBound(IPoint tl,
IPoint br)
|
Methods inherited from class net.sf.latexdraw.actions.ShapeAction |
---|
flush, getShape |
Methods inherited from class net.sf.latexdraw.actions.DrawingAction |
---|
getDrawing, setDrawing |
Methods inherited from class org.malai.action.Action |
---|
abort, cancelledBy, doIt, done, getStatus, hadEffect, isDone, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected IShape.Position refPosition
protected double newX
protected double newY
private java.awt.geom.Rectangle2D bound
private double oldWidth
private double oldHeight
Constructor Detail |
---|
public ScaleShapes()
Method Detail |
---|
public boolean isRegisterable()
Action
isRegisterable
in class Action
public boolean canDo()
canDo
in class ShapeAction<IGroup>
private boolean isValidScales()
private boolean isValidScale(double scale)
protected void doActionBody()
Action
doActionBody
in class Action
private void updateBound(IPoint tl, IPoint br)
public void undo()
Undoable
undo
in interface Undoable
public void setShape(IGroup shape)
ShapeAction
setShape
in class ShapeAction<IGroup>
shape
- The shape to add.private double getScaledHeight()
private double getScaledWidth()
public void redo()
Undoable
redo
in interface Undoable
public java.lang.String getUndoName()
getUndoName
in interface Undoable
public IShape.Position getRefPosition()
public final void setNewX(double newX)
newX
- The new X position used to compute the scale factor.public final void setNewY(double newY)
newY
- The new Y position used to compute the scale factor.public void setRefPosition(IShape.Position refPosition)
refPosition
- The reference position of the scaling.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |