/** * Task async and sync. * * @param taskAsync the task async * @param taskSync the task sync */ protected void taskAsyncAndSync(Runnable taskAsync, Runnable taskSync) { SimpleBooleanProperty asyncCompleted = new SimpleBooleanProperty(false); asyncCompleted.addListener((v, o, n)->{ if (n){ if (Platform.isFxApplicationThread()){ taskSync.run(); } else { Platform.runLater(()->{ taskSync.run(); }); } } }); ExecutorService executor = Executors.newSingleThreadExecutor(); executor.submit(()->{ taskAsync.run(); asyncCompleted.set(true); }); executor.shutdown(); }
/** * * @param attributeVisualisationMappingBuilder attributeEditorBuilder * @param uniformDesign uniformDesign * @param dataVisualisationCustomizer way to customize or extend the editor visualisation for a specific data class, e.g. add a green border(silly example), add special button */ public DataEditor(AttributeVisualisationMappingBuilder attributeVisualisationMappingBuilder, UniformDesign uniformDesign, BiFunction<Node,Data,Node> dataVisualisationCustomizer) { this.dataEditorState = new DataEditorState(null, new ArrayList<>(), attributeVisualisationMappingBuilder,uniformDesign,this,dataVisualisationCustomizer,true); historyNavigationVisible.set(true); historyNavigationVisible.addListener(observable -> updateState(dataEditorState.setShowNavigation(historyNavigationVisible.get()))); }
@Override public void onAdded() { bindView(); if (showBBox()) { turnOnDebugBBox(true); } FXGL.getSettings().getDevShowBBox().addListener(debugBBoxOn); }
/** * Constructor * * @param labelString */ @Override public void setStep(IWizardStep step) { this.step = step; circle.setFill(Color.rgb(148, 148, 148)); indexLabel.setText(String.valueOf(step.getIndex())); indexLabel.getStyleClass().add(WIZARD_HORIZONTAL_STEPPER_INDEX_LABEL_CSS); circleContainer.getChildren().addAll(circle, indexLabel); titleLabel.getStyleClass().add(WIZARD_HORIZONTAL_STEPPER_LABEL_CSS); titleLabel.setText(step.getTitle()); getChildren().add(0, circleContainer); getChildren().add(1, titleLabel); step.validProperty().addListener(new ChangeListener<Boolean>() { @Override public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) { if(!newValue) { setError(); } else { setValid(); } }}); }
public void init() { selectableProperty().addListener((ChangeListener<Boolean>) (observable, oldValue, newValue) -> { if (newValue) { Pane pane = getSelectionPaneWrapper(); if (pane != null) { pane.managedProperty().bind(pane.visibleProperty()); pane.getChildren().add(0, selection); } } else { Pane pane = getSelectionPaneWrapper(); if (pane != null) { if (pane.getChildren().get(0) instanceof CheckBox) { pane.getChildren().remove(selection); } } } }); }
/** * @{inheritedDoc} */ @Override public void buildContent() { super.buildContent(); NodeHelper.styleClassAddAll(content, contentConfiguration, "flowContentStyleClass", "ep-flow-content-wrapper"); if (contentConfiguration != null) { // extract item factory flowItemImpl = contentConfiguration.getPropertyValue("flowItemImpl"); flowItemResolver = contentConfiguration.getPropertyValue("flowItemResolver"); if (StringUtils.isBlank(flowItemImpl) && StringUtils.isBlank(flowItemResolver)) { throw new IllegalArgumentException("flowItemImpl or flowItemResolver is mandatory"); } } getFilteredDatas().addListener((ListChangeListener<OperationData>) c -> { buildItem(); }); modifyingProperty().addListener((ChangeListener<Boolean>) (observable, oldValue, newValue) -> { // f.deselect(); }); if(noContentPaneConfiguration != null) { alwaysShowNoContentPane = noContentPaneConfiguration.getBooleanProperty("alwaysVisible", false); } }
/** * @{inheritedDoc} */ @Override protected void process() { super.process(); detailsViewLayout.setMinimizedViewId(minimizedDetailsView); detailsViewLayout.setMaximizedViewId(maximizedDetailsView); detailsViewLayout.buildFrom(this, null); final String currentLocation = getCurrentLocation(); if (StringUtils.isNotBlank(currentLocation)) { getStructureContent().contentLocationProperty().set(currentLocation); } hideIdentity.addListener((ChangeListener<Boolean>) (observable, oldValue, newValue) -> { handleIdentityDisplay(); }); handleIdentityDisplay(); processedView(detailsViewLayout); }
selected.addListener((ChangeListener<Boolean>) (observable, oldValue, newValue) -> { inputComponentWrapper.setCurrentValue(newValue); inputComponentWrapper.commitModification();
private void addDebugListener() { FXGL.getSettings().getDevShowPosition().addListener((o, prev, show) -> { if (show) { forEach(FXGL.getApp().getGameWorld().getEntities(), e -> { addDebugView(e); }); } else { forEach(debugPositions, entry -> { EntityView view = entry.value; view.translateXProperty().unbind(); view.translateYProperty().unbind(); removeGameView(view, RenderLayer.TOP); }); debugPositions.clear(); } }); }
modifyingProperty().addListener((ChangeListener<Boolean>) (observable, oldValue, newValue) -> { for(MultiPresenterFactory f: factories) { f.deselect();
expanded.addListener((obs, oldVal, newVal) -> { if(newVal) { grid.getRowConstraints().get(0).setMaxHeight(30);
isValid.addListener(invalidationListener); invalidationListener.invalidated(isValid); return borderPane;
fullscreenProperty.addListener((ChangeListener<Boolean>) (ov, t, t1) -> getController().setFullScreen(!stage.isFullScreen()));
maximizeProperty.addListener((ChangeListener<Boolean>) (ov, t, t1) -> {