本文整理汇总了Java中javafx.geometry.Rectangle2D.getMaxY方法的典型用法代码示例。如果您正苦于以下问题:Java Rectangle2D.getMaxY方法的具体用法?Java Rectangle2D.getMaxY怎么用?Java Rectangle2D.getMaxY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.geometry.Rectangle2D
的用法示例。
在下文中一共展示了Rectangle2D.getMaxY方法的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 ();
}
示例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());
}
示例3: loadPositionFromStorage
import javafx.geometry.Rectangle2D; //导入方法依赖的package包/类
protected void loadPositionFromStorage() {
try {
final String key = getCurrentPositionStorageKey();
if (key != null) {
final String value = Main.getProperties().getString(key);
if (value != null) {
String[] coords = value.split(";");
if (coords.length == 2) {
double x = Double.parseDouble(coords[0]);
double y = Double.parseDouble(coords[1]);
Rectangle2D desktop = OverlayStage.getDesktopSize();
if(desktop.getWidth() == 0 || desktop.getHeight() == 0) return;
if (x + getHeight() > desktop.getMaxX() || x < -getHeight())
x = desktop.getMaxX() - getHeight();
if (y + getWidth() > desktop.getMaxY() || y < -getWidth()) y = desktop.getMaxY() - getWidth();
setPosition(new Point2D(x, y));
return;
}
}
}
} catch (Exception e){ Main.log(e); }
setDefaultPosition();
}
示例4: 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);
}
示例5: 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;
}
示例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();
//
// }
}
示例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;
}