- java.lang.Object
-
- javafx.beans.binding.NumberExpressionBase
-
- javafx.beans.binding.DoubleExpression
-
- javafx.beans.property.ReadOnlyDoubleProperty
-
- javafx.beans.property.DoubleProperty
-
- すべての実装されたインタフェース:
NumberExpression,Observable,Property<Number>,ReadOnlyProperty<Number>,ObservableDoubleValue,ObservableNumberValue,ObservableValue<Number>,WritableDoubleValue,WritableNumberValue,WritableValue<Number>
- 直系の既知のサブクラス:
DoublePropertyBase,JavaBeanDoubleProperty
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)を参照してください。- 導入されたバージョン:
- JavaFX 2.0
- 関連項目:
ObservableDoubleValue、WritableDoubleValue、ReadOnlyDoubleProperty、Property
-
-
コンストラクタのサマリー
コンストラクタ コンストラクタ 説明 DoubleProperty()
-
メソッドのサマリー
すべてのメソッド 静的メソッド インスタンス・メソッド 具象メソッド 修飾子と型 メソッド 説明 ObjectProperty<Double>asObject()このDoublePropertyに双方向にバインドされたObjectPropertyを作成します。voidbindBidirectional(Property<Number> other)このPropertyと別のPropertyの間の双方向バインディングを作成します。static DoublePropertydoubleProperty(Property<Double> property)Propertyをラップし、双方向にバインドされるDoublePropertyを返します。voidsetValue(Number v)ラップされた値を設定します。StringtoString()このDoublePropertyオブジェクトの文字列表現を返します。voidunbindBidirectional(Property<Number> other)このPropertyと別のPropertyの間の双方向バインディングを削除します。-
クラスjavafx.beans.binding.DoubleExpressionから継承されたメソッド
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
-
クラスjavafx.beans.binding.NumberExpressionBaseから継承されたメソッド
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
-
クラス java.lang.Objectから継承されたメソッド
clone、equals、finalize、getClass、hashCode、notify、notifyAll、wait、wait、wait
-
インタフェースjavafx.beans.Observableから継承されたメソッド
addListener、removeListener
-
インタフェースjavafx.beans.value.ObservableDoubleValueから継承されたメソッド
get
-
インタフェースjavafx.beans.value.ObservableValueから継承されたメソッド
addListener、getValue、removeListener
-
クラスjavafx.beans.property.ReadOnlyDoublePropertyから継承されたメソッド
readOnlyDoubleProperty
-
インタフェースjavafx.beans.property.ReadOnlyPropertyから継承されたメソッド
getBean, getName
-
インタフェースjavafx.beans.value.WritableDoubleValueから継承されたメソッド
get, set
-
インタフェースjavafx.beans.value.WritableValueから継承されたメソッド
getValue
-
-
-
-
メソッドの詳細
-
setValue
public void setValue(Number v)
ラップされた値を設定します。- 定義:
- インタフェース
WritableDoubleValueのsetValue - 定義:
- インタフェース
WritableValue<Number>のsetValue - パラメータ:
v- 新しい値
-
bindBidirectional
public void bindBidirectional(Property<Number> other)
このPropertyと別のPropertyの間の双方向バインディングを作成します。 双方向バインディングは、一方向バインディングと独立して存在します。 そのため、一方向バインディングを双方向バインディングを使用したプロパティに追加でき、その逆も可能です。 ただし、このプラクティスは推奨されていません。1つのPropertyに複数の双方向バインディングを使用できます。
JavaFX双方向バインディング実装は、弱いリスナーを使用します。 これは、双方向バインディングによってプロパティがガベージ・コレクションされないことを意味します。
- 定義:
- インタフェース
Property<Number>のbindBidirectional - パラメータ:
other- 他のProperty
-
unbindBidirectional
public void unbindBidirectional(Property<Number> other)
このPropertyと別のPropertyの間の双方向バインディングを削除します。 プロパティ間の双方向バインディングが存在しない場合、このメソッドの呼出しは影響しません。 2つ目のプロパティの呼出しによって、バインド解除できます。 このコードが動作します:property1.bindBirectional(property2); property2.unbindBidirectional(property1);- 定義:
- インタフェース
Property<Number>のunbindBidirectional - パラメータ:
other- 他のProperty
-
toString
public String toString()
このDoublePropertyオブジェクトの文字列表現を返します。- オーバーライド:
- クラス
ReadOnlyDoublePropertyのtoString - 戻り値:
- この
DoublePropertyオブジェクトの文字列表現。
-
doubleProperty
public static DoubleProperty doubleProperty(Property<Double> property)
Propertyをラップし、双方向にバインドされるDoublePropertyを返します。 このプロパティの変更により、元のプロパティが変更されます。これは、ObjectProperty <Double>とDoublePropertyを双方向にバインドする場合に非常に便利です。
別の方法は、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に変換することです。注意: ソース・プロパティのnull値は、0.0として解釈されます
- パラメータ:
property- ソースProperty- 戻り値:
PropertyをラップするDoubleProperty- 例外:
NullPointerException-propertyがnullの場合- 導入されたバージョン:
- JavaFX 8.0
- 関連項目:
asObject()
-
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 - 導入されたバージョン:
- JavaFX 8.0
-
-