代码问题导致的继承关系错误

时间:2019-03-30 23:20:26

标签: java bluej

我遇到的问题是,“ RunParameterisedShapes”类的继承关系显然在“ ParameterizedShapes”中发现了一个错误,但我似乎找不到问题所在?它在“ completion”标记下的“ RunParameterisedShapes”类中说:“不兼容的类型:无效的方法引用,但预期为double,double,double,double,double,double,double 找到:没有参数 原因:实际参数和形式参数列表的长度不同”

我不确定有人可以向我解释什么意思吗?

我尝试将代码更改为类似UI.drawRect(...);但是它似乎不起作用,除了替换和删除双精度数之外,或者完全只是将代码擦除到以前的样子,但它不起作用。

这是到目前为止我拥有的代码

 public void doCompletion(double BOARD_LEFT, double BOARD_TOP, double ROW_SIZE, double BOARD_HEIGHT,double DISH_HEIGHT, 
   double DISH_WIDTH, double PEBBLE_DIAM){


 UI.clearGraphics();

this.drawPebbleRow(BOARD_LEFT, BOARD_TOP, ROW_SIZE, BOARD_HEIGHT, 
    DISH_HEIGHT, DISH_WIDTH, PEBBLE_DIAM);

this.drawPebbleRow(BOARD_LEFT, BOARD_TOP, ROW_SIZE, BOARD_HEIGHT, 
    DISH_HEIGHT, DISH_WIDTH, PEBBLE_DIAM);

this.drawPebbleRow(BOARD_LEFT, BOARD_TOP, ROW_SIZE, BOARD_HEIGHT, 
    DISH_HEIGHT, DISH_WIDTH, PEBBLE_DIAM);

this.drawPebbleRow(BOARD_LEFT, BOARD_TOP, ROW_SIZE, BOARD_HEIGHT, 
    DISH_HEIGHT, DISH_WIDTH, PEBBLE_DIAM);

this.drawPebbleRow(BOARD_LEFT, BOARD_TOP, ROW_SIZE, BOARD_HEIGHT, 
    DISH_HEIGHT, DISH_WIDTH, PEBBLE_DIAM);
}

/**   COMPLETION
 * Draws a row of a pebble game. Parameters must be sufficient to specify
 * the position and size of the row, and the positions of the pebbles
 * Hint: It makes the code easier if you count from 0 rather than from 1
 * Hint: use the drawDish and drawPebble methods!
 */
public void drawPebbleRow(double BOARD_LEFT, double BOARD_TOP, double 
ROW_SIZE, double BOARD_HEIGHT,double DISH_HEIGHT, double DISH_WIDTH, double PEBBLE_DIAM){


    this.drawPebbleRow(BOARD_LEFT, BOARD_TOP, ROW_SIZE, BOARD_HEIGHT, DISH_HEIGHT, DISH_WIDTH, PEBBLE_DIAM);
    this.drawPebbleRow(BOARD_LEFT, BOARD_TOP, ROW_SIZE, BOARD_HEIGHT, DISH_HEIGHT, DISH_WIDTH, PEBBLE_DIAM);
    this.drawPebbleRow(BOARD_LEFT, BOARD_TOP, ROW_SIZE, BOARD_HEIGHT, DISH_HEIGHT, DISH_WIDTH, PEBBLE_DIAM);
    this.drawPebbleRow(BOARD_LEFT, BOARD_TOP, ROW_SIZE, BOARD_HEIGHT, DISH_HEIGHT, DISH_WIDTH, PEBBLE_DIAM);
    this.drawPebbleRow(BOARD_LEFT, BOARD_TOP, ROW_SIZE, BOARD_HEIGHT, DISH_HEIGHT, DISH_WIDTH, PEBBLE_DIAM);
}

我需要代码沿着类似于棋盘的线条画东西,每个正方形中间都有圆圈。

0 个答案:

没有答案