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

Method getShape

src/org/opensourcephysics/media/core/TLine.java:152–161  ·  view source on GitHub ↗

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

(VideoPanel vidPanel)

Source from the content-addressed store, hash-verified

150 * @return the line shape
151 */
152 @Override
153protected Shape getShape(VideoPanel vidPanel) {
154 this.center(end1, end2);
155 Point p1 = end1.getScreenPosition(vidPanel);
156 Point p2 = end2.getScreenPosition(vidPanel);
157 line.setLine(p1, p2);
158 end1Rect.setLocation(p1.x-4, p1.y-4);
159 end2Rect.setLocation(p2.x-4, p2.y-4);
160 return stroke.createStrokedShape(line);
161 }
162
163 //_________________________ inner End classes _________________________
164 class LineEnd extends TPoint {

Callers

nothing calls this directly

Calls 3

centerMethod · 0.80
getScreenPositionMethod · 0.80
setLocationMethod · 0.45

Tested by

no test coverage detected