MCPcopy Create free account
hub / github.com/Neop/mudmap2 / createTab

Method createTab

src/main/java/mudmap2/frontend/Mainwindow.java:235–263  ·  view source on GitHub ↗

create world tab @param world

(final World world)

Source from the content-addressed store, hash-verified

233 * @param world
234 */
235 public void createTab(final World world) {
236 setMinimumSize(new Dimension(500, 400));
237
238 if (tabbedPane == null) {
239 remove(infoPanel);
240 tabbedPane = new JTabbedPane();
241 add(tabbedPane);
242 tabbedPane.addChangeListener(this);
243 }
244
245 if (!worldTabs.containsKey(world)) {
246 // open new tab
247 final WorldTab tab = new WorldTab(this, world, false);
248 worldTabs.put(world, tab);
249 tabbedPane.addTab(tab.getWorld().getName(), tab);
250 }
251 // change current tab
252 tabbedPane.setSelectedComponent(worldTabs.get(world));
253
254 final WorldTab curTab = getSelectedTab();
255 if (curTab != null) {
256 // update menu entry
257 menuWorldShowCursor.setState(curTab.getWorldPanel().isCursorEnabled());
258 }
259
260 if (world.getWorldFile() != null) {
261 WorldFileList.push(new WorldFileList.WorldFileEntry(world.getName(), new File(world.getWorldFile().getFilename())));
262 }
263 }
264
265 /**
266 * Closes all tabs

Callers 3

actionPerformedMethod · 0.95
createNewWorldMethod · 0.95
createMethod · 0.80

Calls 12

getWorldMethod · 0.95
getSelectedTabMethod · 0.95
getWorldPanelMethod · 0.95
pushMethod · 0.95
addChangeListenerMethod · 0.80
putMethod · 0.80
isCursorEnabledMethod · 0.80
getFilenameMethod · 0.80
removeMethod · 0.65
getMethod · 0.65
getNameMethod · 0.45
getWorldFileMethod · 0.45

Tested by

no test coverage detected