public class ResizePolicy extends AbstractPolicy
adaptable
adaptable
IAdaptable.Bound.Impl<T extends IAdaptable>
Constructor and Description |
---|
ResizePolicy() |
Modifier and Type | Method and Description |
---|---|
protected void |
applySize(double dw,
double dh)
Apply the new size to the host.
|
ITransactionalOperation |
commit()
Returns an
ITransactionalOperation that performs all
manipulations applied by the policy since the previous AbstractPolicy.init()
call. |
protected Dimension |
computeApplicableDelta(double dw,
double dh)
Computes the applicable delta from the given delta width and delta height
values, i.e. respecting the part's minimum size.
|
protected ITransactionalOperation |
createOperation()
Creates an
ITransactionalOperation that is used to encapsulate
the changes that are applied by this AbstractPolicy through its
"work" methods. |
protected ITransactionalOperation |
createResizeContentOperation(ResizeOperation resizeOperation)
Create an operation to resize the content according to the given
ResizeOperation . |
protected Dimension |
getCurrentSize()
Returns the current size of the
IResizableContentPart . |
double |
getDeltaHeight()
Returns the delta height of the
resize
operation that is used by this policy. |
double |
getDeltaWidth()
Returns the delta width of the
resize
operation that is used by this policy. |
IResizableContentPart<? extends javafx.scene.Node> |
getHost()
|
protected Dimension |
getInitialSize()
Returns the initial size of the
IResizableContentPart . |
protected ResizeOperation |
getResizeOperation()
Returns the
ResizeOperation that is used by this
ResizePolicy . |
protected boolean |
isContentResizable()
Returns whether the content part supports a content resize operation.
|
void |
resize(double finalDw,
double finalDh)
Resizes the host by the given delta width and delta height.
|
protected void |
updateResizeOperation(double intendedDeltaWidth,
double intendedDeltaHeight)
Computes the applicable delta width and height from the given intended
delta values and updates the operation accordingly.
|
checkInitialized, getOperation, init, isInitialized, locallyExecuteOperation, rollback
adaptableProperty, getAdaptable, setAdaptable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
adaptableProperty, getAdaptable, setAdaptable
protected void applySize(double dw, double dh)
dw
- The width delta.dh
- The height delta.public ITransactionalOperation commit()
AbstractPolicy
ITransactionalOperation
that performs all
manipulations applied by the policy since the previous AbstractPolicy.init()
call.commit
in interface IPolicy
commit
in class AbstractPolicy
ITransactionalOperation
that performs all
manipulations applied by the policy since the last
AbstractPolicy.init()
call.protected Dimension computeApplicableDelta(double dw, double dh)
dw
- The width delta.dh
- The height delta.Dimension
containing the applicable delta based on the
given values.protected ITransactionalOperation createOperation()
AbstractPolicy
ITransactionalOperation
that is used to encapsulate
the changes that are applied by this AbstractPolicy
through its
"work" methods. The created operation should allow for
local execution
at each time.createOperation
in class AbstractPolicy
ITransactionalOperation
to encapsulate all applied
changes.protected ITransactionalOperation createResizeContentOperation(ResizeOperation resizeOperation)
ResizeOperation
.resizeOperation
- The ResizeOperation
for which to create a
ResizeContentOperation
.protected Dimension getCurrentSize()
IResizableContentPart
.public double getDeltaHeight()
resize
operation
that is used by this policy.resize
operation
that is used by this policy.public double getDeltaWidth()
resize
operation
that is used by this policy.resize
operation
that is used by this policy.public IResizableContentPart<? extends javafx.scene.Node> getHost()
IPolicy
IPolicy
.protected Dimension getInitialSize()
IResizableContentPart
.protected ResizeOperation getResizeOperation()
ResizeOperation
that is used by this
ResizePolicy
.ResizeOperation
used by this AbstractPolicy
.protected boolean isContentResizable()
true
if content resize is supported,
false
otherwise.public void resize(double finalDw, double finalDh)
finalDw
- The delta width.finalDh
- The delta height.protected void updateResizeOperation(double intendedDeltaWidth, double intendedDeltaHeight)
intendedDeltaWidth
- The intended width delta.intendedDeltaHeight
- The intended height delta.Copyright (c) 2014, 2016 itemis AG and others. All rights reserved.