当前位置: 首页>>代码示例>>Java>>正文


Java StackPane类代码示例

本文整理汇总了Java中javafx.scene.layout.StackPane的典型用法代码示例。如果您正苦于以下问题:Java StackPane类的具体用法?Java StackPane怎么用?Java StackPane使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StackPane类属于javafx.scene.layout包,在下文中一共展示了StackPane类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import javafx.scene.layout.StackPane; //导入依赖的package包/类
@Override public void start(Stage stage) {
    StackPane pane = new StackPane(graph);
    pane.setPadding(new Insets(10));
    pane.setBackground(new Background(new BackgroundFill(Color.rgb(40, 40, 40), CornerRadii.EMPTY, Insets.EMPTY)));

    Scene scene = new Scene(pane);

    stage.setTitle("Radial Chart");
    stage.setScene(scene);
    stage.show();

    timer.start();
}
 
开发者ID:HanSolo,项目名称:radialchart,代码行数:14,代码来源:Demo.java

示例2: show

import javafx.scene.layout.StackPane; //导入依赖的package包/类
public void show() {
	textArea = new JFXTextArea(bodyText);
	
	JFXDialogLayout content = new JFXDialogLayout();
	content.setHeading(new Text(headingText));
	content.setBody(textArea);
	content.setPrefSize(dialogWidth, dialogHeight);
	StackPane stackPane = new StackPane();
	stackPane.autosize();
	JFXDialog dialog = new JFXDialog(stackPane, content, JFXDialog.DialogTransition.LEFT, true);
	JFXButton button = new JFXButton("Okay");
	button.setOnAction(new EventHandler<ActionEvent>() {
		@Override
		public void handle(ActionEvent event) {
			dialog.close();
		}
	});
	button.setButtonType(com.jfoenix.controls.JFXButton.ButtonType.RAISED);
	button.setPrefHeight(32);
	button.setStyle(dialogBtnStyle);
	content.setActions(button);
	pane.getChildren().add(stackPane);
	AnchorPane.setTopAnchor(stackPane, (pane.getHeight() - content.getPrefHeight()) / 2);
	AnchorPane.setLeftAnchor(stackPane, (pane.getWidth() - content.getPrefWidth()) / 2);
	dialog.show();
}
 
开发者ID:Seil0,项目名称:cemu_UI,代码行数:27,代码来源:JFXTextAreaInfoDialog.java

示例3: start

import javafx.scene.layout.StackPane; //导入依赖的package包/类
@Override public void start(Stage stage) {
    GridPane gridPane = new GridPane();
    gridPane.setPadding(new Insets(10));
    gridPane.setHgap(10);
    gridPane.setVgap(10);
    gridPane.add(lineChart, 0, 0);
    gridPane.add(areaChart, 1, 0);
    gridPane.add(smoothLineChart, 0, 1);
    gridPane.add(smoothAreaChart, 1, 1);
    gridPane.add(scatterChart, 0, 2);
    gridPane.add(donutChart, 1, 2);

    Scene scene = new Scene(new StackPane(gridPane));

    stage.setTitle("Charts");
    stage.setScene(scene);
    stage.show();

    timer.start();

    modificationThread.start();
}
 
开发者ID:HanSolo,项目名称:charts,代码行数:23,代码来源:ChartTest.java

示例4: EnumerationNodeView

import javafx.scene.layout.StackPane; //导入依赖的package包/类
public EnumerationNodeView(EnumerationNode node) {
    super(node);
    //setChangeListeners();

    container = new StackPane();
    rectangle = new Rectangle();
    vbox = new VBox();
    container.getChildren().addAll(rectangle, vbox);

    initVBox();
    createRectangles();
    changeHeight(node.getHeight());
    changeWidth(node.getWidth());
    initLooks();

    this.getChildren().add(container);

    this.setTranslateX(node.getTranslateX());
    this.setTranslateY(node.getTranslateY());
    createHandles();
}
 
开发者ID:kaanburaksener,项目名称:octoBubbles,代码行数:22,代码来源:EnumerationNodeView.java

示例5: init

import javafx.scene.layout.StackPane; //导入依赖的package包/类
@Override public void init() throws Exception {
    root = new StackPane();
    background = new StackPane();
    background.setId("Window");
    background.setCache(true);
    ImageView carImageView = new ImageView(new Image(
            DataAppPreloader.class.getResourceAsStream("images/car.png")));
    raceTrack = new RaceTrack();
    root.getChildren().addAll(background, raceTrack, carImageView);
    Platform.runLater(new Runnable() {
        @Override public void run() {
            preloaderScene = new Scene(root,1250,750);
            preloaderScene.getStylesheets().add(
                    DataAppPreloader.class.getResource("preloader.css").toExternalForm());
        }
    });
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:18,代码来源:DataAppPreloader.java

示例6: displayLetter

import javafx.scene.layout.StackPane; //导入依赖的package包/类
public static void displayLetter(Pane parent, LetterInterface letter, boolean draggable) {
    Text tileText = new Text(LetterToStringTransformer.transform(letter));
    tileText.getStyleClass().add("tile-letter");

    Text tileValue = new Text(String.valueOf(letter.getValue()));
    tileValue.getStyleClass().add("tile-value");
    tileValue.setTranslateX(8);
    tileValue.setTranslateY(10);

    StackPane tile = new StackPane(tileText, tileValue);
    tile.getStyleClass().add("tile");

    if (draggable) {
        DraggableLetterManager.makeLetterDraggable(tile, letter);
    }

    parent.getChildren().add(tile);
}
 
开发者ID:Chrisp1tv,项目名称:ScrabbleGame,代码行数:19,代码来源:Templates.java

示例7: GoogleEntryGMapsFXView

import javafx.scene.layout.StackPane; //导入依赖的package包/类
GoogleEntryGMapsFXView(GoogleEntry entry) {
    this.entry = entry;
    this.entry.locationProperty().addListener(obs -> updateLocation());

    this.mapView.addMapInializedListener(this);
    this.mapView.getStyleClass().add("map");
    this.mapView.setMouseTransparent(true);

    this.mapViewWrapper.getChildren().add(mapView);
    this.mapViewWrapper.setVisible(false);
    this.mapViewWrapper.managedProperty().bind(this.mapView.visibleProperty());
    this.mapViewWrapper.setPrefSize(300, 300);

    StackPane stackPane = new StackPane();
    stackPane.getStyleClass().add("map-view-wrapper");
    stackPane.getChildren().add(mapViewWrapper);
    getChildren().add(stackPane);
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:19,代码来源:GoogleEntryGMapsFXView.java

示例8: createContent

import javafx.scene.layout.StackPane; //导入依赖的package包/类
@Override
@FXThread
protected void createContent(@NotNull final StackPane root) {

    appStateList = new AppStateList(this::selectAppStateFromList, this);
    propertyEditorAppStateContainer = new VBox();

    filterList = new FilterList(this::selectFilterFromList, this);
    propertyEditorFiltersContainer = new VBox();

    layerNodeTree = new LayerNodeTree(this::selectNodeFromLayersTree, this);
    propertyEditorLayersContainer = new VBox();

    super.createContent(root);

    FXUtils.addClassTo(layerNodeTree.getTreeView(), CSSClasses.TRANSPARENT_TREE_VIEW);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:18,代码来源:SceneFileEditor.java

示例9: createIconContent

import javafx.scene.layout.StackPane; //导入依赖的package包/类
public static Node createIconContent() {
    StackPane sp = new StackPane();
    HBox hbox = new HBox(3);
    hbox.setAlignment(Pos.CENTER);

    Rectangle rectangle = new Rectangle(70, 25, Color.LIGHTGREY);
    rectangle.setStroke(Color.BLACK);
    hbox.setPrefSize(rectangle.getWidth(), rectangle.getHeight());

    Rectangle r1 = new Rectangle(14, 14, Color.web("#1c89f4"));
    Rectangle r2 = new Rectangle(14, 14, Color.web("#349b00"));
    Rectangle r3 = new Rectangle(18, 14, Color.web("#349b00"));

    hbox.getChildren().addAll(r1, r2, r3);
    sp.getChildren().addAll(rectangle, hbox);

    return new Group(sp);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:19,代码来源:HBoxSample.java

示例10: createUi

import javafx.scene.layout.StackPane; //导入依赖的package包/类
private void createUi() {
    getStyleClass().add(TITLE_BAR_STYLE_CLASS);
    setAlignment(Pos.CENTER_RIGHT);
    setMaxWidth(Double.MAX_VALUE);

    Region selectedBar = new Region();
    selectedBar.getStyleClass().add(HIGHLIGHT_STYLE_CLASS);
    selectedBar.setMinWidth(Region.USE_PREF_SIZE);
    selectedBar.setMaxHeight(Region.USE_PREF_SIZE);
    selectedBar.setMaxWidth(Double.MAX_VALUE);
    StackPane.setAlignment(selectedBar, Pos.BOTTOM_CENTER);

    StackPane labelPane = new StackPane(label, selectedBar);
    labelPane.setMaxHeight(Double.MAX_VALUE);
    labelPane.setMaxWidth(Region.USE_PREF_SIZE);

    Region filler = new Region();
    HBox.setHgrow(filler, Priority.ALWAYS);
    rightLabel.getStyleClass().setAll(RIGHT_LABEL_STYLE_CLASS);

    new FadeInAnimator().apply(expanded, selectedBar);
    new FadeInAnimator().apply(expanded, rightLabel);

    getChildren().addAll(labelPane, filler, rightLabel);
}
 
开发者ID:rmfisher,项目名称:fx-animation-editor,代码行数:26,代码来源:TitleBarComponent.java

示例11: show

import javafx.scene.layout.StackPane; //导入依赖的package包/类
/**
 * Shows this dialog.
 *
 * @param owner the owner.
 */
@FXThread
public void show(@NotNull final Window owner) {

    final Scene scene = owner.getScene();

    if (scene instanceof EditorFXScene) {
        final EditorFXScene editorFXScene = (EditorFXScene) scene;
        final StackPane container = editorFXScene.getContainer();
        container.setFocusTraversable(false);
    }

    focusOwner = scene.getFocusOwner();

    dialog.initOwner(owner);
    dialog.show();
    dialog.requestFocus();

    GAnalytics.sendPageView(getDialogId(), null, "/dialog/" + getDialogId());
    GAnalytics.sendEvent(GAEvent.Category.DIALOG, GAEvent.Action.DIALOG_OPENED, getDialogId());

    final JFXApplication application = JFXApplication.getInstance();
    application.addWindow(dialog);

    Platform.runLater(dialog::sizeToScene);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:31,代码来源:EditorDialog.java

示例12: createIconContent

import javafx.scene.layout.StackPane; //导入依赖的package包/类
public static Node createIconContent() {
    StackPane sp = new StackPane();
    FlowPane fp = new FlowPane();
    fp.setAlignment(Pos.CENTER);

    Rectangle rectangle = new Rectangle(62, 62, Color.LIGHTGREY);
    rectangle.setStroke(Color.BLACK);
    fp.setPrefSize(rectangle.getWidth(), rectangle.getHeight());

    Rectangle[] littleRecs = new Rectangle[4];
    Rectangle[] bigRecs = new Rectangle[4];
    for (int i = 0; i < 4; i++) {
        littleRecs[i] = new Rectangle(14, 14, Color.web("#1c89f4"));
        bigRecs[i] = new Rectangle(16, 12, Color.web("#349b00"));
        fp.getChildren().addAll(littleRecs[i], bigRecs[i]);
        FlowPane.setMargin(littleRecs[i], new Insets(2, 2, 2, 2));
    }
    sp.getChildren().addAll(rectangle, fp);
    return new Group(sp);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:21,代码来源:FlowPaneSample.java

示例13: createIconContent

import javafx.scene.layout.StackPane; //导入依赖的package包/类
public static Node createIconContent() {
    StackPane sp = new StackPane();
    AnchorPane anchorPane = new AnchorPane();

    Rectangle rectangle = new Rectangle(62, 62, Color.LIGHTGREY);
    rectangle.setStroke(Color.BLACK);
    anchorPane.setPrefSize(rectangle.getWidth(), rectangle.getHeight());

    Rectangle r1 = new Rectangle(14, 14, Color.web("#1c89f4"));
    Rectangle r2 = new Rectangle(45, 10, Color.web("#349b00"));
    Rectangle r3 = new Rectangle(35, 14, Color.web("#349b00"));

    anchorPane.getChildren().addAll(r1, r2, r3);
    AnchorPane.setTopAnchor(r1, Double.valueOf(1));
    AnchorPane.setLeftAnchor(r1, Double.valueOf(1));
    AnchorPane.setTopAnchor(r2, Double.valueOf(20));
    AnchorPane.setLeftAnchor(r2, Double.valueOf(1));
    AnchorPane.setBottomAnchor(r3, Double.valueOf(1));
    AnchorPane.setRightAnchor(r3, Double.valueOf(5));

    sp.getChildren().addAll(rectangle, anchorPane);
    return new Group(sp);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:24,代码来源:AnchorPaneSample.java

示例14: addState

import javafx.scene.layout.StackPane; //导入依赖的package包/类
private void addState(State<?,?> state, HBox line, Color color, int stateIndex, String stateDescription) {
	final Rectangle rectangle = new Rectangle(WIDTH, WIDTH, color);
	rectangle.setArcHeight(WIDTH);
	rectangle.setArcWidth(WIDTH);
	rectangle.setUserData(state);
	Label text = new Label(computeStateLabel(stateIndex));
	text.setTextOverrun(OverrunStyle.ELLIPSIS);
	text.setAlignment(Pos.CENTER);
	text.setMouseTransparent(true);
	text.setTextFill(Color.WHITE);
	text.setFont(STATE_FONT);
	text.setMaxWidth(WIDTH);
	final Tooltip tooltip = new Tooltip(stateDescription);
	Tooltip.install(rectangle, tooltip);
	StackPane layout = new StackPane();
	StackPane.setMargin(rectangle, MARGIN_INSETS);
	layout.getChildren().addAll(rectangle, text);
	line.getChildren().add(layout);
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:20,代码来源:TimelineDiffViewerRenderer.java

示例15: createContent

import javafx.scene.layout.StackPane; //导入依赖的package包/类
@Override
@FXThread
protected void createContent(@NotNull final StackPane root) {
    createEditorAreaPane();

    mainSplitContainer = new EditorToolSplitPane(JFX_APPLICATION.getScene(), root);

    editorToolComponent = new ScrollableEditorToolComponent(mainSplitContainer, 1);
    editorToolComponent.prefHeightProperty().bind(root.heightProperty());

    createToolComponents(editorToolComponent, root);

    editorToolComponent.addChangeListener((observable, oldValue, newValue) -> processChangeTool(oldValue, newValue));
    editorToolComponent.getSelectionModel().selectedIndexProperty().addListener((observable, oldValue, newValue) -> {
        final S editorState = getEditorState();
        if (editorState != null) editorState.setOpenedTool(newValue.intValue());
    });

    mainSplitContainer.initFor(editorToolComponent, getEditorAreaPane());

    FXUtils.addToPane(mainSplitContainer, root);
    FXUtils.addClassTo(mainSplitContainer, CSSClasses.FILE_EDITOR_MAIN_SPLIT_PANE);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:24,代码来源:Advanced3DFileEditorWithRightTool.java


注:本文中的javafx.scene.layout.StackPane类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。