Package org.eclipse.gef.mvc.fx.policies
Class ResizePolicy
java.lang.Object
org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl<IVisualPart<? extends javafx.scene.Node>>
org.eclipse.gef.mvc.fx.policies.AbstractPolicy
org.eclipse.gef.mvc.fx.policies.ResizePolicy
- All Implemented Interfaces:
IAdaptable.Bound<IVisualPart<? extends javafx.scene.Node>>,IPolicy
-
Property Summary
Properties inherited from class org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl
adaptableProperties inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
adaptable -
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
IAdaptable.Bound.Impl<T extends IAdaptable> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplySize(double dw, double dh) Apply the new size to the host.commit()Returns anITransactionalOperationthat performs all manipulations applied by the policy since the previousAbstractPolicy.init()call.protected DimensioncomputeApplicableDelta(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 ITransactionalOperationCreates anITransactionalOperationthat is used to encapsulate the changes that are applied by thisAbstractPolicythrough its "work" methods.protected ITransactionalOperationcreateResizeContentOperation(ResizeOperation resizeOperation) Create an operation to resize the content according to the givenResizeOperation.protected DimensionReturns the current size of theIResizableContentPart.doubleReturns the delta height of theresize operationthat is used by this policy.doubleReturns the delta width of theresize operationthat is used by this policy.IResizableContentPart<? extends javafx.scene.Node>getHost()protected DimensionReturns the initial size of theIResizableContentPart.protected ResizeOperationReturns theResizeOperationthat is used by thisResizePolicy.protected booleanReturns whether the content part supports a content resize operation.voidresize(double finalDw, double finalDh) Resizes the host by the given delta width and delta height.protected voidupdateResizeOperation(double intendedDeltaWidth, double intendedDeltaHeight) Computes the applicable delta width and height from the given intended delta values and updates the operation accordingly.Methods inherited from class org.eclipse.gef.mvc.fx.policies.AbstractPolicy
checkInitialized, getOperation, init, isInitialized, locallyExecuteOperation, rollbackMethods inherited from class org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl
adaptableProperty, getAdaptable, setAdaptableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound
adaptableProperty, getAdaptable, setAdaptable
-
Constructor Details
-
ResizePolicy
public ResizePolicy()
-
-
Method Details
-
applySize
protected void applySize(double dw, double dh) Apply the new size to the host.- Parameters:
dw- The width delta.dh- The height delta.
-
commit
Description copied from class:AbstractPolicyReturns anITransactionalOperationthat performs all manipulations applied by the policy since the previousAbstractPolicy.init()call.- Specified by:
commitin interfaceIPolicy- Overrides:
commitin classAbstractPolicy- Returns:
- An
ITransactionalOperationthat performs all manipulations applied by the policy since the lastAbstractPolicy.init()call.
-
computeApplicableDelta
Computes the applicable delta from the given delta width and delta height values, i.e. respecting the part's minimum size.- Parameters:
dw- The width delta.dh- The height delta.- Returns:
- A
Dimensioncontaining the applicable delta based on the given values.
-
createOperation
Description copied from class:AbstractPolicyCreates anITransactionalOperationthat is used to encapsulate the changes that are applied by thisAbstractPolicythrough its "work" methods. The created operation should allow forlocal executionat each time.- Specified by:
createOperationin classAbstractPolicy- Returns:
- A new
ITransactionalOperationto encapsulate all applied changes.
-
createResizeContentOperation
Create an operation to resize the content according to the givenResizeOperation.- Parameters:
resizeOperation- TheResizeOperationfor which to create aResizeContentOperation.- Returns:
- The operation to resize the content.
-
getCurrentSize
Returns the current size of theIResizableContentPart.- Returns:
- The current size.
-
getDeltaHeight
public double getDeltaHeight()Returns the delta height of theresize operationthat is used by this policy.- Returns:
- The delta height of the
resize operationthat is used by this policy.
-
getDeltaWidth
public double getDeltaWidth()Returns the delta width of theresize operationthat is used by this policy.- Returns:
- The delta width of the
resize operationthat is used by this policy.
-
getHost
Description copied from interface:IPolicy- Returns:
- The host of this
IPolicy.
-
getInitialSize
Returns the initial size of theIResizableContentPart.- Returns:
- The initial size.
-
getResizeOperation
Returns theResizeOperationthat is used by thisResizePolicy.- Returns:
- The
ResizeOperationused by thisAbstractPolicy.
-
isContentResizable
protected boolean isContentResizable()Returns whether the content part supports a content resize operation.- Returns:
trueif content resize is supported,falseotherwise.
-
resize
public void resize(double finalDw, double finalDh) Resizes the host by the given delta width and delta height.- Parameters:
finalDw- The delta width.finalDh- The delta height.
-
updateResizeOperation
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.- Parameters:
intendedDeltaWidth- The intended width delta.intendedDeltaHeight- The intended height delta.
-