本文整理匯總了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 ();
}
示例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: 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);
}
示例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;
}
示例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);
}
示例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;
}