How can I set a ID for each clipping?
eg) ??? =g.drawRect(x, y, a, b)
Thank you very much!
There is no native support for something like that.
The closest thing you could do would be to implement that on your own. Something
like creating a Class that records the parameters of each draw routine before drawing:
// this would only be good for rects
public class DrawParams {
int x,y,w,h;
public DrawParams(int x, int y, int w, int h) {
this.x = x;
this.y = y;
this.w = w;
this.h = h;
}
}
// then use this method for drawing rects:
DrawParams drawRect(Graphics g, int x, int y, int w, int h) {
DrawParams dp = new DrawParams(x,y,w,h);
g.drawRect(x,y,w,h);
return dp;
}
What do you want to do with these IDs?
shmoove