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

Method getShape

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

Gets the shape to be filled in the draw method. @param vidPanel the video panel @return the fill shape

(VideoPanel vidPanel)

Source from the content-addressed store, hash-verified

210 * @return the fill shape
211 */
212 protected Shape getShape(VideoPanel vidPanel) {
213 Point p = getScreenPosition(vidPanel);
214 setHitRectCenter(p.x, p.y);
215 if(stroke==null) {
216 return(Rectangle) hitRect.clone();
217 }
218 return stroke.createStrokedShape(hitRect);
219 }
220
221 /**
222 * Centers the hit testing rectangle on the specified screen point.

Callers 2

getBoundsMethod · 0.95
drawMethod · 0.95

Calls 3

setHitRectCenterMethod · 0.95
getScreenPositionMethod · 0.80
cloneMethod · 0.65

Tested by

no test coverage detected