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

Method draw

src/org/opensourcephysics/media/core/TShape.java:158–170  ·  view source on GitHub ↗

Overrides TPoint draw method. @param panel the drawing panel requesting the drawing @param _g the graphics context on which to draw

(DrawingPanel panel, Graphics _g)

Source from the content-addressed store, hash-verified

156 * @param _g the graphics context on which to draw
157 */
158 @Override
159public void draw(DrawingPanel panel, Graphics _g) {
160 if(!(panel instanceof VideoPanel)||!isVisible()) {
161 return;
162 }
163 VideoPanel vidPanel = (VideoPanel) panel;
164 fillShape = getShape(vidPanel);
165 Graphics2D g = (Graphics2D) _g;
166 Paint gpaint = g.getPaint();
167 g.setPaint(color);
168 g.fill(fillShape);
169 g.setPaint(gpaint);
170 }
171
172 /**
173 * Overrides TPoint findInteractive method.

Callers

nothing calls this directly

Calls 5

isVisibleMethod · 0.95
getShapeMethod · 0.95
getPaintMethod · 0.80
setPaintMethod · 0.80
fillMethod · 0.45

Tested by

no test coverage detected