X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scenegraph%2Fsrc%2Forg%2Fsimantics%2Fscenegraph%2Futils%2Fvariable%2FDynamicDouble.java;h=60a6f8d41211e1944f9aa7bd8e92539f96c04cdf;hb=d9d532f32a94b62a8c2bfaeb1da0ad5ec429a21d;hp=656b771d2f6e952063196d139907c0fe14018eec;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/utils/variable/DynamicDouble.java b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/utils/variable/DynamicDouble.java index 656b771d2..60a6f8d41 100644 --- a/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/utils/variable/DynamicDouble.java +++ b/bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/utils/variable/DynamicDouble.java @@ -1,60 +1,60 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.scenegraph.utils.variable; - -/** - * A container for a single dynamic-enabled double variable of a scene graph - * node. Dynamic-enabled means a variable that potentially has two values: one - * static (~ default) and one dynamic. If the dynamic part has a non-null value - * it should always be used instead of the static value. Use - * {@link #getActiveValue()} to get the current variable value to follow this - * policy in your client code. - * - *

- * Variables generally determine the way a node gets rendered. - * - * @author Tuukka Lehtonen - */ -public class DynamicDouble extends DynamicVariable { - - private double value; - - public static DynamicDouble make(double initialValue) { - return new DynamicDouble(initialValue); - } - - public DynamicDouble(double initialValue) { - this.value = initialValue; - } - - public double getValue() { - return value; - } - - public double getActiveValue() { - return dynamicValue != null ? dynamicValue : value; - } - - /** - * Sets the static value of the variable. - * - * @param value new static value - */ - public void setValue(double value) { - this.value = value; - } - - public boolean hasDynamicValue() { - return dynamicValue != null && getValue() != getActiveValue(); - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.scenegraph.utils.variable; + +/** + * A container for a single dynamic-enabled double variable of a scene graph + * node. Dynamic-enabled means a variable that potentially has two values: one + * static (~ default) and one dynamic. If the dynamic part has a non-null value + * it should always be used instead of the static value. Use + * {@link #getActiveValue()} to get the current variable value to follow this + * policy in your client code. + * + *

+ * Variables generally determine the way a node gets rendered. + * + * @author Tuukka Lehtonen + */ +public class DynamicDouble extends DynamicVariable { + + private double value; + + public static DynamicDouble make(double initialValue) { + return new DynamicDouble(initialValue); + } + + public DynamicDouble(double initialValue) { + this.value = initialValue; + } + + public double getValue() { + return value; + } + + public double getActiveValue() { + return dynamicValue != null ? dynamicValue : value; + } + + /** + * Sets the static value of the variable. + * + * @param value new static value + */ + public void setValue(double value) { + this.value = value; + } + + public boolean hasDynamicValue() { + return dynamicValue != null && getValue() != getActiveValue(); + } + +}