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

Method draw

src/csm/ch03/PixelRectangle.java:44–49  ·  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

42 * @param g Graphics
43 */
44 @Override
45public void draw(DrawingPanel panel, Graphics g) {
46 // this method implements the Drawable interface
47 g.setColor(Color.RED); // set drawing color to red
48 g.fillRect(left, top, width, height); // draws rectangle
49 }
50}
51
52/*

Callers

nothing calls this directly

Calls 2

setColorMethod · 0.45
fillRectMethod · 0.45

Tested by

no test coverage detected