List of usage examples for javafx.scene.layout Pane getStyleClass
@Override public final ObservableList<String> getStyleClass()
From source file:net.rptools.layercontrol.LayerStackLayer.java
/** * Add a layer.// w w w . jav a 2 s.c o m * @param i index to add at * @param layer layer to add */ @ThreadPolicy(ThreadPolicy.ThreadId.ANY) public synchronized void addLayer(final int i, final Layer layer) { if (!Platform.isFxApplicationThread()) { Platform.runLater(new Runnable() { @Override public void run() { addLayer(i, layer); } }); } // Now on JFX thread Pane pane = new Pane(); final String resource = "layer" + layer.getName() + ".fxml"; try { pane = component.getFramework().getFXMLLoader(layer.getClass().getResource(resource)).load(); } catch (final Exception e) { LOGGER.warn("no layer pane found resource={}", resource); } pane.getStyleClass().add(layer.getName().toLowerCase()); pane.setId(StringUtils.uncapitalize(layer.getName())); pane.minWidthProperty().bind(getDrawable().widthProperty()); pane.minHeightProperty().bind(getDrawable().heightProperty()); final int size = getDrawable().getChildren().size(); getDrawable().getChildren().add(size - i, pane); layer.setDrawable(pane); }
From source file:org.pdfsam.ui.module.BaseTaskExecutionModule.java
@PostConstruct final void init() { Pane innerPanel = getInnerPanel(); innerPanel.getStyleClass().addAll(Style.DEAULT_CONTAINER.css()); innerPanel.getStyleClass().addAll(Style.MODULE_CONTAINER.css()); footer.runButton().setOnAction(event -> { ErrorTracker errorTracker = new ErrorTracker(); Builder<? extends AbstractParameters> builder = getBuilder(errorTracker .andThen(s -> eventStudio().broadcast(new AddNotificationRequestEvent(NotificationType.ERROR, s, DefaultI18nContext.getInstance().i18n("Invalid parameters"))))); if (!errorTracker.errorOnBuild) { eventStudio().broadcast(new TaskExecutionRequestEvent(id(), builder.build())); }// ww w . j a v a 2s . co m }); modulePanel.setBottom(footer); modulePanel.setCenter(innerPanel); eventStudio().addAnnotatedListeners(this); }