VR
- The visual root node of the UI toolkit used, e.g.
javafx.scene.Node in case of JavaFX.public abstract class AbstractResizePolicy<VR> extends AbstractTransactionPolicy<VR>
adaptable
IAdaptable.Bound.Impl<T extends IAdaptable>
Constructor and Description |
---|
AbstractResizePolicy() |
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 last AbstractTransactionPolicy.init() call. |
protected ITransactionalOperation |
createResizeContentOperation()
Create an operation to resize the content.
|
protected abstract Dimension |
getCurrentSize()
Returns the current size of the
IResizableContentPart . |
protected Dimension |
getInitialSize()
Returns the initial size of the
IResizableContentPart . |
void |
init()
Initializes the policy, so that the policy's "work" methods can be used.
|
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 abstract void |
updateResizeOperation(double finalDw,
double finalDh)
Update the resize operation to the new final dh and dw values.
|
checkInitialized, createOperation, getOperation, isInitialized, locallyExecuteOperation, rollback
adaptableProperty, getAdaptable, getHost, setAdaptable
protected void applySize(double dw, double dh)
dw
- The width delta.dh
- The height delta.public ITransactionalOperation commit()
AbstractTransactionPolicy
ITransactionalOperation
that performs all
manipulations applied by the policy since the last AbstractTransactionPolicy.init()
call.
When called multiple times in sequence, only the first call will yield an
operation, the subsequent calls will yield null
.commit
in class AbstractTransactionPolicy<VR>
ITransactionalOperation
that performs all
manipulations applied by the policy since the last
AbstractTransactionPolicy.init()
call.protected ITransactionalOperation createResizeContentOperation()
protected abstract Dimension getCurrentSize()
IResizableContentPart
.protected Dimension getInitialSize()
IResizableContentPart
.public void init()
AbstractTransactionPolicy
IllegalStateException
. It is safe to call AbstractTransactionPolicy.init()
multiple times in sequence.init
in class AbstractTransactionPolicy<VR>
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 abstract void updateResizeOperation(double finalDw, double finalDh)
finalDw
- The new final width delta.finalDh
- The new final height delta.Copyright (c) 2014 itemis AG and others. All rights reserved.