當前位置: 首頁>>代碼示例>>Java>>正文


Java Rectangle2D.getMinX方法代碼示例

本文整理匯總了Java中javafx.geometry.Rectangle2D.getMinX方法的典型用法代碼示例。如果您正苦於以下問題:Java Rectangle2D.getMinX方法的具體用法?Java Rectangle2D.getMinX怎麽用?Java Rectangle2D.getMinX使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.geometry.Rectangle2D的用法示例。


在下文中一共展示了Rectangle2D.getMinX方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: start

import javafx.geometry.Rectangle2D; //導入方法依賴的package包/類
@Override
    public void start(Stage primaryStage) throws Exception{
        FXMLLoader fxmlLoader = new FXMLLoader();
        fxmlLoader.setLocation(getClass().getResource("sample.fxml"));
        Parent root = fxmlLoader.load();
        Screen screen = Screen.getPrimary ();

//        界麵初始化
        Controller controller = fxmlLoader.getController();
        controller.init(primaryStage);

        Rectangle2D bounds = screen.getVisualBounds ();

        double minX = bounds.getMinX ();
        double minY = bounds.getMinY ();
        double maxX = bounds.getMaxX ();
        double maxY = bounds.getMaxY ();

        screenWidth = maxX - minX;
        screenHeight = maxY - minY;

        Scene scene = new Scene(root, (maxX - minX) * 0.6, (maxY - minY) * 0.6);

        primaryStage.setTitle ("Higher Cloud Compute Platform");
        primaryStage.setScene (scene);
		primaryStage.setFullScreen(true);
        primaryStage.show ();

    }
 
開發者ID:Luodian,項目名稱:Higher-Cloud-Computing-Project,代碼行數:30,代碼來源:Main.java

示例2: snapRect

import javafx.geometry.Rectangle2D; //導入方法依賴的package包/類
private static Rectangle2D snapRect(Rectangle2D bounds, Rectangle2D screenBounds) {
	double x1 = bounds.getMinX(), y1 = bounds.getMinY();
	double x2 = bounds.getMaxX(), y2 = bounds.getMaxY();
	if (Math.abs(x1 - screenBounds.getMinX()) < SNAP_DISTANCE) {
		x1 = screenBounds.getMinX();
	}
	if (Math.abs(y1 - screenBounds.getMinY()) < SNAP_DISTANCE) {
		y1 = screenBounds.getMinY();
	}
	if (Math.abs(x2 - screenBounds.getMaxX()) < SNAP_DISTANCE) {
		x1 = screenBounds.getMaxX() - bounds.getWidth();
	}
	if (Math.abs(y2 - screenBounds.getMaxY()) < SNAP_DISTANCE) {
		y1 = screenBounds.getMaxY() - bounds.getHeight();
	}
	return new Rectangle2D(x1, y1, bounds.getWidth(), bounds.getHeight());
}
 
開發者ID:DeskChan,項目名稱:DeskChan,代碼行數:18,代碼來源:MovablePane.java

示例3: getDesktopSize

import javafx.geometry.Rectangle2D; //導入方法依賴的package包/類
static Rectangle2D getDesktopSize() {
	Rectangle2D rect = Screen.getPrimary().getBounds();
	double minX = rect.getMinX(), minY = rect.getMinY();
	double maxX = rect.getMaxX(), maxY = rect.getMaxY();
	for (Screen screen : Screen.getScreens()) {
		Rectangle2D screenRect = screen.getBounds();
		if (minX > screenRect.getMinX()) {
			minX = screenRect.getMinX();
		}
		if (minY > screenRect.getMinY()) {
			minY = screenRect.getMinY();
		}
		if (maxX < screenRect.getMaxX()) {
			maxX = screenRect.getMaxX();
		}
		if (maxY < screenRect.getMaxY()) {
			maxY = screenRect.getMaxY();
		}
	}
	return new Rectangle2D(minX, minY, maxX - minX, maxY - minY);
}
 
開發者ID:DeskChan,項目名稱:DeskChan,代碼行數:22,代碼來源:OverlayStage.java

示例4: getInsertData

import javafx.geometry.Rectangle2D; //導入方法依賴的package包/類
private InsertData getInsertData(Point2D screenPoint) {
    for(TabPane tabPane : tabPanes) {
        Rectangle2D tabAbsolute = getAbsoluteRect(tabPane);
        if(tabAbsolute.contains(screenPoint)) {
            int tabInsertIndex = 0;
            if(!tabPane.getTabs().isEmpty()) {
                Rectangle2D firstTabRect = getAbsoluteRect(tabPane.getTabs().get(0));
                if(firstTabRect.getMaxY()+60 < screenPoint.getY() || firstTabRect.getMinY() > screenPoint.getY()) {
                    return null;
                }
                Rectangle2D lastTabRect = getAbsoluteRect(tabPane.getTabs().get(tabPane.getTabs().size() - 1));
                if(screenPoint.getX() < (firstTabRect.getMinX() + firstTabRect.getWidth() / 2)) {
                    tabInsertIndex = 0;
                }
                else if(screenPoint.getX() > (lastTabRect.getMaxX() - lastTabRect.getWidth() / 2)) {
                    tabInsertIndex = tabPane.getTabs().size();
                }
                else {
                    for(int i = 0; i < tabPane.getTabs().size() - 1; i++) {
                        Tab leftTab = tabPane.getTabs().get(i);
                        Tab rightTab = tabPane.getTabs().get(i + 1);
                        if(leftTab instanceof DraggableTab && rightTab instanceof DraggableTab) {
                            Rectangle2D leftTabRect = getAbsoluteRect(leftTab);
                            Rectangle2D rightTabRect = getAbsoluteRect(rightTab);
                            if(betweenX(leftTabRect, rightTabRect, screenPoint.getX())) {
                                tabInsertIndex = i + 1;
                                break;
                            }
                        }
                    }
                }
            }
            return new InsertData(tabInsertIndex, tabPane);
        }
    }
    return null;
}
 
開發者ID:ForJ-Latech,項目名稱:fwm,代碼行數:38,代碼來源:DraggableTab.java

示例5: CustomStage

import javafx.geometry.Rectangle2D; //導入方法依賴的package包/類
public CustomStage(AnchorPane ap, StageStyle style) {
    initStyle(style);

    setSize(ap.getPrefWidth(), ap.getPrefHeight());

    Rectangle2D screenBounds = Screen.getPrimary().getVisualBounds();
    double x = screenBounds.getMinX() + screenBounds.getWidth() - ap.getPrefWidth() - 2;
    double y = screenBounds.getMinY() + screenBounds.getHeight() - ap.getPrefHeight() - 2;

    bottomRight = Location.at(x, y);
}
 
開發者ID:victorward,項目名稱:recruitervision,代碼行數:12,代碼來源:CustomStage.java

示例6: main

import javafx.geometry.Rectangle2D; //導入方法依賴的package包/類
public static void main(String[] args) {

        Screen screen = Screen.getPrimary ();

//        界麵初始化

        Rectangle2D bounds = screen.getVisualBounds ();

        double minX = bounds.getMinX ();
        double minY = bounds.getMinY ();
        double maxX = bounds.getMaxX ();
        double maxY = bounds.getMaxY ();

        screenWidth = maxX - minX;
        screenHeight = maxY - minY;

        launch(args);

//        Map<String,String> map = Collections.singletonMap("ROLE", "DOWNLOAD");
//        Ignite ignite = IgniteUtility.startDefaultIgnite(map,"DOWNLOAD");
//        //使用Downloads標簽注冊這個ignite結點的信息。
//        Map<String,String> attrs = Collections.singletonMap("AGENT","Download");
//
//        //使用Downloads注冊這個cache的名字。
//        Ignite ignite = IgniteUtility.startDefaultIgnite(attrs,"Downloads");
//
//        ClusterGroup remoteCluster = ignite.cluster().forRemotes();
//        ClusterGroup localCluster = ignite.cluster().forLocal();
//        Collection<ClusterNode> remoteNodes = remoteCluster.nodes();
//        Collection<ClusterNode> localNodes = localCluster.nodes();
//
//        for (ClusterNode clusterNode:localNodes) {
//            long heapSize = clusterNode.metrics().getHeapMemoryTotal();
//            int cpusNum = clusterNode.metrics().getTotalCpus();
//            System.out.println("heapSize:"+heapSize);
//            System.out.println("cpus:"+cpusNum);
////            Node curNode = new Node();
//
//        }
    }
 
開發者ID:Luodian,項目名稱:Higher-Cloud-Computing-Project,代碼行數:41,代碼來源:Main.java

示例7: betweenX

import javafx.geometry.Rectangle2D; //導入方法依賴的package包/類
private boolean betweenX(Rectangle2D r1, Rectangle2D r2, double xPoint) {
    double lowerBound = r1.getMinX() + r1.getWidth() / 2;
    double upperBound = r2.getMaxX() - r2.getWidth() / 2;
    return xPoint >= lowerBound && xPoint <= upperBound;
}
 
開發者ID:ForJ-Latech,項目名稱:fwm,代碼行數:6,代碼來源:DraggableTab.java

示例8: getInsertData

import javafx.geometry.Rectangle2D; //導入方法依賴的package包/類
private InsertData getInsertData(final Point2D screenPoint)
{
    for (final TabPane tabPane : TabManagement.getInstance().getTabPanes())
    {
        final Rectangle2D tabAbsolute = this.getAbsoluteRect(tabPane);
        if (tabAbsolute.contains(screenPoint))
        {
            int tabInsertIndex = 0;
            if (!tabPane.getTabs().isEmpty())
            {
                final Rectangle2D firstTabRect = this.getAbsoluteRect(tabPane.getTabs().get(0));
                if (firstTabRect.getMaxY() + 60 < screenPoint.getY() || firstTabRect.getMinY() > screenPoint.getY())
                    return null;
                final Rectangle2D lastTabRect = this
                        .getAbsoluteRect(tabPane.getTabs().get(tabPane.getTabs().size() - 1));
                if (screenPoint.getX() < firstTabRect.getMinX() + firstTabRect.getWidth() / 2)
                    tabInsertIndex = 0;
                else if (screenPoint.getX() > lastTabRect.getMaxX() - lastTabRect.getWidth() / 2)
                    tabInsertIndex = tabPane.getTabs().size();
                else
                    for (int i = 0; i < tabPane.getTabs().size() - 1; i++)
                    {
                        final Tab leftTab = tabPane.getTabs().get(i);
                        final Tab rightTab = tabPane.getTabs().get(i + 1);
                        if (leftTab instanceof DraggableTab && rightTab instanceof DraggableTab)
                        {
                            final Rectangle2D leftTabRect = this.getAbsoluteRect(leftTab);
                            final Rectangle2D rightTabRect = this.getAbsoluteRect(rightTab);
                            if (this.betweenX(leftTabRect, rightTabRect, screenPoint.getX()))
                            {
                                tabInsertIndex = i + 1;
                                break;
                            }
                        }
                    }
            }
            return new InsertData(tabInsertIndex, tabPane);
        }
    }
    return null;
}
 
開發者ID:Leviathan-Studio,項目名稱:MineIDE,代碼行數:42,代碼來源:DraggableTab.java

示例9: betweenX

import javafx.geometry.Rectangle2D; //導入方法依賴的package包/類
private boolean betweenX(final Rectangle2D r1, final Rectangle2D r2, final double xPoint)
{
    final double lowerBound = r1.getMinX() + r1.getWidth() / 2;
    final double upperBound = r2.getMaxX() - r2.getWidth() / 2;
    return xPoint >= lowerBound && xPoint <= upperBound;
}
 
開發者ID:Leviathan-Studio,項目名稱:MineIDE,代碼行數:7,代碼來源:DraggableTab.java


注:本文中的javafx.geometry.Rectangle2D.getMinX方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。