public class FXResizePolicy extends AbstractPolicy<javafx.scene.Node> implements ITransactional
Modifier and Type | Field and Description |
---|---|
protected boolean |
initialized
Stores the initialized flag for this policy, i.e.
|
protected ForwardUndoCompositeOperation |
resizeAndRevealOperation
The
ForwardUndoCompositeOperation that assembles the resize
operation and the reveal operation. |
protected FXResizeNodeOperation |
resizeOperation
The
FXResizeNodeOperation that is used to resize the host's
visual. |
Constructor and Description |
---|
FXResizePolicy() |
Modifier and Type | Method and Description |
---|---|
IUndoableOperation |
commit()
Returns an
IUndoableOperation that performs all manipulations
applied by the policy since the last ITransactional.init() call. |
protected Dimension |
getInitialSize(javafx.scene.Node visualToResize)
Returns the current size of the passed-in
Node , i.e. the width
and height of its layout-bounds. |
protected double |
getMinimumHeight()
Returns the minimum height.
|
protected double |
getMinimumWidth()
Returns the minimum width.
|
protected javafx.scene.Node |
getVisualToResize()
Returns the
Node that should be resized. |
void |
init()
Initializes the policy, so that the policy's "work" methods can be used.
|
void |
performResize(double dw,
double dh)
Resizes the
visual by the given delta width
and delta height. |
protected void |
updateOperation(double layoutDw,
double layoutDh)
Updates the resize operation to use the given delta width and delta
height.
|
commit, disableRefreshVisuals, enableRefreshVisuals, getAdaptable, getHost, init, setAdaptable
protected boolean initialized
protected FXResizeNodeOperation resizeOperation
FXResizeNodeOperation
that is used to resize the host's
visual.protected ForwardUndoCompositeOperation resizeAndRevealOperation
ForwardUndoCompositeOperation
that assembles the resize
operation and the reveal operation.public IUndoableOperation commit()
ITransactional
IUndoableOperation
that performs all manipulations
applied by the policy since the last ITransactional.init()
call. When called
multiple times in sequence, only the first call will yield an operation,
the subsequent calls will yield null
.commit
in interface ITransactional
IUndoableOperation
that performs all manipulations
applied by the policy since the last ITransactional.init()
call.protected Dimension getInitialSize(javafx.scene.Node visualToResize)
Node
, i.e. the width
and height of its layout-bounds.visualToResize
- The Node
for which to return the current size.Node
.protected double getMinimumHeight()
Node
cannot be
changed below this limit.protected double getMinimumWidth()
Node
cannot be changed
below this limit.protected javafx.scene.Node getVisualToResize()
Node
that should be resized. Per default, this is the
host's
visual.Node
that should be resized.public void init()
ITransactional
IllegalStateException
. It is safe to call ITransactional.init()
multiple times in sequence.init
in interface ITransactional
public void performResize(double dw, double dh)
visual
by the given delta width
and delta height.dw
- The delta width.dh
- The delta height.protected void updateOperation(double layoutDw, double layoutDh)
layoutDw
- The new delta width.layoutDh
- The new delta height.Copyright (c) 2014 itemis AG and others. All rights reserved.