public void setAxesLength(int newVal) { int lengthIncrease = newVal - axesLength; Line xAxis = cartesianPlane.getXAxis(); Line yAxis = cartesianPlane.getYAxis(); xAxis.setX(xAxis.getX() - lengthIncrease / 2); yAxis.setY(yAxis.getY() - lengthIncrease / 2); updateXOfLabel(xLabel, xLabel.getLocation().getX() + lengthIncrease / 2); updateYOfLabel(yLabel, yLabel.getLocation().getY() - lengthIncrease / 2); axesLength = newVal; xAxis.setWidth(axesLength); yAxis.setHeight(axesLength); }
public void setAxesLength(int anAxesLength) { axesLength = anAxesLength; xAxis.setWidth(axesLength); yAxis.setHeight(axesLength); xAxis.setX(toXAxisX()); xAxis.setY(toXAxisY()); yAxis.setX(toYAxisX()); yAxis.setY(toYAxisY()); xLabel.setX(toXLabelX()); xLabel.setY(toXLabelY()); yLabel.setX(toYLabelX()); yLabel.setY(toYLabelY()); }