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


Java Side类代码示例

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


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

示例1: createChart

import javafx.geometry.Side; //导入依赖的package包/类
protected ScatterChart<Number, Number> createChart() {
    final NumberAxis xAxis = new NumberAxis();
    xAxis.setSide(Side.TOP);
    final NumberAxis yAxis = new NumberAxis();
    yAxis.setSide(Side.RIGHT);
    final ScatterChart<Number,Number> sc = new ScatterChart<Number,Number>(xAxis,yAxis);
    // setup chart
    xAxis.setLabel("X Axis");
    yAxis.setLabel("Y Axis");
    // add starting data
    for (int s=0;s<5;s++) {
        XYChart.Series<Number, Number> series = new XYChart.Series<Number, Number>();
        series.setName("Data Series "+s);
        for (int i=0; i<30; i++) series.getData().add(new XYChart.Data<Number, Number>(Math.random()*98, Math.random()*98));
        sc.getData().add(series);
    }
    return sc;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:ChartAdvancedScatter.java

示例2: TabSample

import javafx.geometry.Side; //导入依赖的package包/类
public TabSample() {
    BorderPane borderPane = new BorderPane();
    final TabPane tabPane = new TabPane();
    tabPane.setPrefSize(400, 400);
    tabPane.setSide(Side.TOP);
    tabPane.setTabClosingPolicy(TabPane.TabClosingPolicy.UNAVAILABLE);
    final Tab tab1 = new Tab();
    tab1.setText("Tab 1");
    final Tab tab2 = new Tab();
    tab2.setText("Tab 2");
    final Tab tab3 = new Tab();
    tab3.setText("Tab 3");
    final Tab tab4 = new Tab();
    tab4.setText("Tab 4");
    tabPane.getTabs().addAll(tab1, tab2, tab3, tab4);
    borderPane.setCenter(tabPane);
    getChildren().add(borderPane);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:19,代码来源:TabSample.java

示例3: MonitoringPane

import javafx.geometry.Side; //导入依赖的package包/类
public MonitoringPane()
{
    super();
    super.setPrefHeight(AppTabPane.CONTENT_HEIGHT);
    super.setPrefWidth(AppTabPane.CONTENT_WIDTH);
    super.setSide(Side.BOTTOM);
    
    Tab[] tabs = new Tab[3];
    
    tabs[0] = new Tab("Core Usage");
    tabs[0].setContent(new CoreUsageMonitorPane());
    
    tabs[1] = new Tab("Memory Usage");
    tabs[1].setContent(new MemoryUsageMonitorPane());
    
    tabs[2] = new Tab("Temperature");
    tabs[2].setContent(new TempMonitorPane());
    
    for(int i = 0; i < tabs.length; i++)
        tabs[i].setClosable(false);
    
    super.getTabs().addAll(tabs);
}
 
开发者ID:BlueGoliath,项目名称:Goliath-Overclocking-Utility-FX,代码行数:24,代码来源:MonitoringPane.java

示例4: getPanel

import javafx.geometry.Side; //导入依赖的package包/类
@Override
public final Node getPanel(Stage stage) {
    DateControl dateControl = createControl();
    control = dateControl;
    requireNonNull(control, "missing date control");

    DeveloperConsole console = new DeveloperConsole();
    console.setDateControl(dateControl);

    if (isSupportingDeveloperConsole()) {
        MasterDetailPane masterDetailPane = new MasterDetailPane();
        masterDetailPane.setMasterNode(wrap(dateControl));
        masterDetailPane.setDetailSide(Side.BOTTOM);
        masterDetailPane.setDetailNode(console);
        masterDetailPane.setShowDetailNode(true);
        return masterDetailPane;
    }

    return wrap(dateControl);
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:21,代码来源:CalendarFXDateControlSample.java

示例5: handleMouseClickedEvent

import javafx.geometry.Side; //导入依赖的package包/类
/**
 * Handle mouse clicked events.
 *
 * @param event the mouse clicked event.
 */
@FXThread
private void handleMouseClickedEvent(@NotNull final MouseEvent event) {

    final ResourceElement item = getItem();
    if (item == null) return;

    final boolean isFolder = item instanceof FolderResourceElement;
    final ResourceTree treeView = (ResourceTree) getTreeView();

    if (event.getButton() == MouseButton.SECONDARY) {
        final ContextMenu contextMenu = treeView.getContextMenu(item);
        if (contextMenu == null) return;
        contextMenu.show(this, Side.BOTTOM, 0, 0);
    } else if ((treeView.isOnlyFolders() || !isFolder) && event.getButton() == MouseButton.PRIMARY &&
            event.getClickCount() > 1) {
        final Consumer<ResourceElement> openFunction = treeView.getOpenFunction();
        if (openFunction != null) openFunction.accept(item);
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:25,代码来源:ResourceTreeCell.java

示例6: setTitleSideBase

import javafx.geometry.Side; //导入依赖的package包/类
private void setTitleSideBase(String side){
    side = side == null ? "":side;
    side = side.trim().toLowerCase();
    switch (side){
        case "bottom":
            body.setTitleSide(Side.BOTTOM);
            break;
        case "left":
            body.setTitleSide(Side.LEFT);
            break;
        case "right":
            body.setTitleSide(Side.RIGHT);
            break;
        default:
            body.setTitleSide(Side.TOP);
            break;
    }
}
 
开发者ID:whitewoodcity,项目名称:xbrowser,代码行数:19,代码来源:Chart.java

示例7: setLegendSideBase

import javafx.geometry.Side; //导入依赖的package包/类
private void setLegendSideBase(String side){
    side = side == null ? "":side;
    side = side.trim().toLowerCase();
    switch (side){
        case "top":
            body.setLegendSide(Side.TOP);
            break;
        case "left":
            body.setLegendSide(Side.LEFT);
            break;
        case "right":
            body.setLegendSide(Side.RIGHT);
            break;
        default:
            body.setLegendSide(Side.BOTTOM);
            break;
    }
}
 
开发者ID:whitewoodcity,项目名称:xbrowser,代码行数:19,代码来源:Chart.java

示例8: populatePopup

import javafx.geometry.Side; //导入依赖的package包/类
private void populatePopup(LinkedList<String> results) {
    List<CustomMenuItem> menuItems = results.stream()
        .map(Label::new)
        .map(label -> {
            CustomMenuItem menuItem = new CustomMenuItem(label, true);
            menuItem.setOnAction(action -> {
                select(label.getText());
                popup.hide();
            });
            return menuItem;
        })
        .collect(Collectors.toCollection(LinkedList::new));

    popup.getItems().setAll(menuItems);

    if (!popup.isShowing()) {
        popup.show(this, Side.BOTTOM, 0, 0);
    }
}
 
开发者ID:cs2103jan2016-w13-4j,项目名称:main,代码行数:20,代码来源:AutoCompleteTextField.java

示例9: DemoPanel

import javafx.geometry.Side; //导入依赖的package包/类
public DemoPanel(final Willow chrome) {
    // create a canvas demos button.
    final Button canvasButton = new IconButton(
            getString("demo-panel.canvas-demos"),
            "canvas.jpg",
            getString("demo-panel.canvas-demos.tooltip"),
            null
    );
    canvasButton.setOnAction(actionEvent ->
            canvasMenu.show(canvasButton, Side.BOTTOM, 0, 0)
    );
    for (String[] bookmark : canvasBookmarks) {
        BookmarkHandler.installBookmark(chrome, canvasMenu, bookmark[0], bookmark[1]);
    }

    // create a box for demos.
    VBox demoBox = new VBox();  // todo generalize this title stuff creation for sidebar items.
    demoBox.setSpacing(5);
    demoBox.setStyle("-fx-padding: 5");
    demoBox.getChildren().addAll(canvasButton);

    setText(getString("demo-panel.title"));
    setContent(demoBox);
    getStyleClass().add("sidebar-panel");
    setExpanded(false);
}
 
开发者ID:proofy,项目名称:willow-browser,代码行数:27,代码来源:DemoPanel.java

示例10: pageInformationAlignmentProperty

import javafx.geometry.Side; //导入依赖的package包/类
public final ObjectProperty<Side> pageInformationAlignmentProperty() {
	if (pageInformationAlignment == null) {
		pageInformationAlignment = new StyleableObjectProperty<Side>(Side.BOTTOM) {
			@Override
			protected void invalidated() {
				getSkinnable().requestLayout();
			}

			@Override
			public CssMetaData<Pagination, Side> getCssMetaData() {
				return StyleableProperties.PAGE_INFORMATION_ALIGNMENT;
			}

			@Override
			public Object getBean() {
				return CPagenationSkin.this;
			}

			@Override
			public String getName() {
				return "pageInformationAlignment";
			}
		};
	}
	return pageInformationAlignment;
}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:27,代码来源:CPagenationSkin.java

示例11: createFloatingActionButtons

import javafx.geometry.Side; //导入依赖的package包/类
private Layer createFloatingActionButtons() {
    callActionButton = Util.createFAB(MaterialDesignIcon.CALL, e -> {
        Dialog confirmCallDialog = new Dialog(OTNBundle.getString("OTN.VENUE.CALLDIALOG.TITLE"), OTNBundle.getString("OTN.VENUE.CALLDIALOG.CONTENT", getVenue().getName(), getVenue().getPhoneNumber())) {
            {
                rootNode.setPrefWidth(MobileApplication.getInstance().getView().getScene().getWidth() * 0.9);
            }

        };
        Button cancel = new Button(OTNBundle.getString("OTN.VENUE.CALLDIALOG.NO"));
        Button ok = new Button(OTNBundle.getString("OTN.VENUE.CALLDIALOG.YES"));
        cancel.setOnAction(event -> confirmCallDialog.hide());
        ok.setOnAction(event -> {
            Services.get(DialerService.class).ifPresent(d -> d.call(getVenue().getPhoneNumber()));
            confirmCallDialog.hide();
        });
        confirmCallDialog.getButtons().addAll(cancel, ok);
        confirmCallDialog.showAndWait();

    });
    webActionButton = Util.createWebLaunchFAB(() -> getVenue().getUrl());
    webActionButton.getStyleClass().add("secondary");
    webActionButton.attachTo(callActionButton, Side.TOP);
    return callActionButton.getLayer();
}
 
开发者ID:gluonhq,项目名称:javaone2016,代码行数:25,代码来源:VenuePresenter.java

示例12: CommandPane

import javafx.geometry.Side; //导入依赖的package包/类
public CommandPane (SessionTable sessionTable, ProcessInstruction processInstruction)
{
  setSide (Side.TOP);
  setTabClosingPolicy (TabClosingPolicy.UNAVAILABLE);

  final Tab tabCommand = getTab ("Command", commandTextArea);
  final Tab tabReply = getTab ("Reply", replyTextArea);
  final Tab tabScreen = getTab ("Screen", screenTextArea);
  final Tab tabFields = getTab ("Fields", fieldsTextArea);
  final Tab tabBuffer = getTab ("Buffer", bufferTextArea);
  final Tab tabReplyBuffer = getTab ("Reply Buffer", replyBufferTextArea);

  this.processInstruction = processInstruction;

  getTabs ().addAll (tabCommand, tabBuffer, tabFields, tabScreen, tabReply,
                     tabReplyBuffer);

  sessionTable.getSelectionModel ().selectedItemProperty ()
      .addListener ( (observable, oldValue, newValue) -> replay (newValue));
}
 
开发者ID:xframium,项目名称:xframium-java,代码行数:21,代码来源:CommandPane.java

示例13: DownArrowMenu

import javafx.geometry.Side; //导入依赖的package包/类
public DownArrowMenu(@NotNull Image arrowImg, @NotNull MenuItem... items) {
	ImageView img = new ImageView(arrowImg);
	img.setOnMouseEntered(new EventHandler<MouseEvent>() {
		@Override
		public void handle(MouseEvent event) {
			if (popupMenu.isShowing()) {
				return;
			}
			popupMenu.show(DownArrowMenu.this, Side.BOTTOM, 0, 0);
		}
	});
	popupMenu.setAutoHide(true);
	getItems().addAll(items);

	setAlignment(Pos.CENTER_LEFT);
	getChildren().add(img);
}
 
开发者ID:kayler-renslow,项目名称:arma-dialog-creator,代码行数:18,代码来源:DownArrowMenu.java

示例14: changed

import javafx.geometry.Side; //导入依赖的package包/类
@Override
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {

    if (textInputControl.getText().length() == 0) {
        entriesPopup.hide();
    } else {
        LinkedList<String> searchResult = new LinkedList<>();
        // todo make sense to add list of items, text get last word
        searchResult.addAll(entries.subSet(textInputControl.getText(), textInputControl.getText() + Character.MAX_VALUE));
        if (entries.size() > 0) {
            populatePopup(searchResult);
            if (!entriesPopup.isShowing()) {
                // textInputControl.
                entriesPopup.show(textInputControl, Side.BOTTOM,
                        2 * textInputControl.getFont().getSize(),
                        -1 * textInputControl.getHeight() + 2 * textInputControl.getFont().getSize());

            }
        } else {
            entriesPopup.hide();
        }
    }

}
 
开发者ID:iazarny,项目名称:gitember,代码行数:25,代码来源:ChangeListenerHistoryHint.java

示例15: getConnectorPosition

import javafx.geometry.Side; //导入依赖的package包/类
@Override
public Point2D getConnectorPosition(final GConnectorSkin connectorSkin) {

    final Node connectorRoot = connectorSkin.getRoot();

    final Side side = DefaultConnectorTypes.getSide(connectorSkin.getConnector().getType());

    // The following logic is required because the connectors are offset slightly from the node edges.
    final double x, y;
    if (side.equals(Side.LEFT)) {
        x = 0;
        y = connectorRoot.getLayoutY() + connectorSkin.getHeight() / 2;
    } else if (side.equals(Side.RIGHT)) {
        x = getRoot().getWidth();
        y = connectorRoot.getLayoutY() + connectorSkin.getHeight() / 2;
    } else if (side.equals(Side.TOP)) {
        x = connectorRoot.getLayoutX() + connectorSkin.getWidth() / 2;
        y = 0;
    } else {
        x = connectorRoot.getLayoutX() + connectorSkin.getWidth() / 2;
        y = getRoot().getHeight();
    }

    return new Point2D(x, y);
}
 
开发者ID:Heverton,项目名称:grapheditor,代码行数:26,代码来源:DefaultNodeSkin.java


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