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

项目:stvs    文件:SpecificationTableDemo.java   
private List<Node> simpleTableScene() {
  List<Type> types = Arrays.asList(TypeInt.INT, TypeBool.BOOL);
  List<CodeIoVariable> codevars = Arrays.asList(
      new CodeIoVariable(VariableCategory.INPUT, "BOOL", "A"),
      new CodeIoVariable(VariableCategory.INPUT, "INT", "B"),
      new CodeIoVariable(VariableCategory.OUTPUT, "INT", "C")
  );
  ObjectProperty<List<Type>> typeContext = new SimpleObjectProperty<>(types);
  ObjectProperty<List<CodeIoVariable>> codeIoVariables = new SimpleObjectProperty<>(codevars);

  FreeVariableList freeVariableList = new FreeVariableList(new ArrayList<>());

  FreeVariableListValidator freevarValidator = new FreeVariableListValidator(typeContext, freeVariableList);
  SpecificationTableController table = new SpecificationTableController(
      new GlobalConfig(),
      typeContext,
      codeIoVariables,
      freevarValidator.validFreeVariablesProperty(),
      new HybridSpecification(freeVariableList, true));
  Pane extractedTablePane = createExtractedTableTextArea(
      table.getHybridSpecification(),
      table.getValidator());

  return Arrays.asList(table.getView(), extractedTablePane);
}
项目:SunburstChart    文件:SunburstChart.java   
public ObjectProperty<Color> brightTextColorProperty() {
    if (null == brightTextColor) {
        brightTextColor = new ObjectPropertyBase<Color>(_brightTextColor) {
            @Override protected void invalidated() {
                if (isAutoTextColor()) {
                    adjustTextColors();
                    redraw();
                }
            }
            @Override public Object getBean() { return SunburstChart.this; }
            @Override public String getName() { return "brightTextColor"; }
        };
        _brightTextColor = null;
    }
    return brightTextColor;
}
项目:SunburstChart    文件:SunburstChart.java   
public ObjectProperty<Color> darkTextColorProperty() {
    if (null == darkTextColor) {
        darkTextColor = new ObjectPropertyBase<Color>(_darkTextColor) {
            @Override protected void invalidated() {
                if (isAutoTextColor()) {
                    adjustTextColors();
                    redraw();
                }
            }
            @Override public Object getBean() { return SunburstChart.this; }
            @Override public String getName() { return "darkTextColor"; }
        };
        _darkTextColor = null;
    }
    return darkTextColor;
}
项目:charts    文件:SunburstChart.java   
public ObjectProperty<Color> brightTextColorProperty() {
    if (null == brightTextColor) {
        brightTextColor = new ObjectPropertyBase<Color>(_brightTextColor) {
            @Override protected void invalidated() {
                if (isAutoTextColor()) {
                    adjustTextColors();
                    redraw();
                }
            }
            @Override public Object getBean() { return SunburstChart.this; }
            @Override public String getName() { return "brightTextColor"; }
        };
        _brightTextColor = null;
    }
    return brightTextColor;
}
项目:mokka7    文件:SessionManager.java   
@SuppressWarnings("unchecked")
public void bind(final ObjectProperty<?> property, final String propertyName, Class<?> type) {
    String value = props.getProperty(propertyName);
    if (value != null) {
        if (type.getName().equals(Color.class.getName())) {
            ((ObjectProperty<Color>) property).set(Color.valueOf(value));
        } else if (type.getName().equals(String.class.getName())) {
            ((ObjectProperty<String>) property).set(value);
        } else {
            ((ObjectProperty<Object>) property).set(value);
        }
    }
    property.addListener(new InvalidationListener() {

        @Override
        public void invalidated(Observable o) {
            props.setProperty(propertyName, property.getValue().toString());
        }
    });
}
项目:FastisFX    文件:TimeAxis.java   
public TimeAxis(ObjectProperty<LocalTime> timeStart, ObjectProperty<LocalTime> timeEnd,
                ObjectProperty<Duration> timeSteps, DateTimeFormatter formatter) {
    this.timeStartProperty = timeStart;
    this.timeEndProperty = timeEnd;
    this.timeStepsProperty = timeSteps;
    this.formatter = formatter;
    this.horizontal = false;

    this.getStyleClass().add("time-axis");

    getTimeStartProperty().addListener(observable -> createLabels());
    getTimeEndProperty().addListener(observable -> createLabels());
    getTimeStepsProperty().addListener(observable -> createLabels());

    createLabels();
}
项目:sankeyplot    文件:SankeyPlot.java   
public ObjectProperty<Color> streamColorProperty() {
    if (null == streamColor) {
        streamColor = new ObjectPropertyBase<Color>(_streamColor) {
            @Override protected void invalidated() { redraw(); }
            @Override public Object getBean() { return SankeyPlot.this; }
            @Override public String getName() { return "streamColor"; }
        };
        _streamColor = null;
    }
    return streamColor;
}
项目:smoothcharts    文件:SmoothedChart.java   
public ObjectProperty<Color> selectorFillColorProperty() {
    if (null == selectorFillColor) {
        selectorFillColor = new ObjectPropertyBase<Color>(_selectorFillColor) {
            @Override protected void invalidated() {
                selector.setFill(get());
                layoutPlotChildren(); 
            }
            @Override public Object getBean() { return SmoothedChart.this; }
            @Override public String getName() { return "selectorFillColor"; }
        };
        _selectorFillColor = null;
    }
    return selectorFillColor;
}
项目:charts    文件:LegendItem.java   
public ObjectProperty<Color> textColorProperty() {
    if (null == textColor) {
        textColor = new ObjectPropertyBase<Color>(_textColor) {
            @Override protected void invalidated() { redraw(); }
            @Override public Object getBean() { return LegendItem.this; }
            @Override public String getName() { return "textColor"; }
        };
        _textColor = null;
    }
    return textColor;
}
项目:charts    文件:LegendItem.java   
public ObjectProperty<Color> symbolStrokeProperty() {
    if (null == symbolStroke) {
        symbolStroke = new ObjectPropertyBase<Color>(_symbolStroke) {
            @Override protected void invalidated() { redraw(); }
            @Override public Object getBean() { return LegendItem.this; }
            @Override public String getName() { return "symbolStroke"; }
        };
        _symbolStroke = null;
    }
    return symbolStroke;
}
项目:charts    文件:Axis.java   
public ObjectProperty<AxisType> typeProperty() {
    if (null == type) {
        type = new ObjectPropertyBase<AxisType>(_type) {
            @Override protected void invalidated() { redraw(); }
            @Override public Object getBean() {  return Axis.this;  }
            @Override public String getName() {  return "axisType";  }
        };
        _type = null;
    }
    return type;
}
项目:charts    文件:NestedBarChart.java   
public ObjectProperty<Order> orderProperty() {
    if (null == order) {
        order = new ObjectPropertyBase<Order>(_order) {
            @Override protected void invalidated() { redraw(); }
            @Override public Object getBean() { return NestedBarChart.this; }
            @Override public String getName() { return "order"; }
        };
        _order = null;
    }
    return order;
}
项目:charts    文件:XYZChartItem.java   
public ObjectProperty<Color> fillProperty() {
    if (null == fill) {
        fill = new ObjectPropertyBase<Color>(_fill) {
            @Override protected void invalidated() { fireItemEvent(ITEM_EVENT); }
            @Override public Object getBean() { return XYZChartItem.this; }
            @Override public String getName() { return "fill"; }
        };
        _fill = null;
    }
    return fill;
}
项目:SunburstChart    文件:SunburstChart.java   
public ObjectProperty<TextOrientation> textOrientationProperty() {
    if (null == textOrientation) {
        textOrientation = new ObjectPropertyBase<TextOrientation>(_textOrientation) {
            @Override protected void invalidated() { redraw(); }
            @Override public Object getBean() { return SunburstChart.this; }
            @Override public String getName() { return "textOrientation"; }
        };
        _textOrientation = null;
    }
    return textOrientation;
}
项目:charts    文件:CircularPlot.java   
public ObjectProperty<Color> tickMarkColorProperty() {
    if (null == tickMarkColor) {
        tickMarkColor = new ObjectPropertyBase<Color>(_tickMarkColor) {
            @Override protected void invalidated() { redraw(); }
            @Override public Object getBean() { return CircularPlot.this; }
            @Override public String getName() { return "tickMarkColor"; }
        };
        _tickMarkColor = null;
    }
    return tickMarkColor;
}
项目:ABC-List    文件:CellUtils.java   
static <T> ChoiceBox<T> createChoiceBox(
        final Cell<T> cell,
        final ObservableList<T> items,
        final ObjectProperty<StringConverter<T>> converter
) {
    final ChoiceBox<T> choiceBox = new ChoiceBox<>(items);
    choiceBox.setMaxWidth(Double.MAX_VALUE);
    choiceBox.converterProperty().bind(converter);
    choiceBox.getSelectionModel().selectedItemProperty().addListener((ov, oldValue, newValue) -> {
        if (cell.isEditing()) {
            cell.commitEdit(newValue);
        }
    });
    return choiceBox;
}
项目:charts    文件:MatrixChartItem.java   
public ObjectProperty<Color> fillProperty() {
    if (null == fill) {
        fill = new ObjectPropertyBase<Color>(_fill) {
            @Override protected void invalidated() { fireItemEvent(ITEM_EVENT); }
            @Override public Object getBean() { return MatrixChartItem.this; }
            @Override public String getName() { return "fill"; }
        };
        _fill = null;
    }
    return fill;
}
项目:sankeyplot    文件:SankeyPlot.java   
public ObjectProperty<Color> textColorProperty() {
    if (null == textColor) {
        textColor = new ObjectPropertyBase<Color>(_textColor) {
            @Override protected void invalidated() { prepareData(); }
            @Override public Object getBean() { return SankeyPlot.this; }
            @Override public String getName() { return "textColor"; }
        };
        _textColor = null;
    }
    return textColor;
}
项目:charts    文件:XYChartItem.java   
public ObjectProperty<Color> strokeProperty() {
    if (null == stroke) {
        stroke = new ObjectPropertyBase<Color>(_stroke) {
            @Override protected void invalidated() { fireItemEvent(ITEM_EVENT); }
            @Override public Object getBean() { return XYChartItem.this; }
            @Override public String getName() { return "stroke"; }
        };
        _stroke = null;
    }
    return stroke;
}
项目:sankeyplot    文件:SankeyPlot.java   
public ObjectProperty<Color> itemColorProperty() {
    if (null == itemColor) {
        itemColor = new ObjectPropertyBase<Color>(_itemColor) {
            @Override protected void invalidated() { redraw(); }
            @Override public Object getBean() { return SankeyPlot.this; }
            @Override public String getName() { return "itemColor"; }
        };
    }
    return itemColor;
}
项目:vars-annotation    文件:BindingDemo.java   
public static void main(String[] args) {
        ObjectProperty<LocalDateTime> dp = new SimpleObjectProperty<>(LocalDateTime.now());
        ObjectProperty<Instant> ip = new SimpleObjectProperty<>();

        Binding<Instant> ib = Bindings.createObjectBinding(
                () -> dp.get().toInstant(OffsetDateTime.now().getOffset()),
                dp);
        ip.bind(ib);

//        Binding<LocalDateTime> db = Bindings.createObjectBinding(
//                () -> ip.get().atZone(ZoneId.systemDefault()).toLocalDateTime(),
//                ip);
//        dp.bind(db);

        dp.addListener((obs, ov, nv) -> System.out.println(dp.get()));
        ip.addListener((obs, ov, nv) -> System.out.println(ip.get()));

        dp.setValue(LocalDateTime.of(2000, 9, 22, 9, 16, 0));
        dp.setValue(LocalDateTime.of(1968, 12, 25, 8, 0, 0));
        dp.setValue(LocalDateTime.of(2002, 7, 27, 3, 30, 0));
//
//        ip.setValue(Instant.EPOCH);
//        ip.setValue(Instant.MAX);
//        ip.setValue(Instant.MIN);


    }
项目:marathonv5    文件:SimplePropertySheet.java   
public static Object get(ObservableValue valueModel) {
    if (valueModel instanceof DoubleProperty) {
        return ((DoubleProperty)valueModel).get();
    } else if (valueModel instanceof ObjectProperty) {
        return ((ObjectProperty)valueModel).get();
    }

    return null;
}
项目:stvs    文件:StvsMenuBarController.java   
/**
 * create a StvsMenuBarController; the parameters will be modified.
 *
 * @param rootModel the applications root model
 */
public StvsMenuBarController(ObjectProperty<StvsRootModel> rootModel) {
    // set own properties
    this.rootModel = rootModel;

    // create view
    this.view = new StvsMenuBar();

    rootModel.get().getHistory().getFilenames()
            .addListener(new HistoryFilenamesChangeListener());
    // Fill history menu
    updateHistoryMenu();

    // add listener
    view.newCode.setOnAction(this::createNewCode);
    view.newSpec.setOnAction(this::createNewSpec);
    view.open.setOnAction(this::openFile);
    view.openSession.setOnAction(this::openSession);
    view.openCode.setOnAction(this::openCode);
    view.openSpec.setOnAction(this::openSpec);
    view.saveAll.setOnAction(this::saveAll);
    view.saveSessionAs.setOnAction(this::saveSessionAs);
    view.saveCode.setOnAction(this::saveCode);
    view.saveSpec.setOnAction(this::saveSpec);
    view.config.setOnAction(this::openConfigDialog);
    view.wizard.setOnAction(this::openWizard);
    view.about.setOnAction(this::openAboutDialog);

    //popluate examples
    for (Example ex : ExamplesFacade.getExamples()) {
        final Example a = ex;
        final MenuItem mex = new MenuItem(ex.getName());
        mex.setOnAction((value) -> this.openExample(a));
        mex.setMnemonicParsing(true);
        Tooltip.install(mex.getGraphic(), new Tooltip(ex.getDescription()));
        view.examples.getItems().add(mex);
    }
}
项目:stvs    文件:AdvancedCellUtils.java   
static <T> ComboBox<T> createComboBox(final Cell<T> cell,
                                      final ObservableList<T> items,
                                      final ObjectProperty<StringConverter<T>> converter) {
    ComboBox<T> comboBox = new ComboBox<T>(items);
    comboBox.converterProperty().bind(converter);
    comboBox.setMaxWidth(Double.MAX_VALUE);
    comboBox.getSelectionModel().selectedItemProperty().addListener((ov, oldValue, newValue) -> {
        if (cell.isEditing()) {
            cell.commitEdit(newValue);
        }
    });
    return comboBox;
}
项目:circularplot    文件:CircularPlot.java   
public ObjectProperty<Color> textColorProperty() {
    if (null == textColor) {
        textColor = new ObjectPropertyBase<Color>(_textColor) {
            @Override protected void invalidated() { redraw(); }
            @Override public Object getBean() { return CircularPlot.this; }
            @Override public String getName() { return "textColor"; }
        };
        _textColor = null;
    }
    return textColor;
}
项目:charts    文件:CircularPlot.java   
public ObjectProperty<Locale> localeProperty() {
    if (null == locale) {
        locale = new ObjectPropertyBase<Locale>(_locale) {
            @Override protected void invalidated() { redraw(); }
            @Override public Object getBean() { return CircularPlot.this; }
            @Override public String getName() { return "locale"; }
        };
    }
    _locale = null;
    return locale;
}
项目:charts    文件:ChartItemBuilder.java   
public final ChartItem build() {
    final ChartItem ITEM = new ChartItem();
    for (String key : properties.keySet()) {
        if ("name".equals(key)) {
            ITEM.setName(((StringProperty) properties.get(key)).get());
        } else if ("value".equals(key)) {
            ITEM.setValue(((DoubleProperty) properties.get(key)).get());
        } else if("fill".equals(key)) {
            ITEM.setFill(((ObjectProperty<Color>) properties.get(key)).get());
        } else if("stroke".equals(key)) {
            ITEM.setStroke(((ObjectProperty<Color>) properties.get(key)).get());
        } else if("textColor".equals(key)) {
            ITEM.setTextColor(((ObjectProperty<Color>) properties.get(key)).get());
        } else if("timestamp".equals(key)) {
            ITEM.setTimestamp(((ObjectProperty<Instant>) properties.get(key)).get());
        } else if ("timestampDateTime".equals(key)) {
            ITEM.setTimestamp(((ObjectProperty<ZonedDateTime>) properties.get(key)).get());
        } else if("symbol".equals(key)) {
            ITEM.setSymbol(((ObjectProperty<Symbol>) properties.get(key)).get());
        } else if("animated".equals(key)) {
            ITEM.setAnimated(((BooleanProperty) properties.get(key)).get());
        } else if("animationDuration".equals(key)) {
            ITEM.setAnimationDuration(((LongProperty) properties.get(key)).get());
        }
    }
    return ITEM;
}
项目:charts    文件:YChartItem.java   
public ObjectProperty<Color> strokeProperty() {
    if (null == stroke) {
        stroke = new ObjectPropertyBase<Color>(_stroke) {
            @Override protected void invalidated() { fireItemEvent(ITEM_EVENT); }
            @Override public Object getBean() { return YChartItem.this; }
            @Override public String getName() { return "stroke"; }
        };
        _stroke = null;
    }
    return stroke;
}
项目:fx-animation-editor    文件:UngroupCommand.java   
private void moveChildByGroupPosition(NodeModel childNode, KeyFrameModel keyFrame, int factor) {
    ObjectProperty<Object> x = keyFrame.getKeyValues().get(childNode).get(AnimatableField.LAYOUT_X).valueProperty();
    ObjectProperty<Object> y = keyFrame.getKeyValues().get(childNode).get(AnimatableField.LAYOUT_Y).valueProperty();
    if (x.get() != null) {
        x.set(((Double) x.get()) + factor * groupPosition.getX());
    }
    if (y.get() != null) {
        y.set(((Double) y.get()) + factor * groupPosition.getY());
    }
}
项目:charts    文件:XYZPane.java   
public ObjectProperty<Paint> chartBackgroundProperty() {
    if (null == chartBackground) {
        chartBackground = new ObjectPropertyBase<Paint>(_chartBackground) {
            @Override protected void invalidated() { redraw(); }
            @Override public Object getBean() { return XYZPane.this; }
            @Override public String getName() { return "chartBackground"; }
        };
        _chartBackground = null;
    }
    return chartBackground;
}
项目:charts    文件:SankeyPlot.java   
public ObjectProperty<Locale> localeProperty() {
    if (null == locale) {
        locale = new ObjectPropertyBase<Locale>(_locale) {
            @Override protected void invalidated() { prepareData(); }
            @Override public Object getBean() { return SankeyPlot.this; }
            @Override public String getName() { return "locale"; }
        };
    }
    _locale = null;
    return locale;
}
项目:CSS-Editor-FX    文件:MainFrameController.java   
private ObservableValue<TabEntity> currentTabEntity() {
  return CacheUtil.cache(this, "currentTabEntity", () -> {
    ObjectProperty<TabEntity> op = new SimpleObjectProperty<>();
    op.bind(map(tabPane.getSelectionModel().selectedIndexProperty(),
        i -> uncatch(() -> tabList.get(i.intValue()))));
    return op;
  });
}
项目:charts    文件:Axis.java   
public ObjectProperty<LocalDateTime> startProperty() {
    if (null == start) {
        start = new ObjectPropertyBase<LocalDateTime>(_start) {
            @Override protected void invalidated() {
                if (AxisType.DATE != getType()) { throw new IllegalArgumentException("Axis type has to be DATE"); }
                setMinValue(get().toEpochSecond(Helper.getZoneOffset()));
            }
            @Override public Object getBean() { return Axis.this; }
            @Override public String getName() { return "start"; }
        };
        _start = null;
    }
    return start;
}
项目:charts    文件:Series.java   
public ObjectProperty<Paint> fillProperty() {
    if (null == fill) {
        fill = new ObjectPropertyBase<Paint>(_fill) {
            @Override protected void invalidated() { refresh(); }
            @Override public Object getBean() { return Series.this; }
            @Override public String getName() { return "fill"; }
        };
        _fill = null;
    }
    return fill;
}
项目:drd    文件:InventoryController.java   
@Override
public void setHero(final ObjectProperty<Hero> hero) {
    if (this.hero != null) {
        this.hero.removeListener(heroChangeListener);
    }

    this.hero = hero;
    this.hero.addListener(heroChangeListener);
}
项目:charts    文件:PlotItem.java   
public ObjectProperty<Symbol> symbolProperty() {
    if (null == symbol) {
        symbol = new ObjectPropertyBase<Symbol>(_symbol) {
            @Override protected void invalidated() { fireItemEvent(ITEM_EVENT); }
            @Override public Object getBean() {  return PlotItem.this;  }
            @Override public String getName() {  return "symbol";  }
        };
        _symbol = null;
    }
    return symbol;
}
项目:charts    文件:Location.java   
public ObjectProperty<Color> colorProperty() {
    if (null == color) {
        color = new ObjectPropertyBase<Color>(_color) {
            @Override protected void invalidated() { fireLocationEvent(UPDATE_EVENT); }
            @Override public Object getBean() { return Location.this; }
            @Override public String getName() { return "color"; }
        };
        _color = null;
    }
    return color;
}
项目:charts    文件:HeatMapBuilder.java   
public final HeatMap build() {
    double              width               = 400;
    double              height              = 400;
    ColorMapping        colorMapping        = ColorMapping.LIME_YELLOW_RED;
    double              spotRadius          = 15.5;
    boolean             fadeColors          = false;
    double              heatMapOpacity      = 0.5;
    OpacityDistribution opacityDistribution = OpacityDistribution.CUSTOM;

    for (String key : properties.keySet()) {
        if ("prefSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            width  = dim.getWidth();
            height = dim.getHeight();
        } else if ("width".equals(key)) {
            width = ((DoubleProperty) properties.get(key)).get();
        } else if ("height".equals(key)) {
            height = ((DoubleProperty) properties.get(key)).get();
        } else if ("colorMapping".equals(key)) {
            colorMapping = ((ObjectProperty<ColorMapping>) properties.get(key)).get();
        } else if ("spotRadius".equals(key)) {
            spotRadius = ((DoubleProperty) properties.get(key)).get();
        } else if ("fadeColors".equals(key)) {
            fadeColors = ((BooleanProperty) properties.get(key)).get();
        } else if ("heatMapOpacity".equals(key)) {
            heatMapOpacity = ((DoubleProperty) properties.get(key)).get();
        } else if ("opacityDistribution".equals(key)) {
            opacityDistribution = ((ObjectProperty<OpacityDistribution>) properties.get(key)).get();
        }
    }
    return new HeatMap(width,  height, colorMapping, spotRadius, fadeColors, heatMapOpacity, opacityDistribution);
}
项目:Squid    文件:RunsViewModel.java   
public ObjectProperty<Predicate<? super PrawnFile.Run>> filterProperty() {
    return viewableShrimpRuns.predicateProperty();
}
项目:fritz-home-skill    文件:Switch.java   
public default ObjectProperty<Mode> modePorperty() {
  return mode;
}