javafx.scene.control.TitledPane Java Examples

The following examples show how to use javafx.scene.control.TitledPane. 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: SplitModule.java    From pdfsam with GNU Affero General Public License v3.0 8 votes vote down vote up
private VBox settingPanel() {
    VBox pane = new VBox();
    pane.setAlignment(Pos.TOP_CENTER);

    TitledPane prefixTitled = Views.titledPane(DefaultI18nContext.getInstance().i18n("File names settings"),
            prefix);
    prefix.addMenuItemFor(Prefix.CURRENTPAGE);
    prefix.addMenuItemFor(Prefix.FILENUMBER);
    prefix.addMenuItemFor("[TOTAL_FILESNUMBER]");

    pane.getChildren().addAll(selectionPane,
            Views.titledPane(DefaultI18nContext.getInstance().i18n("Split settings"), splitOptions),
            Views.titledPane(DefaultI18nContext.getInstance().i18n("Output settings"), destinationPane),
            prefixTitled);
    return pane;
}
 
Example #2
Source File: RFXTitledPaneTest.java    From marathonv5 with Apache License 2.0 6 votes vote down vote up
@Test
public void getText() {
    TitledPane titledPane = (TitledPane) getPrimaryStage().getScene().getRoot().lookup(".titled-pane");
    LoggingRecorder lr = new LoggingRecorder();
    List<String> text = new ArrayList<>();
    Platform.runLater(() -> {
        RFXTitledPane rfxTitledPane = new RFXTitledPane(titledPane, null, null, lr);
        titledPane.setExpanded(true);
        rfxTitledPane.mouseButton1Pressed(null);
        text.add(rfxTitledPane.getAttribute("text"));
    });
    new Wait("Waiting for titled pane text.") {
        @Override
        public boolean until() {
            return text.size() > 0;
        }
    };
    AssertJUnit.assertEquals("Node 1", text.get(0));
}
 
Example #3
Source File: AboutViewController.java    From TerasologyLauncher with Apache License 2.0 6 votes vote down vote up
private Optional<TitledPane> createPaneFor(URL url) {
    return createViewFor(url)
            .map(view -> {
                view.getStylesheets().add(BundleUtils.getFXMLUrl("css_webview").toExternalForm());
                view.setContextMenuEnabled(false);
                return view;
            })
            .map(view -> {
                final AnchorPane pane = new AnchorPane();
                AnchorPane.setBottomAnchor(view, 0.0);
                AnchorPane.setTopAnchor(view, 0.0);
                pane.getChildren().add(view);
                return pane;
            })
            .map(contentPane -> {
                String fname = Files.getNameWithoutExtension(url.getFile());
                final TitledPane titledPane = new TitledPane(fname, contentPane);
                titledPane.setAnimated(false);
                return titledPane;
            });
}
 
Example #4
Source File: RotateModule.java    From pdfsam with GNU Affero General Public License v3.0 6 votes vote down vote up
private VBox settingPanel() {
    VBox pane = new VBox();
    pane.setAlignment(Pos.TOP_CENTER);
    VBox.setVgrow(selectionPane, Priority.ALWAYS);

    TitledPane prefixTitled = Views.titledPane(DefaultI18nContext.getInstance().i18n("File names settings"),
            prefix);
    prefix.addMenuItemFor(Prefix.FILENUMBER);
    prefix.addMenuItemFor("[TOTAL_FILESNUMBER]");

    TitledPane options = Views.titledPane(DefaultI18nContext.getInstance().i18n("Rotate settings"), rotateOptions);

    pane.getChildren().addAll(selectionPane, options,
            Views.titledPane(DefaultI18nContext.getInstance().i18n("Output settings"), destinationPane),
            prefixTitled);
    return pane;
}
 
Example #5
Source File: SplitByBookmarksModule.java    From pdfsam with GNU Affero General Public License v3.0 6 votes vote down vote up
private VBox settingPanel() {
    VBox pane = new VBox();
    pane.setAlignment(Pos.TOP_CENTER);

    TitledPane prefixTitled = Views.titledPane(DefaultI18nContext.getInstance().i18n("File names settings"),
            prefix);
    prefix.addMenuItemFor(Prefix.CURRENTPAGE);
    prefix.addMenuItemFor(Prefix.FILENUMBER);
    prefix.addMenuItemFor(Prefix.BOOKMARK);
    prefix.addMenuItemFor(Prefix.BOOKMARK_STRICT);
    prefix.addMenuItemFor("[TOTAL_FILESNUMBER]");

    pane.getChildren().addAll(selectionPane,
            Views.titledPane(DefaultI18nContext.getInstance().i18n("Split settings"), splitOptions),
            Views.titledPane(DefaultI18nContext.getInstance().i18n("Output settings"), destinationPane),
            prefixTitled);
    return pane;
}
 
Example #6
Source File: SplitBySizeModule.java    From pdfsam with GNU Affero General Public License v3.0 6 votes vote down vote up
private VBox settingPanel() {
    VBox pane = new VBox();
    pane.setAlignment(Pos.TOP_CENTER);

    TitledPane prefixTitled = Views.titledPane(DefaultI18nContext.getInstance().i18n("File names settings"),
            prefix);
    prefix.addMenuItemFor(Prefix.CURRENTPAGE);
    prefix.addMenuItemFor(Prefix.FILENUMBER);
    prefix.addMenuItemFor("[TOTAL_FILESNUMBER]");

    pane.getChildren().addAll(selectionPane,
            Views.titledPane(DefaultI18nContext.getInstance().i18n("Split settings"), splitOptions),
            Views.titledPane(DefaultI18nContext.getInstance().i18n("Output settings"), destinationPane),
            prefixTitled);
    return pane;
}
 
Example #7
Source File: DetailViewPresenter.java    From jfxvnc with Apache License 2.0 6 votes vote down vote up
@Override
public void initialize(URL location, ResourceBundle resources) {

  ConnectView connectView = new ConnectView();
  InfoView infoView = new InfoView();
  AboutView aboutView = new AboutView();
  detailPane.setMinWidth(0.0);
  detailPane.getPanes().addAll((TitledPane) connectView.getView(), (TitledPane) infoView.getView(), (TitledPane) aboutView.getView());
  detailPane.setExpandedPane((TitledPane) connectView.getView());

  detailPane.expandedPaneProperty().addListener((observable, oldValue, newValue) -> Platform.runLater(() -> {
    if (detailPane.getExpandedPane() == null) {
      // keep first view open
      detailPane.setExpandedPane(detailPane.getPanes().get(0));
    }
  }));
}
 
Example #8
Source File: ArenaCoursesSlide.java    From ShootOFF with GNU General Public License v3.0 6 votes vote down vote up
private Pane buildCoursePanes() {
	final File coursesDirectory = new File(System.getProperty("shootoff.courses"));

	final ItemSelectionPane<File> uncategorizedPane = buildCategoryPane(coursesDirectory);
	coursePanes.getChildren().add(new TitledPane("Uncategorized Courses", uncategorizedPane));
	categoryMap.put(coursesDirectory.getPath(), uncategorizedPane);

	final File[] courseFolders = coursesDirectory.listFiles(FOLDER_FILTER);

	if (courseFolders != null) {
		for (final File courseFolder : courseFolders) {
			coursePanes.getChildren().add(new TitledPane(courseFolder.getName().replaceAll("_", "") + " Courses",
					buildCategoryPane(courseFolder)));
		}
	} else {
		logger.error("{} does not appear to be a valid course directory", coursesDirectory.getPath());
	}

	return coursePanes;
}
 
Example #9
Source File: MarsNode.java    From mars-sim with GNU General Public License v3.0 6 votes vote down vote up
public void createGreenhouses(TitledPane tp, Settlement settlement) {
 	VBox v = new VBox();
    v.setSpacing(10);
    v.setPadding(new Insets(0, 20, 10, 20));

 	List<Building> buildings = settlement.getBuildingManager().getACopyOfBuildings();

	Iterator<Building> iter1 = buildings.iterator();
	while (iter1.hasNext()) {
		Building building = iter1.next();
    	if (building.hasFunction(FunctionType.FARMING)) {
//        	try {
        		Farming farm = (Farming) building.getFunction(FunctionType.FARMING);
            	Button b = createGreenhouseDialog(farm);
            	v.getChildren().add(b);
//        	}
//        	catch (BuildingException e) {}
        }
	}


    tp.setContent(v);//"1 2 3 4 5..."));
    tp.setExpanded(true);

 }
 
Example #10
Source File: SessionManager.java    From mokka7 with Eclipse Public License 1.0 6 votes vote down vote up
public void bind(final Accordion accordion, final String propertyName) {
    Object selectedPane = props.getProperty(propertyName);
    for (TitledPane tp : accordion.getPanes()) {
        if (tp.getText() != null && tp.getText().equals(selectedPane)) {
            accordion.setExpandedPane(tp);
            break;
        }
    }
    accordion.expandedPaneProperty().addListener(new ChangeListener<TitledPane>() {

        @Override
        public void changed(ObservableValue<? extends TitledPane> ov, TitledPane t, TitledPane expandedPane) {
            if (expandedPane != null) {
                props.setProperty(propertyName, expandedPane.getText());
            }
        }
    });
}
 
Example #11
Source File: AttributeEditorPanel.java    From constellation with Apache License 2.0 6 votes vote down vote up
public void updateEditorPanel(final AttributeState state) {
    if (state != null) {
        Platform.runLater(() -> {
            clearHeaderTitledPanes();
            for (GraphElementType type : state.getGraphElements()) {
                double longestTitleWidth = calcLongestTitle(state.getAttributeNames().get(type));
                populateContentContainer(state, type, longestTitleWidth);
            }

            for (int i = 0; i < titledPaneHeadingsContainer.getChildren().size(); i++) {
                TitledPane tp = (TitledPane) titledPaneHeadingsContainer.getChildren().get(i);
                int count = ((VBox) tp.getContent()).getChildren().size();
                final int totalAttrs = state.getAttributeCounts().get(ELEMENT_TYPES[i]);
                final String attrCountDisplay = totalAttrs == count ? String.format(HEADING_TITLES[i], totalAttrs, "") : String.format(HEADING_TITLES[i], totalAttrs, String.format(HIDDEN_ATTRIBUTES_INFORMATION, totalAttrs - count));
                headingTitleProperties[i].setValue(attrCountDisplay);
                if (!state.getActiveGraphElements().isEmpty()) {
                    tp.setExpanded(state.getActiveGraphElements().contains(ELEMENT_TYPES[i]));
                }
            }
        });
    }
}
 
Example #12
Source File: CCollapsibleBand.java    From Open-Lowcode with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public Node getNode(
		PageActionManager actionmanager,
		CPageData inputdata,
		Window parentwindow,
		TabPane[] parenttabpanes,
		CollapsibleNode nodetocollapsewhenactiontriggered) {
	Node payloadnode = payload.getNode(actionmanager, inputdata, parentwindow, parenttabpanes,
			(closewheninlineactioninside ? this : null));
	collapsiblepane = new TitledPane(this.title, payloadnode);
	collapsiblepane.setCollapsible(true);
	collapsiblepane.setExpanded(this.openbydefault);
	collapsiblepane.setBorder(Border.EMPTY);
	collapsiblepane.setAnimated(false);

	return collapsiblepane;
}
 
Example #13
Source File: PluginManagerWidget.java    From BowlerStudio with GNU General Public License v3.0 5 votes vote down vote up
public PluginManagerWidget(PluginManager m, Node graphic){
	HBox content = new HBox(20);

	content.setPadding(new Insets(0, 20, 10, 20)); 
	this.manager = m;
	ArrayList<TitledPane> plugins = manager.getPlugins();
	accordion.getPanes().addAll(plugins);
	disconnectTHis = new Button("Disconnect "+manager.getName(), AssetFactory.loadIcon("Disconnect-Device.png"));

	disconnectTHis.setOnMousePressed(	event -> {
		new Thread(){
			public void run(){
				Thread.currentThread().setUncaughtExceptionHandler(new IssueReportingExceptionHandler());

				setName("disconnect plugins");
			    	Log.warning("Disconnect button for "+manager.getName()+" pressed");
			    	getManager().getDevice().disconnect();
		    	
			}
		}.start();

	});
	setGraphic(AssetFactory.loadIcon("Bowler-Device-In-Manager.png"));
	deviceName.setOnAction(event -> {
		getManager().setName(deviceName.getText());
		setText(manager.getName());
		disconnectTHis.setText("Disconnect "+manager.getName());
	});
	Platform.runLater(()->deviceName.setText(manager.getName()));
	content.setHgrow(accordion, Priority.ALWAYS);
	content.getChildren().addAll(graphic,disconnectTHis,deviceName,accordion);
	setContent(content);
	setText(manager.getName());
}
 
Example #14
Source File: QualityControlViewPane.java    From constellation with Apache License 2.0 5 votes vote down vote up
/**
 * 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: TestTemplateManager.java    From latexdraw with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void start(final Stage aStage) throws Exception {
	super.start(aStage);
	final TitledPane root = FXMLLoader.load(LaTeXDraw.class.getResource("/fxml/Template.fxml"), injector.getInstance(ResourceBundle.class),
		injector.getInstance(BuilderFactory.class), cl -> injector.getInstance(cl));
	final BorderPane pane = new BorderPane();
	pane.setTop(root.getContent());
	pane.setCenter(stage.getScene().getRoot());
	stage.getScene().setRoot(pane);
}
 
Example #16
Source File: MetadataOverview.java    From sis with Apache License 2.0 5 votes vote down vote up
private VBox createSummaryView() {
    VBox vb = new VBox();
    TitledPane idPane = new TitledPane("Identification info", createIdGridPane());
    GridPane createSpatialGridPane = createSpatialGridPane();
    vb.getChildren().add(idPane);
    if (!createSpatialGridPane.getChildren().isEmpty()) {
        TitledPane spatialPane = new TitledPane("Spatial representation", createSpatialGridPane);
        vb.getChildren().add(spatialPane);
    }
    return vb;
}
 
Example #17
Source File: ExtractModule.java    From pdfsam with GNU Affero General Public License v3.0 5 votes vote down vote up
private VBox settingPanel() {
    VBox pane = new VBox();
    pane.setAlignment(Pos.TOP_CENTER);
    VBox.setVgrow(selectionPane, Priority.ALWAYS);

    TitledPane prefixTitled = Views.titledPane(DefaultI18nContext.getInstance().i18n("File names settings"),
            prefix);
    prefix.addMenuItemFor(Prefix.FILENUMBER);
    prefix.addMenuItemFor("[TOTAL_FILESNUMBER]");

    pane.getChildren().addAll(selectionPane,
            titledPane(DefaultI18nContext.getInstance().i18n("Extract settings"), extractOptions),
            titledPane(DefaultI18nContext.getInstance().i18n("Output settings"), destinationPane), prefixTitled);
    return pane;
}
 
Example #18
Source File: AttributeEditorPanel.java    From constellation with Apache License 2.0 5 votes vote down vote up
/**
 * multi value pane showing multiple values for an attribute
 *
 * @param attribute
 * @param attributePane
 * @param values
 */
private void createMultiValuePane(final AttributeData attribute, final TitledPane attributePane, final Object[] values) {
    final VBox dataAndMoreButtonBox = new VBox(5); // 5 = spacing

    final ScrollPane multiValuePane = new ScrollPane();

    multiValuePane.setFitToWidth(true);

    final ObservableList<Object> listData = FXCollections.observableArrayList();

    if (values.length > VISIBLE_ROWS) {
        for (int i = 0; i < VISIBLE_ROWS; i++) {
            listData.add(values[i]);
        }
    } else {
        listData.addAll(values);
    }
    final ListView<Object> listView = createListView(attribute, listData);
    final boolean moreToLoad = values.length > VISIBLE_ROWS;
    int visibleRow = moreToLoad ? VISIBLE_ROWS : listData.size();
    listView.setPrefHeight((CELL_HEIGHT * visibleRow) + 2); // +2 because if it is == then there is still a scrollbar.
    multiValuePane.setPrefHeight((CELL_HEIGHT * visibleRow) + 1);
    multiValuePane.setContent(listView);
    multiValuePane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    dataAndMoreButtonBox.setAlignment(Pos.CENTER);
    dataAndMoreButtonBox.setPadding(new Insets(0, 0, 5, 0));
    dataAndMoreButtonBox.getChildren().add(multiValuePane);
    if (moreToLoad) {
        Button loadMoreButton = createLoadMoreButton(dataAndMoreButtonBox, attribute);
        dataAndMoreButtonBox.getChildren().add(loadMoreButton);
    }
    dataAndMoreButtonBox.addEventFilter(KeyEvent.KEY_PRESSED, (KeyEvent event) -> {
        if (event.isShortcutDown() && (event.getCode() == KeyCode.A)) {
            listView.getSelectionModel().selectAll();
            event.consume();
        }
    });
    attributePane.setContent(dataAndMoreButtonBox);
}
 
Example #19
Source File: BattleDetailPhase.java    From logbook-kai with MIT License 5 votes vote down vote up
private void initializeDetail(ObservableValue<? extends Boolean> ob, Boolean o, Boolean n) {
    if (!n)
        return;
    for (Node node : this.detail.getChildren()) {
        if (node instanceof TitledPane) {
            Parent content = this.detailNode(this.attackDetails);
            ((TitledPane) node).setContent(content);
        }
    }
}
 
Example #20
Source File: AttributeEditorPanel.java    From constellation with Apache License 2.0 5 votes vote down vote up
public void resetPanel() {
    Platform.runLater(() -> {
        clearHeaderTitledPanes();
        for (Node n : titledPaneHeadingsContainer.getChildren()) {
            TitledPane tp = (TitledPane) n;
            tp.setExpanded(false);
        }
    });
}
 
Example #21
Source File: SessionContext.java    From jfxvnc with Apache License 2.0 5 votes vote down vote up
public void bind(final Accordion accordion, final String propertyName) {
  Object selectedPane = props.getProperty(propertyName);
  for (TitledPane tp : accordion.getPanes()) {
    if (tp.getText() != null && tp.getText().equals(selectedPane)) {
      accordion.setExpandedPane(tp);
      break;
    }
  }
  accordion.expandedPaneProperty().addListener((ov, t, expandedPane) -> {
    if (expandedPane != null) {
      props.setProperty(propertyName, expandedPane.getText());
    }
  });
}
 
Example #22
Source File: JFXLegendPanel.java    From tuxguitar with GNU Lesser General Public License v2.1 5 votes vote down vote up
public JFXLegendPanel(JFXContainer<? extends Region> parent) {
	super(new TitledPane(), parent);
	
	this.getControl().setContent(new Pane());
	this.getControl().setCollapsible(false);
	this.getControl().setAnimated(false);
	this.getContentPane().setFocusTraversable(false);
}
 
Example #23
Source File: ExportXPathWizardController.java    From pmd-designer with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void initialize(URL location, ResourceBundle resources) {
    initialiseLanguageChoiceBox();

    Platform.runLater(() -> { // Fixes blurry text in the description text area
        descriptionArea.setCache(false);
        ScrollPane sp = (ScrollPane) descriptionArea.getChildrenUnmodifiable().get(0);
        sp.setCache(false);
        for (Node n : sp.getChildrenUnmodifiable()) {
            n.setCache(false);
        }
    });

    // Expands required info pane
    Platform.runLater(() -> infoAccordion.setExpandedPane((TitledPane) infoAccordion.getChildrenUnmodifiable().get(0)));
    Platform.runLater(this::registerValidators);

    exportResultArea.setSyntaxHighlighter(new XmlSyntaxHighlighter());
    exportResultArea.setEditable(false);

    ControlUtil.copyToClipboardButton(copyResultButton, exportResultArea::getText);

    resetMetadataButton.setOnAction(e -> {
        Alert alert = new Alert(AlertType.CONFIRMATION, "Wipe out the rule's metadata?",
                                ButtonType.YES, ButtonType.CANCEL);
        alert.showAndWait();

        exportResultArea.setSyntaxHighlighter(new XmlSyntaxHighlighter());
        if (alert.getResult() == ButtonType.YES) {
            nameProperty().setValue("");
            descriptionProperty().setValue("");
            messageProperty().setValue("");
            priorityProperty().setValue(RulePriority.MEDIUM);
        }
    });

    languageVersionRangeSlider.currentLanguageProperty().bind(this.languageProperty());
    Platform.runLater(() -> exportResultArea.moveTo(0));
}
 
Example #24
Source File: SVRemoteNodeAdapter.java    From scenic-view with GNU General Public License v3.0 5 votes vote down vote up
public SVRemoteNodeAdapter(final Node node, final boolean collapseControls, final boolean collapseContentControls, final boolean fillChildren, final SVRemoteNodeAdapter parent) {
    super(ConnectorUtils.nodeClass(node), node.getClass().getName());
    boolean mustBeExpanded = !(node instanceof Control) || !collapseControls;
    if (!mustBeExpanded && !collapseContentControls) {
        mustBeExpanded = node instanceof TabPane || node instanceof SplitPane || node instanceof ScrollPane || node instanceof Accordion || node instanceof TitledPane;
    }
    setExpanded(mustBeExpanded);
    this.id = node.getId();
    this.nodeId = ConnectorUtils.getNodeUniqueID(node);
    this.focused = node.isFocused();
    if (node.getParent() != null && parent == null) {
        this.parent = new SVRemoteNodeAdapter(node.getParent(), collapseControls, collapseContentControls, false, null);
    } else if (parent != null) {
        this.parent = parent;
    }
    /**
     * Check visibility and mouse transparency after calculating the parent
     */
    this.mouseTransparent = node.isMouseTransparent() || (this.parent != null && this.parent.isMouseTransparent());
    this.visible = node.isVisible() && (this.parent == null || this.parent.isVisible());

    /**
     * TODO This should be improved
     */
    if (fillChildren) {
        nodes = ChildrenGetter.getChildren(node)
                  .stream()
                  .map(childNode -> new SVRemoteNodeAdapter(childNode, collapseControls, collapseContentControls, true, this))
                  .collect(Collectors.toList());
    }
}
 
Example #25
Source File: Palette.java    From phoebus with Eclipse Public License 1.0 5 votes vote down vote up
/** Create a TilePane for each WidgetCategory
 *  @param parent Parent Pane
 *  @return Map of panes for each category
 */
private Map<WidgetCategory, Pane> createWidgetCategoryPanes(final Pane parent)
{
    final Map<WidgetCategory, Pane> palette_groups = new HashMap<>();
    final Set<String> deprecated = Preferences.hidden_widget_types;
    for (final WidgetCategory category : WidgetCategory.values())
    {
        if (!WidgetFactory.getInstance()
        .getWidgetDescriptions()
        .stream()
        .filter(desc -> !deprecated.contains(desc.getType()))
        .filter(desc -> desc.getCategory() == category)
        .findFirst().isPresent())
            continue;
        final TilePane palette_group = new TilePane();
        palette_group.getStyleClass().add("palette_group");
        palette_group.setPrefColumns(1);
        palette_group.setMaxWidth(Double.MAX_VALUE);
        palette_groups.put(category, palette_group);
        palette_group.setHgap(2);
        palette_group.setVgap(2);
        final TitledPane pane = new TitledPane(category.getDescription(), palette_group);
        pane.getStyleClass().add("palette_category");
        parent.getChildren().add(pane);
    }
    return palette_groups;
}
 
Example #26
Source File: MarathonFileChooser.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
@Override
public Parent getContentPane() {
    BorderPane root = new BorderPane();

    root.getStyleClass().add("MarathonFileChooser");
    root.setId("marathon-file-chooser");
    if (doesAllowChildren) {
        if (!fileChooserInfo.isFileCreation()) {
            propertiesView = new AddPropertiesView(new TestPropertiesInfo(fileChooserInfo.getFileToSave()));
            TitledPane titledPane = new TitledPane("Properties", propertiesView);
            centerPane.getChildren().addAll(splitPane, titledPane);
            root.setPrefWidth(540);
            root.setPrefHeight(580);
        } else {
            root.setPrefWidth(540);
            root.setPrefHeight(380);
            centerPane.getChildren().addAll(splitPane);
        }
    } else {
        root.setPrefWidth(540);
        root.setPrefHeight(380);
        centerPane.getChildren().add(childrenListView);
    }
    root.setCenter(centerPane);
    root.setBottom(buttonBar);
    return root;
}
 
Example #27
Source File: DialogErrorContent.java    From WorkbenchFX with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a control which shows the details of an exception or error to be used as the content of
 * a {@link WorkbenchDialog}.
 *
 * @param message the {@link Node} containing the standard dialog message
 * @param details about the error or exception
 */
public DialogErrorContent(Node message, String details) {
  this.message = message;
  this.details = details;

  getStyleClass().add("container");

  // add message to the dialog content
  getChildren().add(message);

  // if details were specified, add them wrapped in a TitledPane
  if (!Strings.isNullOrEmpty(details)) {
    TextArea textArea = new TextArea();
    textArea.setText(details);
    textArea.setWrapText(true);
    textArea.getStyleClass().add("error-details-text-area");

    TitledPane titledPane = new TitledPane();
    titledPane.getStyleClass().add("error-details-titled-pane");
    titledPane.setText("Details");
    titledPane.setContent(textArea);
    titledPane.setPrefHeight(300);

    getChildren().add(titledPane);
  }

}
 
Example #28
Source File: SourceState.java    From paintera with GNU General Public License v2.0 5 votes vote down vote up
static VBox defaultPreferencePaneNode(ObjectProperty<Composite<ARGBType, ARGBType>> composite) {
	final TitledPane titledPane = SourceStateCompositePane.createTitledPane(composite);
	final VBox vbox = new VBox(titledPane);
	vbox.setSpacing(0.0);
	vbox.setPadding(Insets.EMPTY);
	return vbox;
}
 
Example #29
Source File: ImageManufactureOperationController.java    From MyBox with Apache License 2.0 5 votes vote down vote up
@Override
public void initControls() {
    try {
        super.initControls();
        accordionPane.expandedPaneProperty().addListener(new ChangeListener<TitledPane>() {
            @Override
            public void changed(ObservableValue<? extends TitledPane> v, TitledPane o, TitledPane n) {
                if (parent == null || n == null || (myPane != null && myPane.equals(n))) {
                    return;
                }
                expandPane(n);
            }
        });

        isPickingColor.addListener(new ChangeListener<Boolean>() {
            @Override
            public void changed(ObservableValue<? extends Boolean> ov, Boolean oldVal, Boolean newVal) {
                if (imageController == null || imageController.isPickingColor.isBound()) {
                    return;
                }
                imageController.isPickingColor.set(newVal);
            }
        });

    } catch (Exception e) {
        logger.error(e.toString());
    }

}
 
Example #30
Source File: AccordionSample.java    From marathonv5 with Apache License 2.0 5 votes vote down vote up
public AccordionSample() {
    super(150,150);
    TitledPane t1 = new TitledPane("Node 1", new Button("Button"));
    TitledPane t2 = new TitledPane("Node 2", new Text("String"));
    TitledPane t3 = new TitledPane("Node 3", new Rectangle(120,50, Color.RED));
    Accordion accordion = new Accordion();
    accordion.getPanes().add(t1);
    accordion.getPanes().add(t2);
    accordion.getPanes().add(t3);
    getChildren().add(accordion);
}