public void resetHoleBoundary() { if (this.state == CONTROLLER_STATE.CONTROLLER_BOUNDARY) { if ((this.counterPixelsHistory != null) && (this.counterPixelsHistory.size() > 0)) { for (Pixel p : this.counterPixelsHistory) { Grid.getInstance().setPixel(p, p.getValue()); } refreshView(); } this.state = CONTROLLER_STATE.CONTROLLER_HOLE; } }
public void markBoundary() { if (this.state == CONTROLLER_STATE.CONTROLLER_HOLE) { ArrayList<Pixel> boundaryPixels = this.gridAlgorithm2.findBoundary(); this.counterPixelsHistory = new ArrayList<Pixel>(); for (Pixel p : boundaryPixels) { this.counterPixelsHistory.add(new Pixel(p.getX(), p.getY(), p.getValue())); } Grid.getInstance().markBoundary(boundaryPixels); refreshView(); this.state = CONTROLLER_STATE.CONTROLLER_BOUNDARY; } }
public void markBoundary1() { if (this.state == CONTROLLER_STATE.CONTROLLER_HOLE) { this.holePixelsInfo = this.gridAlgorithm.findBoundaryAndHoles(); this.counterPixelsHistory = new ArrayList<Pixel>(); for (Pixel p : holePixelsInfo.getBoundaryPixels()) { this.counterPixelsHistory.add(new Pixel(p.getX(), p.getY(), p.getValue())); } Grid.getInstance().markBoundary(this.holePixelsInfo.getBoundaryPixels()); refreshView(); this.state = CONTROLLER_STATE.CONTROLLER_BOUNDARY; } }