stify">}
}
(exit) {return;}
> out=new ArrayList (); (int i=0; i > tmp=graphAction_step (bimage, packs.get (i). size (),. get (i). get (packs.get (i). size () / 2),, _last,,,,
,, _ways); (tmp!=null) {. addAll (tmp);
}
}
/ / saving ways=out; model=(DefaultTableModel) ways.getModel ();. setRowCount (0); (int i=0; i
}
};
List > graphAction_step (BufferedImage bimage, int w, Point pt, Point previous, Point pt_last, int defColour, int dx, int dy, int stack, boolean erase, List tmp_ways) {
trace=new ArrayList (); radius_tmp=w; radius=radius_tmp / 2 +1; width=radius_tmp; iterations=0;
(pt!=null) {
(abs (pt_last.x - pt.x) <= width && abs (pt_last.y - pt.y) <= width) {. add (new Point (pt_last . x + dx, pt_last.y + dy)); > end=new ArrayList ();. add (trace); end;
}
> packs=new ArrayList > (); content=new ArrayList (); contentwrite=false;
pt_tmp=new Point (pt.x - radius, pt.y - radius); (int i=0; i <= 8 * radius - 1; i + +) {alpha=PI / 2 * (i / (2 * radius));
(isPtInBImg (bimage, pt_tmp.x, pt_tmp.y) && defColour == bimage.getRGB (pt_tmp.x, pt_tmp.y)) {. add (pt_tmp);=true ;
} if (contentwrite) {
. add (content);=new ArrayList ();=false;
} _tmp=new Point (pt_tmp.x + (int) cos (alpha), pt_tmp.y + (int) sin (alpha));
}
(contentwrite) {
(! packs.isEmpty () && (packs.get (0). get (0). x == pt.x - radius && packs.get (0) . get (0). y == pt.y - radius)) {. addAll (0, packs.get (0));. set (0, content);=false;
} else {. add (content);=false; boolean isPtInBImg (BufferedImage bimage, int x, int y) {! (x <0 | | y <0 | | x> (bimage. getWidth () - 1) | | y> (bimage.getHeight () - 1));
}
}
}
(packs.isEmpty ()) {;
}
{+ +; (int i=0; i
}
}
} (int i=- (radius - 1); i <= (radius - 1); i + +) {(int j=- (radius - 1); j <= (radius - 1 ); j + +) {(isPtInBImg (bimage, pt.x + i, pt.y + j)) {. setRGB (pt.x + i, pt.y + j, - 1);
}
}
}
(iterations> 1 && packs.size ()> 1) {> end=new ArrayList (); (int i=0; i