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

Method refreshGUI

src/org/opensourcephysics/tools/Launcher.java:1275–1384  ·  view source on GitHub ↗

Refreshes the GUI.

()

Source from the content-addressed store, hash-verified

1273 * Refreshes the GUI.
1274 */
1275 protected void refreshGUI() {
1276 refreshMemoryButton();
1277 // set tab properties
1278 LaunchPanel tab = getSelectedTab();
1279 boolean rootDisabled = tab != null && !tab.getRootNode().enabled;
1280 if (tab != null) {
1281 tab.tree.setEnabled(tab.getRootNode().enabled);
1282 tabbedPane.setEnabled(tab.getRootNode().enabled);
1283 tab.splitPane.setDividerLocation(divider);
1284 }
1285 // update undo/redo buttons
1286 backButton.setEnabled(undoManager.canUndo());
1287 forwardButton.setEnabled(undoManager.canRedo());
1288 String name;
1289 if (frame != null) {
1290 // set frame title
1291 name = (title == null) ? tabSetName : title;
1292 if (name == null) {
1293 name = LaunchRes.getString("Frame.Title"); //$NON-NLS-1$
1294 } else {
1295 name = LaunchRes.getString("Frame.Title") + ": " + name; //$NON-NLS-1$//$NON-NLS-2$
1296 }
1297 if (rootDisabled) {
1298 name += " " + LaunchRes.getString("Launcher.Title.NeedsPassword"); //$NON-NLS-1$//$NON-NLS-2$
1299 }
1300 frame.setTitle(name);
1301 // rebuild file menu
1302 fileMenu.removeAll();
1303 if (undoManager.canReload()) {
1304 fileMenu.add(backItem);
1305 }
1306 if (!OSPRuntime.isApplet) {
1307 if (fileMenu.getItemCount() > 0) {
1308 fileMenu.addSeparator();
1309 }
1310 fileMenu.add(openItem);
1311 }
1312 if (openFromJarMenu != null) {
1313 fileMenu.add(openFromJarMenu);
1314 }
1315 if (rootDisabled) {
1316 fileMenu.add(passwordItem);
1317 }
1318 if (OSPRuntime.isApplet) { // added by W. Christian
1319 fileMenu.add(hideItem);
1320 return;
1321 }
1322 if (tab != null) {
1323 if (fileMenu.getItemCount() > 0) {
1324 fileMenu.addSeparator();
1325 }
1326 boolean showCloseTab = true;
1327 if (getClass() == Launcher.class) {
1328 if (tab.getRootNode().isButtonView()) {
1329 showCloseTab = false;
1330 name = LaunchRes.getString("Frame.Title") + ": " + //$NON-NLS-1$//$NON-NLS-2$
1331 tab.getRootNode().name;
1332 } else if (tabbedPane.getTabCount() == 1) {

Callers 15

actionPerformedMethod · 0.95
LauncherMethod · 0.95
setDividerMethod · 0.95
valueChangedMethod · 0.95
actionPerformedMethod · 0.95
showButtonViewMethod · 0.95
showTabbedPaneViewMethod · 0.95
removeSelectedTabMethod · 0.95
removeAllTabsMethod · 0.95
stateChangedMethod · 0.95
propertyChangeMethod · 0.95
setFontLevelMethod · 0.95

Calls 15

refreshMemoryButtonMethod · 0.95
getSelectedTabMethod · 0.95
getRootNodeMethod · 0.95
getStringMethod · 0.95
isWebStartMethod · 0.95
getStringMethod · 0.95
getRootNodeMethod · 0.95
canReloadMethod · 0.80
isButtonViewMethod · 0.80
setEnabledMethod · 0.65
setTitleMethod · 0.65
setTextMethod · 0.65

Tested by

no test coverage detected