public abstract class DoubleProperty extends ReadOnlyDoubleProperty implements Property<Number>, WritableDoubleValue
double
値をラップするProperty
を定義します。
ObservableDoubleValue.get()
、DoubleExpression.getValue()
、WritableDoubleValue.set(double)
およびsetValue(Number)
を使用して、DoubleProperty
の値を取得および設定できます。
Property.bind(ObservableValue)
およびProperty.unbind()
を使用して、プロパティを一方向にバインドおよびバインド解除できます。bindBidirectional(Property)
およびunbindBidirectional(Property)
を使用して、双方向バインディングを作成および削除できます。
ReadOnlyProperty.getBean()
およびReadOnlyProperty.getName()
を使用して、DoubleProperty
のコンテキストを読み取ることができます。
注意: null値へのこのプロパティの設定またはバインドにより、プロパティが0.0に設定されます。setValue(java.lang.Number)
を参照してください。
ObservableDoubleValue
、WritableDoubleValue
、ReadOnlyDoubleProperty
、Property
コンストラクタと説明 |
---|
DoubleProperty() |
修飾子と型 | メソッドと説明 |
---|---|
ObjectProperty<Double> |
asObject()
この
DoubleProperty に双方向にバインドされたObjectProperty を作成します。 |
void |
bindBidirectional(Property<Number> other)
この
Property と別のPropertyの間の双方向バインディングを作成します。 |
static DoubleProperty |
doubleProperty(Property<Double> property)
Property をラップし、双方向にバインドされるDoubleProperty を返します。 |
void |
setValue(Number v)
ラップされた値を設定します。
|
String |
toString()
この
DoubleProperty オブジェクトの文字列表現を返します。 |
void |
unbindBidirectional(Property<Number> other)
この
Property と別のPropertyの間の双方向バインディングを削除します。 |
readOnlyDoubleProperty
add, add, add, add, add, divide, divide, divide, divide, divide, doubleExpression, doubleExpression, doubleValue, floatValue, getValue, intValue, longValue, multiply, multiply, multiply, multiply, multiply, negate, subtract, subtract, subtract, subtract, subtract
asString, asString, asString, greaterThan, greaterThan, greaterThan, greaterThan, greaterThan, greaterThanOrEqualTo, greaterThanOrEqualTo, greaterThanOrEqualTo, greaterThanOrEqualTo, greaterThanOrEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, isNotEqualTo, lessThan, lessThan, lessThan, lessThan, lessThan, lessThanOrEqualTo, lessThanOrEqualTo, lessThanOrEqualTo, lessThanOrEqualTo, lessThanOrEqualTo, numberExpression
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBean, getName
addListener、getValue、removeListener
addListener、removeListener
get, set
getValue
get
public void setValue(Number v)
WritableDoubleValue
のsetValue
WritableValue<Number>
のsetValue
v
- 新しい値public void bindBidirectional(Property<Number> other)
Property
と別のPropertyの間の双方向バインディングを作成します。双方向バインディングは、一方向バインディングと独立して存在します。そのため、一方向バインディングを双方向バインディングを使用したプロパティに追加でき、その逆も可能です。ただし、このプラクティスは推奨されていません。
1つのPropertyに複数の双方向バインディングを使用できます。
JavaFX双方向バインディング実装は、弱いリスナーを使用します。これは、双方向バインディングによってプロパティがガベージ・コレクションされないことを意味します。
Property<Number>
のbindBidirectional
other
- 他のProperty
public void unbindBidirectional(Property<Number> other)
Property
と別のPropertyの間の双方向バインディングを削除します。プロパティ間の双方向バインディングが存在しない場合、このメソッドの呼出しは影響しません。2つ目のプロパティの呼出しによって、バインド解除できます。このコードが動作します:
property1.bindBirectional(property2); property2.unbindBidirectional(property1);
Property<Number>
のunbindBidirectional
other
- 他のProperty
public String toString()
DoubleProperty
オブジェクトの文字列表現を返します。ReadOnlyDoubleProperty
のtoString
DoubleProperty
オブジェクトの文字列表現。public static DoubleProperty doubleProperty(Property<Double> property)
Property
をラップし、双方向にバインドされるDoubleProperty
を返します。このプロパティの変更により、元のプロパティが変更されます。
ObjectProperty
注意: ソース・プロパティのnull値は、0.0として解釈されます
別の方法は、
DoubleProperty doubleProperty = new SimpleDoubleProperty(1.0);
ObjectProperty<Double> objectProperty = new SimpleObjectProperty<>(2.0);
// Need to keep the reference as bidirectional binding uses weak references
DoubleProperty objectAsDouble = DoubleProperty.doubleProperty(objectProperty);
doubleProperty.bindBidirectional(objectAsDouble);
asObject()
メソッドを使用してDoublePropertyをObjectPropertyに変換することです。
property
- ソースProperty
Property
をラップするDoubleProperty
NullPointerException
- property
がnull
の場合asObject()
public ObjectProperty<Double> asObject()
DoubleProperty
に双方向にバインドされたObjectProperty
を作成します。このDoubleProperty
の値が変更されると、ObjectProperty
の値が自動的に更新され、その逆も同様です。
DoublePropertyへのObjectPropertyのバインドに使用できます。
DoubleProperty doubleProperty = new SimpleDoubleProperty(1.0); ObjectProperty<Double> objectProperty = new SimpleObjectProperty<>(2.0); objectProperty.bind(doubleProperty.asObject());
ReadOnlyDoubleProperty
のasObject
ObjectProperty
Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.