public class FXChangeViewportOperation extends AbstractOperation
FXChangeViewportOperation
can be used to alter a
ViewportModel
. It is used by scroll/pan and zoom policies.Modifier and Type | Field and Description |
---|---|
protected double |
newHeight
The viewport height that is applied when executing this operation.
|
protected AffineTransform |
newTransform
The contents transformation that is applied when executing this
operation.
|
protected double |
newTx
The horizontal translation that is applied when executing this operation.
|
protected double |
newTy
The vertical translation that is applied when executing this operation.
|
protected double |
newWidth
The viewport width that is applied when executing this operation.
|
protected double |
oldHeight
The viewport height that is applied when undoing this operation.
|
protected AffineTransform |
oldTransform
The contents transformation that is applied when undoing this operation.
|
protected double |
oldTx
The horizontal translation that is applied when undoing this operation.
|
protected double |
oldTy
The vertical translation that is applied when undoing this operation.
|
protected double |
oldWidth
The viewport width that is applied when undoing this operation.
|
protected ViewportModel |
viewportModel
The
ViewportModel that is manipulated by this operation. |
Modifier | Constructor and Description |
---|---|
protected |
FXChangeViewportOperation(ViewportModel viewportModel)
Creates a new
FXChangeViewportOperation to manipulate the given
ViewportModel . |
|
FXChangeViewportOperation(ViewportModel viewportModel,
AffineTransform newTransform)
Creates a new
FXChangeViewportOperation to manipulate the given
ViewportModel . |
|
FXChangeViewportOperation(ViewportModel viewportModel,
double newTx,
double newTy)
Creates a new
FXChangeViewportOperation to manipulate the given
ViewportModel . |
|
FXChangeViewportOperation(ViewportModel viewportModel,
double newTx,
double newTy,
AffineTransform newTransform)
Creates a new
FXChangeViewportOperation to manipulate the given
ViewportModel . |
|
FXChangeViewportOperation(ViewportModel viewportModel,
double newTx,
double newTy,
double newWidth,
double newHeight,
AffineTransform newTransform)
Creates a new
FXChangeViewportOperation to manipulate the given
ViewportModel . |
Modifier and Type | Method and Description |
---|---|
void |
concatenateToNewTransform(AffineTransform t)
Concatenates the given
AffineTransform to the
contents transformation that will be applied when executing this
operation. |
IStatus |
execute(IProgressMonitor monitor,
IAdaptable info) |
double |
getNewHeight()
Returns the viewport height that will be applied when executing this
operation.
|
AffineTransform |
getNewTransform()
Returns the contents transformation that will be applied when executing
this operation.
|
double |
getNewTx()
Returns the horizontal translation that will be applied when executing
this operation.
|
double |
getNewTy()
Returns the vertical translation that will be applied when executing this
operation.
|
double |
getNewWidth()
Returns the viewport width that will be applied when executing this
operation.
|
double |
getOldHeight()
Returns the viewport height that will be applied when undoing this
operation.
|
AffineTransform |
getOldTransform()
Returns the contents transformation that will be applied when undoing
this operation.
|
double |
getOldTx()
Returns the horizontal translation that will be applied when undoing this
operation.
|
double |
getOldTy()
Returns the vertical translation that will be applied when undoing this
operation.
|
double |
getOldWidth()
Returns the viewport width that will be applied when undoing this
operation.
|
ViewportModel |
getViewportModel()
Returns the
ViewportModel which will be manipulated by this
operation. |
boolean |
hasEffect()
Returns
true if the execution of this operation will result
in a manipulation, i.e. if it will have an effect. |
protected void |
readViewport(ViewportModel viewportModel)
Stores all relevant values in fields, so that they can be restored later.
|
IStatus |
redo(IProgressMonitor monitor,
IAdaptable info) |
void |
setNewHeight(double newHeight)
Sets the viewport height that will be applied when executing this
operation to the given value.
|
void |
setNewTransform(AffineTransform newTransform)
Sets the contents transformation that will be applied when executing this
operation to the given value.
|
void |
setNewTx(double newTx)
Sets the horizontal translation that will be applied when executing this
operation to the given value.
|
void |
setNewTy(double newTy)
Sets the vertical translation that will be applied when executing this
operation to the given value.
|
void |
setNewWidth(double newWidth)
Sets the viewport width that will be applied when executing this
operation to the given value.
|
IStatus |
undo(IProgressMonitor monitor,
IAdaptable info) |
addContext, canExecute, canRedo, canUndo, dispose, getContexts, getLabel, hasContext, removeContext, setLabel, toString
protected ViewportModel viewportModel
ViewportModel
that is manipulated by this operation.protected double oldWidth
protected double newWidth
protected double oldHeight
protected double newHeight
protected AffineTransform oldTransform
protected AffineTransform newTransform
protected double oldTx
protected double newTx
protected double oldTy
protected double newTy
protected FXChangeViewportOperation(ViewportModel viewportModel)
FXChangeViewportOperation
to manipulate the given
ViewportModel
. The current viewport values are read and used when
undoing this operation.viewportModel
- The ViewportModel
which is manipulated by this
operation.public FXChangeViewportOperation(ViewportModel viewportModel, AffineTransform newTransform)
FXChangeViewportOperation
to manipulate the given
ViewportModel
. The current viewport values are read and used when
undoing this operation. The given AffineTransform
will be applied when executing this operation.viewportModel
- The ViewportModel
that is manipulated.newTransform
- The contents transformation which is applied when executing
this operation.public FXChangeViewportOperation(ViewportModel viewportModel, double newTx, double newTy)
FXChangeViewportOperation
to manipulate the given
ViewportModel
. The current viewport values are read and used when
undoing this operation. The given translation values will be applied when
executing this operation.viewportModel
- The ViewportModel
that is manipulated.newTx
- The horizontal translation that is applied when executing this
operation.newTy
- The vertical translation that is applied when executing this
operation.public FXChangeViewportOperation(ViewportModel viewportModel, double newTx, double newTy, AffineTransform newTransform)
FXChangeViewportOperation
to manipulate the given
ViewportModel
. The current viewport values are read and used when
undoing this operation. The given translation values and contents
transformation will be applied when executing this operation.viewportModel
- The ViewportModel
that is manipulated.newTx
- The horizontal translation that is applied when executing this
operation.newTy
- The vertical translation that is applied when executing this
operation.newTransform
- The contents transformation which is applied when executing
this operation.public FXChangeViewportOperation(ViewportModel viewportModel, double newTx, double newTy, double newWidth, double newHeight, AffineTransform newTransform)
FXChangeViewportOperation
to manipulate the given
ViewportModel
. The current viewport values are read and used when
undoing this operation. The given translation values, dimensions, and
contents transformation will be applied when executing this operation.viewportModel
- The ViewportModel
that is manipulated.newTx
- The horizontal translation that is applied when executing this
operation.newTy
- The vertical translation that is applied when executing this
operation.newWidth
- The viewport width that is applied when executing this
operation.newHeight
- The viewport height that is applied when executing this
operation.newTransform
- The contents transformation which is applied when executing
this operation.public void concatenateToNewTransform(AffineTransform t)
AffineTransform
to the
contents transformation that will be applied when executing this
operation.t
- The AffineTransform
which is
concatenated to the transformation that will be applied when
executing this operation.public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException
execute
in interface IUndoableOperation
execute
in class AbstractOperation
ExecutionException
public double getNewHeight()
public AffineTransform getNewTransform()
public double getNewTx()
public double getNewTy()
public double getNewWidth()
public double getOldHeight()
public AffineTransform getOldTransform()
public double getOldTx()
public double getOldTy()
public double getOldWidth()
public ViewportModel getViewportModel()
ViewportModel
which will be manipulated by this
operation.ViewportModel
which will be manipulated by this
operation.public boolean hasEffect()
true
if the execution of this operation will result
in a manipulation, i.e. if it will have an effect. Otherwise
false
is returned.true
if the execution of this operation will result
in a manipulation, otherwise false
.protected void readViewport(ViewportModel viewportModel)
viewportModel
- The ViewportModel
from which the values are read.public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException
redo
in interface IUndoableOperation
redo
in class AbstractOperation
ExecutionException
public void setNewHeight(double newHeight)
newHeight
- The viewport height to apply when executing this operation.public void setNewTransform(AffineTransform newTransform)
newTransform
- The contents transformation to apply when executing this
operation.public void setNewTx(double newTx)
newTx
- The horizontal translation to apply when executing this
operation.public void setNewTy(double newTy)
newTy
- The vertical translation to apply when executing this
operation.public void setNewWidth(double newWidth)
newWidth
- The viewport width to apply when executing this operation.public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException
undo
in interface IUndoableOperation
undo
in class AbstractOperation
ExecutionException
Copyright (c) 2014 itemis AG and others. All rights reserved.