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


Java Bounds.getMinX方法代碼示例

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


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

示例1: ensureVisible

import javafx.geometry.Bounds; //導入方法依賴的package包/類
protected void ensureVisible(Node target) {
    ScrollPane scrollPane = getParentScrollPane(target);
    if (scrollPane == null) {
        return;
    }
    Node content = scrollPane.getContent();
    Bounds contentBounds = content.localToScene(content.getBoundsInLocal());
    Bounds viewportBounds = scrollPane.getViewportBounds();
    Bounds nodeBounds = target.localToScene(target.getBoundsInLocal());
    if (scrollPane.contains(nodeBounds.getMinX() - contentBounds.getMinX(), nodeBounds.getMinY() - contentBounds.getMinY())) {
        return;
    }
    double toVScroll = (nodeBounds.getMinY() - contentBounds.getMinY())
            * ((scrollPane.getVmax() - scrollPane.getVmin()) / (contentBounds.getHeight() - viewportBounds.getHeight()));
    scrollPane.setVvalue(toVScroll);
    double toHScroll = (nodeBounds.getMinX() - contentBounds.getMinX())
            * ((scrollPane.getHmax() - scrollPane.getHmin()) / (contentBounds.getWidth() - viewportBounds.getWidth()));
    scrollPane.setHvalue(toHScroll);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:20,代碼來源:FXEventQueueDevice.java

示例2: scrollTo

import javafx.geometry.Bounds; //導入方法依賴的package包/類
private void scrollTo(Node target) {
	ScrollPane scrollPane = getParentScrollPane(target);
	if (scrollPane == null)
		return;
	Node content = scrollPane.getContent();
	Bounds contentBounds = content.localToScene(content.getBoundsInLocal());
	Bounds viewportBounds = scrollPane.getViewportBounds();
	Bounds nodeBounds = target.localToScene(target.getBoundsInLocal());
	double toVScroll = (nodeBounds.getMinY() - contentBounds.getMinY())
			* ((scrollPane.getVmax() - scrollPane.getVmin())
					/ (contentBounds.getHeight() - viewportBounds.getHeight()));
	if (toVScroll >= scrollPane.getVmin() && toVScroll < scrollPane.getVmax())
		scrollPane.setVvalue(toVScroll);
	double toHScroll = (nodeBounds.getMinX() - contentBounds.getMinX())
			* ((scrollPane.getHmax() - scrollPane.getHmin())
					/ (contentBounds.getWidth() - viewportBounds.getWidth()));
	if (toHScroll >= scrollPane.getHmin() && toHScroll < scrollPane.getHmax())
		scrollPane.setHvalue(toHScroll);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:20,代碼來源:ScrollPaneSample2.java

示例3: showPopup

import javafx.geometry.Bounds; //導入方法依賴的package包/類
/**
 * Shows the popup.
 */
private void showPopup() {

    if (popup.isShowing())
        return;

    calendarView.setVisible(true);
    //calendarView.setManaged(true);

    Bounds calendarBounds = calendarView.getBoundsInLocal();
    Bounds bounds = getSkinnable().localToScene(getSkinnable().getBoundsInLocal());

    double posX = calendarBounds.getMinX() + bounds.getMinX() + getSkinnable().getScene().getX() + getSkinnable().getScene().getWindow().getX();
    double posY = calendarBounds.getMinY() + bounds.getHeight() + bounds.getMinY() + getSkinnable().getScene().getY() + getSkinnable().getScene().getWindow().getY();

    popup.show(getSkinnable(), posX, posY);
}
 
開發者ID:scourgemancer,項目名稱:graphing-loan-analyzer,代碼行數:20,代碼來源:DatePickerSkin.java

示例4: doOnMouseMoved

import javafx.geometry.Bounds; //導入方法依賴的package包/類
private void doOnMouseMoved(final MouseEvent e) {
	final int mouseMovedDeltaX = this.mouseMovedDeltaX.get();
	final int mouseMovedDeltaY = this.mouseMovedDeltaY.get();
	
	this.mouseMovementTime.set(System.currentTimeMillis());
	
	if(mouseMovedDeltaX != 0 || mouseMovedDeltaY != 0) {
		this.mouseMovedX.addAndGet(this.mouseMovedDeltaX.get() - (int)(e.getScreenX()));
		this.mouseMovedY.addAndGet(this.mouseMovedDeltaY.get() - (int)(e.getScreenY()));
	}
	
	this.mouseX.set((int)(e.getX()));
	this.mouseY.set((int)(e.getY()));
	
	onMouseMoved(this.mouseMovedX.getAndSet(0), this.mouseMovedY.getAndSet(0));
	
	if(isMouseRecentering()) {
		final Bounds bounds = this.canvas.localToScreen(this.canvas.getBoundsInLocal());
		
		final int minX = (int)(bounds.getMinX());
		final int minY = (int)(bounds.getMinY());
		final int width = (int)(bounds.getWidth());
		final int height = (int)(bounds.getHeight());
		final int x = minX + width / 2;
		final int y = minY + height / 2;
		
		this.robot.mouseMove(x, y);
		
		this.mouseMovedDeltaX.set(x);
		this.mouseMovedDeltaY.set(y);
	} else {
		this.mouseMovedDeltaX.set((int)(e.getScreenX()));
		this.mouseMovedDeltaY.set((int)(e.getScreenY()));
	}
}
 
開發者ID:macroing,項目名稱:Dayflower-Path-Tracer,代碼行數:36,代碼來源:AbstractApplication.java

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

示例6: showDateDetails

import javafx.geometry.Bounds; //導入方法依賴的package包/類
private void showDateDetails(LocalDate date) {
    DateCell cell = cellMap.get(date);
    Bounds bounds = cell.localToScreen(cell.getLayoutBounds());
    Callback<DateControl.DateDetailsParameter, Boolean> callback = getSkinnable().getDateDetailsCallback();
    DateControl.DateDetailsParameter param = new DateControl.DateDetailsParameter(null, getSkinnable(), cell, date, bounds.getMinX(), bounds.getMinY());
    callback.call(param);
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:8,代碼來源:MonthSheetViewSkin.java

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

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

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

示例10: rotatorMouseDragged

import javafx.geometry.Bounds; //導入方法依賴的package包/類
@FXML void rotatorMouseDragged(MouseEvent e) {
    final Parent p = rotator_dial.getParent();
    final Bounds b = rotator_dial.getLayoutBounds();
    final Double centerX = b.getMinX() + (b.getWidth() / 2);
    final Double centerY = b.getMinY() + (b.getHeight() / 2);
    final Point2D center = p.localToParent(centerX, centerY);
    final Point2D mouse = p.localToParent(e.getX(), e.getY());
    final Double deltaX = mouse.getX() - center.getX();
    final Double deltaY = mouse.getY() - center.getY();
    final Double radians = Math.atan2(deltaY, deltaX);
    rotate(Math.toDegrees(radians));
}
 
開發者ID:EricCanull,項目名稱:fxexperience2,代碼行數:13,代碼來源:RotatorControl.java

示例11: getTextLocation

import javafx.geometry.Bounds; //導入方法依賴的package包/類
@Override
public Point2D getTextLocation(final int offset) {
    final Optional<Bounds> caretBoundsOr = editor.getCaretBounds();
    if (caretBoundsOr.isPresent()) {
        final Bounds bounds = caretBoundsOr.get();
        return new Point2D(bounds.getMinX(), bounds.getMinY() + 20);
    }
    return null;
}
 
開發者ID:toastkidjp,項目名稱:RichTextFX_verification,代碼行數:10,代碼來源:EditorInputMethodRequests.java

示例12: getPosition

import javafx.geometry.Bounds; //導入方法依賴的package包/類
Point2D getPosition() {
	Bounds bounds = getLayoutBounds();
	try {
		Bounds local = localToScreen(bounds);
		if (local != null) bounds = local;
	} catch(Exception e){ }
	Point2D position = new Point2D(bounds.getMinX(), bounds.getMinY());
	return position;
}
 
開發者ID:DeskChan,項目名稱:DeskChan,代碼行數:10,代碼來源:MovablePane.java

示例13: getLocation

import javafx.geometry.Bounds; //導入方法依賴的package包/類
@Override public Point2D getLocation() {
    Bounds bounds = node.getBoundsInParent();
    return new Point2D(bounds.getMinX(), bounds.getMinY());
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:5,代碼來源:JavaFXElement.java

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

示例15: center

import javafx.geometry.Bounds; //導入方法依賴的package包/類
@Override
public Point2D center() {
	Bounds bounds = node.localToScreen(node.getBoundsInLocal());
	return new Point2D(bounds.getMinX() + bounds.getWidth()/2, bounds.getMinY() + bounds.getHeight()/2);
}
 
開發者ID:BestSolution-at,項目名稱:FX-Test,代碼行數:6,代碼來源:RNodeImpl.java


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