public <ValueType> PropertyValueListener(String labelDescription, ReadOnlyProperty listenedProperty, String textFieldId, Object owningObject, Boolean showCounters) {
this.owningObject = owningObject;
receivedValueTF.setId(textFieldId);
receivedValueTF.setTooltip(new Tooltip());
if (listenedProperty.getName().contains("BOUNDS")) {
//Make text field width, because bounds - big.
receivedValueTF.setMinWidth(500);
}
this.listenedProperty = listenedProperty;
counter = new PropertyValueCounter(listenedProperty);
getChildren().add(LabelBuilder.create().text(labelDescription).prefWidth(100).build());
if (showCounters) {
getChildren().add(counter.getVisualRepresentation());
}
getChildren().add(receivedValueTF);
listenedProperty.addListener(new ChangeListener() {
public void changed(ObservableValue ov, Object t, Object t1) {
processNewValue(t1);
}
});
processNewValue(listenedProperty.getValue());
}
java类javafx.beans.property.ReadOnlyProperty的实例源码
PropertyValueListener.java 文件源码
项目:openjfx-8u-dev-tests
阅读 36
收藏 0
点赞 0
评论 0
DialogModalityAccessor.java 文件源码
项目:reduxfx
阅读 45
收藏 0
点赞 0
评论 0
@Override
protected void setValue(Consumer<Object> dispatcher, ReadOnlyProperty property, Object value) {
final Object bean = property.getBean();
if (bean instanceof Stage) {
final Stage stage = (Stage) bean;
if (stage.isShowing()) {
stage.hide();
stage.initModality((Modality) value);
stage.show();
} else {
stage.initModality((Modality) value);
}
} else {
LOG.warn("Unsupported Dialog-type encountered: {}", bean.getClass());
}
}
MapItemsControl.java 文件源码
项目:FX-Map-Control
阅读 29
收藏 0
点赞 0
评论 0
@Override
public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
if (!selectionChanging) {
selectionChanging = true;
ReadOnlyProperty<? extends Boolean> property = (ReadOnlyProperty<? extends Boolean>) observable;
MapItem mapItem = (MapItem) property.getBean();
T item = (T) mapItem.getItem();
if (item == null) {
item = (T) mapItem;
}
if (newValue) {
addSelectedItem(item);
} else {
removeSelectedItem(item);
}
selectionChanging = false;
}
}
ModelConfigDialog.java 文件源码
项目:lttng-scope
阅读 39
收藏 0
点赞 0
评论 0
public LineThicknessMenuButton(TimeGraphWidget widget,
ConfigOption<LineThickness> option,
ReadOnlyProperty<? extends Paint> colorSource) {
fOption = option;
fColorSource = colorSource;
ToggleGroup tg = new ToggleGroup();
List<LineThicknessMenuButtonItem> items = Arrays.stream(LineThickness.values())
.map(lt -> {
LineThicknessMenuButtonItem rmi = new LineThicknessMenuButtonItem(lt);
rmi.setGraphic(getRectangleForThickness(lt));
rmi.setToggleGroup(tg);
LineThickness currentThickness = option.get();
rmi.setSelected(lt == currentThickness);
rmi.setOnAction(e -> {
option.set(lt);
LineThicknessMenuButton.this.setGraphic(getRectangleForThickness(lt));
repaintAllRectangles(widget);
});
return rmi;
})
.collect(Collectors.toList());
/* Initial value shown in the button */
setGraphic(getRectangleForThickness(option.get()));
getItems().addAll(items);
}
WindowShowingAccessor.java 文件源码
项目:reduxfx
阅读 27
收藏 0
点赞 0
评论 0
@Override
protected void setValue(Consumer<Object> dispatcher, ReadOnlyProperty property, Object value) {
final Stage stage = (Stage) property.getBean();
if (Boolean.TRUE.equals(value)) {
stage.show();
} else {
stage.hide();
}
}
PropertyAccessor.java 文件源码
项目:reduxfx
阅读 38
收藏 0
点赞 0
评论 0
@SuppressWarnings("unchecked")
@Override
protected void setValue(Consumer<Object> dispatcher, ReadOnlyProperty readOnlyProperty, Object value) {
final Property property = (Property) readOnlyProperty;
if (property.getValue() == null? value != null : ! property.getValue().equals(value)) {
property.setValue(value);
}
}
ListenerHandlingAccessor.java 文件源码
项目:reduxfx
阅读 33
收藏 0
点赞 0
评论 0
@SuppressWarnings("unchecked")
protected void clearListeners(Object node, ReadOnlyProperty property) {
final ChangeListener changeListener = (ChangeListener) getProperties(node).get(property.getName() + ".change");
if (changeListener != null) {
property.removeListener(changeListener);
}
final InvalidationListener invalidationListener = (InvalidationListener) getProperties(node).get(property.getName() + ".invalidation");
if (invalidationListener != null) {
property.removeListener(invalidationListener);
}
}
ListenerHandlingAccessor.java 文件源码
项目:reduxfx
阅读 33
收藏 0
点赞 0
评论 0
@SuppressWarnings("unchecked")
protected void setChangeListener(Consumer<Object> dispatcher, Object node, ReadOnlyProperty property, VChangeListener listener) {
final ChangeListener newListener = (source, oldValue, newValue) -> {
final Object action = listener.onChange(fxToV(oldValue), fxToV(newValue));
if (action != null) {
dispatcher.accept(action);
}
};
property.addListener(newListener);
getProperties(node).put(property.getName() + ".change", newListener);
}
ListenerHandlingAccessor.java 文件源码
项目:reduxfx
阅读 31
收藏 0
点赞 0
评论 0
protected void setInvalidationListener(Consumer<Object> dispatcher, Object node, ReadOnlyProperty property, VInvalidationListener listener) {
final InvalidationListener newListener = source -> {
final Object action = listener.onInvalidation();
if (action != null) {
dispatcher.accept(action);
}
};
property.addListener(newListener);
getProperties(node).put(property.getName() + ".invalidation", newListener);
}
ToggleGroupAccessor.java 文件源码
项目:reduxfx
阅读 34
收藏 0
点赞 0
评论 0
@SuppressWarnings("unchecked")
@Override
protected void setValue(Consumer<Object> dispatcher, ReadOnlyProperty property, Object value) {
if (value instanceof ToggleGroup) {
((Property) property).setValue(value);
return;
}
throw new IllegalStateException(String.format("Unable to set the value %s of property %s in class %s",
value, property.getName(), property.getBean().getClass()));
}
PropertyReference.java 文件源码
项目:JXTN
阅读 30
收藏 0
点赞 0
评论 0
/**
* 取得屬性本身
*
* @param bean 要取得屬性本身的物件
* @return 屬性本身
* @throws IllegalStateException 屬性不提供{@link ReadOnlyProperty}
*/
@SuppressWarnings("unchecked")
public ReadOnlyProperty<T> getProperty(Object bean)
{
if (!this.hasProperty())
throw new IllegalStateException("Cannot get property " + this.name);
return (ReadOnlyProperty<T>) this.reflectedInfo.getProperty.apply(bean);
}
SourceType.java 文件源码
项目:shuffleboard
阅读 33
收藏 0
点赞 0
评论 0
public final ReadOnlyProperty<ConnectionStatus> connectionStatusProperty() {
return connectionStatus;
}
Playback.java 文件源码
项目:shuffleboard
阅读 28
收藏 0
点赞 0
评论 0
public static ReadOnlyProperty<Playback> currentPlaybackProperty() {
return currentPlayback;
}
PropertyValueCounter.java 文件源码
项目:openjfx-8u-dev-tests
阅读 35
收藏 0
点赞 0
评论 0
public ReadOnlyProperty getObservedProperty() {
return observedProperty;
}
PropertiesTable.java 文件源码
项目:openjfx-8u-dev-tests
阅读 40
收藏 0
点赞 0
评论 0
@Override
public void addSimpleListener(ReadOnlyProperty<? extends Object> bindableProperty, Object owningObject) {
AbstractPropertyValueListener listener = new PropertyValueListener(bindableProperty, owningObject);
readonlyPropertyListeners.put(bindableProperty.getName().toUpperCase(), listener);
listenersFlowPane.getChildren().add(listener.getVisualRepresentation());
}
PropertyValueListener.java 文件源码
项目:openjfx-8u-dev-tests
阅读 38
收藏 0
点赞 0
评论 0
public <ValueType> PropertyValueListener(ReadOnlyProperty bindableProperty, Object owningObject) {
this(bindableProperty, owningObject, true);
}
PropertyValueListener.java 文件源码
项目:openjfx-8u-dev-tests
阅读 30
收藏 0
点赞 0
评论 0
public <ValueType> PropertyValueListener(ReadOnlyProperty bindableProperty, Object owningObject, Boolean showCounters) {
this(bindableProperty.getName().toLowerCase() + " : ", bindableProperty, bindableProperty.getName().toUpperCase() + LISTENER_SUFFIX, owningObject, showCounters);
}
PropertyValueListener.java 文件源码
项目:openjfx-8u-dev-tests
阅读 28
收藏 0
点赞 0
评论 0
public <ValueType> PropertyValueListener(String labelDescription, ReadOnlyProperty listenedProperty, String textFieldId, Object owningObject) {
this(labelDescription, listenedProperty, textFieldId, owningObject, true);
}
EventManager.java 文件源码
项目:Simulizer
阅读 42
收藏 0
点赞 0
评论 0
public synchronized <T> void addPropertyListener(ReadOnlyProperty<T> property, ChangeListener<? super T> listener) {
addPropertyListener(property.getName(), listener);
}
EventManager.java 文件源码
项目:Simulizer
阅读 31
收藏 0
点赞 0
评论 0
public synchronized <T> void removePropertyListener(ReadOnlyProperty<T> property, ChangeListener<? super T> listener) {
removePropertyListener(property.getName(), listener);
}
ReadOnlyPropertyAccessor.java 文件源码
项目:reduxfx
阅读 36
收藏 0
点赞 0
评论 0
@Override
protected void setValue(Consumer<Object> dispatcher, ReadOnlyProperty property, Object value) {
LOG.warn("Tried to set read-only property {} to {}", property, value);
}
FocusedAccessor.java 文件源码
项目:reduxfx
阅读 29
收藏 0
点赞 0
评论 0
@Override
protected void setValue(Consumer<Object> dispatcher, ReadOnlyProperty property, Object value) {
if (Boolean.TRUE.equals(value)) {
((Node) property.getBean()).requestFocus();
}
}
ListAccessor.java 文件源码
项目:reduxfx
阅读 30
收藏 0
点赞 0
评论 0
@SuppressWarnings("unchecked")
@Override
protected void setValue(Consumer<Object> dispatcher, ReadOnlyProperty property, Object value) {
((ObservableList) property.getValue()).setAll(value == null? Collections.emptyList() : ((Seq) value).toJavaList());
}
FxDockEmptyPane.java 文件源码
项目:FxDock
阅读 28
收藏 0
点赞 0
评论 0
public final ReadOnlyProperty<Node> dockParentProperty()
{
return parent.getReadOnlyProperty();
}
FxDockSplitPane.java 文件源码
项目:FxDock
阅读 32
收藏 0
点赞 0
评论 0
public final ReadOnlyProperty<Node> dockParentProperty()
{
return parent.getReadOnlyProperty();
}
FxDockBorderPane.java 文件源码
项目:FxDock
阅读 41
收藏 0
点赞 0
评论 0
public final ReadOnlyProperty<Node> dockParentProperty()
{
return parent.getReadOnlyProperty();
}
FxDockTabPane.java 文件源码
项目:FxDock
阅读 29
收藏 0
点赞 0
评论 0
public final ReadOnlyProperty<Node> dockParentProperty()
{
return parent.getReadOnlyProperty();
}
PropertyView.java 文件源码
项目:aomrolemapper
阅读 29
收藏 0
点赞 0
评论 0
public ReadOnlyProperty<String> nameProperty() {
return mName;
}
UserProfileBindings.java 文件源码
项目:ISAAC
阅读 36
收藏 0
点赞 0
评论 0
/**
* @return the viewCoordinatePath
*/
public ReadOnlyProperty<UUID> getViewCoordinatePath()
{
return viewCoordinatePath.getReadOnlyProperty();
}
UserProfileBindings.java 文件源码
项目:ISAAC
阅读 31
收藏 0
点赞 0
评论 0
/**
* @return the editCoordinatePath
*/
public ReadOnlyProperty<UUID> getEditCoordinatePath()
{
return editCoordinatePath.getReadOnlyProperty();
}