MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / draw

Method draw

unused/debugging/PixelRectangle.java:51–64  ·  view source on GitHub ↗

Draws this rectangle using the AWT drawing API. Required to implement the Drawable interface. @param panel DrawingPanel @param g Graphics

(DrawingPanel panel, Graphics g)

Source from the content-addressed store, hash-verified

49 * @param g Graphics
50 */
51 public void draw(DrawingPanel panel, Graphics g) {
52 g = g.create();
53 left = control.getInt("xleft");
54 top = control.getInt("ytop");
55// Shape clipShape = g.getClip();
56 System.out.println("PixelRectangle setting clip...");
57 g.setClip(0, 0, panel.getWidth(), panel.getHeight());
58 // this method implements the Drawable interface
59 System.out.println("PixelRectangle filling...");
60 g.setColor(Color.RED); // set drawing color to red
61 g.fillRect(left, top, width, height); // draws rectangle
62 System.out.println("PixelRectangle disposing...");
63 g.dispose();
64 }
65}
66
67/*

Callers

nothing calls this directly

Calls 9

setClipMethod · 0.80
getIntMethod · 0.65
printlnMethod · 0.65
getWidthMethod · 0.65
getHeightMethod · 0.65
disposeMethod · 0.65
createMethod · 0.45
setColorMethod · 0.45
fillRectMethod · 0.45

Tested by

no test coverage detected