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

Method calculate

unused/debugging/SetClipBug.java:36–46  ·  view source on GitHub ↗

Creates a rectangle and adds it to the DisplayFrame.

()

Source from the content-addressed store, hash-verified

34 * Creates a rectangle and adds it to the DisplayFrame.
35 */
36 public void calculate() {
37 // gets rectangle location
38 int left = control.getInt("xleft");
39 int top = control.getInt("ytop");
40 // gets rectangle dimensions
41 int width = control.getInt("width");
42 int height = control.getInt("height");
43 Drawable rectangle = new PixelRectangle(control, left, top, width, height);
44 frame.addDrawable(rectangle);
45 // frame is automatically rendered after Calculate button is pressed
46 }
47
48 /**
49 * Resets the program to its initial state.

Callers 1

resetMethod · 0.95

Calls 2

getIntMethod · 0.65
addDrawableMethod · 0.45

Tested by

no test coverage detected