Java 类javafx.beans.property.MapProperty 实例源码

项目:SynchronizeFX    文件:PropertyVisitor.java   
/**
 * 
 * @param object
 *            The object which fields should be visited.
 * @return {@code true} when the object was a observable object, {@code false} when it was a simple object.
 * @throws SecurityException
 *             If a {@link SecurityManager} is active and denies access to fields via reflection.
 * @throws IllegalAccessException
 *             If access modifiers like {@code private} are enforced even when the model is accessed via reflection.
 */
private boolean visitFields(final Object object) throws IllegalAccessException {
    boolean isObservableObject = false;
    for (final Field field : getInheritedFields(object.getClass())) {
        field.setAccessible(true);
        currentField = field;
        final Class<?> fieldClass = field.getType();

        if (!isObservableObject && classImplementsOrExtends(fieldClass, Property.class)) {
            startVisiting(object);
            isObservableObject = true;
        }

        if (classImplementsOrExtends(fieldClass, ListProperty.class)) {
            handle((ListProperty<?>) field.get(object));
        } else if (classImplementsOrExtends(fieldClass, SetProperty.class)) {
            handle((SetProperty<?>) field.get(object));
        } else if (classImplementsOrExtends(fieldClass, MapProperty.class)) {
            handle((MapProperty<?, ?>) field.get(object));
        } else if (classImplementsOrExtends(fieldClass, Property.class)) {
            handle((Property<?>) field.get(object));
        }
    }
    return isObservableObject;
}
项目:Java-9-Programming-Blueprints    文件:BeanPathAdapter.java   
/**
 * Provides the underlying value class for a given {@link Property}
 * 
 * @param property
 *            the {@link Property} to check
 * @return the value class of the {@link Property}
 */
@SuppressWarnings("unchecked")
protected static <T> Class<T> propertyValueClass(final Property<T> property) {
    Class<T> clazz = null;
    if (property != null) {
        if (StringProperty.class.isAssignableFrom(property.getClass())) {
            clazz = (Class<T>) String.class;
        } else if (IntegerProperty.class.isAssignableFrom(property
                .getClass())) {
            clazz = (Class<T>) Integer.class;
        } else if (BooleanProperty.class.isAssignableFrom(property
                .getClass())) {
            clazz = (Class<T>) Boolean.class;
        } else if (DoubleProperty.class.isAssignableFrom(property
                .getClass())) {
            clazz = (Class<T>) Double.class;
        } else if (FloatProperty.class
                .isAssignableFrom(property.getClass())) {
            clazz = (Class<T>) Float.class;
        } else if (LongProperty.class.isAssignableFrom(property.getClass())) {
            clazz = (Class<T>) Long.class;
        } else if (ListProperty.class.isAssignableFrom(property.getClass())) {
            clazz = (Class<T>) List.class;
        } else if (MapProperty.class.isAssignableFrom(property.getClass())) {
            clazz = (Class<T>) Map.class;
        } else {
            clazz = (Class<T>) Object.class;
        }
    }
    return clazz;
}
项目:javafx-demos    文件:BeanPathAdapter.java   
/**
 * Provides the underlying value class for a given {@linkplain Property}
 * 
 * @param property
 *            the {@linkplain Property} to check
 * @return the value class of the {@linkplain Property}
 */
@SuppressWarnings("unchecked")
protected static <T> Class<T> propertyValueClass(final Property<T> property) {
    Class<T> clazz = null;
    if (property != null) {
        if (StringProperty.class.isAssignableFrom(property.getClass())) {
            clazz = (Class<T>) String.class;
        } else if (IntegerProperty.class.isAssignableFrom(property
                .getClass())) {
            clazz = (Class<T>) Integer.class;
        } else if (BooleanProperty.class.isAssignableFrom(property
                .getClass())) {
            clazz = (Class<T>) Boolean.class;
        } else if (DoubleProperty.class.isAssignableFrom(property
                .getClass())) {
            clazz = (Class<T>) Double.class;
        } else if (FloatProperty.class.isAssignableFrom(property
                .getClass())) {
            clazz = (Class<T>) Float.class;
        } else if (LongProperty.class.isAssignableFrom(property
                .getClass())) {
            clazz = (Class<T>) Long.class;
        } else if (ListProperty.class.isAssignableFrom(property
                .getClass())) {
            clazz = (Class<T>) List.class;
        } else if (MapProperty.class.isAssignableFrom(property
                .getClass())) {
            clazz = (Class<T>) Map.class;
        } else {
            clazz = (Class<T>) Object.class;
        }
    }
    return clazz;
}
项目:SynchronizeFX    文件:PropertyVisitor.java   
private void handle(final MapProperty<?, ?> property) throws IllegalAccessException {
    if (visitCollectionProperty(property)) {
        for (Entry<?, ?> entry : property.entrySet()) {
            visit(entry.getKey());
            visit(entry.getValue());
        }
    }
}
项目:SynchronizeFX    文件:PropertyVisitor.java   
Parent(final Property<?> parentProperty, final ListProperty<?> parentList, final SetProperty<?> parentSet,
        final MapProperty<?, ?> parentMap) {
    this.parentList = parentList;
    this.parentSet = parentSet;
    this.parentMap = parentMap;
    this.parentProperty = parentProperty;
}
项目:fx-gson    文件:MapPropertyTypeAdapter.java   
@NotNull
@Override
protected MapProperty<K, V> createProperty(ObservableMap<K, V> deserializedValue) {
    return new SimpleMapProperty<>(deserializedValue);
}
项目:LoliXL    文件:SimpleGameConfiguration.java   
public MapProperty<String, String> customizedCommandlineVariablesProperty() {
    return customizedCommandlineVariablesProperty;
}
项目:drbookings    文件:BinYearMonth.java   
public final MapProperty<YearMonth, Collection<DateBean>> yearMonth2DateBeanMapProperty() {
return this.yearMonth2DateBeanMap;
   }
项目:drbookings    文件:MoneyMonitor.java   
public final MapProperty<LocalDate, Number> dayToNetEarningsProperty() {
    return this.dayToNetEarnings;
}
项目:drbookings    文件:MoneyMonitor.java   
public final MapProperty<YearMonth, Number> yearMonthToNetEarningsProperty() {
    return this.yearMonthToNetEarnings;
}
项目:drbookings    文件:DateBean.java   
public final MapProperty<String, Number> earningsPerOriginProperty() {
    return this.earningsPerOrigin;
}
项目:Topsoil    文件:VariableColumnChooser.java   
public MapProperty<Variable<Number>, TopsoilDataColumn> selectionsProperty() {
    if (selectionsProperty == null) {
        selectionsProperty = new SimpleMapProperty<>(FXCollections.observableHashMap());
    }
    return selectionsProperty;
}
项目:firstlight    文件:MenuBarModel.java   
public final MapProperty<String, MenuItemModel> currentMenuItemsProperty(){
    return this.currentMenuItems;
}
项目:auto-web-auth    文件:Profile.java   
public MapProperty<String, String> parameterProperty() {
return this.parameterProperty;
   }
项目:SynchronizeFX    文件:PropertyVisitor.java   
/**
 * Visit a field of type {@link MapProperty}.
 * 
 * @param fieldValue
 *            The value that is bound to the field.
 * @return {@code true} if the childs of this property should be visited, {@code false} if not.
 */
protected abstract boolean visitCollectionProperty(MapProperty<?, ?> fieldValue);
项目:SynchronizeFX    文件:PropertyVisitor.java   
/**
 * @return The parent {@link MapProperty} if the parent of the current object is a {@link MapProperty}. If not or if
 *         this is the root element and therefore their is no parent {@code null} is returned.
 */
public MapProperty<?, ?> getParentMap() {
    return parent.peek().parentMap;
}
项目:SynchronizeFX    文件:Listeners.java   
/**
 * Registers listeners on a property so that commands are created when changes in the property occur.
 * 
 * @param map
 *            The property to register the change listeners on.
 */
public void registerOn(final MapProperty<?, ?> map) {
    map.addListener(mapListener);
}