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

项目:stvs    文件:SelectionTest.java   
@Test
public void testClearColumnListenerSelection() {
  BooleanProperty wasCalled = new SimpleBooleanProperty(false);
  Selection selection = new Selection("fgrfg", 4);
  InvalidationListener listener = i -> wasCalled.set(true);
  selection.columnProperty().addListener(listener);
  selection.columnProperty().set(null);
  assertTrue(wasCalled.get());
  assertTrue(selection.columnProperty().isNull().get());

  wasCalled.set(false);
  selection.columnProperty().removeListener(listener);
  selection.setColumn("Test");
  assertFalse(wasCalled.get());
  assertEquals("Test", selection.getColumn().get());
}
项目:worldheatmap    文件:HeatMapBuilder.java   
public final HeatMap build() {
    double              width               = 400;
    double              height              = 400;
    ColorMapping        colorMapping        = ColorMapping.LIME_YELLOW_RED;
    double              eventRadius         = 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 ("eventRadius".equals(key)) {
            eventRadius = ((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, eventRadius, fadeColors, heatMapOpacity, opacityDistribution);
}
项目:ABC-List    文件:TestdataTermPresenter.java   
public void bind(BooleanProperty disableProperty) {
    cbQuantityEntities.disableProperty().unbind();
    cbQuantityEntities.disableProperty().bind(disableProperty);

    cbQuantityTimePeriod.disableProperty().unbind();
    cbQuantityTimePeriod.disableProperty().bind(disableProperty);
}
项目:charts    文件:XYSeriesBuilder.java   
public final XYSeries build() {
    final XYSeries SERIES = new XYSeries();

    if (properties.keySet().contains("itemsArray")) {
        SERIES.setItems(((ObjectProperty<XYItem[]>) properties.get("itemsArray")).get());
    }
    if(properties.keySet().contains("itemsList")) {
        SERIES.setItems(((ObjectProperty<List<XYItem>>) properties.get("itemsList")).get());
    }

    for (String key : properties.keySet()) {
        if ("name".equals(key)) {
            SERIES.setName(((StringProperty) properties.get(key)).get());
        } else if ("fill".equals(key)) {
            SERIES.setFill(((ObjectProperty<Paint>) properties.get(key)).get());
        } else if ("stroke".equals(key)) {
            SERIES.setStroke(((ObjectProperty<Paint>) properties.get(key)).get());
        } else if ("symbolFill".equals(key)) {
            SERIES.setSymbolFill(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("symbolStroke".equals(key)) {
            SERIES.setSymbolStroke(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("symbol".equals(key)) {
            SERIES.setSymbol(((ObjectProperty<Symbol>) properties.get(key)).get());
        } else if ("chartType".equals(key)) {
            SERIES.setChartType(((ObjectProperty<ChartType>) properties.get(key)).get());
        } else if ("symbolsVisible".equals(key)) {
            SERIES.setSymbolsVisible(((BooleanProperty) properties.get(key)).get());
        } else if ("symbolSize".equals(key)) {
            SERIES.setSymbolSize(((DoubleProperty) properties.get(key)).get());
        } else if ("strokeWidth".equals(key)) {
            SERIES.setStrokeWidth(((DoubleProperty) properties.get(key)).get());
        }
    }
    return SERIES;
}
项目:drd    文件:ShopWeaponMeleController.java   
@Override
public void setShowOnlineDatabase(BooleanProperty showOnlineDatabase) {
    showOnlineDatabase.addListener((observable, oldValue, newValue) -> {
        if (newValue == null) {
            return;
        }

        manager.toggleDatabase(newValue);
    });
}
项目:H-Uppaal    文件:SubComponentPresentation.java   
private void initializeName() {
    final SubComponent subComponent = controller.getSubComponent();
    final BooleanProperty initialized = new SimpleBooleanProperty(false);

    controller.identifier.focusedProperty().addListener((observable, oldValue, newValue) -> {
        if (newValue && !initialized.get()) {
            controller.root.requestFocus();
            initialized.setValue(true);
        }
    });

    // Set the text field to the name in the model, and bind the model to the text field
    controller.identifier.setText(subComponent.getIdentifier());
    controller.identifier.textProperty().addListener((obs, oldIdentifier, newIdentifier) -> {
        subComponent.identifierProperty().unbind();
        subComponent.setIdentifier(newIdentifier);
    });

    final Runnable updateColor = () -> {
        final Color color = subComponent.getComponent().getColor();
        final Color.Intensity colorIntensity = subComponent.getComponent().getColorIntensity();

        // Set the text color for the label
        controller.identifier.setStyle("-fx-text-fill: " + color.getTextColorRgbaString(colorIntensity) + ";");
        controller.identifier.setFocusColor(color.getTextColor(colorIntensity));
        controller.identifier.setUnFocusColor(javafx.scene.paint.Color.TRANSPARENT);

        controller.originalComponentLabel.setStyle("-fx-text-fill: " + color.getTextColorRgbaString(colorIntensity) + ";");
    };

    controller.getSubComponent().getComponent().colorProperty().addListener(observable -> updateColor.run());
    updateColor.run();

    // Center the text vertically and aff a left padding of CORNER_SIZE
    controller.identifier.setPadding(new Insets(2, 0, 0, CORNER_SIZE));
    controller.identifier.setOnKeyPressed(CanvasController.getLeaveTextAreaKeyHandler());

    controller.originalComponentLabel.setPadding(new Insets(0, 5, 0, 15));
    controller.originalComponentLabel.textProperty().bind(subComponent.getComponent().nameProperty());
}
项目:stvs    文件:TimingDiagramController.java   
/**
 * Generates a boolean timing diagram.
 *
 * @param concreteSpec the concrete specification which should be used to extract the needed
 *        information
 * @param specIoVar the variable for which a diagram should be generated
 * @param globalXAxis  global x axis used for all diagrams
 * @param selection selection that should be updated when hovering with mouse
 * @param activated only update selection if true
 * @return A {@link Pair} which holds a {@link TimingDiagramController} and a {@link CategoryAxis}
 */
public static Pair<TimingDiagramController, Axis> createBoolTimingDiagram(
    ConcreteSpecification concreteSpec, ValidIoVariable specIoVar, NumberAxis globalXAxis,
    Selection selection, BooleanProperty activated) {
  ObservableList<String> categories = FXCollections.observableArrayList();
  categories.addAll("FALSE", "TRUE");
  CategoryAxis boolCategoryAxis = new CategoryAxis(categories);
  boolCategoryAxis.setPrefWidth(30);
  boolCategoryAxis.setSide(Side.LEFT);
  boolCategoryAxis.setAutoRanging(true);
  TimingDiagramController timingDiagramController = new TimingDiagramController(globalXAxis,
      boolCategoryAxis, concreteSpec, specIoVar, selection, activated);
  return new ImmutablePair<>(timingDiagramController, boolCategoryAxis);
}
项目:charts    文件:AreaHeatMapBuilder.java   
public final AreaHeatMap build() {
    final AreaHeatMap CONTROL = new AreaHeatMap();
    for (String key : properties.keySet()) {
        if ("prefSize".equals(key)) {
            Dimension2D dim = ((ObjectProperty<Dimension2D>) properties.get(key)).get();
            CONTROL.setPrefSize(dim.getWidth(), dim.getHeight());
        } else if ("colorMapping".equals(key)) {
            CONTROL.setColorMapping(((ObjectProperty<ColorMapping>) properties.get(key)).get());
        } else if("useColorMapping".equals(key)) {
            CONTROL.setUseColorMapping(((BooleanProperty) properties.get(key)).get());
        } else if ("quality".equals(key)) {
            CONTROL.setQuality(((IntegerProperty) properties.get(key)).get());
        } else if ("heatMapOpacity".equals(key)) {
            CONTROL.setHeatMapOpacity(((DoubleProperty) properties.get(key)).get());
        } else if ("dataPointsVisible".equals(key)) {
            CONTROL.setDataPointsVisible(((BooleanProperty) properties.get(key)).get());
        } else if ("smoothedHull".equals(key)) {
            CONTROL.setSmoothedHull(((BooleanProperty) properties.get(key)).get());
        } else if ("discreteColors".equals(key)) {
            CONTROL.setDiscreteColors(((BooleanProperty) properties.get(key)).get());
        } else if ("noOfCloserInfluentPoints".equals(key)) {
            CONTROL.setNoOfCloserInfluentPoints(((IntegerProperty) properties.get(key)).get());
        }
    }
    if (properties.keySet().contains("dataPointsArray")) {
        CONTROL.setDataPoints(((ObjectProperty<DataPoint[]>) properties.get("dataPointsArray")).get());
    }
    if(properties.keySet().contains("dataPointsList")) {
        CONTROL.setDataPoints(((ObjectProperty<List<DataPoint>>) properties.get("dataPointsList")).get());
    }
    return CONTROL;
}
项目:aem-epic-tool    文件:AuthHandler.java   
public AuthHandler(StringProperty host, BooleanProperty ssl, StringProperty userName, StringProperty password) {
    model = new Login();

    model.hostProperty().bindBidirectional(host);
    model.sslProperty().bindBidirectional(ssl);
    model.userNameProperty().bindBidirectional(userName);
    model.passwordProperty().bindBidirectional(password);

    unbindHandler = () -> {
        model.hostProperty().unbindBidirectional(host);
        model.sslProperty().unbindBidirectional(ssl);
        model.userNameProperty().unbindBidirectional(userName);
        model.passwordProperty().unbindBidirectional(password);
    };

    unbindHandler = () -> {
        model.hostProperty().unbindBidirectional(host);
        model.sslProperty().unbindBidirectional(ssl);
        model.userNameProperty().unbindBidirectional(userName);
        model.passwordProperty().unbindBidirectional(password);
    };

    model.hostProperty().addListener(this::triggerLoginTest);
    model.sslProperty().addListener(this::triggerLoginTest);
    model.userNameProperty().addListener(this::triggerLoginTest);
    model.passwordProperty().addListener(this::triggerLoginTest);

    model.statusMessageProperty().set(ApplicationState.getMessage(INCOMPLETE_FIELDS));
    model.loginConfirmedProperty().set(false);

}
项目:WebPLP    文件:PLPRegFile.java   
/***
 * PLPRegFile constructor. It creates all the registers and initializes to default value
 */
public PLPRegFile()
{
    this.registers = new IntegerProperty[NUMBER_OF_REGISTERS];
    this.regInstructions = new BooleanProperty[NUMBER_OF_REGISTERS];

    for(int i = 0; i < NUMBER_OF_REGISTERS; i++)
        this.registers[i] = new SimpleIntegerProperty(DEFAULT_REGISTER_VALUE);

    for(int i = 0; i < NUMBER_OF_REGISTERS; i++)
        this.regInstructions[i] = new SimpleBooleanProperty(false);


    this.namedRegisters = buildNamedRegistersMap();
}
项目:charts    文件:XYZSeriesBuilder.java   
public final XYZSeries build() {
    final XYZSeries SERIES = new XYZSeries();

    if (properties.keySet().contains("itemsArray")) {
        SERIES.setItems(((ObjectProperty<XYZItem[]>) properties.get("itemsArray")).get());
    }
    if(properties.keySet().contains("itemsList")) {
        SERIES.setItems(((ObjectProperty<List<XYZItem>>) properties.get("itemsList")).get());
    }

    for (String key : properties.keySet()) {
        if ("name".equals(key)) {
            SERIES.setName(((StringProperty) properties.get(key)).get());
        } else if ("fill".equals(key)) {
            SERIES.setFill(((ObjectProperty<Paint>) properties.get(key)).get());
        } else if ("stroke".equals(key)) {
            SERIES.setStroke(((ObjectProperty<Paint>) properties.get(key)).get());
        } else if ("symbolFill".equals(key)) {
            SERIES.setSymbolFill(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("symbolStroke".equals(key)) {
            SERIES.setSymbolStroke(((ObjectProperty<Color>) properties.get(key)).get());
        } else if ("symbol".equals(key)) {
            SERIES.setSymbol(((ObjectProperty<Symbol>) properties.get(key)).get());
        } else if ("chartType".equals(key)) {
            SERIES.setChartType(((ObjectProperty<ChartType>) properties.get(key)).get());
        } else if ("symbolsVisible".equals(key)) {
            SERIES.setSymbolsVisible(((BooleanProperty) properties.get(key)).get());
        } else if ("symbolsVisible".equals(key)) {
            SERIES.setSymbolsVisible(((BooleanProperty) properties.get(key)).get());
        } else if ("symbolSize".equals(key)) {
            SERIES.setSymbolSize(((DoubleProperty) properties.get(key)).get());
        } else if ("strokeWidth".equals(key)) {
            SERIES.setStrokeWidth(((DoubleProperty) properties.get(key)).get());
        }
    }
    return SERIES;
}
项目:drd    文件:ShopBackpackController.java   
@Override
public void setShowOnlineDatabase(BooleanProperty showOnlineDatabase) {
    showOnlineDatabase.addListener((observable, oldValue, newValue) -> {
        if (newValue == null) {
            return;
        }

        manager.toggleDatabase(newValue);
    });
}
项目: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;
}
项目:H-Uppaal    文件:ComponentPresentation.java   
private void initializeName() {
    final Component component = controller.getComponent();
    final BooleanProperty initialized = new SimpleBooleanProperty(false);

    controller.name.focusedProperty().addListener((observable, oldValue, newValue) -> {
        if (newValue && !initialized.get()) {
            controller.root.requestFocus();
            initialized.setValue(true);
        }
    });

    // Set the text field to the name in the model, and bind the model to the text field
    controller.name.setText(component.getName());
    controller.name.textProperty().addListener((obs, oldName, newName) -> {
        component.nameProperty().unbind();
        component.setName(newName);
    });

    final Runnable updateColor = () -> {
        final Color color = component.getColor();
        final Color.Intensity colorIntensity = component.getColorIntensity();

        // Set the text color for the label
        controller.name.setStyle("-fx-text-fill: " + color.getTextColorRgbaString(colorIntensity) + ";");
        controller.name.setFocusColor(color.getTextColor(colorIntensity));
        controller.name.setUnFocusColor(javafx.scene.paint.Color.TRANSPARENT);
    };

    controller.getComponent().colorProperty().addListener(observable -> updateColor.run());
    updateColor.run();

    // Center the text vertically and aff a left padding of CORNER_SIZE
    controller.name.setPadding(new Insets(2, 0, 0, CORNER_SIZE));
    controller.name.setOnKeyPressed(CanvasController.getLeaveTextAreaKeyHandler());
}
项目:stvs    文件:TimingDiagramController.java   
/**
 * Instantiates a new Timing diagram controller with a category xAxis.
 *
 * @param commonXAxis the common x axis
 * @param externalYAxis the external y axis
 * @param spec the specification
 * @param ioVariable the io variable
 * @param selection the selection that should be updated
 * @param activated property that indicates if the selection should be updated
 */
public TimingDiagramController(NumberAxis commonXAxis, CategoryAxis externalYAxis,
    ConcreteSpecification spec, ValidIoVariable ioVariable, Selection selection,
    BooleanProperty activated) {
  this.activated = activated;
  this.ioVariable = ioVariable;
  this.selection = selection;
  this.concreteSpec = spec;
  this.commonXAxis = commonXAxis;
  NumberAxis xaxis = new NumberAxis(0, 0, 1);
  CategoryAxis yaxis = new CategoryAxis();
  TimingDiagramView<String> view = new TimingDiagramView<>(xaxis, yaxis);
  this.view = view;
  XYChart.Series<Number, String> seriesData =
      Plotable.toStringSeries(spec.getColumnByName(ioVariable.getName()).getCells());
  ObservableList<XYChart.Series<Number, String>> data = FXCollections.observableArrayList();
  data.add(seriesData);
  view.getData().addAll(data);

  externalYAxis.prefHeightProperty().bind(yaxis.heightProperty());
  yaxis.setAutoRanging(true);
  yaxis.setCategories(externalYAxis.getCategories());
  xaxis.lowerBoundProperty().bind(commonXAxis.lowerBoundProperty());
  xaxis.upperBoundProperty().bind(commonXAxis.upperBoundProperty());

  initCommon();
}
项目:ExtremeGuiMakeover    文件:MovieView.java   
public BooleanProperty enableEffectsProperty() {
    return enableEffects;
}
项目:CalendarFX    文件:CalendarHeaderView.java   
public final boolean isCalendarVisible(Calendar calendar) {
    BooleanProperty prop = getCalendarVisibilityProperty(calendar);
    return prop.get();
}
项目:ABC-List    文件:Topic.java   
public BooleanProperty markAsChangedProperty() {
    return markAsChangedProperty;
}
项目:eadlsync    文件:ConflictManagerViewModel.java   
public BooleanProperty isAllConflictsResolvedProperty() {
    return isAllConflictsResolved;
}
项目:eadlsync    文件:ConflictManagerViewModel.java   
public BooleanProperty isLocalFacingChangedProperty() {
    return isLocalFacingChanged;
}
项目:CalendarFX    文件:SourceGridView.java   
public final BooleanProperty getCalendarVisibilityProperty(Calendar calendar) {
    return calendarVisibilityMap.computeIfAbsent(calendar, cal -> new SimpleBooleanProperty(SourceGridView.this, "visible", true));
}
项目:fx-animation-editor    文件:KeyFrameModel.java   
public BooleanProperty selectedProperty() {
    return selected;
}
项目:eadlsync    文件:ConflictManagerViewModel.java   
public BooleanProperty isLocalAchievingChangedProperty() {
    return isLocalAchievingChanged;
}
项目:MediathekView14Concept    文件:EntryModel.java   
public BooleanProperty hdProperty() {
  return hd;
}
项目:eadlsync    文件:ConflictManagerViewModel.java   
public BooleanProperty isRemoteFacingChangedProperty() {
    return isRemoteFacingChanged;
}
项目:eadlsync    文件:ConflictManagerViewModel.java   
public BooleanProperty isRemoteNeglectedChangedProperty() {
    return isRemoteNeglectedChanged;
}
项目:eadlsync    文件:ConflictManagerViewModel.java   
public BooleanProperty isRemoteAchievingChangedProperty() {
    return isRemoteAchievingChanged;
}
项目:eadlsync    文件:ConflictManagerViewModel.java   
public BooleanProperty isRemoteAcceptingChangedProperty() {
    return isRemoteAcceptingChanged;
}
项目:eadlsync    文件:ConflictManagerViewModel.java   
public BooleanProperty isLocalContextSelectedProperty() {
    return isLocalContextSelected;
}
项目:eadlsync    文件:ConflictManagerViewModel.java   
public BooleanProperty isLocalChosenSelectedProperty() {
    return isLocalChosenSelected;
}
项目:MultiAxisCharts    文件:MultiAxisChart.java   
public final BooleanProperty verticalZeroLineVisibleProperty() {
    return verticalZeroLineVisible;
}
项目:CSS-Editor-FX    文件:BooleanOption.java   
@Override
public BooleanProperty property() {
  return property;
}
项目:eadlsync    文件:ConflictManagerViewModel.java   
public BooleanProperty isRemoteNeglectedSelectedProperty() {
    return isRemoteNeglectedSelected;
}
项目:eadlsync    文件:ConflictManagerViewModel.java   
public BooleanProperty isRemoteAchievingSelectedProperty() {
    return isRemoteAchievingSelected;
}
项目:eadlsync    文件:ConflictManagerViewModel.java   
public BooleanProperty isLocalContextNeglectedProperty() {
    return isLocalContextNeglected;
}
项目:eadlsync    文件:ConflictManagerViewModel.java   
public BooleanProperty isLocalFacingNeglectedProperty() {
    return isLocalFacingNeglected;
}
项目:eadlsync    文件:ConflictManagerViewModel.java   
public BooleanProperty isLocalChosenNeglectedProperty() {
    return isLocalChosenNeglected;
}
项目:eadlsync    文件:ConflictManagerViewModel.java   
public BooleanProperty isLocalNeglectedNeglectedProperty() {
    return isLocalNeglectedNeglected;
}
项目:ServerBrowser    文件:SampServer.java   
public BooleanProperty passwordedProperty() {
    return passwordedProperty;
}
项目:CalendarFX    文件:GoogleEntry.java   
public final BooleanProperty attendeesCanInviteOthersProperty() {
    return attendeesCanInviteOthers;
}