/** Set the tool tip texts (used for language change, and at initialization labels). */
 public void setLabels() {
   btnColumns.setToolTipText(loc.getMenuTooltip("Columns"));
   btnOptions.setToolTipText(loc.getMenuTooltip("Options"));
   btnExport.setToolTipText(loc.getPlainTooltip("ExportAsWebpage"));
   btnPrint.setToolTipText(loc.getMenuTooltip("Print"));
   btnHelp.setToolTipText(loc.getMenuTooltip("FastHelp"));
   miShowOnlyBreakpoints.setText(loc.getPlain("ShowOnlyBreakpoints"));
   miColorfulConstructionProtocol.setText(loc.getPlain("ColorfulConstructionProtocol"));
 }
Пример #2
0
  /** @see org.jgraph.pad.actions.IpssAbstractGraphAction#getMenuComponent(String) */
  protected Component getMenuComponent(String actionCommand) {
    JCheckBoxMenuItem button = new JCheckBoxMenuItem(this);
    abstractButtons.add(button);
    GPBarFactory.fillMenuButton(button, getName(), actionCommand);
    String presentationText = getPresentationText(actionCommand);
    if (presentationText != null) button.setText(presentationText);

    return button;
  }
Пример #3
0
 /** Rename an Editor type panel in Show Panels sub menu */
 public void renameEditorPanel(Editor panel) {
   if (panelsList.size() == 0) {
     return;
   }
   for (int i = 0; i < panelsList.size(); i++) {
     Object o = panelsList.get(i);
     if (o == panel) {
       JCheckBoxMenuItem r = (JCheckBoxMenuItem) panelsSubMenu.getItem(i);
       r.setText(panel.getTitle());
       return;
     }
   }
 }
  /**
   * Sets the text of the ACIDE - A Configurable IDE database panel menu components with the labels
   * in the selected language to display.
   */
  public void setTextOfMenuComponents() {

    // Sets the name menu item text
    _nameMenuItem.setText(AcideLanguageManager.getInstance().getLabels().getString("s2272"));

    // Sets the name fields menu item text
    _nameFieldsMenuItem.setText(AcideLanguageManager.getInstance().getLabels().getString("s2273"));

    // Sets the name fields types menu item text
    _nameFieldsTypesMenuItem.setText(
        AcideLanguageManager.getInstance().getLabels().getString("s2274"));

    Iterator<AcideMenuObjectConfiguration> it = _insertedObjects.iterator();
    while (it.hasNext()) {
      AcideMenuObjectConfiguration ob = it.next();
      if (ob.isSubmenu()) {
        _insertedMenus.get(ob.getName()).setText(ob.getName());
        _insertedMenus.get(ob.getName()).setTextOfMenuComponents();
      } else {
        _insertedItems.get(ob.getName()).setText(ob.getName());
      }
    }
  }
Пример #5
0
 private JCheckBoxMenuItem getMenuViewImage() {
   if (menuViewImage == null) {
     menuViewImage = new JCheckBoxMenuItem();
     menuViewImage.setText(Constant.messages.getString("menu.view.enableImage")); // ZAP: i18n
     menuViewImage.addItemListener(
         new java.awt.event.ItemListener() {
           @Override
           public void itemStateChanged(java.awt.event.ItemEvent e) {
             getModel()
                 .getOptionsParam()
                 .getViewParam()
                 .setProcessImages(getMenuViewImage().getState() ? 1 : 0);
           }
         });
   }
   return menuViewImage;
 }
Пример #6
0
  private void MenuConstructor() {

    jcbmiX = new javax.swing.JCheckBoxMenuItem();

    jmLF.setText(
        "\u0412\u044a\u043d\u0448\u0435\u043d \u0432\u0438\u0434 \u043d\u0430 \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u0430\u0442\u0430");
    jcbmiX.setText(
        "\u041f\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043d\u0435");
    jcbmiX.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jcbmiXActionPerformed(evt);
          }
        });
    jmLF.add(jcbmiX);

    // TODO da se izwlekat temite ot available_lafs.xml w HashMap i po nego da se postroi meniuto
    // (Array ot JCheckBoxMenuItem(s))

  }
  // TODO
  // change into addToggleAction
  public void addPredicateAction(
      String category,
      String name,
      String description,
      String tooltip,
      Icon icon,
      final Predicate predicate,
      boolean initialValue) {

    final JCheckBoxMenuItem checkBox = MenuBar.makeMenuItem(name, JCheckBoxMenuItem.class);
    checkBox.setIcon(icon);
    checkBox.setText(description);
    checkBox.setToolTipText(tooltip);
    checkBox.setSelected(initialValue);
    checkBox.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            predicate.set(checkBox.isSelected());
            fireCodeChanged(false);
          }
        });
    menuBar.addItem(category, checkBox);
  }
Пример #8
0
  private void jbInit() throws Exception {
    borderForProjectView = BorderFactory.createLineBorder(Color.black, 2);
    titleBoderForProjectView = new TitledBorder(borderForProjectView, "Project view");
    borderForEntitiesView = BorderFactory.createLineBorder(Color.black, 2);
    titledBorderForEntitiesView = new TitledBorder(borderForEntitiesView, "Entities view");
    titledBorderForMessagesPane =
        new TitledBorder(
            BorderFactory.createEtchedBorder(Color.white, new Color(148, 145, 140)), "Messages");
    this.getContentPane().setLayout(borderLayout2);
    file.setText("File");
    save.setEnabled(false);
    save.setText("Save");
    save.setName("Savefilemenu");
    save.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            save_actionPerformed(e);
          }
        });
    load.setText("Load");
    load.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            load_actionPerformed(e);
          }
        });
    this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    this.setJMenuBar(mainMenuBar);
    this.setTitle("INGENIAS Development Kit");
    this.setSize(625, 470);
    this.addWindowListener(
        new java.awt.event.WindowAdapter() {
          public void windowClosed(WindowEvent e) {
            this_windowClosed(e);
          }

          public void windowClosing(WindowEvent e) {
            this_windowClosing(e);
          }
        });
    splitPaneSeparatingProjectsAndEntitiesView.setOrientation(JSplitPane.VERTICAL_SPLIT);
    splitPaneSeparatingProjectsAndEntitiesView.setBottomComponent(scrollPaneForEntitiesView);
    splitPaneSeparatingProjectsAndEntitiesView.setTopComponent(scrollPaneForProyectView);
    jPanel1.setLayout(gridLayout1);
    arbolObjetos.addMouseListener(
        new java.awt.event.MouseAdapter() {
          public void mouseClicked(MouseEvent e) {
            arbolObjetos_mouseClicked(e);
          }
        });
    scrollPaneForProyectView.setAutoscrolls(true);
    scrollPaneForProyectView.setBorder(titleBoderForProjectView);
    scrollPaneForEntitiesView.setBorder(titledBorderForEntitiesView);
    edit.setText("Edit");
    copyImage.setText("Copy diagram as a file");
    copyImage.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            capture_actionPerformed(e);
          }
        });
    saveas.setText("Save as");
    saveas.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            saveas_actionPerformed(e);
          }
        });
    help.setText("Help");
    manual.setText("Tool manual");
    manual.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            manual_actionPerformed(e);
          }
        });
    about.setText("About");
    about.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            about_actionPerformed(e);
          }
        });
    project.setText("Project");
    copy.setText("Copy");
    copy.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            copy_actionPerformed(e);
          }
        });
    paste.setText("Paste");
    paste.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            paste_actionPerformed(e);
          }
        });
    exit.setText("Exit");
    exit.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            exit_actionPerformed(e);
          }
        });
    splitPanelDiagramMessagesPaneSeparator.setOrientation(JSplitPane.VERTICAL_SPLIT);
    splitPanelDiagramMessagesPaneSeparator.setLastDividerLocation(150);
    pprin.setLayout(new BorderLayout());
    pprin.setName("DiagramPane");
    pprin.setPreferredSize(new Dimension(400, 300));
    pprin.add(BorderLayout.SOUTH, pbar);
    pbar.setVisible(false);
    jSplitPane1.setOrientation(JSplitPane.HORIZONTAL_SPLIT);

    scrollLogs.setBorder(titledBorderForMessagesPane);
    scrollLogs.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyPressed(KeyEvent e) {
            jScrollPane3_keyPressed(e);
          }
        });
    this.clearMessages.setText("Clear");
    clearMessages.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            clearMessages_actionPerformed(e, (JTextPane) messagesMenu.getInvoker());
          }
        });
    forcegc.setText("Force GC");
    forcegc.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            forcegc_actionPerformed(e);
          }
        });

    menuTools.setText("Tools");
    menuCodeGenerator.setText("Code Generator");
    profiles.setText("Profiles");

    menuModules.setText("Modules");
    this.properties.setText("Properties");
    properties.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            properties_actionPerformed(e);
          }
        });
    moutput.setEditable(false);
    moutput.setSelectionStart(0);
    moutput.setText("");
    moduleOutput.addMouseListener(
        new java.awt.event.MouseAdapter() {
          public void mouseClicked(MouseEvent e) {
            moduleOutput_mouseClicked(e);
          }
        });
    moduleOutput.setFont(new java.awt.Font("Monospaced", 0, 11));
    logs.setContentType("text/html");
    logs.setEditable(false);
    logs.setText("");
    logs.addMouseListener(
        new java.awt.event.MouseAdapter() {
          public void mouseClicked(MouseEvent e) {
            logs_mouseClicked(e);
          }
        });
    logs.addComponentListener(
        new java.awt.event.ComponentAdapter() {
          public void componentResized(ComponentEvent e) {
            logs_componentResized(e);
          }
        });
    newProject.setText("New");
    newProject.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            newProject_actionPerformed(e);
          }
        });
    undo.setText("Undo");
    undo.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            undo_actionPerformed(e);
          }
        });
    redo.setText("Redo");
    redo.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            redo_actionPerformed(e);
          }
        });
    delete.setText("Delete");
    delete.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            delete_actionPerformed(e);
          }
        });
    selectall.setText("Select all");
    selectall.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            selectall_actionPerformed(e);
          }
        });
    cpClipboard.setText("Copy diagram to clipboard");
    cpClipboard.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            cpClipboard_actionPerformed(e);
          }
        });
    preferences.setText("Preferences");

    enableUMLView.setToolTipText("UML view" + "instead of its type");
    enableUMLView.setText("Enable UML view from now on");
    enableUMLView.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            enableUMLView_actionPerformed(e);
          }
        });
    enableINGENIASView.setToolTipText("INGENIAS view");
    enableINGENIASView.setText("Enable INGENIAS view from now on");
    enableINGENIASView.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            enableINGENIASView_actionPerformed(e);
          }
        });

    switchINGENIASView.setToolTipText("Switch to INGENIAS view");
    switchINGENIASView.setText("Switch to INGENIAS view");
    switchINGENIASView.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            switchINGENIASView_actionPerformed(e);
          }
        });

    switchUMLView.setToolTipText("Switch to UML view");
    switchUMLView.setText("Switch to UML view");
    switchUMLView.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            switchUMLView_actionPerformed(e);
          }
        });

    resizeAll.setToolTipText("Resize all");
    resizeAll.setText("Resize all entities within current diagram");
    resizeAll.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            resizeAll_actionPerformed(e);
          }
        });

    resizeAllDiagrams.setToolTipText("Resize all diagrams");
    resizeAllDiagrams.setText("Resize all entities within all defined diagram");
    resizeAllDiagrams.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            resizeAllDiagrams_actionPerformed(e);
          }
        });

    JMenuItem workspaceEntry = new JMenuItem("Switch workspace");
    workspaceEntry.setToolTipText("Change current workspace");
    workspaceEntry.setText("Switch workspace");
    workspaceEntry.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            changeWorkspace(e);
          }
        });
    preferences.add(workspaceEntry);
    preferences.add(resizeAll);
    preferences.add(resizeAllDiagrams);
    {
      elimOverlap = new JMenuItem();
      preferences.add(elimOverlap);
      elimOverlap.setText("Eliminate overlap");
      elimOverlap.setAccelerator(KeyStroke.getKeyStroke("F3"));
      elimOverlap.addMenuKeyListener(
          new MenuKeyListener() {
            public void menuKeyPressed(MenuKeyEvent evt) {
              System.out.println("elimOverlap.menuKeyPressed, event=" + evt);
              // TODO add your code for elimOverlap.menuKeyPressed
            }

            public void menuKeyReleased(MenuKeyEvent evt) {
              System.out.println("elimOverlap.menuKeyReleased, event=" + evt);
              // TODO add your code for elimOverlap.menuKeyReleased
            }

            public void menuKeyTyped(MenuKeyEvent evt) {
              elimOverlapMenuKeyTyped(evt);
            }
          });
      elimOverlap.addKeyListener(
          new KeyAdapter() {
            public void keyPressed(KeyEvent evt) {
              elimOverlapKeyPressed(evt);
            }
          });
      elimOverlap.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              elimOverlapActionPerformed(evt);
            }
          });
    }
    {
      modelingLanguageNotationSwitchMenu = new JMenu();
      preferences.add(modelingLanguageNotationSwitchMenu);
      modelingLanguageNotationSwitchMenu.setText("Modelling language");
      modelingLanguageNotationSwitchMenu.add(enableINGENIASView);

      viewSelection.add(enableINGENIASView);
      modelingLanguageNotationSwitchMenu.add(enableUMLView);
      viewSelection.add(enableUMLView);

      enableINGENIASView.setSelected(true);
      modelingLanguageNotationSwitchMenu.add(switchUMLView);
      modelingLanguageNotationSwitchMenu.add(switchINGENIASView);
    }
    {
      propertiesModeMenu = new JMenu();
      preferences.add(propertiesModeMenu);
      propertiesModeMenu.setText("Edit Properties Mode");
      {
        editPopUpProperties = new JCheckBoxMenuItem();
        propertiesModeMenu.add(editPopUpProperties);
        editPopUpProperties.setText("Edit Properties in a PopUp Window");
        editPopUpProperties.setSelected(true);
        editPopUpProperties.addActionListener(
            new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                editPopUpProperties_selected();
              }
            });
        propertiesEditModeSelection.add(editPopUpProperties);
      }
      {
        editOnMessages = new JCheckBoxMenuItem();
        propertiesModeMenu.add(editOnMessages);
        editOnMessages.setText("Edit Properties in Messages Panel");
        propertiesEditModeSelection.add(editOnMessages);
        editOnMessages.addActionListener(
            new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                editOnMessages_selected();
              }
            });
      }
    }

    mainMenuBar.add(file);
    mainMenuBar.add(edit);
    mainMenuBar.add(project);
    mainMenuBar.add(menuModules);
    mainMenuBar.add(profiles);
    mainMenuBar.add(preferences);
    mainMenuBar.add(help);
    file.add(newProject);
    file.add(load);
    {
      importFile = new JMenuItem();
      file.add(importFile);
      importFile.setText("Import file");
      importFile.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              importFileActionPerformed(evt);
            }
          });
    }
    file.add(save);
    file.add(saveas);
    file.addSeparator();
    file.add(exit);
    file.addSeparator();
    rightPanel.setLayout(new BorderLayout());
    rightPanel.add(buttonModelPanel, BorderLayout.WEST);
    this.getContentPane().add(jSplitPane1, BorderLayout.CENTER);
    rightPanel.add(splitPanelDiagramMessagesPaneSeparator, BorderLayout.CENTER);
    jSplitPane1.add(splitPaneSeparatingProjectsAndEntitiesView, JSplitPane.LEFT);
    splitPaneSeparatingProjectsAndEntitiesView.add(scrollPaneForProyectView, JSplitPane.TOP);
    {
      jPanel2 = new JPanel();
      BorderLayout jPanel2Layout = new BorderLayout();
      jPanel2.setLayout(jPanel2Layout);
      splitPaneSeparatingProjectsAndEntitiesView.add(jPanel2, JSplitPane.BOTTOM);
      jPanel2.add(jPanel1, BorderLayout.SOUTH);
      jPanel2.add(scrollPaneForEntitiesView, BorderLayout.CENTER);
    }
    jSplitPane1.add(rightPanel, JSplitPane.RIGHT);
    splitPanelDiagramMessagesPaneSeparator.add(pprin, JSplitPane.TOP);
    splitPanelDiagramMessagesPaneSeparator.add(messagespane, JSplitPane.BOTTOM);
    JScrollPane scrollSearchDiagram = new JScrollPane();
    scrollSearchDiagram.getViewport().add(searchDiagramPanel, null);
    searchDiagramPanel.setContentType("text/html");
    searchDiagramPanel.setEditable(false);

    messagespane.addConventionalTab(scrollLogs, "Logs");
    scrollLogs.getViewport().add(logs, null);
    scrolloutput.getViewport().add(this.moduleOutput, null);
    messagespane.addConventionalTab(scrolloutput, "Module Output");
    messagespane.addConventionalTab(scrollSearchDiagram, "Search");
    scrolloutput.getViewport().add(moduleOutput, null);
    {
      searchPanel = new JPanel();
      FlowLayout searchPanelLayout = new FlowLayout();
      searchPanelLayout.setVgap(1);
      searchPanel.setLayout(searchPanelLayout);
      jPanel1.add(searchPanel, BorderLayout.SOUTH);
      searchPanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
      {
        searchField = new JTextField();
        searchPanel.add(searchField);
        searchField.setColumns(15);

        searchField.addKeyListener(
            new KeyAdapter() {
              public void keyTyped(KeyEvent evt) {
                searchFieldKeyTyped(evt);
              }
            });
      }
      {
        Search = new JButton();
        scrollPaneForProyectView.setViewportView(arbolProyectos);
        scrollPaneForEntitiesView.setViewportView(arbolObjetos);
        searchPanel.add(Search);

        Search.setIcon(new ImageIcon(ImageLoader.getImage(("images/lense.png"))));
        //	Search.setPreferredSize(new java.awt.Dimension(20, 20));
        Search.setIconTextGap(0);
        Search.addActionListener(
            new ActionListener() {
              public void actionPerformed(ActionEvent evt) {
                SearchActionPerformed(evt);
              }
            });
      }
    }
    edit.add(undo);
    edit.add(redo);
    edit.addSeparator();
    edit.add(copy);
    edit.add(paste);
    edit.add(delete);
    edit.add(selectall);
    edit.addSeparator();
    edit.add(copyImage);
    edit.add(cpClipboard);
    help.add(manual);
    help.add(about);
    help.add(forcegc);

    menuModules.add(menuTools);
    menuModules.add(menuCodeGenerator);
    messagesMenu.add(this.clearMessages);
    project.add(this.properties);

    project.addSeparator();
    jSplitPane1.setDividerLocation(250);
    splitPaneSeparatingProjectsAndEntitiesView.setDividerLocation(250);
    arbolProyectos.addMouseListener(
        new java.awt.event.MouseAdapter() {
          public void mouseClicked(MouseEvent e) {
            arbolProyectos_mouseClicked(e);
          }
        });
    splitPanelDiagramMessagesPaneSeparator.setDividerLocation(400);
  }
  public JMenuBar getMenuBar() {
    jMenuAbout.setText("About");
    jMenuAbout.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.jMenuHelpAbout_actionPerformed(e);
          }
        });
    jMenuView.setText("View");

    jMenuFileExit.setText("Exit");
    jMenuFileExit.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.jMenuFileExit_actionPerformed(e);
          }
        });
    jMenuEdit.setText("Edit");
    menuExchangeGeom.setText("Exchange Geometries");
    menuExchangeGeom.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.menuExchangeGeom_actionPerformed(e);
          }
        });
    menuViewText.setText("Test Case Text...");
    menuViewText.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.menuViewText_actionPerformed(e);
          }
        });
    menuViewGeometry.setText("Geometry Inspector...");
    menuViewGeometry.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.actionInspectGeometry();
          }
        });
    menuLoadXmlTestFile.setText("Open XML File(s)...");
    menuLoadXmlTestFile.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.menuLoadXmlTestFile_actionPerformed(e);
          }
        });
    saveAsXmlMenuItem.setText("Save As XML...");
    saveAsXmlMenuItem.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.menuSaveAsXml_actionPerformed(e);
          }
        });
    saveAsHtmlMenuItem.setText("Save As HTML...");
    saveAsHtmlMenuItem.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.menuSaveAsHtml_actionPerformed(e);
          }
        });
    saveAsPNGMenuItem.setText("Save As PNG...");
    saveAsPNGMenuItem.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.menuSaveAsPNG_actionPerformed(e);
          }
        });
    saveToClipboardMenuItem.setText("Save Screen To Clipboard");
    saveToClipboardMenuItem.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.menuSaveScreenToClipboard_actionPerformed(e);
          }
        });
    deleteAllTestCasesMenuItem.setText("Delete All Test Cases");
    deleteAllTestCasesMenuItem.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.deleteAllTestCasesMenuItem_actionPerformed(e);
          }
        });
    showVerticesMenuItem.setText("Vertices");
    showVerticesMenuItem.setSelected(true);
    showVerticesMenuItem.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.setShowingVertices(showVerticesMenuItem.isSelected());
          }
        });
    final JCheckBoxMenuItem showLabelMenuItem = menuItem("Labels", true);
    showLabelMenuItem.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.setShowingLabel(showLabelMenuItem.isSelected());
          }
        });
    showGridMenuItem.setText("Grid");
    showGridMenuItem.setSelected(true);
    showGridMenuItem.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.setShowingGrid(showGridMenuItem.isSelected());
          }
        });
    showStructureMenuItem.setText("Geometry Structure");
    showStructureMenuItem.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.setShowingStructure(showStructureMenuItem.isSelected());
          }
        });
    showOrientationsMenuItem.setText("Orientations");
    showOrientationsMenuItem.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.setShowingOrientations(showOrientationsMenuItem.isSelected());
          }
        });
    showVertexIndicesMenuItem.setText("Vertex Indices");
    showVertexIndicesMenuItem.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.setShowingVertices(showVerticesMenuItem.isSelected());
          }
        });
    menuLoadXmlTestFolder.setText("Open XML Folder(s)...");
    menuLoadXmlTestFolder.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.menuLoadXmlTestFolder_actionPerformed(e);
          }
        });
    precisionModelMenuItem.setText("Precision Model...");
    precisionModelMenuItem.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.precisionModelMenuItem_actionPerformed(e);
          }
        });
    removeDuplicatePoints.setText("Remove Duplicate Points");
    removeDuplicatePoints.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.menuRemoveDuplicatePoints_actionPerformed(e);
          }
        });
    changeToLines.setText("Change to Lines");
    changeToLines.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            tbFrame.menuChangeToLines_actionPerformed(e);
          }
        });
    generateExpectedValuesMenuItem.setText("Generate Expected Values");
    generateExpectedValuesMenuItem.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            // generateExpectedValuesMenuItem_actionPerformed(e);
          }
        });
    jMenuFile.setText("File");
    jMenuHelp.setText("Help");
    // jMenuOptions.setText("Options");
    // jMenuTools.setText("Tools");

    jMenuFile.add(menuLoadXmlTestFile);
    jMenuFile.add(menuLoadXmlTestFolder);
    jMenuFile.add(saveAsPNGMenuItem);
    jMenuFile.add(saveToClipboardMenuItem);
    jMenuFile.add(saveAsXmlMenuItem);
    jMenuFile.add(saveAsHtmlMenuItem);
    jMenuFile.add(generateExpectedValuesMenuItem);
    jMenuFile.addSeparator();
    jMenuFile.add(jMenuFileExit);

    jMenuHelp.add(jMenuAbout);

    jMenuView.add(showVerticesMenuItem);
    // jMenuOptions.add(showVertexIndicesMenuItem);
    jMenuView.add(showStructureMenuItem);
    jMenuView.add(showOrientationsMenuItem);
    jMenuView.add(showLabelMenuItem);
    jMenuView.addSeparator();
    jMenuView.add(showGridMenuItem);
    jMenuView.addSeparator();
    jMenuView.add(menuViewText);
    jMenuView.add(menuViewGeometry);

    jMenuEdit.add(deleteAllTestCasesMenuItem);
    jMenuEdit.add(menuExchangeGeom);
    jMenuEdit.addSeparator();
    jMenuEdit.add(precisionModelMenuItem);
    jMenuEdit.addSeparator();
    jMenuEdit.add(removeDuplicatePoints);
    jMenuEdit.add(changeToLines);

    jMenuBar1.add(jMenuFile);
    jMenuBar1.add(jMenuView);
    jMenuBar1.add(jMenuEdit);
    // jMenuBar1.add(jMenuOptions);
    // jMenuBar1.add(jMenuTools);
    jMenuBar1.add(jMenuHelp);

    return jMenuBar1;
  }
 JCheckBoxMenuItem menuItem(String name, boolean init) {
   JCheckBoxMenuItem item = new JCheckBoxMenuItem();
   item.setText("Labels");
   item.setSelected(init);
   return item;
 }
Пример #11
0
  /** Build the widget structure of the main window */
  private void createFrame() {

    // Set up the actions table for the whole application
    Toolkit t = Toolkit.getDefaultToolkit();
    Dimension d = t.getScreenSize();

    int width = DEFAULT_WIDTH;
    int height = d.height * 3 / 4;

    top = new JFrame();
    top.setIconImage(
        t.getImage(this.getClass().getResource(rb.getString("frame.jWinDiff.iconImage"))));
    top.setTitle(rb.getString("frame.title.scanning"));
    top.setSize(width, height);

    JPanel base = new JPanel();
    base.setLayout(new BorderLayout());
    top.getContentPane().add(base);

    pictView = new PicturePanel();
    pictView.setOpaque(true);
    pictView.setBackground(Color.white);
    base.add(pictView, BorderLayout.WEST);

    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());
    panel.setOpaque(true);
    //      panel.setBackground(Color.cyan);
    base.add(panel, BorderLayout.NORTH);

    mainView = new JList();
    mainView.setFont(new Font(rb.getString("panel.jWinDiff.font.name"), Font.PLAIN, 12));

    sp = new JScrollPane();
    sp.setViewportView(mainView);
    base.add(sp);

    // Now create each of the menus

    JMenuBar menuBar = new JMenuBar();

    // file
    JMenu menu = new JMenu();
    menu.setText(rb.getString("menu.file.text"));
    menu.setMnemonic(KeyEvent.VK_F);

    compareTargetsMenuItem = new JMenuItem();
    compareTargetsMenuItem.setText(rb.getString("menuItem.compareTargets.text"));
    compareTargetsMenuItem.setMnemonic(KeyEvent.VK_T);
    menu.add(compareTargetsMenuItem);

    menu.addSeparator();

    abortMenuItem = new JMenuItem();
    abortMenuItem.setText(rb.getString("menuItem.abort.text"));
    abortMenuItem.setMnemonic(KeyEvent.VK_A);
    abortMenuItem.setEnabled(false);
    menu.add(abortMenuItem);

    menu.addSeparator();

    saveFilelistMenuItem = new JMenuItem();
    saveFilelistMenuItem.setText(rb.getString("menuItem.saveFileList.text"));
    saveFilelistMenuItem.setMnemonic(KeyEvent.VK_S);
    menu.add(saveFilelistMenuItem);

    JMenuItem menuItem = new JMenuItem();
    menuItem.setText(rb.getString("menuItem.copyFiles.text"));
    menuItem.setMnemonic(KeyEvent.VK_C);
    menuItem.setEnabled(false);
    menu.add(menuItem);

    menuItem = new JMenuItem();
    menuItem.setText(rb.getString("menuItem.print.text"));
    menuItem.setMnemonic(KeyEvent.VK_P);
    menuItem.setEnabled(false);
    menu.add(menuItem);

    exitMenuItem = new JMenuItem();
    exitMenuItem.setText(rb.getString("menuItem.exit.text"));
    exitMenuItem.setMnemonic(KeyEvent.VK_X);
    menu.add(exitMenuItem);

    menuBar.add(menu);

    // edit
    menu = new JMenu();
    menu.setText(rb.getString("menu.edit.text"));
    menu.setMnemonic(KeyEvent.VK_E);

    editLeftMenuItem = new JMenuItem();
    editLeftMenuItem.setText(rb.getString("menuItem.editLeftFile.text"));
    editLeftMenuItem.setMnemonic(KeyEvent.VK_L);
    menu.add(editLeftMenuItem);

    editRightMenuItem = new JMenuItem();
    editRightMenuItem.setText(rb.getString("menuItem.editRightFile.text"));
    editRightMenuItem.setMnemonic(KeyEvent.VK_R);
    menu.add(editRightMenuItem);

    menuItem = new JMenuItem();
    menuItem.setText(rb.getString("menuItem.editCompositeFile.text"));
    menuItem.setMnemonic(KeyEvent.VK_C);
    menuItem.setEnabled(false);
    menu.add(menuItem);

    menu.addSeparator();

    setEditorMenuItem = new JMenuItem();
    setEditorMenuItem.setText(rb.getString("menuItem.setEditor.text"));
    setEditorMenuItem.setMnemonic(KeyEvent.VK_E);
    menu.add(setEditorMenuItem);

    menuBar.add(menu);

    // view
    ButtonGroup bg = new ButtonGroup();

    menu = new JMenu(rb.getString("menu.view.text"));
    menu.setMnemonic(KeyEvent.VK_V);

    viewOutline = new JCheckBoxMenuItem();
    viewOutline.setText(rb.getString("menuItem.outline.text"));
    viewOutline.setMnemonic(KeyEvent.VK_O);
    menu.add(viewOutline);
    bg.add(viewOutline);

    viewExpand = new JCheckBoxMenuItem();
    viewExpand.setText(rb.getString("menuItem.expand.text"));
    viewExpand.setMnemonic(KeyEvent.VK_E);
    menu.add(viewExpand);
    bg.add(viewExpand);

    menu.addSeparator();

    menuItem = new JCheckBoxMenuItem();
    menuItem.setText(rb.getString("menuItem.picture.text"));
    //      menuItem.setMnemonic(KeyEvent.VK_P); // M+p
    menuItem.setEnabled(false);
    menu.add(menuItem);

    menu.addSeparator();

    prevMenuItem = new JMenuItem();
    prevMenuItem.setText(rb.getString("menuItem.previousChange.text"));
    prevMenuItem.setMnemonic(KeyEvent.VK_P); // F7
    menu.add(prevMenuItem);

    nextMenuItem = new JMenuItem();
    nextMenuItem.setText(rb.getString("menuItem.nextChange.text"));
    nextMenuItem.setMnemonic(KeyEvent.VK_N); // F8
    menu.add(nextMenuItem);

    menu.addSeparator();

    rescanMenuItem = new JMenuItem();
    rescanMenuItem.setText(rb.getString("menuItem.rescanSelectedFile.text"));
    rescanMenuItem.setMnemonic(KeyEvent.VK_R);
    menu.add(rescanMenuItem);

    menuBar.add(menu);

    // expand
    menu = new JMenu(rb.getString("menu.expand.text"));
    menu.setMnemonic(KeyEvent.VK_X);

    bg = new ButtonGroup();

    showLeftOnly = new JCheckBoxMenuItem();
    showLeftOnly.setText(rb.getString("menuItem.leftFileOnly.text"));
    showLeftOnly.setMnemonic(KeyEvent.VK_F); // M+l
    showLeftOnly.setActionCommand(ShowExpandMode.left.name());
    menu.add(showLeftOnly);
    bg.add(showLeftOnly);

    showRightOnly = new JCheckBoxMenuItem();
    showRightOnly.setText(rb.getString("menuItem.rightFileOnly.text"));
    showRightOnly.setMnemonic(KeyEvent.VK_H); // M-r
    showRightOnly.setActionCommand(ShowExpandMode.right.name());
    menu.add(showRightOnly);
    bg.add(showRightOnly);

    showBoth = new JCheckBoxMenuItem();
    showBoth.setText(rb.getString("menuItem.bothFiles.text"));
    showBoth.setMnemonic(KeyEvent.VK_O); // M-b
    showBoth.setActionCommand(ShowExpandMode.both.name());
    showBoth.setSelected(true);
    menu.add(showBoth);
    bg.add(showBoth);

    menu.addSeparator();

    bg = new ButtonGroup();

    showLeftNums = new JCheckBoxMenuItem();
    showLeftNums.setText(rb.getString("menuItem.leftLineNumbers.text"));
    showLeftNums.setMnemonic(KeyEvent.VK_L);
    showLeftNums.setActionCommand(ShowNumMode.left.name());
    menu.add(showLeftNums);
    bg.add(showLeftNums);

    showRightNums = new JCheckBoxMenuItem();
    showRightNums.setText(rb.getString("menuItem.rightLineNumbers.text"));
    showRightNums.setMnemonic(KeyEvent.VK_R);
    showRightNums.setActionCommand(ShowNumMode.right.name());
    menu.add(showRightNums);
    bg.add(showRightNums);

    hideNums = new JCheckBoxMenuItem();
    hideNums.setText(rb.getString("menuItem.noLineNumbers.text"));
    hideNums.setMnemonic(KeyEvent.VK_N);
    hideNums.setActionCommand(ShowNumMode.none.name());
    hideNums.setSelected(true);
    menu.add(hideNums);
    bg.add(hideNums);

    menuBar.add(menu);

    // opts
    menu = new JMenu(rb.getString("menu.opts.text"));
    menu.setMnemonic(KeyEvent.VK_O);

    ignoreBlanks = new JCheckBoxMenuItem();
    ignoreBlanks.setText(rb.getString("menuItem.ignoreBlanks.text"));
    ignoreBlanks.setMnemonic(KeyEvent.VK_B);
    ignoreBlanks.setSelected(true);
    menu.add(ignoreBlanks);

    menu.addSeparator();

    menuItem = new JCheckBoxMenuItem(rb.getString("menuItem.monoColours.text"));
    menuItem.setMnemonic(KeyEvent.VK_M);
    menuItem.setEnabled(false);
    menu.add(menuItem);

    menu.addSeparator();

    showIdentical = new JCheckBoxMenuItem();
    showIdentical.setText(rb.getString("menuItem.showIdenticalFiles.text"));
    showIdentical.setMnemonic(KeyEvent.VK_I);
    showIdentical.setSelected(true);
    menu.add(showIdentical);

    showLeft = new JCheckBoxMenuItem();
    showLeft.setText(rb.getString("menuItem.showLeftOnlyFiles.text"));
    showLeft.setMnemonic(KeyEvent.VK_L);
    showLeft.setSelected(true);
    menu.add(showLeft);

    showRight = new JCheckBoxMenuItem();
    showRight.setText(rb.getString("menuItem.showRightOnlyFiles.text"));
    showRight.setMnemonic(KeyEvent.VK_R);
    showRight.setSelected(true);
    menu.add(showRight);

    showDifferent = new JCheckBoxMenuItem();
    showDifferent.setText(rb.getString("menuItem.showDifferentFiles.text"));
    showDifferent.setMnemonic(KeyEvent.VK_D);
    showDifferent.setSelected(true);
    menu.add(showDifferent);

    menuBar.add(menu);

    // mark
    menu = new JMenu();
    menu.setText(rb.getString("menu.mark.text"));
    menu.setMnemonic(KeyEvent.VK_K);

    markFileMenuItem = new JMenuItem();
    markFileMenuItem.setText(rb.getString("menuItem.markFile.text"));
    markFileMenuItem.setMnemonic(KeyEvent.VK_M); // M+m
    menu.add(markFileMenuItem);

    markPatternMenuItem = new JMenuItem();
    markPatternMenuItem.setText(rb.getString("menuItem.markPattern.text"));
    markPatternMenuItem.setMnemonic(KeyEvent.VK_P);
    menu.add(markPatternMenuItem);

    hideMarked = new JCheckBoxMenuItem();
    hideMarked.setText(rb.getString("menuItem.hideMarkedFiles.text"));
    hideMarked.setMnemonic(KeyEvent.VK_H);
    menu.add(hideMarked);

    toggleMarkedMenuItem = new JMenuItem();
    toggleMarkedMenuItem.setText(rb.getString("menuItem.toggleMarkedState.text"));
    toggleMarkedMenuItem.setMnemonic(KeyEvent.VK_T);
    menu.add(toggleMarkedMenuItem);

    menuBar.add(menu);

    // help
    menu = new JMenu();
    menu.setText(rb.getString("menu.help.text"));
    menu.setMnemonic(KeyEvent.VK_H);

    menuItem = new JMenuItem();
    menuItem.setText(rb.getString("menuItem.contents.text"));
    menuItem.setMnemonic(KeyEvent.VK_C);
    menuItem.setEnabled(false);
    menu.add(menuItem);

    menu.addSeparator();

    menuItem = new JMenuItem();
    menuItem.setText(rb.getString("menuItem.about.text"));
    menuItem.setMnemonic(KeyEvent.VK_A);
    menuItem.setEnabled(false);
    menu.add(menuItem);

    menuBar.add(menu);

    top.setJMenuBar(menuBar);

    // popup outline menu
    popupOutline = new JPopupMenu();

    markFileMenuItem.setMnemonic(KeyEvent.VK_M);
    popupOutline.add(markFileMenuItem);

    popupOutline.addSeparator();

    nextMenuItem2 = new JMenuItem();
    nextMenuItem2.setText(rb.getString("menuItem.nextChange.text"));
    nextMenuItem2.setMnemonic(KeyEvent.VK_N); // F8
    popupOutline.add(nextMenuItem2);

    prevMenuItem2 = new JMenuItem();
    prevMenuItem2.setText(rb.getString("menuItem.previousChange.text"));
    prevMenuItem2.setMnemonic(KeyEvent.VK_P); // F7
    popupOutline.add(prevMenuItem2);

    expandMenuItem = new JMenuItem();
    expandMenuItem.setText(rb.getString("button.changeMode.text.expand"));
    expandMenuItem.setMnemonic(KeyEvent.VK_E);
    popupOutline.add(expandMenuItem);

    rescanMenuItem2 = new JMenuItem();
    rescanMenuItem2.setText(rb.getString("menuItem.rescanSelectedFile.text"));
    rescanMenuItem2.setMnemonic(KeyEvent.VK_R);
    popupOutline.add(rescanMenuItem2);

    popupOutline.addSeparator();

    editLeftMenuItem2 = new JMenuItem();
    editLeftMenuItem2.setText(rb.getString("menuItem.editLeftFile.text"));
    editLeftMenuItem2.setMnemonic(KeyEvent.VK_L);
    popupOutline.add(editLeftMenuItem2);

    editRightMenuItem2 = new JMenuItem();
    editRightMenuItem2.setText(rb.getString("menuItem.editRightFile.text"));
    editRightMenuItem2.setMnemonic(KeyEvent.VK_R);
    popupOutline.add(editRightMenuItem2);

    menuItem = new JMenuItem();
    menuItem.setText(rb.getString("menuItem.editCompositeFile.text"));
    menuItem.setMnemonic(KeyEvent.VK_C);
    menuItem.setEnabled(false);
    popupOutline.add(menuItem);

    // popup expanded menu
    popupExpanded = new JPopupMenu();

    menuItem = popupExpanded.add(rb.getString("menuItem.showMoveDest.text"));
    menuItem.setMnemonic(KeyEvent.VK_S);
    menuItem.setEnabled(false);

    popupExpanded.addSeparator();

    nextMenuItem3 = new JMenuItem();
    nextMenuItem3.setText(rb.getString("menuItem.nextChange.text"));
    nextMenuItem3.setMnemonic(KeyEvent.VK_N); // F8
    popupExpanded.add(nextMenuItem3);

    prevMenuItem3 = new JMenuItem();
    prevMenuItem3.setText(rb.getString("menuItem.previousChange.text"));
    prevMenuItem3.setMnemonic(KeyEvent.VK_P); // F7
    popupExpanded.add(prevMenuItem3);

    outlineMenuItem = new JMenuItem();
    outlineMenuItem.setText(rb.getString("button.changeMode.text.outline"));
    outlineMenuItem.setMnemonic(KeyEvent.VK_O);
    popupExpanded.add(outlineMenuItem);

    rescanMenuItem3 = new JMenuItem();
    rescanMenuItem3.setText(rb.getString("menuItem.rescanSelectedFile.text"));
    rescanMenuItem3.setMnemonic(KeyEvent.VK_R);
    popupExpanded.add(rescanMenuItem3);

    popupExpanded.addSeparator();

    editLeftMenuItem3 = new JMenuItem();
    editLeftMenuItem3.setText(rb.getString("menuItem.editLeftFile.text"));
    editLeftMenuItem3.setMnemonic(KeyEvent.VK_L);
    popupExpanded.add(editLeftMenuItem3);

    editRightMenuItem3 = new JMenuItem();
    editRightMenuItem3.setText(rb.getString("menuItem.editRightFile.text"));
    editRightMenuItem3.setMnemonic(KeyEvent.VK_R);
    popupExpanded.add(editRightMenuItem3);

    menuItem = new JMenuItem();
    menuItem.setText(rb.getString("menuItem.editCompositeFile.text"));
    menuItem.setMnemonic(KeyEvent.VK_C);
    menuItem.setEnabled(false);
    popupExpanded.add(menuItem);

    // labels
    names = new JLabel();
    names.setForeground(Color.blue);
    panel.add(BorderLayout.WEST, names);

    paths = new JLabel();
    paths.setBorder(new BevelBorder(BevelBorder.LOWERED));
    panel.add(BorderLayout.CENTER, paths);

    // chageMode button
    changeMode = new JButton();
    changeMode.setMnemonic(KeyEvent.VK_D);
    panel.add(BorderLayout.EAST, changeMode);
  }