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

Method detach

src/org/opensourcephysics/media/core/TPoint.java:343–355  ·  view source on GitHub ↗

Detaches this TPoint.

()

Source from the content-addressed store, hash-verified

341 * Detaches this TPoint.
342 */
343 public void detach() {
344 if (attachedTo != null) {
345 PropertyChangeListener[] listeners = attachedTo.support.getPropertyChangeListeners("location"); //$NON-NLS-1$
346 for (PropertyChangeListener next : listeners) {
347 if (next instanceof Follower) {
348 Follower follower = (Follower) next;
349 if (follower.getTarget() == this)
350 attachedTo.removePropertyChangeListener("location", next); //$NON-NLS-1$
351 }
352 }
353 attachedTo = null;
354 }
355 }
356
357 /**
358 * Determines if this point is attached to another.

Callers 1

attachToMethod · 0.95

Calls 2

getTargetMethod · 0.95

Tested by

no test coverage detected