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


Java Rectangle.getX方法代码示例

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


在下文中一共展示了Rectangle.getX方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AbstractDataView

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
/**
 *
 * @param bounds
 */
protected AbstractDataView(Rectangle bounds, int leftMargin, int topMargin) {
    super(bounds.getWidth(), bounds.getHeight());
    x = bounds.getX();
    y = bounds.getY();
    this.leftMargin = leftMargin;
    this.topMargin = topMargin;

    this.myOnPeakData = null;

    width = bounds.getWidth();
    height = bounds.getHeight();
    graphWidth = (int) width - leftMargin;
    graphHeight = (int) height - topMargin;

    this.tics = null;
}
 
开发者ID:CIRDLES,项目名称:Squid,代码行数:21,代码来源:AbstractDataView.java

示例2: insertRectanglesTrim

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
protected void insertRectanglesTrim(){
    setLabel();

    if(showArrayList.size() >= 0){
        showList.getChildren().clear();

        //根据线性大小添加
        for (int i = 0; i < showArrayList.size(); i++) {

            //添加矩形
            Rectangle rectangle = new Rectangle(START_X + i * WIDTH, START_Y, WIDTH, HEIGHT);
            rectangle.setFill(Color.WHITE);
            rectangle.setStroke(Color.BLACK);
            rectangle.setOpacity(0.2);
            showList.getChildren().add(rectangle);

            //添加元素值
            Text text = new Text(rectangle.getX() + rectangle.getWidth() / 2, rectangle.getY() + rectangle.getHeight() / 2, showArrayList.get(i));
            showList.getChildren().add(text);
        }
    }
}
 
开发者ID:fankaljead,项目名称:Curriculum-design-of-data-structure,代码行数:23,代码来源:ShowArrayListController.java

示例3: initialInsert

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
protected void initialInsert(){
    setLabel();

    showList.getChildren().clear();

    for (int i = 0; i < capacitySize; i++) {

        //添加矩形
        Rectangle rectangle = new Rectangle(START_X + i * WIDTH, START_Y, WIDTH, HEIGHT);
        rectangle.setFill(Color.WHITE);
        rectangle.setStroke(Color.BLACK);
        rectangle.setOpacity(0.3);
        showList.getChildren().add(rectangle);

        //添加线
        Line line = new Line(rectangle.getX(), rectangle.getY() + HEIGHT, rectangle.getX() + WIDTH, rectangle.getY());
        showList.getChildren().add(line);
    }
}
 
开发者ID:fankaljead,项目名称:Curriculum-design-of-data-structure,代码行数:20,代码来源:ShowArrayListController.java

示例4: Sprite

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public Sprite(Entity e,int actualSize,double playSpeed,Image spriteSheet,List<Rectangle> specifications,double width, double height,int scale, boolean leftToRight){
    super();
    this.actualSize = actualSize;
    this.playSpeed = playSpeed;
    this.numberOfFrames=specifications.size();
    this.width = width;
    this.height = height;
    this.scale = scale;
    resersePlay = leftToRight;
    this.entityReference=e;
    hasValidSpriteImages=true;
    spriteImages=new Image[specifications.size()];
    for (int i = 0; i < specifications.size(); i++) {
        Rectangle specification = specifications.get(i);
        int x=(int)specification.getX();
        int y=(int)specification.getY();
        int w=(int)specification.getWidth();
        int h=(int)specification.getHeight();

        //To DO Check dimensions provided are not going out of spritesheet dimensions\

        spriteImages[i]=ImageUtils.crop(spriteSheet, x, y, w, h);
    }
}
 
开发者ID:ashish2199,项目名称:Aidos,代码行数:25,代码来源:Sprite.java

示例5: insertRectangles

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
protected void insertRectangles(){
    setLabel();
    if(showArrayList.size() >= 0){
        showList.getChildren().clear();
        if(showArrayList.size() >= capacitySize){
            capacitySize *= 1.5;
        }

        //根据容量添加
        for (int i = 0; i < capacitySize; i++) {

            Rectangle rectangle = new Rectangle(START_X + i * WIDTH, START_Y, WIDTH, HEIGHT);
            rectangle.setFill(Color.WHITE);
            rectangle.setStroke(Color.BLACK);
            rectangle.setOpacity(0.5);
            showList.getChildren().add(rectangle);

            //当有元素时
            if(i < showArrayList.size()) {
                Text text = new Text(rectangle.getX() + rectangle.getWidth() / 2, rectangle.getY() + rectangle.getHeight() / 2, showArrayList.get(i));
                showList.getChildren().add(text);
            }
            //当超过线性表大小
            else {
                Line line = new Line(rectangle.getX(), rectangle.getY() + HEIGHT, rectangle.getX() + WIDTH, rectangle.getY());
                showList.getChildren().add(line);
            }

        }
    }
}
 
开发者ID:fankaljead,项目名称:Curriculum-design-of-data-structure,代码行数:32,代码来源:ShowArrayListController.java

示例6: insertRectangles

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
protected void insertRectangles() {
    if(list.size() > 0){
        showArea.getChildren().clear();


        //根据添加
        for (int i = 0; i < list.size(); i++) {
            Rectangle rectangle = new Rectangle(START_X, START_Y + i * HEIGHT, WIDTH, HEIGHT);
            rectangle.setFill(Color.WHITE);
            rectangle.setStroke(Color.BLACK);
            rectangle.setOpacity(0.5);
            Text text = new Text(rectangle.getX() + rectangle.getWidth()/2, rectangle.getY() + rectangle.getHeight()/2, list.get(i));

            if(i == list.size() - 1){
                top = new Text(START_X - WIDTH, START_Y + HEIGHT/2, TOP);

                //画箭头
                top_mid = new Line(START_X - WIDTH/5*3, START_Y + HEIGHT/2,
                        START_X, START_Y + HEIGHT/2);
                top_left = new Line(top_mid.getEndX(), top_mid.getEndY(),
                        top_mid.getEndX() - HEIGHT/3, top_mid.getEndY() - HEIGHT/2);
                top_right = new Line(top_mid.getEndX(), top_mid.getEndY(),
                        top_mid.getEndX() - HEIGHT/3, top_mid.getEndY() + HEIGHT/2);

                        showArea.getChildren().addAll(top, top_mid, top_left, top_right);
            }


            showArea.getChildren().addAll(rectangle, text);
        }
    }else {
        initialInsert();
    }
}
 
开发者ID:fankaljead,项目名称:Curriculum-design-of-data-structure,代码行数:35,代码来源:ShowStackController.java


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