|
From: SourceForge.net <no...@so...> - 2005-10-21 22:24:06
|
Bugs item #1334543, was opened at 2005-10-21 17:20 Message generated for change (Comment added) made by jerryvos You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101703&aid=1334543&group_id=1703 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed Resolution: None Priority: 5 Submitted By: Jerry Vos (jerryvos) Assigned to: Nobody/Anonymous (nobody) Summary: Removing and then adding in a display causes an exception Initial Comment: Reported by Ken (kmz...@earthlink) I would like to turn a Displayable on and off in my model. [Using the drop down menu to do this is not acceptable because the menu does not stay visible while the model runs.] It seems that I can remove a Displayable, but when I add that same Displayable again, I get an error that there is already a menu item for that Displayable. OK, well how can I remove the menu item then? Here is a trivial example: dsurf.addDisplayable(display, "temp"); dsurf.removeDisplayable(display); dsurf.addDisplayable(display, "temp"); Exception: Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Display Surface already contains a menu item with this menu text ---------------------------------------------------------------------- >Comment By: Jerry Vos (jerryvos) Date: 2005-10-21 17:24 Message: Logged In: YES user_id=1093815 Bug in the release. Things weren't getting entirely removed in the remove. Possible workaround: Add extra stuff to the display name since that's what's not getting totally deleted. dsurf.addDisplayable(display, "Display Title" + (staticInt++)); where staticInt is some static variable in the class. Fixed in CVS. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101703&aid=1334543&group_id=1703 |