private void open(String indexName) { DbgOutput.println(1, "open() " + indexName); cmd.reset(); cmd.cmdType = LibgistCommand.OPEN; cmd.indexName.append(indexName); opThread.dispatchCmd(cmd); }
public static void main(String[] argv) { MainWindow win; DbgOutput.toStdout(); win = new MainWindow(); // process cmd line arguments int i; for (i = 0; i < argv.length; i++) { if (argv[i].equals("-D")) { i++; // try to interpret the next argument as the debug level int dbgLvl = 1; // basic debug level if (i >= argv.length) { // no more arguments, we stick with debug level 1 break; } try { dbgLvl = Integer.parseInt(argv[i]); } catch (NumberFormatException e) { dbgLvl = 1; // didn't work, this is probably a filename win.open(argv[i]); } DbgOutput.setDbgLevel(dbgLvl); Libgist.setDbgLevel(dbgLvl); } else if (argv[i].equals("-h")) { // print help message and exit System.out.println("Usage: amdb [-D <dbglevel> | -h] [index]"); System.exit(0); } else { // this is a name of an index, open it // System.out.println("open " + argv[i]); win.open(argv[i]); } } win.setTitle("amdb"); win.setSize(800, 600); win.setLocation(50, 50); win.setVisible(true); }
// enable all menu items/menus for operations that require // a Gist to work on, excluding the debugging functions private void enableIndexOpened() { DbgOutput.println(1, "enableIndexOpened()"); setAllEnabled(true); // debugging operations only during operations stepAction.setEnabled(false); stopAction.setEnabled(false); cancelAction.setEnabled(false); nextAction.setEnabled(false); contAction.setEnabled(false); // no profile opened completeAnalysisItem.setEnabled(false); wkldStatsItem.setEnabled(false); splitStatsItem.setEnabled(false); penaltyStatsItem.setEnabled(false); }
// enable/disable all menu items/actions private void setAllEnabled(boolean enabled) { DbgOutput.println(2, "enabled: " + enabled); fileMenu.setEnabled(enabled); newItem.setEnabled(enabled); openItem.setEnabled(enabled); closeItem.setEnabled(enabled); // dumpItem.setEnabled(enabled); flushItem.setEnabled(enabled); optionsItem.setEnabled(enabled); settingsItem.setEnabled(enabled); debugMenu.setEnabled(enabled); stepAction.setEnabled(enabled); stopAction.setEnabled(enabled); cancelAction.setEnabled(enabled); nextAction.setEnabled(enabled); contAction.setEnabled(enabled); breakpointsItem.setEnabled(enabled); opsMenu.setEnabled(enabled); insertItem.setEnabled(enabled); deleteItem.setEnabled(enabled); searchItem.setEnabled(enabled); executeItem.setEnabled(enabled); treeStatsMenu.setEnabled(enabled); utilItem.setEnabled(enabled); predSzItem.setEnabled(enabled); slotCntItem.setEnabled(enabled); analysisMenu.setEnabled(enabled); newAnalysisItem.setEnabled(enabled); openAnalysisItem.setEnabled(enabled); completeAnalysisItem.setEnabled(enabled); wkldStatsItem.setEnabled(enabled); splitStatsItem.setEnabled(enabled); penaltyStatsItem.setEnabled(enabled); // these are never disabled windowsMenu.setEnabled(true); showCmdsItem.setEnabled(true); showResultsItem.setEnabled(true); showTraceItem.setEnabled(true); tileItem.setEnabled(true); }
public int setGuiState(int state, boolean isScript, boolean enableCancel) { DbgOutput.println(2, "state: " + state); int oldState = guiState; guiState = state; switch (guiState) { case INITSTATE: enableInit(); break; case IDXOPENSTATE: enableIndexOpened(); break; case DEBUGSTATE: enableDebug(isScript, enableCancel); break; case ANLOPENSTATE: enableAnalysis(); break; } return oldState; }