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

Method setFontLevel

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

Sets the font level. @param level the level

(int level)

Source from the content-addressed store, hash-verified

2107 * @param level the level
2108 */
2109 public void setFontLevel(int level) {
2110 if (frame != null) {
2111 // set font levels of menubar and content pane
2112 FontSizer.setFonts(frame.getJMenuBar(), level);
2113 }
2114 FontSizer.setFonts(contentPane, level);
2115 LaunchPanel lp = getSelectedTab();
2116 FontSizer.setFonts(lp.splitPane, level);
2117 // refresh string resources to adjust label sizes
2118 refreshStringResources();
2119 // refresh all trees to adjust node sizes
2120 for (int i = 0; i < getTabCount(); i++) {
2121 LaunchPanel tab = getTab(i);
2122 Enumeration<?> en = tab.getRootNode().breadthFirstEnumeration();
2123 while (en.hasMoreElements()) {
2124 LaunchNode node = (LaunchNode) en.nextElement();
2125 tab.treeModel.nodeChanged(node);
2126 }
2127 tab.repaint();
2128 }
2129 // refresh GUI to update font size menu
2130 refreshGUI();
2131 }
2132
2133 /**
2134 * Gets the paths of currently open set and tabs.

Callers 2

LauncherMethod · 0.95
propertyChangeMethod · 0.95

Calls 8

setFontsMethod · 0.95
getSelectedTabMethod · 0.95
getTabCountMethod · 0.95
getTabMethod · 0.95
getRootNodeMethod · 0.95
refreshGUIMethod · 0.95
repaintMethod · 0.65

Tested by

no test coverage detected