當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。