Package org.eclipse.gef.fx.anchors
Class IComputationStrategy.Parameter<T>
- java.lang.Object
-
- javafx.beans.binding.ObjectExpression<T>
-
- javafx.beans.property.ReadOnlyObjectProperty<T>
-
- javafx.beans.property.ObjectProperty<T>
-
- javafx.beans.property.ObjectPropertyBase<T>
-
- org.eclipse.gef.fx.anchors.IComputationStrategy.Parameter<T>
-
- Type Parameters:
T- The parameter value type.
- All Implemented Interfaces:
javafx.beans.Observable,javafx.beans.property.Property<T>,javafx.beans.property.ReadOnlyProperty<T>,javafx.beans.value.ObservableObjectValue<T>,javafx.beans.value.ObservableValue<T>,javafx.beans.value.WritableObjectValue<T>,javafx.beans.value.WritableValue<T>
- Direct Known Subclasses:
DynamicAnchor.AnchorageReferenceGeometry,DynamicAnchor.AnchorageReferencePosition,DynamicAnchor.AnchoredReferencePoint,DynamicAnchor.PreferredOrientation
- Enclosing interface:
- IComputationStrategy
public abstract static class IComputationStrategy.Parameter<T> extends javafx.beans.property.ObjectPropertyBase<T>Base class for all computation parameters that can be passed to anIComputationStrategy.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIComputationStrategy.Parameter.KindIndicates whether the parameter value can be shared to compute positions of all attached anchors or not.
-
Constructor Summary
Constructors Constructor Description Parameter(IComputationStrategy.Parameter.Kind kind)Creates a new mandatoryIComputationStrategy.Parameterof the given kind.Parameter(IComputationStrategy.Parameter.Kind kind, boolean optional)Creates a new optional parameter of the given kind.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbind(javafx.beans.value.ObservableValue<? extends T> newObservable)protected static <T extends IComputationStrategy.Parameter<?>>
Tget(java.util.Collection<? extends IComputationStrategy.Parameter<?>> parameters, java.lang.Class<T> parameterType)Retrieves a parameter of the respective type from the set of given parameters.java.lang.ObjectgetBean()IComputationStrategy.Parameter.KindgetKind()Retrieves theIComputationStrategy.Parameter.Kindof this parameter, which indicates whether a single value may be shared to compute the positions of all attachedAnchorKeys or not.static IComputationStrategy.Parameter.KindgetKind(java.lang.Class<? extends IComputationStrategy.Parameter<?>> paramType)Returns theIComputationStrategy.Parameter.Kindreturned by an instance of the givenIComputationStrategy.Parametertype.java.lang.StringgetName()voidinvalidateBinding()If this parameter is bound, can be used to invalidate the underlying binding, so that the value is re-computed.booleanisOptional()Indicates whether this parameter is optionalstatic booleanisOptional(java.lang.Class<? extends IComputationStrategy.Parameter<?>> paramType)Returnstrueif an instance of the givenIComputationStrategy.Parametertype is optional.voidunbind()-
Methods inherited from class javafx.beans.property.ObjectPropertyBase
addListener, addListener, fireValueChangedEvent, get, invalidated, isBound, removeListener, removeListener, set, toString
-
Methods inherited from class javafx.beans.property.ObjectProperty
bindBidirectional, setValue, unbindBidirectional
-
Methods inherited from class javafx.beans.binding.ObjectExpression
asString, asString, asString, getValue, isEqualTo, isEqualTo, isNotEqualTo, isNotEqualTo, isNotNull, isNull, objectExpression
-
-
-
-
Constructor Detail
-
Parameter
public Parameter(IComputationStrategy.Parameter.Kind kind)
Creates a new mandatoryIComputationStrategy.Parameterof the given kind.- Parameters:
kind- The parameter kind.
-
Parameter
public Parameter(IComputationStrategy.Parameter.Kind kind, boolean optional)
Creates a new optional parameter of the given kind.- Parameters:
kind- The parameter kin.optional- Whether this parameter is optional or not.
-
-
Method Detail
-
get
protected static <T extends IComputationStrategy.Parameter<?>> T get(java.util.Collection<? extends IComputationStrategy.Parameter<?>> parameters, java.lang.Class<T> parameterType)
Retrieves a parameter of the respective type from the set of given parameters.- Type Parameters:
T- The runtime type of the parameter.- Parameters:
parameters- The set of parameters to search.parameterType- The parameter type- Returns:
- The parameter or
null.
-
getKind
public static IComputationStrategy.Parameter.Kind getKind(java.lang.Class<? extends IComputationStrategy.Parameter<?>> paramType)
Returns theIComputationStrategy.Parameter.Kindreturned by an instance of the givenIComputationStrategy.Parametertype.- Parameters:
paramType- TheIComputationStrategy.Parametertype for which to return theIComputationStrategy.Parameter.Kind.- Returns:
- The
IComputationStrategy.Parameter.Kindfor the givenIComputationStrategy.Parametertype.
-
isOptional
public static boolean isOptional(java.lang.Class<? extends IComputationStrategy.Parameter<?>> paramType)
Returnstrueif an instance of the givenIComputationStrategy.Parametertype is optional. Otherwise returnsfalse.- Parameters:
paramType- TheIComputationStrategy.Parametertype for which to determine optionality.- Returns:
trueif an instance of the givenIComputationStrategy.Parametertype is optional, otherwisefalse.
-
bind
public void bind(javafx.beans.value.ObservableValue<? extends T> newObservable)
-
getBean
public java.lang.Object getBean()
-
getKind
public final IComputationStrategy.Parameter.Kind getKind()
Retrieves theIComputationStrategy.Parameter.Kindof this parameter, which indicates whether a single value may be shared to compute the positions of all attachedAnchorKeys or not.- Returns:
- The parameter
IComputationStrategy.Parameter.Kind.
-
getName
public java.lang.String getName()
-
invalidateBinding
public void invalidateBinding()
If this parameter is bound, can be used to invalidate the underlying binding, so that the value is re-computed.
-
isOptional
public final boolean isOptional()
Indicates whether this parameter is optional- Returns:
trueif the parameter is optional,falseotherwise.
-
-