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


Java Bounds.getMaxX方法代码示例

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


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

import javafx.geometry.Bounds; //导入方法依赖的package包/类
private WeekDayView getWeekDayViewAt(double x) {
    for (WeekDayView view : getWeekDayViews()) {
        final Bounds bounds = view.getBoundsInParent();
        if (bounds.getMinX() <= x && bounds.getMaxX() >= x) {
            return view;
        }
    }

    return null;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:11,代码来源:WeekView.java

示例3: 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

示例4: 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

示例5: 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

示例6: hitRightOrLeftEdge

import javafx.geometry.Bounds; //导入方法依赖的package包/类
private boolean hitRightOrLeftEdge(Bounds bounds) 
{
   return (c.getLayoutX() <= (bounds.getMinX() + c.getRadius())) ||
      (c.getLayoutX() >= (bounds.getMaxX() - c.getRadius()));
}
 
开发者ID:cleitonferreira,项目名称:LivroJavaComoProgramar10Edicao,代码行数:6,代码来源:TimelineAnimationController.java

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