Package javax.swing.event

Examples of javax.swing.event.InternalFrameAdapter


    setResizable(resizable);
    setClosable(closable);
    setMaximizable(maximizable);
    setIconifiable(iconifiable);
    setFont(Common.font_std);
    this.addInternalFrameListener(new InternalFrameAdapter() {
      public void internalFrameIconified(InternalFrameEvent evt) {
        JLaunchMenu.cascadeFrames();
      }

      public void internalFrameDeiconified(InternalFrameEvent evt) {
View Full Code Here


  InterfaceThread interfaceThread;

  public JInternalFrameInterfaceControl()
  {
    super();
    addInternalFrameListener(new InternalFrameAdapter() {
      public void internalFrameClosing(final InternalFrameEvent e) {
        if (ConfirmExit() == true)
        {
          dispose();
        }
View Full Code Here

  public JInternalFrameMHNProperties(String mhnNumber) {

    super();
   
    addInternalFrameListener(new InternalFrameAdapter()
    {
      @Override
      public void internalFrameClosing(InternalFrameEvent e)
      {
        save();
View Full Code Here

  private PreparedStatement listStatement;
  private JButton4j jButtonAssign;

  public JInternalFramePackLabelPrint()
  {
    addInternalFrameListener(new InternalFrameAdapter()
    {
      public void internalFrameClosing(InternalFrameEvent e)
      {
        timer.stop();
View Full Code Here

        JInternalFrame internalFrame = outputDisplayManager.showResultFrame(editor, target, messageTitle, errorString);
   
        if (editor != null) {
            // This bit of code ensures that some 'clean-up' code is done when the result internal frame is closed.
            // (ie. Need to update the ValueEditorHierarchy)
            internalFrame.addInternalFrameListener(new InternalFrameAdapter() {
       
                private final ValueEditor resultEditor = editor;
           
                public void internalFrameClosing(InternalFrameEvent e) {
                    outputPanelHierarchyManager.removeValueEditor(resultEditor, true);
View Full Code Here

            }

      _browser.setFrameIcon(getIcon16());
      _browserOpen = true;

            _browser.addInternalFrameListener(new InternalFrameAdapter()
      {
        /**
         * Invoked when an internal frame has been closed.
         */
        public void internalFrameClosed(InternalFrameEvent e)
View Full Code Here

        final AgentRunInternalFrame agentFrame = new AgentRunInternalFrame();
        agentFrame.setAgentGui(agentGui, agent);

        // Set closing listener.
        agentFrame.setClosable(true);
        agentFrame.addInternalFrameListener(new InternalFrameAdapter() {

            /**
             * Sets <code>dispose()</code> on the agent GUI, such that no client
             * will try to work on it, even if that client still has a reference
             * to the agent GUI.
View Full Code Here

    /**
     * Method to control the display of the glasspane, dependant
     * on the frame being active or not
     */
    protected void addFrameListener() {
        addInternalFrameListener(new InternalFrameAdapter() {

            @Override
            public void internalFrameActivated(InternalFrameEvent e) {
                if (hasChildFrame() == true) {
                    getGlassPane().setVisible(true);
View Full Code Here

      if (m_GUIType == GUI_MDI) {
        final ChildFrameMDI frame = (ChildFrameMDI) c;
        Point l = panel.getFrameLocation();
        if ((l.x != -1) && (l.y != -1))
    frame.setLocation(l);
        frame.addInternalFrameListener(new InternalFrameAdapter() {
    public void internalFrameClosing(InternalFrameEvent e) {
      panel.stopMonitoring();
    }
        });
      }
      else {
        final ChildFrameSDI frame = (ChildFrameSDI) c;
        Point l = panel.getFrameLocation();
        if ((l.x != -1) && (l.y != -1))
    frame.setLocation(l);
        frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
      panel.stopMonitoring();
    }
        });
      }
    }
    else {
      showWindow(getWindow(title));
    }
  }
      });

      jMenuProgram.add(new JSeparator());

      // Program/Exit
      jMenuItemProgramExit = new JMenuItem();
      jMenuProgram.add(jMenuItemProgramExit);
      jMenuItemProgramExit.setText("Exit");
      jMenuItemProgramExit.setMnemonic('E');
      jMenuItemProgramExit.addActionListener(new ActionListener() { 
  public void actionPerformed(ActionEvent evt) {
    // close all children
    Iterator iter = getWindowList();
    Vector<Container> list = new Vector<Container>();
    while (iter.hasNext())
      list.add((Container) iter.next());
    for (int i = 0; i < list.size(); i++) {
      Container c = list.get(i);
      if (c instanceof ChildFrameMDI)
        ((ChildFrameMDI) c).dispose();
      else if (c instanceof ChildFrameSDI)
        ((ChildFrameSDI) c).dispose();
    }
    // close logwindow
    m_LogWindow.dispose();
    // close main window
    m_Self.dispose();
    // make sure we stop
    System.exit(0);
  }
      });

      // Applications
      jMenuApplications = new JMenu();
      jMenuBar.add(jMenuApplications);
      jMenuApplications.setText("Applications");
      jMenuApplications.setMnemonic('A');

      // Applications/Explorer
      jMenuItemApplicationsExplorer = new JMenuItem();
      jMenuApplications.add(jMenuItemApplicationsExplorer);
      jMenuItemApplicationsExplorer.setText("Explorer");
      jMenuItemApplicationsExplorer.setMnemonic('E');
      jMenuItemApplicationsExplorer.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent evt) {
    String title = jMenuItemApplicationsExplorer.getText();
    if (!containsWindow(title)) {
      createFrame(
    m_Self, title, new Explorer(), new BorderLayout(),
    BorderLayout.CENTER, 800, 600, null, true, true);
    }
    else {
      showWindow(getWindow(title));
    }
  }
      });

      // Applications/Experimenter
      jMenuItemApplicationsExperimenter = new JMenuItem();
      jMenuApplications.add(jMenuItemApplicationsExperimenter);
      jMenuItemApplicationsExperimenter.setText("Experimenter");
      jMenuItemApplicationsExperimenter.setMnemonic('X');
      jMenuItemApplicationsExperimenter.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent evt) {
    String title = jMenuItemApplicationsExperimenter.getText();
    if (!containsWindow(title)) {
      createFrame(
    m_Self, title, new Experimenter(false), new BorderLayout(),
    BorderLayout.CENTER, 800, 600, null, true, true);
    }
    else {
      showWindow(getWindow(title));
    }
  }
      });

      // Applications/KnowledgeFlow
      jMenuItemApplicationsKnowledgeFlow = new JMenuItem();
      jMenuApplications.add(jMenuItemApplicationsKnowledgeFlow);
      jMenuItemApplicationsKnowledgeFlow.setText("KnowledgeFlow");
      jMenuItemApplicationsKnowledgeFlow.setMnemonic('K');
      jMenuItemApplicationsKnowledgeFlow.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent evt) {
    String title = jMenuItemApplicationsKnowledgeFlow.getText();
    if (!containsWindow(title)) {
      KnowledgeFlowApp.createSingleton(new String[0]);
      createFrame(
    m_Self, title, KnowledgeFlowApp.getSingleton(), new BorderLayout(),
    BorderLayout.CENTER, 900, 600, null, true, true);
    }
    else {
      showWindow(getWindow(title));
    }
  }
      });

      // Applications/SimpleCLI
      jMenuItemApplicationsSimpleCLI = new JMenuItem();
      jMenuApplications.add(jMenuItemApplicationsSimpleCLI);
      jMenuItemApplicationsSimpleCLI.setText("SimpleCLI");
      jMenuItemApplicationsSimpleCLI.setMnemonic('S');
      jMenuItemApplicationsSimpleCLI.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent evt) {
    String title = jMenuItemApplicationsSimpleCLI.getText();
    if (!containsWindow(title)) {
      try {
        createFrame(
      m_Self, title, new SimpleCLIPanel(), new BorderLayout(),
      BorderLayout.CENTER, 600, 500, null, true, true);
      }
      catch (Exception e) {
        e.printStackTrace();
        JOptionPane.showMessageDialog(
      m_Self, "Error instantiating SimpleCLI:\n" + e.getMessage());
        return;
      }
    }
    else {
      showWindow(getWindow(title));
    }
  }
      });

      // Tools
      jMenuTools = new JMenu();
      jMenuBar.add(jMenuTools);
      jMenuTools.setText("Tools");
      jMenuTools.setMnemonic('T');

      // Tools/ArffViewer
      jMenuItemToolsArffViewer = new JMenuItem();
      jMenuTools.add(jMenuItemToolsArffViewer);
      jMenuItemToolsArffViewer.setText("ArffViewer");
      jMenuItemToolsArffViewer.setMnemonic('A');
      jMenuItemToolsArffViewer.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent evt) {
    String title = jMenuItemToolsArffViewer.getText();
    if (!containsWindow(title)) {
      ArffViewerMainPanel panel = new ArffViewerMainPanel(null);
      panel.setConfirmExit(false);
      Container frame = createFrame(
    m_Self, title, panel, new BorderLayout(),
    BorderLayout.CENTER, 800, 600, panel.getMenu(), true, true);
      panel.setParent(frame);
    }
    else {
      showWindow(getWindow(title));
    }
  }
      });

      // Tools/SqlViewer
      jMenuItemToolsSqlViewer = new JMenuItem();
      jMenuTools.add(jMenuItemToolsSqlViewer);
      jMenuItemToolsSqlViewer.setText("SqlViewer");
      jMenuItemToolsSqlViewer.setMnemonic('S');
      jMenuItemToolsSqlViewer.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent evt) {
    String title = jMenuItemToolsSqlViewer.getText();
    if (!containsWindow(title)) {
      final SqlViewer sql = new SqlViewer(null);
      final Container frame = createFrame(
    m_Self, title, sql, new BorderLayout(),
    BorderLayout.CENTER, -1, -1, null, false, true);

      // custom listener
      if (frame instanceof ChildFrameMDI) {
        ((ChildFrameMDI) frame).addInternalFrameListener(new InternalFrameAdapter() {
    public void internalFrameClosing(InternalFrameEvent e) {
      sql.saveSize();
      ((ChildFrameMDI) frame).dispose();
    }
        });
      }
      else if (frame instanceof ChildFrameSDI) {
        ((ChildFrameSDI) frame).addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
      sql.saveSize();
      ((ChildFrameSDI) frame).dispose();
    }
        });
      }
    }
    else {
      showWindow(getWindow(title));
    }
  }
      });
     
      // Tools/Bayes net editor
      // Tools/Bayes net editor
      final JMenuItem jMenuItemBayesNet = new JMenuItem();
      jMenuTools.add(jMenuItemBayesNet);
      jMenuItemBayesNet.setText("Bayes net editor");
      jMenuItemBayesNet.setMnemonic('N');

      jMenuItemBayesNet.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          String title = jMenuItemBayesNet.getText();
         
          if (!containsWindow(title)) {
            final GUI bayesNetGUI = new GUI();
            final Container frame = createFrame(
                m_Self, title, bayesNetGUI, new BorderLayout(),
                BorderLayout.CENTER, 800, 600, bayesNetGUI.getMenuBar(), false, true);
          }
          else {
            showWindow(getWindow(title));
          }         
        }      
      });

      // Tools/Groovy console
      if (Groovy.isPresent()) {
  jMenuItemToolsGroovyConsole = new JMenuItem();
  jMenuTools.add(jMenuItemToolsGroovyConsole);
  jMenuItemToolsGroovyConsole.setText("Groovy console");
  jMenuItemToolsGroovyConsole.setMnemonic('G');
  jMenuItemToolsGroovyConsole.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
      String title = jMenuItemToolsGroovyConsole.getText();
      if (!containsWindow(title)) {
        final GroovyPanel panel = new GroovyPanel();
        final Container frame = createFrame(
      m_Self, title, panel, new BorderLayout(),
      BorderLayout.CENTER, 800, 600, panel.getMenuBar(), false, true);

        // custom listener
        if (frame instanceof ChildFrameMDI) {
    ((ChildFrameMDI) frame).addInternalFrameListener(new InternalFrameAdapter() {
      public void internalFrameClosing(InternalFrameEvent e) {
        ((ChildFrameMDI) frame).dispose();
      }
    });
        }
        else if (frame instanceof ChildFrameSDI) {
    ((ChildFrameSDI) frame).addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {
        ((ChildFrameSDI) frame).dispose();
      }
    });
        }
      }
      else {
        showWindow(getWindow(title));
      }
    }
  });
      }

      // Tools/Jython console
      if (Jython.isPresent()) {
  jMenuItemToolsJythonConsole = new JMenuItem();
  jMenuTools.add(jMenuItemToolsJythonConsole);
  jMenuItemToolsJythonConsole.setText("Jython console");
  jMenuItemToolsJythonConsole.setMnemonic('J');
  jMenuItemToolsJythonConsole.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent evt) {
      String title = jMenuItemToolsJythonConsole.getText();
      if (!containsWindow(title)) {
        final JythonPanel panel = new JythonPanel();
        final Container frame = createFrame(
      m_Self, title, panel, new BorderLayout(),
      BorderLayout.CENTER, 800, 600, panel.getMenuBar(), false, true);

        // custom listener
        if (frame instanceof ChildFrameMDI) {
    ((ChildFrameMDI) frame).addInternalFrameListener(new InternalFrameAdapter() {
      public void internalFrameClosing(InternalFrameEvent e) {
        ((ChildFrameMDI) frame).dispose();
      }
    });
        }
View Full Code Here

    public ChildFrameMDI(Main parent, String title) {
      super(title, true, true, true, true);
     
      m_Parent = parent;

      addInternalFrameListener(new InternalFrameAdapter() {
  public void internalFrameActivated(InternalFrameEvent e) {
    // update title of parent
    if (getParentFrame() != null)
      getParentFrame().createTitle(getTitle());
  }
View Full Code Here

TOP

Related Classes of javax.swing.event.InternalFrameAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.