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


Java Rectangle2D.getMinY方法代码示例

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


在下文中一共展示了Rectangle2D.getMinY方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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


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