Java Code Examples for javafx.scene.control.ScrollPane#setHbarPolicy()
The following examples show how to use
javafx.scene.control.ScrollPane#setHbarPolicy() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SessionViewerController.java From ShootOFF with GNU General Public License v3.0 | 6 votes |
private void updateCameraTabs() { cameraTabPane.getTabs().clear(); cameraGroups.clear(); eventSelectionsPerTab.clear(); for (final String cameraName : currentSession.getEvents().keySet()) { final Group canvas = new Group(); final ScrollPane scrollPane = new ScrollPane(canvas); scrollPane.setPrefSize(cameraTabPane.getPrefWidth(), cameraTabPane.getPrefHeight()); scrollPane.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); cameraGroups.put(cameraName, new SessionCanvasManager(canvas, config)); final Tab cameraTab = new Tab(cameraName); cameraTab.setContent(scrollPane); cameraTabPane.getTabs().add(cameraTab); } }
Example 2
Source File: StepRepresentationPresentation.java From phoenicis with GNU Lesser General Public License v3.0 | 6 votes |
@Override protected void drawStepContent() { final String title = this.getParentWizardTitle(); VBox contentPane = new VBox(); contentPane.setId("presentationBackground"); Label titleWidget = new Label(title + "\n\n"); titleWidget.setId("presentationTextTitle"); Text textWidget = new Text(textToShow); textWidget.setId("presentationText"); TextFlow flow = new TextFlow(); flow.getChildren().add(textWidget); ScrollPane scrollPane = new ScrollPane(); scrollPane.setId("presentationScrollPane"); scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); scrollPane.setFitToWidth(true); scrollPane.setContent(flow); VBox.setVgrow(scrollPane, Priority.ALWAYS); contentPane.getChildren().add(scrollPane); getParent().getRoot().setCenter(contentPane); }
Example 3
Source File: LogsView.java From trex-stateless-gui with Apache License 2.0 | 6 votes |
private void buildUI() { contentWrapper = new ScrollPane(); contentWrapper.setHbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED); getChildren().add(contentWrapper); setTopAnchor(contentWrapper, 0d); setLeftAnchor(contentWrapper, 0d); setBottomAnchor(contentWrapper, 0d); setRightAnchor(contentWrapper, 0d); logsContent = new VBox(); logsContent.setId("logs_view"); logsContent.heightProperty().addListener((observable, oldValue, newValue) -> contentWrapper.setVvalue((Double) newValue)); logsContent.setSpacing(5); contentWrapper.setContent(logsContent); }
Example 4
Source File: CommentBoxVBoxer.java From marathonv5 with Apache License 2.0 | 6 votes |
private Node createTextArea(boolean selectable, boolean editable) { textArea = new TextArea(); textArea.setPrefRowCount(4); textArea.setEditable(editable); textArea.textProperty().addListener((observable, oldValue, newValue) -> { item.setText(textArea.getText()); }); textArea.setText(item.getText()); ScrollPane scrollPane = new ScrollPane(textArea); scrollPane.setFitToWidth(true); scrollPane.setFitToHeight(true); scrollPane.setHbarPolicy(ScrollBarPolicy.NEVER); scrollPane.setVbarPolicy(ScrollBarPolicy.ALWAYS); HBox.setHgrow(scrollPane, Priority.ALWAYS); return scrollPane; }
Example 5
Source File: MutableOfferView.java From bisq with GNU Affero General Public License v3.0 | 5 votes |
private void addScrollPane() { scrollPane = new ScrollPane(); scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); scrollPane.setFitToWidth(true); scrollPane.setFitToHeight(true); AnchorPane.setLeftAnchor(scrollPane, 0d); AnchorPane.setTopAnchor(scrollPane, 0d); AnchorPane.setRightAnchor(scrollPane, 0d); AnchorPane.setBottomAnchor(scrollPane, 0d); root.getChildren().add(scrollPane); }
Example 6
Source File: BreakingNewsDemo.java From htm.java-examples with GNU Affero General Public License v3.0 | 5 votes |
public void configureView() { view = new BreakingNewsDemoView(); view.autoModeProperty().addListener((v, o, n) -> { this.mode = n; }); this.mode = view.autoModeProperty().get(); view.startActionProperty().addListener((v, o, n) -> { if(n) { if(mode == Mode.AUTO) cursor++; start(); }else{ stop(); } }); view.runOneProperty().addListener((v, o, n) -> { this.cursor += n.intValue(); runOne(jsonList.get(cursor), cursor); }); view.flipStateProperty().addListener((v, o, n) -> { view.flipPaneProperty().get().flip(); }); view.setPrefSize(1370, 1160); view.setMinSize(1370, 1160); mainViewScroll = new ScrollPane(); mainViewScroll.setViewportBounds(new BoundingBox(0, 0, 1370, 1160)); mainViewScroll.setHbarPolicy(ScrollBarPolicy.NEVER); mainViewScroll.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); mainViewScroll.setContent(view); mainViewScroll.viewportBoundsProperty().addListener((v, o, n) -> { view.setPrefSize(Math.max(1370, n.getMaxX()), Math.max(1160, n.getMaxY()));//1370, 1160); }); createDataStream(); createAlgorithm(); }
Example 7
Source File: ContainerVerbsPanelSkin.java From phoenicis with GNU Lesser General Public License v3.0 | 5 votes |
/** * {@inheritDoc} */ @Override public void initialise() { final Text title = new Text(tr("Verbs")); title.getStyleClass().add("title"); final GridPane verbs = new GridPane(); verbs.getStyleClass().add("verb-grid"); // ensure that the shown verbs are always up to date getControl().getVerbScripts().addListener((Observable invalidation) -> updateVerbs(verbs)); // ensure that the shown verbs are correctly initialized updateVerbs(verbs); final ScrollPane verbScrollPanel = new ScrollPane(verbs); verbScrollPanel.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); verbScrollPanel.setFitToWidth(true); VBox.setVgrow(verbScrollPanel, Priority.ALWAYS); final HBox verbManagementButtons = createVerbManagementButtons(verbs); verbManagementButtons.getStyleClass().add("verb-management-button-container"); final VBox container = new VBox(title, verbScrollPanel, verbManagementButtons); container.getStyleClass().addAll("container-details-panel", "container-verbs-panel"); getChildren().setAll(container); }
Example 8
Source File: PannableView.java From mars-sim with GNU General Public License v3.0 | 5 votes |
/** @return a ScrollPane which scrolls the layout. */ private ScrollPane createScrollPane(Pane layout) { ScrollPane scroll = new ScrollPane(); scroll.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); scroll.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); scroll.setPannable(true); scroll.setPrefSize(800, 600); scroll.setContent(layout); return scroll; }
Example 9
Source File: DashboardItemPane.java From pdfsam with GNU Affero General Public License v3.0 | 5 votes |
DashboardItemPane(DashboardItem item) { requireNotNullArg(item, "Dashboard item cannot be null"); this.item = item; this.item.pane().getStyleClass().addAll(Style.DEAULT_CONTAINER.css()); this.item.pane().getStyleClass().addAll(Style.CONTAINER.css()); ScrollPane scroll = new ScrollPane(this.item.pane()); scroll.getStyleClass().addAll(Style.DEAULT_CONTAINER.css()); scroll.setFitToWidth(true); scroll.setHbarPolicy(ScrollBarPolicy.NEVER); scroll.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); setCenter(scroll); eventStudio().add(SetActiveModuleRequest.class, enableFooterListener, Integer.MAX_VALUE, ReferenceStrength.STRONG); }
Example 10
Source File: FunctionStage.java From marathonv5 with Apache License 2.0 | 5 votes |
private void initComponents() { mainSplitPane.setDividerPositions(0.35); mainSplitPane.getItems().addAll(createTree(), functionSplitPane); expandAllBtn.setOnAction((e) -> expandAll()); collapseAllBtn.setOnAction((e) -> collapseAll()); refreshButton.setOnAction((e) -> refresh()); topButtonBar.setId("topButtonBar"); topButtonBar.setButtonMinWidth(Region.USE_PREF_SIZE); topButtonBar.getButtons().addAll(expandAllBtn, collapseAllBtn, refreshButton); functionSplitPane.setDividerPositions(0.4); functionSplitPane.setOrientation(Orientation.VERTICAL); documentArea = functionInfo.getEditorProvider().get(false, 0, IEditorProvider.EditorType.OTHER, false); Platform.runLater(() -> { documentArea.setEditable(false); documentArea.setMode("ruby"); }); argumentPane = new VBox(); ScrollPane scrollPane = new ScrollPane(argumentPane); scrollPane.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); functionSplitPane.getItems().addAll(documentArea.getNode(), scrollPane); okButton.setOnAction(new OkHandler()); okButton.setDisable(true); cancelButton.setOnAction((e) -> dispose()); buttonBar.getButtons().addAll(okButton, cancelButton); buttonBar.setButtonMinWidth(Region.USE_PREF_SIZE); }
Example 11
Source File: ImagePanel.java From marathonv5 with Apache License 2.0 | 5 votes |
private void initComponents() { createLeftPane(); createRightPane(); scrollPane = new ScrollPane(anchorPane); scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED); scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED); getItems().addAll(scrollPane, annotationTable); setDividerPositions(0.7); }
Example 12
Source File: ScheduleThemeNode.java From Quelea with GNU General Public License v3.0 | 5 votes |
public ScheduleThemeNode(UpdateThemeCallback songCallback, UpdateThemeCallback bibleCallback, Stage popup, Button themeButton) { this.songCallback = songCallback; this.bibleCallback = bibleCallback; this.popup = popup; themeDialog = new EditThemeDialog(); themeDialog.initModality(Modality.APPLICATION_MODAL); contentPanel = new VBox(); BorderPane.setMargin(contentPanel, new Insets(10)); themeButton.layoutXProperty().addListener(new ChangeListener<Number>() { @Override public void changed(ObservableValue<? extends Number> ov, Number t, Number t1) { MainWindow mainWindow = QueleaApp.get().getMainWindow(); double width = mainWindow.getWidth() - t1.doubleValue() - 100; if (width < 50) { width = 50; } if (width > 900) { width = 900; } contentPanel.setPrefWidth(width); contentPanel.setMaxWidth(width); } }); setMaxHeight(300); contentPanel.setSpacing(5); contentPanel.setPadding(new Insets(3)); refresh(); ScrollPane scroller = new ScrollPane(contentPanel); scroller.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); setCenter(scroller); }
Example 13
Source File: TakeOfferView.java From bisq with GNU Affero General Public License v3.0 | 5 votes |
private void addScrollPane() { scrollPane = new ScrollPane(); scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); scrollPane.setFitToWidth(true); scrollPane.setFitToHeight(true); AnchorPane.setLeftAnchor(scrollPane, 0d); AnchorPane.setTopAnchor(scrollPane, 0d); AnchorPane.setRightAnchor(scrollPane, 0d); AnchorPane.setBottomAnchor(scrollPane, 0d); root.getChildren().add(scrollPane); }
Example 14
Source File: QualityControlViewPane.java From constellation with Apache License 2.0 | 5 votes |
/** * Display a dialog containing all Rule objects registered with the Quality * Control View and which matched for a given identifier. * * @param owner The owner Node * @param identifier The identifier of the graph node being displayed. * @param rules The list of rules measured against this graph node. */ private static void showRuleDialog(final Node owner, final String identifier, final List<Pair<Integer, String>> rules) { final ScrollPane sp = new ScrollPane(); sp.setPrefHeight(512); sp.setPrefWidth(512); sp.setFitToWidth(true); sp.setVbarPolicy(ScrollPane.ScrollBarPolicy.ALWAYS); sp.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); final VBox vbox = new VBox(); vbox.prefWidthProperty().bind(sp.widthProperty()); vbox.setPadding(Insets.EMPTY); for (final Pair<Integer, String> rule : rules) { final String[] t = rule.getValue().split("§"); final String quality = rule.getKey() == 0 ? Bundle.MSG_NotApplicable() : "" + rule.getKey(); final String title = String.format("%s - %s", quality, t[0]); final Text content = new Text(t[1]); content.wrappingWidthProperty().bind(sp.widthProperty().subtract(16)); // Subtract a random number to avoid the vertical scrollbar. final TitledPane tp = new TitledPane(title, content); tp.prefWidthProperty().bind(vbox.widthProperty()); tp.setExpanded(false); tp.setWrapText(true); vbox.getChildren().add(tp); } sp.setContent(vbox); final Alert alert = new Alert(Alert.AlertType.INFORMATION); alert.setHeaderText(String.format(Bundle.MSG_QualtyControlRules(), identifier)); alert.getDialogPane().setContent(sp); alert.setResizable(true); alert.show(); }
Example 15
Source File: ConsolidatedDialog.java From constellation with Apache License 2.0 | 4 votes |
/** * A generic multiple matches dialog which can be used to display a * collection of ObservableList items * * @param title The title of the dialog * @param observableMap The map of {@code ObservableList} objects * @param message The (help) message that will be displayed at the top of * the dialog window * @param listItemHeight The height of each list item. If you have a single * row of text then set this to 24. */ public ConsolidatedDialog(String title, Map<String, ObservableList<Container<K, V>>> observableMap, String message, int listItemHeight) { final BorderPane root = new BorderPane(); root.setStyle("-fx-background-color: #DDDDDD;-fx-border-color: #3a3e43;-fx-border-width: 4px;"); // add a title final Label titleLabel = new Label(); titleLabel.setText(title); titleLabel.setStyle("-fx-font-size: 11pt;-fx-font-weight: bold;"); titleLabel.setAlignment(Pos.CENTER); titleLabel.setPadding(new Insets(5)); root.setTop(titleLabel); final Accordion accordion = new Accordion(); for (String identifier : observableMap.keySet()) { final ObservableList<Container<K, V>> objects = observableMap.get(identifier); ListView<Container<K, V>> listView = new ListView<>(objects); listView.setEditable(false); listView.setPrefHeight((listItemHeight * objects.size())); listView.getSelectionModel().selectedItemProperty().addListener(event -> { listView.getItems().get(0).getKey(); final Container<K, V> container = listView.getSelectionModel().getSelectedItem(); if (container != null) { selectedObjects.add(new Pair<>(container.getKey(), container.getValue())); } else { // the object was unselected so go through the selected objects and remove them all because we don't know which one was unselected for (Container<K, V> object : listView.getItems()) { selectedObjects.remove(new Pair<>(object.getKey(), object.getValue())); } } }); final TitledPane titledPane = new TitledPane(identifier, listView); accordion.getPanes().add(titledPane); } final HBox help = new HBox(); help.getChildren().add(helpMessage); help.getChildren().add(new ImageView(UserInterfaceIconProvider.HELP.buildImage(16, ConstellationColor.AZURE.getJavaColor()))); help.setPadding(new Insets(10, 0, 10, 0)); helpMessage.setText(message + "\n\nNote: To deselect hold Ctrl when you click."); helpMessage.setStyle("-fx-font-size: 11pt;"); helpMessage.setWrapText(true); helpMessage.setPadding(new Insets(5)); final VBox box = new VBox(); box.getChildren().add(help); // add the multiple matching accordion box.getChildren().add(accordion); final ScrollPane scroll = new ScrollPane(); scroll.setContent(box); scroll.setFitToWidth(true); scroll.setHbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED); root.setCenter(scroll); final FlowPane buttonPane = new FlowPane(); buttonPane.setAlignment(Pos.BOTTOM_RIGHT); buttonPane.setPadding(new Insets(5)); buttonPane.setHgap(5); root.setBottom(buttonPane); useButton = new Button("Continue"); buttonPane.getChildren().add(useButton); accordion.expandedPaneProperty().set(null); final Scene scene = new Scene(root); fxPanel.setScene(scene); fxPanel.setPreferredSize(new Dimension(500, 500)); }
Example 16
Source File: Palette.java From phoebus with Eclipse Public License 1.0 | 4 votes |
/** Create UI elements * @return Top-level Node of the UI */ @SuppressWarnings("unchecked") public Node create() { final VBox palette = new VBox(); final Map<WidgetCategory, Pane> palette_groups = createWidgetCategoryPanes(palette); groups = palette_groups.values(); createWidgetEntries(palette_groups); final ScrollPane palette_scroll = new ScrollPane(palette); palette_scroll.setHbarPolicy(ScrollBarPolicy.NEVER); palette_scroll.setFitToWidth(true); // TODO Determine the correct size for the main node // Using 2*PREFERRED_WIDTH was determined by trial and error palette_scroll.setMinWidth(PREFERRED_WIDTH + 12); palette_scroll.setPrefWidth(PREFERRED_WIDTH); // Copy the widgets, i.e. the children of each palette_group, // to the userData. // Actual children are now updated based on search by widget name palette_groups.values().forEach(group -> group.setUserData(new ArrayList<Node>(group.getChildren()))); final TextField searchField = new ClearingTextField(); searchField.setPromptText(Messages.SearchTextField); searchField.setTooltip(new Tooltip(Messages.WidgetFilterTT)); searchField.setPrefColumnCount(9); searchField.textProperty().addListener( ( observable, oldValue, search_text ) -> { final String search = search_text.toLowerCase().trim(); palette_groups.values().stream().forEach(group -> { group.getChildren().clear(); final List<Node> all_widgets = (List<Node>)group.getUserData(); if (search.isEmpty()) group.getChildren().setAll(all_widgets); else group.getChildren().setAll(all_widgets.stream() .filter(node -> { final String text = ((ToggleButton) node).getText().toLowerCase(); return text.contains(search); }) .collect(Collectors.toList())); }); }); HBox.setHgrow(searchField, Priority.NEVER); final HBox toolsPane = new HBox(6); toolsPane.setAlignment(Pos.CENTER_RIGHT); toolsPane.setPadding(new Insets(6)); toolsPane.getChildren().add(searchField); BorderPane paletteContainer = new BorderPane(); paletteContainer.setTop(toolsPane); paletteContainer.setCenter(palette_scroll); return paletteContainer; }
Example 17
Source File: MainLayout.java From redtorch with MIT License | 4 votes |
private void createLayout() { vBox.getChildren().add(crearteMainMenuBar()); // 左右切分布局------------------------ SplitPane horizontalSplitPane = new SplitPane(); horizontalSplitPane.setDividerPositions(0.5); vBox.getChildren().add(horizontalSplitPane); VBox.setVgrow(horizontalSplitPane, Priority.ALWAYS); // 左右切分布局----左侧上下切分布局--------- SplitPane leftVerticalSplitPane = new SplitPane(); leftVerticalSplitPane.setDividerPositions(0.4); horizontalSplitPane.getItems().add(leftVerticalSplitPane); leftVerticalSplitPane.setOrientation(Orientation.VERTICAL); // 左右切分布局----左侧上下切分布局----上布局----- SplitPane leftTopHorizontalSplitPane = new SplitPane(); leftVerticalSplitPane.getItems().add(leftTopHorizontalSplitPane); HBox leftTopRithtPane = new HBox(); Node orderPanelLayoutNode = orderPanelLayout.getNode(); HBox.setHgrow(orderPanelLayoutNode, Priority.ALWAYS); ScrollPane marketDetailsScrollPane = new ScrollPane(); Node marketDetailsNode = marketDetailsLayout.getNode(); marketDetailsScrollPane.setContent(marketDetailsNode); marketDetailsScrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); marketDetailsScrollPane.setPrefWidth(253); marketDetailsScrollPane.setMinWidth(253); marketDetailsScrollPane.setMaxWidth(253); leftTopRithtPane.getChildren().addAll(marketDetailsScrollPane, orderPanelLayoutNode); leftTopRithtPane.setMaxWidth(680); leftTopRithtPane.setPrefWidth(680); leftTopHorizontalSplitPane.getItems().addAll(tickLayout.getNode(), leftTopRithtPane); SplitPane.setResizableWithParent(leftTopRithtPane, false); // 左右切分布局----左侧上下切分布局----下布局----- TabPane leftBootomTabPane = new TabPane(); leftVerticalSplitPane.getItems().add(leftBootomTabPane); Tab orderTab = new Tab("定单"); leftBootomTabPane.getTabs().add(orderTab); orderTab.setClosable(false); orderTab.setContent(orderLayout.getNode()); Tab tradeTab = new Tab("成交"); leftBootomTabPane.getTabs().add(tradeTab); tradeTab.setClosable(false); tradeTab.setContent(tradeLayout.getNode()); // 左右切分布局----右侧TAB布局------------- TabPane rightTabPane = new TabPane(); horizontalSplitPane.getItems().add(rightTabPane); Tab portfolioInvestmentTab = new Tab("投资组合"); rightTabPane.getTabs().add(portfolioInvestmentTab); portfolioInvestmentTab.setClosable(false); SplitPane portfolioVerticalSplitPane = new SplitPane(); portfolioInvestmentTab.setContent(portfolioVerticalSplitPane); portfolioVerticalSplitPane.setOrientation(Orientation.VERTICAL); VBox.setVgrow(portfolioVerticalSplitPane, Priority.ALWAYS); VBox portfolioVBox = new VBox(); portfolioVBox.getChildren().add(combinationLayout.getNode()); portfolioVBox.getChildren().add(accountLayout.getNode()); VBox.setVgrow(accountLayout.getNode(), Priority.ALWAYS); portfolioVerticalSplitPane.getItems().add(portfolioVBox); portfolioVerticalSplitPane.getItems().add(positionLayout.getNode()); Tab allContractTab = new Tab("全部合约"); allContractTab.setContent(contractLayout.getNode()); rightTabPane.getTabs().add(allContractTab); allContractTab.setClosable(false); // 状态栏------------------------------ vBox.getChildren().add(createStatusBar()); }
Example 18
Source File: TradeStepView.java From bisq with GNU Affero General Public License v3.0 | 4 votes |
protected TradeStepView(PendingTradesViewModel model) { this.model = model; preferences = model.dataModel.preferences; trade = model.dataModel.getTrade(); checkNotNull(trade, "Trade must not be null at TradeStepView"); ScrollPane scrollPane = new ScrollPane(); scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED); scrollPane.setFitToHeight(true); scrollPane.setFitToWidth(true); AnchorPane.setLeftAnchor(scrollPane, 10d); AnchorPane.setRightAnchor(scrollPane, 10d); AnchorPane.setTopAnchor(scrollPane, 10d); AnchorPane.setBottomAnchor(scrollPane, 0d); getChildren().add(scrollPane); gridPane = new GridPane(); gridPane.setHgap(Layout.GRID_GAP); gridPane.setVgap(Layout.GRID_GAP); ColumnConstraints columnConstraints1 = new ColumnConstraints(); columnConstraints1.setHgrow(Priority.ALWAYS); ColumnConstraints columnConstraints2 = new ColumnConstraints(); columnConstraints2.setHgrow(Priority.ALWAYS); gridPane.getColumnConstraints().addAll(columnConstraints1, columnConstraints2); scrollPane.setContent(gridPane); AnchorPane.setLeftAnchor(this, 0d); AnchorPane.setRightAnchor(this, 0d); AnchorPane.setTopAnchor(this, -10d); AnchorPane.setBottomAnchor(this, 0d); addContent(); errorMessageListener = (observable, oldValue, newValue) -> { if (newValue != null) new Popup().error(newValue).show(); }; clockListener = new ClockWatcher.Listener() { @Override public void onSecondTick() { } @Override public void onMinuteTick() { updateTimeLeft(); } }; }
Example 19
Source File: SpectraIdentificationResultsWindowFX.java From mzmine3 with GNU General Public License v2.0 | 4 votes |
public SpectraIdentificationResultsWindowFX() { super(); pnMain = new BorderPane(); this.setScene(new Scene(pnMain)); getScene().getStylesheets() .addAll(MZmineCore.getDesktop().getMainWindow().getScene().getStylesheets()); pnMain.setPrefSize(1000, 600); pnMain.setMinSize(700, 500); setMinWidth(700); setMinHeight(500); setTitle("Processing..."); pnGrid = new GridPane(); // any number of rows noMatchesFound = new Label("I'm working on it"); noMatchesFound.setFont(headerFont); // yellow noMatchesFound.setTextFill(Color.web("0xFFCC00")); pnGrid.add(noMatchesFound, 0, 0); pnGrid.setVgap(5); // Add the Windows menu MenuBar menuBar = new MenuBar(); // menuBar.add(new WindowsMenu()); Menu menu = new Menu("Menu"); // set font size of chart MenuItem btnSetup = new MenuItem("Setup dialog"); btnSetup.setOnAction(e -> { Platform.runLater(() -> { if (MZmineCore.getConfiguration() .getModuleParameters(SpectraIdentificationResultsModule.class) .showSetupDialog(true) == ExitCode.OK) { showExportButtonsChanged(); } }); }); menu.getItems().add(btnSetup); CheckMenuItem cbCoupleZoomY = new CheckMenuItem("Couple y-zoom"); cbCoupleZoomY.setSelected(true); cbCoupleZoomY.setOnAction(e -> setCoupleZoomY(cbCoupleZoomY.isSelected())); menu.getItems().add(cbCoupleZoomY); menuBar.getMenus().add(menu); pnMain.setTop(menuBar); scrollPane = new ScrollPane(pnGrid); pnMain.setCenter(scrollPane); scrollPane.setHbarPolicy(ScrollBarPolicy.AS_NEEDED); scrollPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED); totalMatches = new ArrayList<>(); matchPanels = new HashMap<>(); setCoupleZoomY(true); show(); }
Example 20
Source File: TransactionGraphLabelsEditorFactory.java From constellation with Apache License 2.0 | 4 votes |
@Override protected Node createEditorControls() { // get all transaction attributes currently in the graph final ReadableGraph rg = GraphManager.getDefault().getActiveGraph().getReadableGraph(); try { for (int i = 0; i < rg.getAttributeCount(GraphElementType.TRANSACTION); i++) { attributeNames.add(rg.getAttributeName(rg.getAttribute(GraphElementType.TRANSACTION, i))); } } finally { rg.release(); } attributeNames.sort(String::compareTo); final HBox labelTitles = new HBox(); final Label attrLabel = new Label("Attribute"); attrLabel.setAlignment(Pos.CENTER); attrLabel.setPrefWidth(150); final Label colorLabel = new Label("Colour"); colorLabel.setPrefWidth(40); colorLabel.setAlignment(Pos.CENTER); final Label sizeLabel = new Label("Size"); sizeLabel.setPrefWidth(50); sizeLabel.setAlignment(Pos.CENTER); final Label positionLabel = new Label("Position"); positionLabel.setPrefWidth(115); positionLabel.setAlignment(Pos.CENTER); labelTitles.getChildren().addAll(attrLabel, colorLabel, sizeLabel, positionLabel); labelPaneContent.setPadding(new Insets(5)); labelPaneContent.getChildren().addAll(labelTitles, labelEntries); final ScrollPane labelsScrollPane = new ScrollPane(); labelsScrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); labelsScrollPane.setPrefHeight(200); labelsScrollPane.setPrefWidth(400); labelsScrollPane.setContent(labelPaneContent); addButton.setOnAction(e -> { new LabelEntry(labels, labelEntries, attributeNames.isEmpty() ? "" : attributeNames.get(0), ConstellationColor.LIGHT_BLUE, 1); addButton.setDisable(labels.size() == GraphLabels.MAX_LABELS); update(); }); final Label addButtonLabel = new Label("Add Label"); final FlowPane addPane = new FlowPane(); addPane.setHgap(10); addPane.setAlignment(Pos.CENTER_RIGHT); addPane.getChildren().addAll(addButtonLabel, addButton); final VBox controls = new VBox(10); controls.setPrefWidth(400); controls.getChildren().addAll(labelsScrollPane, addPane); return controls; }