@@ -0,0 +1,2853 @@
+/******************************************************************************%0A *                                                                            *%0A *                    Copyright 2018 Subterranean Security                    *%0A *                                                                            *%0A *  Licensed under the Apache License, Version 2.0 (the %22License%22);           *%0A *  you may not use this file except in compliance with the License.          *%0A *  You may obtain a copy of the License at                                   *%0A *                                                                            *%0A *      http://www.apache.org/licenses/LICENSE-2.0                            *%0A *                                                                            *%0A *  Unless required by applicable law or agreed to in writing, software       *%0A *  distributed under the License is distributed on an %22AS IS%22 BASIS,         *%0A *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  *%0A *  See the License for the specific language governing permissions and       *%0A *  limitations under the License.                                            *%0A *                                                                            *%0A *****************************************************************************/%0Apackage com.sandpolis.viewer.jfx.attribute;%0A%0Aimport java.util.LinkedList;%0Aimport java.util.List;%0A%0Aimport com.sandpolis.core.attribute.Attribute;%0Aimport com.sandpolis.core.attribute.UntrackedAttribute;%0A%0Aimport javafx.beans.InvalidationListener;%0Aimport javafx.beans.property.Property;%0Aimport javafx.beans.value.ChangeListener;%0Aimport javafx.beans.value.ObservableValue;%0A%0A/**%0A * This %7B@link Attribute%7D is intended to be bound to a JavaFX %7B@link Property%7D%0A * for extremely easy updates.%0A * %0A * @author cilki%0A * @since 5.0.0%0A */%0Apublic class ObservableAttribute%3CE%3E extends UntrackedAttribute%3CE%3E implements ObservableValue%3CE%3E %7B%0A%0A%09private List%3CChangeListener%3C? super E%3E%3E listeners = new LinkedList%3C%3E();%0A%0A%09@Override%0A%09public void addListener(InvalidationListener listener) %7B%0A%09%09throw new UnsupportedOperationException();%0A%09%7D%0A%0A%09@Override%0A%09public void removeListener(InvalidationListener listener) %7B%0A%09%09throw new UnsupportedOperationException();%0A%09%7D%0A%0A%09@Override%0A%09public void addListener(ChangeListener%3C? super E%3E listener) %7B%0A%09%09listeners.add(listener);%0A%09%7D%0A%0A%09@Override%0A%09public void removeListener(ChangeListener%3C? super E%3E listener) %7B%0A%09%09listeners.remove(listener);%0A%09%7D%0A%0A%09@Override%0A%09public void set(E value) %7B%0A%09%09listeners.forEach(listener -%3E listener.changed(this, get(), value));%0A%09%09super.set(value);%0A%09%7D%0A%0A%09@Override%0A%09public void set(E value, long time) %7B%0A%09%09listeners.forEach(listener -%3E listener.changed(this, get(), value));%0A%09%09super.set(value, time);%0A%09%7D%0A%0A%09@Override%0A%09public E getValue() %7B%0A%09%09return get();%0A%09%7D%0A%0A%7D%0A

Add ObservableAttribute