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


Java Bounds.getMaxY方法代碼示例

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


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

示例1: zoomInAndCenter

import javafx.geometry.Bounds; //導入方法依賴的package包/類
private static void zoomInAndCenter(Node node, double initialWidth, double initialHeight, boolean preserveRatio) {
    Parent parent = node.getParent();

    node.toFront();

    Bounds parentBoundsInParent = parent.getBoundsInLocal();

    double xScaleRatio = parentBoundsInParent.getMaxX() / initialWidth;
    double yScaleRatio = parentBoundsInParent.getMaxY() / initialHeight;

    if (preserveRatio) {
        double bestScaleRatio = Math.min(xScaleRatio, yScaleRatio);
        node.setScaleX(bestScaleRatio);
        node.setScaleY(bestScaleRatio);
    } else {
        node.setScaleX(xScaleRatio);
        node.setScaleY(yScaleRatio);
    }

    Bounds boundsInParent = node.getBoundsInParent();

    double translateX = -1 * Math.abs(boundsInParent.getMinY());
    double translateY = -1 * Math.abs(boundsInParent.getMinY());

    node.setTranslateX(translateX);
    node.setTranslateY(translateY);
}
 
開發者ID:schwabdidier,項目名稱:GazePlay,代碼行數:28,代碼來源:StatsDisplay.java

示例2: findPopOverArrowLocation

import javafx.geometry.Bounds; //導入方法依賴的package包/類
public static ArrowLocation findPopOverArrowLocation(Node view) {
    Bounds localBounds = view.getBoundsInLocal();
    Bounds entryBounds = view.localToScreen(localBounds);

    ObservableList<Screen> screens = Screen.getScreensForRectangle(
            entryBounds.getMinX(), entryBounds.getMinY(),
            entryBounds.getWidth(), entryBounds.getHeight());
    Rectangle2D screenBounds = screens.get(0).getVisualBounds();

    double spaceLeft = entryBounds.getMinX();
    double spaceRight = screenBounds.getWidth() - entryBounds.getMaxX();
    double spaceTop = entryBounds.getMinY();
    double spaceBottom = screenBounds.getHeight() - entryBounds.getMaxY();

    if (spaceLeft > spaceRight) {
        if (spaceTop > spaceBottom) {
            return ArrowLocation.RIGHT_BOTTOM;
        }
        return ArrowLocation.RIGHT_TOP;
    }

    if (spaceTop > spaceBottom) {
        return ArrowLocation.LEFT_BOTTOM;
    }

    return ArrowLocation.LEFT_TOP;
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:28,代碼來源:ViewHelper.java

示例3: moveTo

import javafx.geometry.Bounds; //導入方法依賴的package包/類
@Override
public RNode<T> moveTo(Duration d, Pos referencePoint, double _x, double _y) {
	double x;
	double y;
	
	Bounds bounds = node.localToScreen(node.getBoundsInLocal());
	switch (referencePoint.getHpos()) {
	case CENTER:
		x = bounds.getMinX() + bounds.getWidth()/2;
		break;
	case RIGHT:
		x = bounds.getMaxX();
		break;
	default:
		x = bounds.getMinX();
		break;
	}
	
	switch (referencePoint.getVpos()) {
	case BOTTOM:
	case BASELINE:
		y = bounds.getMaxY();
		break;
	case CENTER:
		y = bounds.getMinY() + bounds.getHeight()/2;
		break;
	default:
		y = bounds.getMinY();
		break;
	}
	
	controller.run(Move.to(d, x+_x, y+_y));
	return this;
}
 
開發者ID:BestSolution-at,項目名稱:FX-Test,代碼行數:35,代碼來源:RNodeImpl.java

示例4: location

import javafx.geometry.Bounds; //導入方法依賴的package包/類
@Override
public Point2D location(Pos position) {
	double x;
	double y;
	
	Bounds bounds = node.localToScreen(node.getBoundsInLocal());
	switch (position.getHpos()) {
	case CENTER:
		x = bounds.getMinX() + bounds.getWidth()/2;
		break;
	case RIGHT:
		x = bounds.getMaxX();
		break;
	default:
		x = bounds.getMinX();
		break;
	}
	
	switch (position.getVpos()) {
	case BOTTOM:
	case BASELINE:
		y = bounds.getMaxY();
		break;
	case CENTER:
		y = bounds.getMinY() + bounds.getHeight()/2;
		break;
	default:
		y = bounds.getMinY();
		break;
	}
	return new Point2D(x, y);
}
 
開發者ID:BestSolution-at,項目名稱:FX-Test,代碼行數:33,代碼來源:RNodeImpl.java

示例5: hitTopOrBottom

import javafx.geometry.Bounds; //導入方法依賴的package包/類
private boolean hitTopOrBottom(Bounds bounds) 
{
   return (c.getLayoutY() <= (bounds.getMinY() + c.getRadius())) ||
      (c.getLayoutY() >= (bounds.getMaxY() - c.getRadius()));
}
 
開發者ID:cleitonferreira,項目名稱:LivroJavaComoProgramar10Edicao,代碼行數:6,代碼來源:TimelineAnimationController.java

示例6: LiveMapLocate

import javafx.geometry.Bounds; //導入方法依賴的package包/類
public LiveMapLocate(Group group, Bounds bounds){
    
    rangeX = bounds.getMinX() - bounds.getMaxX();
    rangeY = bounds.getMinY() - bounds.getMaxY();
    
    scaleLongToX = rangeX/rangeLong;
    scaleLatToY = rangeY/rangeLat;
    
    this.bounds = bounds;
    this.group = group;
          
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:13,代碼來源:LiveMapLocate.java


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