@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()); }
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); }
public void bind(BooleanProperty disableProperty) { cbQuantityEntities.disableProperty().unbind(); cbQuantityEntities.disableProperty().bind(disableProperty); cbQuantityTimePeriod.disableProperty().unbind(); cbQuantityTimePeriod.disableProperty().bind(disableProperty); }
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; }
@Override public void setShowOnlineDatabase(BooleanProperty showOnlineDatabase) { showOnlineDatabase.addListener((observable, oldValue, newValue) -> { if (newValue == null) { return; } manager.toggleDatabase(newValue); }); }
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()); }
/** * 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); }
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; }
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); }
/*** * 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(); }
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; }
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; }
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()); }
/** * 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(); }
public BooleanProperty enableEffectsProperty() { return enableEffects; }
public final boolean isCalendarVisible(Calendar calendar) { BooleanProperty prop = getCalendarVisibilityProperty(calendar); return prop.get(); }
public BooleanProperty markAsChangedProperty() { return markAsChangedProperty; }
public BooleanProperty isAllConflictsResolvedProperty() { return isAllConflictsResolved; }
public BooleanProperty isLocalFacingChangedProperty() { return isLocalFacingChanged; }
public final BooleanProperty getCalendarVisibilityProperty(Calendar calendar) { return calendarVisibilityMap.computeIfAbsent(calendar, cal -> new SimpleBooleanProperty(SourceGridView.this, "visible", true)); }
public BooleanProperty selectedProperty() { return selected; }
public BooleanProperty isLocalAchievingChangedProperty() { return isLocalAchievingChanged; }
public BooleanProperty hdProperty() { return hd; }
public BooleanProperty isRemoteFacingChangedProperty() { return isRemoteFacingChanged; }
public BooleanProperty isRemoteNeglectedChangedProperty() { return isRemoteNeglectedChanged; }
public BooleanProperty isRemoteAchievingChangedProperty() { return isRemoteAchievingChanged; }
public BooleanProperty isRemoteAcceptingChangedProperty() { return isRemoteAcceptingChanged; }
public BooleanProperty isLocalContextSelectedProperty() { return isLocalContextSelected; }
public BooleanProperty isLocalChosenSelectedProperty() { return isLocalChosenSelected; }
public final BooleanProperty verticalZeroLineVisibleProperty() { return verticalZeroLineVisible; }
@Override public BooleanProperty property() { return property; }
public BooleanProperty isRemoteNeglectedSelectedProperty() { return isRemoteNeglectedSelected; }
public BooleanProperty isRemoteAchievingSelectedProperty() { return isRemoteAchievingSelected; }
public BooleanProperty isLocalContextNeglectedProperty() { return isLocalContextNeglected; }
public BooleanProperty isLocalFacingNeglectedProperty() { return isLocalFacingNeglected; }
public BooleanProperty isLocalChosenNeglectedProperty() { return isLocalChosenNeglected; }
public BooleanProperty isLocalNeglectedNeglectedProperty() { return isLocalNeglectedNeglected; }
public BooleanProperty passwordedProperty() { return passwordedProperty; }
public final BooleanProperty attendeesCanInviteOthersProperty() { return attendeesCanInviteOthers; }