Ejemplo n.º 1
0
 public void evaluate() {
   try {
     // clear problems and console messages
     problemsView.setText("");
     consoleView.setText("");
     // update status view
     statusView.setText(" Parsing ...");
     tabbedPane.setSelectedIndex(0);
     LispExpr root = Parser.parse(textView.getText());
     statusView.setText(" Running ...");
     tabbedPane.setSelectedIndex(1);
     // update run button
     runButton.setIcon(stopImage);
     runButton.setActionCommand("Stop");
     // start run thread
     runThread = new RunThread(root);
     runThread.start();
   } catch (SyntaxError e) {
     tabbedPane.setSelectedIndex(0);
     System.err.println(
         "Syntax Error at " + e.getLine() + ", " + e.getColumn() + " : " + e.getMessage());
   } catch (Error e) {
     // parsing error
     System.err.println(e.getMessage());
     statusView.setText(" Errors.");
   }
 }
Ejemplo n.º 2
0
  public TdsMonitor(ucar.util.prefs.PreferencesExt prefs, JFrame parentFrame) throws HTTPException {
    this.mainPrefs = prefs;
    this.parentFrame = parentFrame;

    makeCache();

    fileChooser =
        new FileManager(parentFrame, null, null, (PreferencesExt) prefs.node("FileManager"));

    // the top UI
    tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    managePanel = new ManagePanel((PreferencesExt) mainPrefs.node("ManageLogs"));
    accessLogPanel = new AccessLogPanel((PreferencesExt) mainPrefs.node("LogTable"));
    servletLogPanel = new ServletLogPanel((PreferencesExt) mainPrefs.node("ServletLogPanel"));
    urlDump = new URLDumpPane((PreferencesExt) mainPrefs.node("urlDump"));

    tabbedPane.addTab("ManageLogs", managePanel);
    tabbedPane.addTab("AccessLogs", accessLogPanel);
    tabbedPane.addTab("ServletLogs", servletLogPanel);
    tabbedPane.addTab("UrlDump", urlDump);
    tabbedPane.setSelectedIndex(0);

    setLayout(new BorderLayout());
    add(tabbedPane, BorderLayout.CENTER);

    CredentialsProvider provider = new UrlAuthenticatorDialog(null);
    session = new HTTPSession("TdsMonitor");
    session.setCredentialsProvider(provider);
    session.setUserAgent("TdsMonitor");
  }
Ejemplo n.º 3
0
 public void setSelectedTab(int pos) {
   tabbedPane.setSelectedIndex(pos);
 }
Ejemplo n.º 4
0
 private void gotoUrlDump(String urlString) {
   urlDump.setURL(urlString);
   tabbedPane.setSelectedIndex(3);
 }
Ejemplo n.º 5
0
 public void addHTMLTab(String tabTitle, String info, StringBuffer code) {
   // maybe switch on title to determine an image
   HTMLTextView html = new HTMLTextView(code, contextMenu);
   tabbedPane.addTab(tabTitle, icon, html, info);
   tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1);
 }
  // The init method
  public void init() {

    // Set the look and feel
    try {
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (Exception e) {
      return;
    }

    // Create the menuListener
    MenuListener menuListener = new MenuListener();

    // Create the menu bar
    JMenuBar menuBar = new JMenuBar();
    setJMenuBar(menuBar);

    // Create the file menu
    JMenu fileMenu = new JMenu("File");
    menuBar.add(fileMenu);

    // Create the menuitems
    JMenuItem menuItem;
    menuItem = new JMenuItem("Read Particle Location Data");
    fileMenu.add(menuItem);
    menuItem.addActionListener(menuListener);

    menuItem = new JMenuItem("Save Uintah Input File");
    fileMenu.add(menuItem);
    menuItem.addActionListener(menuListener);

    menuItem = new JMenuItem("Exit");
    fileMenu.add(menuItem);
    menuItem.addActionListener(menuListener);

    // Create the main tabbed pane
    mainTabbedPane = new JTabbedPane();

    // Create the panels to be added to the tabbed pane
    uintahInputPanel = new UintahInputPanel(d_partList, this);
    particleGenPanel = new ParticleGeneratePanel(d_partList, this);

    // Add the tabs
    mainTabbedPane.addTab("Uintah Inputs", null, uintahInputPanel, null);
    mainTabbedPane.addTab("Generate Particle Locations", null, particleGenPanel, null);
    mainTabbedPane.setSelectedIndex(0);
    getContentPane().add(mainTabbedPane);

    // Create the help menu
    JMenu helpMenu = new JMenu("Help");
    menuBar.add(helpMenu);

    // Create the menuitems
    menuItem = new JMenuItem("About");
    helpMenu.add(menuItem);
    menuItem.addActionListener(menuListener);

    // Create the invisible help frames
    helpAboutFrame = new HelpAboutFrame();
    helpAboutFrame.pack();

    // Create the Tab Listener
    TabListener tabListener = new TabListener();
    mainTabbedPane.addChangeListener(tabListener);
  }