Package javax.swing.event

Examples of javax.swing.event.InternalFrameAdapter


  }

  @Override
  public void addView(final JComponent component) {
    final JInternalFrame frame = new JInternalFrame(component.getName(),true,true,true,true);
    frame.addInternalFrameListener( new InternalFrameAdapter() {

      @Override
      public void internalFrameClosed(InternalFrameEvent e) {
        logger.debug("remove component: " + component.getName());
        removeView(component);
View Full Code Here


  public AbstractModule(){
    setResizable(true);
    setClosable(true);
    setDefaultCloseOperation(JInternalFrame.HIDE_ON_CLOSE);
   
    addInternalFrameListener(new InternalFrameAdapter(){

      @Override
      public void internalFrameOpened(InternalFrameEvent e) {
        Settings.setProperty(getPropertyVisibleName(), true);
      }
View Full Code Here

  frame.setSize(width, height);
      frame.validate();

      // listener?
      if (listener) {
  frame.addInternalFrameListener(new InternalFrameAdapter() {
    public void internalFrameClosing(InternalFrameEvent e) {
      frame.dispose();
    }
  });
      }
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(Messages.getInstance().getString("Main_InitGUI_JMenuItemProgramExit_SetText_Text"));
      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(Messages.getInstance().getString("Main_InitGUI_JMenuApplications_SetText_Text"));
      jMenuApplications.setMnemonic('A');

      // Applications/Explorer
      jMenuItemApplicationsExplorer = new JMenuItem();
      jMenuApplications.add(jMenuItemApplicationsExplorer);
      jMenuItemApplicationsExplorer.setText(Messages.getInstance().getString("Main_InitGUI_JMenuItemApplicationsExplorer_SetText_Text"));
      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(Messages.getInstance().getString("Main_InitGUI_JMenuItemApplicationsExperimenter_SetText_Text"));
      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(Messages.getInstance().getString("Main_InitGUI_JMenuItemApplicationsKnowledgeFlow_SetText_Text"));
      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(Messages.getInstance().getString("Main_InitGUI_JMenuItemApplicationsSimpleCLI_SetText_Text"));
      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, Messages.getInstance().getString("Main_InitGUI_Exception_JOptionPaneShowMessageDialog_Text") + e.getMessage());
        return;
      }
    }
    else {
      showWindow(getWindow(title));
    }
  }
      });

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

      // Tools/ArffViewer
      jMenuItemToolsArffViewer = new JMenuItem();
      jMenuTools.add(jMenuItemToolsArffViewer);
      jMenuItemToolsArffViewer.setText(Messages.getInstance().getString("Main_InitGUI_JMenuItemToolsArffViewer_SetText_Text"));
      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(Messages.getInstance().getString("Main_InitGUI_JMenuItemToolsSqlViewer_SetText_Text")); //"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();
    }
        });
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

    return robotName;
  }

  private void initialize() {
    try {
      addInternalFrameListener(new InternalFrameAdapter() {
        @Override
        public void internalFrameClosing(InternalFrameEvent e) {
          if (!modified || fileSave(true)) {
            editor.setLineStatus(-1);
            dispose();
View Full Code Here

  frame.setSize(width, height);
      frame.validate();

      // listener?
      if (listener) {
  frame.addInternalFrameListener(new InternalFrameAdapter() {
    public void internalFrameClosing(InternalFrameEvent e) {
      frame.dispose();
    }
  });
      }
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();
    }
        });
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

      if ( _browserFrame == null )
      {
        _browserFrame = new JMXBrowserFrame();
        _browserFrame.setFrameIcon(getIcon16());

        _browserFrame.addInternalFrameListener(new InternalFrameAdapter()
        {
          /**
           * Invoked when an internal frame has been closed.
           */
          public void internalFrameClosed(InternalFrameEvent e)
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.