Exemple #1
0
 /**
  * Make changes to UI to notify content change
  *
  * @param contentchanged
  */
 public final void notifyContentChange(boolean contentchanged) {
   if (contentchanged) {
     this.cmdSave.setEnabled(true);
     if (ContainerComponent instanceof Frame) {
       ((Frame) ContainerComponent).setTitle(getTitle() + "*");
     } else if (ContainerComponent instanceof Dialog) {
       ((Dialog) ContainerComponent).setTitle(getTitle() + "*");
     } else if (ContainerComponent instanceof JTabbedPane) {
       if (TabId > 0) {
         // ((JTabbedPane)ContainerComponent).setTitleAt(getTabId(), getTitle() + "*");
         JTabbedPane jtb = (JTabbedPane) ContainerComponent;
         jtb.setTitleAt(jtb.indexOfComponent(this), getTitle() + "*");
       }
     }
   } else {
     this.cmdSave.setEnabled(false);
     if (ContainerComponent instanceof Frame) {
       ((Frame) ContainerComponent).setTitle(getTitle());
     } else if (ContainerComponent instanceof Dialog) {
       ((Dialog) ContainerComponent).setTitle(getTitle());
     } else if (ContainerComponent instanceof JTabbedPane) {
       if (TabId > 0) {
         // ((JTabbedPane)ContainerComponent).setTitleAt(getTabId(), getTitle());
         JTabbedPane jtb = (JTabbedPane) ContainerComponent;
         jtb.setTitleAt(jtb.indexOfComponent(this), getTitle());
       }
     }
   }
 }
Exemple #2
0
  /**
   * populates the conflict resolver with the conflicts between my and their
   *
   * @param conflict the conflict data set
   */
  public void populate(Conflict<? extends OsmPrimitive> conflict) {
    setMy(conflict.getMy());
    setTheir(conflict.getTheir());
    this.conflict = conflict;
    propertiesMerger.populate(conflict);

    tabbedPane.setEnabledAt(0, true);
    tagMerger.populate(conflict);
    tabbedPane.setEnabledAt(1, true);

    if (my instanceof Node) {
      tabbedPane.setEnabledAt(2, false);
      tabbedPane.setEnabledAt(3, false);
    } else if (my instanceof Way) {
      nodeListMerger.populate(conflict);
      tabbedPane.setEnabledAt(2, true);
      tabbedPane.setEnabledAt(3, false);
      tabbedPane.setTitleAt(3, tr("Members"));
      tabbedPane.setIconAt(3, null);
    } else if (my instanceof Relation) {
      relationMemberMerger.populate(conflict);
      tabbedPane.setEnabledAt(2, false);
      tabbedPane.setTitleAt(2, tr("Nodes"));
      tabbedPane.setIconAt(2, null);
      tabbedPane.setEnabledAt(3, true);
    }
    updateResolvedCompletely();
    selectFirstTabWithConflicts();
  }
  public void applyI18n() {
    // Start autogenerated code ----------------------
    // End autogenerated code ----------------------
    jButtonOK.setText(it.businesslogic.ireport.util.I18n.getString("ok", "Ok"));
    jButtonCancel.setText(it.businesslogic.ireport.util.I18n.getString("cancel", "Cancel"));

    jLabelCategoryExpression.setText(
        it.businesslogic.ireport.util.I18n.getString(
            "charts.categoryExpression", "Category expression"));
    jLabelSeriesExpression.setText(
        it.businesslogic.ireport.util.I18n.getString(
            "charts.seriesExpression", "Series expression"));
    jLabelValueExpression.setText(
        it.businesslogic.ireport.util.I18n.getString("charts.valueExpression", "Value expression"));
    jLabelLabelExpression.setText(
        it.businesslogic.ireport.util.I18n.getString("charts.labelExpression", "Label expression"));

    jTabbedPane1.setTitleAt(0, I18n.getString("chartSeries.tab.Data", "Data"));
    jTabbedPane1.setTitleAt(1, I18n.getString("chartSeries.tab.ItemHyperlink", "Item hyperlink"));

    this.setTitle(
        it.businesslogic.ireport.util.I18n.getString(
            "gui.ChartPropertiesDialog.title", "Chart properties"));
    this.getRootPane().updateUI();
  }
  public void setLabels() {

    // TODO --- finish set labels

    // tab titles
    tabbedPane.setTitleAt(0, app.getMenu("Properties.Basic"));
    tabbedPane.setTitleAt(1, app.getPlain("xAxis"));
    tabbedPane.setTitleAt(2, app.getPlain("yAxis"));
    tabbedPane.setTitleAt(3, app.getMenu("Grid"));

    // window dimension panel
    dimLabel[0].setText("X " + app.getPlain("min") + ":");
    dimLabel[1].setText("X " + app.getPlain("max") + ":");
    dimLabel[2].setText("Y " + app.getPlain("min") + ":");
    dimLabel[3].setText("Y " + app.getPlain("max") + ":");
    axesRatioLabel.setText(app.getPlain("xAxis") + " : " + app.getPlain("yAxis") + " = ");
    //	dimPanelTitle = "ttt";

    cbView.removeActionListener(this);
    cbView.removeAllItems();
    cbView.addItem(app.getPlain("DrawingPad"));
    cbView.addItem(app.getPlain("DrawingPad2"));
    cbView.removeActionListener(this);

    cbShowMouseCoords.setText(app.getMenu("ShowMouseCoordinates"));
  }
 private void renameCurrentPage(String _name) {
   int index = tabbedPanel.getSelectedIndex();
   if (index < 0) return;
   _name = getUniqueName(_name); // Gonzalo 070128
   tabbedPanel.setTitleAt(index, _name);
   Editor page = pageList.get(index);
   page.setName(_name);
   if (!page.isActive()) tabbedPanel.setTitleAt(index, page.getName() + " (D)");
   changed = true;
 }
 private void updateTabTitles() {
   tabbedPane.setTitleAt(
       tabbedPane.indexOfComponent(matchTable), tr(marktr("Matches ({0})"), matches.size()));
   tabbedPane.setTitleAt(
       tabbedPane.indexOfComponent(referenceOnlyList),
       tr(marktr("Reference only ({0})"), referenceOnlyListModel.size()));
   tabbedPane.setTitleAt(
       tabbedPane.indexOfComponent(subjectOnlyList),
       tr(marktr("Subject only ({0})"), subjectOnlyListModel.size()));
 }
  public void applyI18n() {
    // Start autogenerated code ----------------------
    jLabelKeyExpression.setText(
        I18n.getString("pieDatasetPanel.labelKeyExpression", "Key expression"));
    jLabelLabelExpression.setText(
        I18n.getString("pieDatasetPanel.labelLabelExpression", "Label expression"));
    jLabelValueExpression.setText(
        I18n.getString("pieDatasetPanel.labelValueExpression", "Value expression"));
    // End autogenerated code ----------------------

    jTabbedPane1.setTitleAt(0, I18n.getString("chartSeries.tab.SectionValue", "Section value"));
    jTabbedPane1.setTitleAt(
        1, I18n.getString("chartSeries.tab.SectionHyperlink", "Section hyperlink"));
  }
 private void toggleCurrentPage() {
   int index = tabbedPanel.getSelectedIndex();
   if (index < 0) return;
   Editor page = pageList.get(index);
   if (page.isActive()) {
     page.setActive(false);
     tabbedPanel.setTitleAt(index, page.getName() + " (D)");
   } else {
     page.setActive(true);
     tabbedPanel.setTitleAt(index, page.getName());
   }
   changed = true;
   ejs.getModelEditor().getVariablesEditor().updateControlValues(false);
 }
  private JTabbedPane getJTabbedPane0() {
    if (jTabbedPane0 == null) {
      jTabbedPane0 = new JTabbedPane();
      jTabbedPane0.add(
          getJSplitPane0(), new Constraints(new Bilateral(7, 0, 39), new Bilateral(7, 0, 39)));
      jTabbedPane0.setTabPlacement(JTabbedPane.LEFT);
      jTabbedPane0.setFont(new Font("Arial", Font.PLAIN, 10));

      jTabbedPane0.setTitleAt(0, "<HTML> T<BR>a<BR>s<BR>k<BR>R<BR>e<BR>p<BR>o<BR>r<BR>r<BR>t<BR>");
      jTabbedPane0.addMouseListener(
          new MouseAdapter() {

            public void mouseEntered(MouseEvent event) {
              jTabbedPane0MouseMouseEntered(event);
            }

            public void mouseClicked(MouseEvent event) {
              jTabbedPane0MouseMouseClicked(event);
            }
          });
      jTabbedPane0.addMouseWheelListener(
          new MouseWheelListener() {

            public void mouseWheelMoved(MouseWheelEvent event) {
              jTabbedPane0MouseWheelMouseWheelMoved(event);
            }
          });
    }
    return jTabbedPane0;
  }
  @Override
  public void setTitleAt(int index, String title) {
    super.setTitleAt(index, title);

    final Component comp = getTabComponentAt(index);
    if (comp instanceof TabComponent) ((TabComponent) comp).setTitle(title);
  }
Exemple #11
0
 private void fetchLocalLog() {
   // todo: when the log is very very large, this fails with OutOfMemoryError
   final File logFile = new File(outputDirectory, selectedTask.getOutput() + ".log");
   logTab.setTitleAt(1, "Local log: " + logFile.getName());
   if (logFile.exists()) {
     Thread thread =
         new Thread(
             new Runnable() {
               public void run() {
                 final StringBuilder logText = new StringBuilder();
                 try {
                   BufferedReader in = new BufferedReader(new FileReader(logFile));
                   String line;
                   while ((line = in.readLine()) != null) {
                     logText.append(line);
                     logText.append("\n");
                   }
                 } catch (IOException e) {
                   logText.append("Cannot load: ").append(logFile.getAbsolutePath());
                   logText.append(e.toString());
                 }
                 SwingUtilities.invokeLater(
                     new Runnable() {
                       public void run() {
                         localLog.setText(logText.toString());
                       }
                     });
               }
             });
     thread.start();
   } else {
     localLog.setText("No log found: " + logFile.getAbsolutePath());
   }
 }
 protected void addPage(String _typeOfPage, String _name, String _code, boolean _enabled) {
   cardLayout.show(finalPanel, "TabbedPanel");
   _name = getUniqueName(_name);
   Editor page = createPage(_typeOfPage, _name, _code);
   page.setFont(myFont);
   page.setColor(myColor);
   int index = tabbedPanel.getSelectedIndex();
   if (index == -1) {
     pageList.addElement(page);
     if (tabbedPanel.getTabCount() == 0) {
       tabbedPanel.addTab(
           page.getName(),
           null,
           page.getComponent(),
           tooltip); // This causes an exception sometimes
     } else {
       tabbedPanel.insertTab(
           page.getName(), null, page.getComponent(), tooltip, tabbedPanel.getTabCount());
     }
     index = 0;
   } else {
     index++;
     pageList.insertElementAt(page, index);
     tabbedPanel.insertTab(page.getName(), null, page.getComponent(), tooltip, index);
   }
   tabbedPanel.setSelectedComponent(page.getComponent());
   page.setActive(_enabled);
   if (!_enabled) tabbedPanel.setTitleAt(index, page.getName() + " (D)");
   updatePageCounterField(pageList.size());
   // tabbedPanel.validate(); This hangs the computer when reading a file at start-up !!!???
   tabbedPanel.repaint();
   changed = true;
 }
  /** Update tab title to each tab page. */
  public void updateTabTitle() {
    for (int i = 0; i < tabbedPane.getTabCount(); i++) {
      final SessionPane session = (SessionPane) model.getSessions().elementAt(i);

      tabbedPane.setTitleAt(i, session.getSite().getName());
    }
  }
Exemple #14
0
  public void propertyChange(PropertyChangeEvent evt) {
    if (evt.getPropertyName().equals(EditorView.TITLE_PROPERTY)) {
      int ix = views.indexOf(evt.getSource());
      if (ix == -1) return;

      inputTabs.setTitleAt(ix, (String) evt.getNewValue());
    }
  }
Exemple #15
0
  /** Update the labels of the components (e.g. if the language changed). */
  public void setLabels() {
    setTitle(app.getMenu("Settings"));

    closeButton.setText(app.getMenu("Close"));
    saveButton.setText(app.getMenu("Settings.Save"));

    tabbedPane.setTitleAt(TAB_DEFAULTS, app.getPlain("Defaults"));
    tabbedPane.setTitleAt(TAB_EUCLIDIAN, app.getPlain("DrawingPad"));
    tabbedPane.setTitleAt(TAB_SPREADSHEET, app.getPlain("Spreadsheet"));
    tabbedPane.setTitleAt(TAB_CAS, app.getMenu("CAS"));
    tabbedPane.setTitleAt(TAB_ADVANCED, app.getMenu("Advanced"));

    euclidianPanel.setLabels();
    defaultsPanel.setLabels();
    spreadsheetPanel.setLabels();
    casPanel.setLabels();
    advancedPanel.setLabels();
  }
Exemple #16
0
 /** Updates title of content tabs with the number of thep they contain. */
 public void updateContentTabsTitle() {
   int i = 0;
   for (AnalysisGUICommon guiCommon : analysisPlugins) {
     String name = guiCommon.getDisplayName();
     CheckListTable clt = guiCommon.getCheckListTable();
     tabbedPane.setTitleAt(i, name + " [" + clt.getStepNumber() + "]");
     tabbedPane.setToolTipTextAt(
         i, name + ": " + clt.getStepNumber() + " element" + (clt.getStepNumber() > 1 ? "s" : ""));
     i++;
   }
 }
Exemple #17
0
  protected void deleteCurrentPanel() {
    JComponent tabPane = (JComponent) tabbedPane.getSelectedComponent();
    if (tabPane == null) return;

    WMSPanel wmsPanel = (WMSPanel) tabPane.getClientProperty(Constants.FEATURE_OWNER_PROPERTY);

    if (tabbedPane.getTabCount()
        > 2) // actually remove the tab only if there is more than one (plus the "+" tab)
    tabbedPane.remove(tabPane);
    else tabbedPane.setTitleAt(1, "New Server");

    if (wmsPanel != null) wmsPanel.clearPanel();
  }
Exemple #18
0
  /**
   * Builds the tabbed pane with the server preferences
   *
   * @return panel with server preferences tabs
   */
  protected JPanel buildTabbedServerPreferences() {
    JPanel pnl = new JPanel(new BorderLayout());

    JTabbedPane tpServerPreferences = getTabPane();
    pnlAuthPreferences = new AuthenticationPreferencesPanel();
    tpServerPreferences.add(wrapVerticallyScrollablePanel(pnlAuthPreferences));
    pnlProxyPreferences = new ProxyPreferencesPanel();
    tpServerPreferences.add(wrapVerticallyScrollablePanel(pnlProxyPreferences));

    tpServerPreferences.setTitleAt(0, tr("Authentication"));
    tpServerPreferences.setTitleAt(1, tr("Proxy settings"));
    tpServerPreferences.setToolTipTextAt(
        0, tr("Configure your identity and how to authenticate at the OSM server"));
    tpServerPreferences.setToolTipTextAt(1, tr("Configure whether to use a proxy server"));

    pnl.add(tpServerPreferences, BorderLayout.CENTER);
    return pnl;
  }
Exemple #19
0
  protected void updateTable() {
    AuditHasLinksPane mon = new AuditHasLinksPane();
    AuditHasLinksTab jAuditorLinksPane = new AuditHasLinksTab(mon);

    AuditPlanDao dt = null;
    String auditPlanID = null;
    String enterpriseID = null;
    try {
      dt = (AuditPlanDao) dataSource.getCurrentRecord();
      auditPlanID = dt.auditPlanID.getValue();
      enterpriseID = dt.fkEnterpriseID.getValue();
    } catch (DataSourceException ex) {

    }
    AuditHasLinksDao auditHasLinksDao = null;
    try {
      AuditHasLinks auditLinks =
          (AuditHasLinks)
              TmplEJBLocater.getInstance()
                  .getEJBRemote("pt.inescporto.siasoft.go.auditor.ejb.session.AuditHasLinks");
      try {
        auditHasLinksDao = auditLinks.getLinks(auditPlanID, enterpriseID);
      } catch (UserException ex) {
        ex.printStackTrace();
      } catch (RemoteException ex) {
        ex.printStackTrace();
      }
    } catch (NamingException ex) {
      ex.printStackTrace();
    }
    try {
      departList = (Hashtable<String, Vector>) auditHasLinksDao.departList;
      if (departList.containsKey(auditPlanID)) {
        Vector v = auditHasLinksDao.departList.get(auditPlanID);
        jAuditorLinksPane.refresh(v);
      }
      auditTab.removeAll();
      auditTab.add(jAuditorLinksPane.getAuditHasLinksPane(), 0);
      auditTab.setTitleAt(0, res.getString("label.activelinks"));
    } catch (Exception ex) {

    }
  }
 @Override
 public void locationChanged(WebBrowserNavigationEvent e) {
   JWebBrowser webBrowser = e.getWebBrowser();
   JTabbedPane panel = (JTabbedPane) e.getWebBrowser().getParent();
   if (panel != null) {
     int index = 0;
     for (int i = 0; i < panel.getTabCount(); i++) {
       if (webBrowser == panel.getComponentAt(i)) {
         index = i;
         break;
       }
     }
     panel.setTitleAt(index, webBrowser.getPageTitle());
     if (panel.getSelectedComponent() == webBrowser) {
       updateNavigateButtons(webBrowser);
       updateLocation(webBrowser);
     }
   }
 }
Exemple #21
0
  @Override
  public void observe(Event event) {
    if (event instanceof ServerNewGameStateEvent) {
      MachineState s = ((ServerNewGameStateEvent) event).getState();
      // TODO: Perhaps this should run in a separate thread, as in the
      // VisualizationPanel, in case these states are very large.
      JPanel statePanel = new JPanel();
      List<String> sentences = new ArrayList<String>();
      for (GdlSentence sentence : s.getContents()) sentences.add(sentence.toString());
      // The list of sentences is more useful when sorted alphabetically.
      Collections.sort(sentences);
      StringBuffer sentencesList = new StringBuffer();
      for (String sentence : sentences) sentencesList.append(sentence).append("\n");
      JTextArea statesTextArea = new JTextArea(sentencesList.toString());
      statesTextArea.setEditable(false);
      JScrollPane scrollPane = new JScrollPane(statesTextArea);
      scrollPane.setPreferredSize(new Dimension(400, 500));
      statePanel.add(scrollPane);

      // Add the panel as a new tab
      // Reusing the VisualizationPanel code, to make it easier in case this gets
      // moved off into a new thread
      int stepNum = stepCount;
      stepCount++;
      boolean atEnd = (tabs.getSelectedIndex() == tabs.getTabCount() - 1);

      for (int i = tabs.getTabCount(); i < stepNum; i++)
        tabs.add(new Integer(i + 1).toString(), new JPanel());
      tabs.setComponentAt(stepNum - 1, statePanel);
      tabs.setTitleAt(stepNum - 1, new Integer(stepNum).toString());

      if (atEnd) {
        tabs.setSelectedIndex(tabs.getTabCount() - 1);
      }
    }
  }
Exemple #22
0
  /** Refreshes the GUI including locale-based resource strings. */
  protected void refreshGUI() {
    setTitle(ToolsRes.getString("LibraryManager.Title")); // $NON-NLS-1$

    okButton.setText(ToolsRes.getString("Tool.Button.Close")); // $NON-NLS-1$
    addButton.setText(ToolsRes.getString("LibraryManager.Button.Add")); // $NON-NLS-1$
    removeButton.setText(ToolsRes.getString("LibraryManager.Button.Remove")); // $NON-NLS-1$
    moveUpButton.setText(ToolsRes.getString("LibraryTreePanel.Button.Up")); // $NON-NLS-1$
    moveDownButton.setText(ToolsRes.getString("LibraryTreePanel.Button.Down")); // $NON-NLS-1$
    allButton.setText(ToolsRes.getString("LibraryManager.Button.All")); // $NON-NLS-1$
    noneButton.setText(ToolsRes.getString("LibraryManager.Button.None")); // $NON-NLS-1$
    clearCacheButton.setText(ToolsRes.getString("LibraryManager.Button.ClearCache")); // $NON-NLS-1$
    setCacheButton.setText(ToolsRes.getString("LibraryManager.Button.SetCache")); // $NON-NLS-1$

    addButton.setToolTipText(
        ToolsRes.getString("LibraryManager.Button.Add.Tooltip")); // $NON-NLS-1$
    removeButton.setToolTipText(
        ToolsRes.getString("LibraryManager.Button.Remove.Tooltip")); // $NON-NLS-1$
    moveUpButton.setToolTipText(
        ToolsRes.getString("LibraryTreePanel.Button.Up.Tooltip")); // $NON-NLS-1$
    moveDownButton.setToolTipText(
        ToolsRes.getString("LibraryTreePanel.Button.Down.Tooltip")); // $NON-NLS-1$
    allButton.setToolTipText(
        ToolsRes.getString("LibraryManager.Button.All.Tooltip")); // $NON-NLS-1$
    noneButton.setToolTipText(
        ToolsRes.getString("LibraryManager.Button.None.Tooltip")); // $NON-NLS-1$
    clearCacheButton.setToolTipText(
        ToolsRes.getString("LibraryManager.Button.ClearCache.Tooltip")); // $NON-NLS-1$
    setCacheButton.setToolTipText(
        ToolsRes.getString("LibraryManager.Button.SetCache.Tooltip")); // $NON-NLS-1$

    nameLabel.setText(
        ToolsRes.getString("LibraryManager.Label.Name") + ":"); // $NON-NLS-1$ //$NON-NLS-2$
    pathLabel.setText(
        ToolsRes.getString("LibraryManager.Label.Path") + ":"); // $NON-NLS-1$ //$NON-NLS-2$
    collectionsTitleBorder.setTitle(
        ToolsRes.getString("LibraryManager.Title.MenuItems") + ":"); // $NON-NLS-1$ //$NON-NLS-2$
    importsTitleBorder.setTitle(
        ToolsRes.getString("LibraryManager.Title.Import") + ":"); // $NON-NLS-1$ //$NON-NLS-2$
    searchTitleBorder.setTitle(
        ToolsRes.getString("LibraryManager.Title.Search") + ":"); // $NON-NLS-1$ //$NON-NLS-2$
    cacheTitleBorder.setTitle(
        ToolsRes.getString("LibraryManager.Title.Cache") + ":"); // $NON-NLS-1$ //$NON-NLS-2$
    int k = tabbedPane.indexOfComponent(collectionsPanel);
    if (k > -1) {
      tabbedPane.setTitleAt(k, ToolsRes.getString("LibraryManager.Tab.MyLibrary")); // $NON-NLS-1$
      tabbedPane.setToolTipTextAt(
          k, ToolsRes.getString("LibraryManager.Tab.MyLibrary.Tooltip")); // $NON-NLS-1$
    }
    k = tabbedPane.indexOfComponent(importsPanel);
    if (k > -1) {
      tabbedPane.setTitleAt(k, ToolsRes.getString("LibraryManager.Tab.Import")); // $NON-NLS-1$
      tabbedPane.setToolTipTextAt(
          k, ToolsRes.getString("LibraryManager.Tab.Import.Tooltip")); // $NON-NLS-1$
    }
    k = tabbedPane.indexOfComponent(searchPanel);
    if (k > -1) {
      tabbedPane.setTitleAt(k, ToolsRes.getString("LibraryManager.Tab.Search")); // $NON-NLS-1$
      tabbedPane.setToolTipTextAt(
          k, ToolsRes.getString("LibraryManager.Tab.Search.Tooltip")); // $NON-NLS-1$
    }
    k = tabbedPane.indexOfComponent(cachePanel);
    if (k > -1) {
      tabbedPane.setTitleAt(k, ToolsRes.getString("LibraryManager.Tab.Cache")); // $NON-NLS-1$
      tabbedPane.setToolTipTextAt(
          k, ToolsRes.getString("LibraryManager.Tab.Cache.Tooltip")); // $NON-NLS-1$
    }

    resizeLabels();

    pathField.setForeground(LibraryTreePanel.defaultForeground);
    if (tabbedPane.getSelectedComponent() == collectionsPanel) {
      nameField.setEditable(true);
      int i = collectionList.getSelectedIndex();
      moveDownButton.setEnabled(i < library.pathList.size() - 1);
      moveUpButton.setEnabled(i > 0);
      if (i > -1 && library.pathList.size() > i) {
        removeButton.setEnabled(true);
        String path = library.pathList.get(i);
        pathField.setText(path);
        pathField.setCaretPosition(0);
        String name = library.pathToNameMap.get(path);
        nameField.setText(name);
        boolean unavailable =
            path.startsWith("http:") && !LibraryBrowser.webConnected; // $NON-NLS-1$
        Resource res = unavailable ? null : ResourceLoader.getResourceZipURLsOK(path);
        if (res == null) {
          pathField.setForeground(LibraryTreePanel.darkRed);
        }
      } else {
        removeButton.setEnabled(false);
        nameField.setEditable(false);
        nameField.setText(null);
        nameField.setBackground(Color.white);
        pathField.setText(null);
        pathField.setBackground(Color.white);
      }
    } else if (tabbedPane.getSelectedComponent() == importsPanel) {
      nameField.setEditable(false);
      int i = guestList.getSelectedIndex();
      moveDownButton.setEnabled(i < library.importedPathList.size() - 1);
      moveUpButton.setEnabled(i > 0);
      if (i > -1 && library.importedPathList.size() > i) {
        removeButton.setEnabled(true);
        String path = library.importedPathList.get(i);
        pathField.setText(path);
        pathField.setCaretPosition(0);
        String name = library.importedPathToLibraryMap.get(path).getName();
        nameField.setText(name);
        boolean unavailable =
            path.startsWith("http:") && !LibraryBrowser.webConnected; // $NON-NLS-1$
        Resource res = unavailable ? null : ResourceLoader.getResourceZipURLsOK(path);
        if (res == null) {
          pathField.setForeground(LibraryTreePanel.darkRed);
        }
      } else {
        removeButton.setEnabled(false);
        nameField.setText(null);
        nameField.setBackground(Color.white);
        pathField.setText(null);
        pathField.setBackground(Color.white);
      }
    }
    nameField.setBackground(Color.white);
    pathField.setBackground(Color.white);
  }
 public void updateTabTitle(JSChannelsPane chnPane) {
   tabbedPane.setTitleAt(tabbedPane.getSelectedIndex(), chnPane.getTitle());
 }
  private void jbInit() throws Exception {
    printButton.setToolTipText(
        ClientSettings.getInstance().getResources().getResource("print document"));
    printButton.addActionListener(new SaleCreditDocFrame_printButton_actionAdapter(this));

    addPanel.setLayout(borderLayout5);
    confirmButton.addActionListener(new SaleCreditDocFrame_confirmButton_actionAdapter(this));

    headerFormPanel.setFunctionId("DOC01_CREDITNOTES");
    headerFormPanel.setFormController(controller);
    headerFormPanel.setVOClassName("org.jallinone.sales.documents.java.DetailSaleDocVO");

    headerPanel.setLayout(borderLayout3);
    headerButtonsPanel.setLayout(flowLayout1);
    flowLayout1.setAlignment(FlowLayout.LEFT);
    mainPanel.setLayout(borderLayout2);
    this.getContentPane().setLayout(borderLayout1);
    linesPanel.setLayout(borderLayout4);
    insertButton1.setText("insertButton1");
    reloadButton1.setText("reloadButton1");
    deleteButton1.setText("deleteButton1");
    headerFormPanel.setLayout(gridBagLayout1);
    headerFormPanel.setInsertButton(insertButton1);
    headerFormPanel.setEditButton(editButton1);
    headerFormPanel.setReloadButton(reloadButton1);
    headerFormPanel.setDeleteButton(deleteButton1);
    headerFormPanel.setSaveButton(saveButton1);
    this.getContentPane().add(mainPanel, BorderLayout.CENTER);
    mainPanel.add(tabbedPane, BorderLayout.CENTER);
    tabbedPane.add(headerPanel, "header");
    headerPanel.add(headerButtonsPanel, BorderLayout.NORTH);
    headerButtonsPanel.add(insertButton1, null);
    headerButtonsPanel.add(editButton1, null);
    headerButtonsPanel.add(saveButton1, null);
    headerButtonsPanel.add(reloadButton1, null);
    headerButtonsPanel.add(deleteButton1, null);
    headerButtonsPanel.add(confirmButton, null);
    printButton.setEnabled(false);
    headerButtonsPanel.add(printButton, null);
    linesPanel.add(rowsPanel, BorderLayout.CENTER);
    headerPanel.add(headerFormPanel, BorderLayout.CENTER);
    headerFormPanel.add(
        saleIdHeadPanel1,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            1.0,
            0.0,
            GridBagConstraints.NORTHWEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(0, 0, 0, 0),
            0,
            0));
    headerFormPanel.add(
        saleCustomerHeadPanel1,
        new GridBagConstraints(
            0,
            1,
            1,
            1,
            1.0,
            0.0,
            GridBagConstraints.NORTHWEST,
            GridBagConstraints.BOTH,
            new Insets(0, 0, 0, 0),
            0,
            0));
    headerFormPanel.add(
        warePanel,
        new GridBagConstraints(
            0,
            2,
            1,
            1,
            1.0,
            0.0,
            GridBagConstraints.NORTHWEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(0, 0, 0, 0),
            0,
            0));
    headerFormPanel.add(
        saleTotalsPanel1,
        new GridBagConstraints(
            0,
            3,
            1,
            1,
            1.0,
            1.0,
            GridBagConstraints.NORTHWEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(0, 0, 0, 0),
            0,
            0));

    confirmButton.setToolTipText(
        ClientSettings.getInstance().getResources().getResource("credit note closing"));
    confirmButton.setEnabled(false);

    addPanel.add(saleAgentPanel, BorderLayout.NORTH);
    addPanel.add(saleNotesPanel, BorderLayout.CENTER);

    tabbedPane.add(addPanel, "notes");
    tabbedPane.add(linesPanel, "items");
    tabbedPane.add(discPanel, "customer discounts");
    tabbedPane.add(chargePanel, "charges");
    tabbedPane.add(actPanel, "activities");

    headerFormPanel.addLinkedPanel(addPanel);

    tabbedPane.setTitleAt(0, ClientSettings.getInstance().getResources().getResource("header"));
    tabbedPane.setTitleAt(1, ClientSettings.getInstance().getResources().getResource("notes"));
    tabbedPane.setTitleAt(2, ClientSettings.getInstance().getResources().getResource("items"));
    tabbedPane.setTitleAt(
        3, ClientSettings.getInstance().getResources().getResource("customer discounts"));
    tabbedPane.setTitleAt(4, ClientSettings.getInstance().getResources().getResource("charges"));
    tabbedPane.setTitleAt(
        5, ClientSettings.getInstance().getResources().getResource("sale activities"));
  }
  /**
   * Creates the JPanels for displaying the <code>MapdustBug</code> details.
   *
   * @param mapdustBug The <code>MapdustBug</code> object
   */
  private void createPanels(MapdustBug mapdustBug) {
    /* details panel */
    if (cmpDetails == null) {
      detailsPanel = new MapdustBugDetailsPanel(mapdustBug);
      cmpDetails =
          ComponentUtil.createJScrollPane(detailsPanel, getBounds(), getBackground(), true, true);
      cmpDetails.setPreferredSize(new Dimension(100, 100));
      cmpDetails.setName("Bug Details");
    } else {
      detailsPanel.updateComponents(mapdustBug);
    }

    /* address panel */
    Address address = mapdustBug != null ? mapdustBug.getAddress() : null;
    LatLon coordinates = mapdustBug != null ? mapdustBug.getLatLon() : null;
    if (cmpAddress == null) {
      addressPanel = new MapdustAddressPanel(address, coordinates);
      cmpAddress =
          ComponentUtil.createJScrollPane(addressPanel, getBounds(), getBackground(), true, true);
      cmpAddress.setName("Address");
      cmpAddress.setPreferredSize(new Dimension(100, 100));
    } else {
      addressPanel.updateComponents(address, coordinates);
    }

    /* description panel */
    String description = mapdustBug != null ? mapdustBug.getDescription() : "";
    if (descriptionPanel == null) {
      descriptionPanel = new MapdustDescriptionPanel(description);
    } else {
      descriptionPanel.updateComponents(description);
    }

    /* comments panel */
    MapdustComment[] comments =
        mapdustBug != null ? mapdustBug.getComments() : new MapdustComment[0];
    if (commentsPanel == null) {
      commentsPanel = new MapdustCommentsPanel(comments);
    } else {
      commentsPanel.updateComponents(comments);
      mainPanel.setTitleAt(3, commentsPanel.getName());
    }

    /* the help panel */
    if (helpPanel == null) {
      helpPanel = new MapdustHelpPanel();
    }

    /* creates the main panel */
    if (mainPanel == null) {
      mainPanel = new JTabbedPane();
      mainPanel.setIgnoreRepaint(true);
      mainPanel.add(cmpDetails, 0);
      mainPanel.add(cmpAddress, 1);
      mainPanel.add(descriptionPanel, 2);
      mainPanel.add(commentsPanel, 3);
      mainPanel.add(helpPanel);
      add(mainPanel, BorderLayout.CENTER);
    } else {
      mainPanel.revalidate();
    }
  }
Exemple #26
0
 @Override
 public void setTitleAt(int index, String title) {
   super.setTitleAt(index, title);
   getTabComponentAt(index).invalidate();
 }
 public void renameThread(String strThreadID, String strThreadName) {
   PanelThreadMonitor pnlThrMonitor = getPanelThreadMonitor(strThreadID);
   pnlThrMonitor.setThreadName(strThreadName);
   pnlThread.setTitleAt(indexOf(strThreadID), strThreadName);
 }
Exemple #28
0
  /** Initializes the GUI. Auto-generated code - any changes you make will disappear. */
  public void initGUI() {
    try {
      preInitGUI();

      containerTabbedPane = new JTabbedPane();
      tbDirectedGraph = new JPanel();
      btnFilterDirectedGraph = new JButton();
      dirVertexDegreePanel = new JPanel();
      lblMinInDegree = new JLabel();
      lblMaxInDegree = new JLabel();
      lblMinOutDegree = new JLabel();
      lblMaxOutDegree = new JLabel();
      tfInDegreeMin = new JTextField();
      tfInDegreeMax = new JTextField();
      tfOutDegreeMin = new JTextField();
      tfOutDegreeMax = new JTextField();
      lblIinstructions = new JLabel();
      tbUndirectedGraph = new JPanel();
      unDirVertexDegreePanel = new JPanel();
      lblMinDegree = new JLabel();
      lblMaxDegree = new JLabel();
      tfMinDegree = new JTextField();
      tfMaxDegree = new JTextField();
      lblInstructionsDir = new JLabel();
      btnFilterUndirectedGraph = new JButton();

      BorderLayout thisLayout = new BorderLayout();
      this.getContentPane().setLayout(thisLayout);
      thisLayout.setHgap(0);
      thisLayout.setVgap(0);
      this.setTitle("Pruning");
      this.setSize(new java.awt.Dimension(316, 267));

      containerTabbedPane.setPreferredSize(new java.awt.Dimension(309, 265));
      this.getContentPane().add(containerTabbedPane, BorderLayout.CENTER);

      GridBagLayout tbDirectedGraphLayout = new GridBagLayout();
      tbDirectedGraph.setLayout(tbDirectedGraphLayout);
      tbDirectedGraphLayout.columnWidths = new int[] {1};
      tbDirectedGraphLayout.rowHeights = new int[] {1, 1, 1};
      tbDirectedGraphLayout.columnWeights = new double[] {0.1};
      tbDirectedGraphLayout.rowWeights = new double[] {0.1, 0.1, 0.1};
      tbDirectedGraph.setPreferredSize(new java.awt.Dimension(304, 242));
      containerTabbedPane.add(tbDirectedGraph);
      containerTabbedPane.setTitleAt(0, "Directed Graph");

      btnFilterDirectedGraph.setText("Filter Graph");
      tbDirectedGraph.add(
          btnFilterDirectedGraph,
          new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, 17, 0, new Insets(0, 5, 0, 5), 0, 0));
      btnFilterDirectedGraph.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              btnFilterDirectedGraphActionPerformed(evt);
            }
          });

      GridBagLayout dirVertexDegreePanelLayout = new GridBagLayout();
      dirVertexDegreePanel.setLayout(dirVertexDegreePanelLayout);
      dirVertexDegreePanelLayout.columnWidths = new int[] {1, 1};
      dirVertexDegreePanelLayout.rowHeights = new int[] {1, 1, 1, 1, 1};
      dirVertexDegreePanelLayout.columnWeights = new double[] {0.1, 0.1};
      dirVertexDegreePanelLayout.rowWeights = new double[] {0.1, 0.1, 0.1, 0.1, 0.1};
      dirVertexDegreePanel.setBorder(
          new TitledBorder(
              new LineBorder(new java.awt.Color(0, 0, 0), 1, false),
              "Vertex Degree",
              TitledBorder.LEADING,
              TitledBorder.TOP,
              new java.awt.Font("Dialog", 1, 12),
              new java.awt.Color(0, 0, 0)));
      tbDirectedGraph.add(
          dirVertexDegreePanel,
          new GridBagConstraints(0, 0, 1, 3, 0.0, 0.0, 10, 1, new Insets(0, 0, 0, 0), 0, 0));

      lblMinInDegree.setText("In-Degree Minimum");
      dirVertexDegreePanel.add(
          lblMinInDegree,
          new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, 17, 0, new Insets(0, 5, 0, 5), 0, 0));

      lblMaxInDegree.setText("In-Degree Maximum");
      dirVertexDegreePanel.add(
          lblMaxInDegree,
          new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, 17, 0, new Insets(0, 5, 0, 5), 0, 0));

      lblMinOutDegree.setText("Out-Degree Minimum");
      dirVertexDegreePanel.add(
          lblMinOutDegree,
          new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, 17, 0, new Insets(0, 5, 0, 5), 0, 0));

      lblMaxOutDegree.setText("Out-Degree Maximum");
      dirVertexDegreePanel.add(
          lblMaxOutDegree,
          new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, 17, 0, new Insets(0, 5, 0, 5), 0, 0));

      tfInDegreeMin.setMinimumSize(new java.awt.Dimension(40, 20));
      dirVertexDegreePanel.add(
          tfInDegreeMin,
          new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, 10, 2, new Insets(0, 0, 0, 0), 0, 0));

      tfInDegreeMax.setMinimumSize(new java.awt.Dimension(40, 20));
      dirVertexDegreePanel.add(
          tfInDegreeMax,
          new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, 10, 2, new Insets(0, 0, 0, 0), 0, 0));

      tfOutDegreeMin.setMinimumSize(new java.awt.Dimension(40, 20));
      dirVertexDegreePanel.add(
          tfOutDegreeMin,
          new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, 10, 2, new Insets(0, 0, 0, 0), 0, 0));

      tfOutDegreeMax.setMinimumSize(new java.awt.Dimension(40, 20));
      dirVertexDegreePanel.add(
          tfOutDegreeMax,
          new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, 10, 2, new Insets(0, 0, 0, 0), 0, 0));

      lblIinstructions.setText(
          "<html>Enter degree values by which to filter graph. Leave blank to use minimum or maximum value.</html>");
      lblIinstructions.setHorizontalAlignment(SwingConstants.LEADING);
      lblIinstructions.setHorizontalTextPosition(SwingConstants.TRAILING);
      lblIinstructions.setVerticalAlignment(SwingConstants.TOP);
      lblIinstructions.setVerticalTextPosition(SwingConstants.CENTER);
      lblIinstructions.setPreferredSize(new java.awt.Dimension(60, 40));
      lblIinstructions.setMinimumSize(new java.awt.Dimension(60, 40));
      dirVertexDegreePanel.add(
          lblIinstructions,
          new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0, 10, 1, new Insets(0, 0, 0, 0), 0, 0));

      GridBagLayout tbUndirectedGraphLayout = new GridBagLayout();
      tbUndirectedGraph.setLayout(tbUndirectedGraphLayout);
      tbUndirectedGraphLayout.columnWidths = new int[] {1};
      tbUndirectedGraphLayout.rowHeights = new int[] {1, 1, 1};
      tbUndirectedGraphLayout.columnWeights = new double[] {0.1};
      tbUndirectedGraphLayout.rowWeights = new double[] {0.1, 0.1, 0.1};
      tbUndirectedGraph.setPreferredSize(new java.awt.Dimension(304, 212));
      containerTabbedPane.add(tbUndirectedGraph);
      containerTabbedPane.setTitleAt(1, "Undirected Graph");

      GridBagLayout unDirVertexDegreePanelLayout = new GridBagLayout();
      unDirVertexDegreePanel.setLayout(unDirVertexDegreePanelLayout);
      unDirVertexDegreePanelLayout.columnWidths = new int[] {1, 1};
      unDirVertexDegreePanelLayout.rowHeights = new int[] {1, 1, 1, 1};
      unDirVertexDegreePanelLayout.columnWeights = new double[] {0.1, 0.1};
      unDirVertexDegreePanelLayout.rowWeights = new double[] {0.1, 0.1, 0.1, 0.1};
      unDirVertexDegreePanel.setBorder(
          new TitledBorder(
              new LineBorder(new java.awt.Color(0, 0, 0), 1, false),
              "Vertex Degree",
              TitledBorder.LEADING,
              TitledBorder.TOP,
              new java.awt.Font("Dialog", 1, 12),
              new java.awt.Color(0, 0, 0)));
      tbUndirectedGraph.add(
          unDirVertexDegreePanel,
          new GridBagConstraints(0, 0, 1, 2, 0.0, 0.0, 10, 1, new Insets(0, 0, 0, 0), 0, 0));

      lblMinDegree.setText("Minimum Degree");
      unDirVertexDegreePanel.add(
          lblMinDegree,
          new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, 17, 0, new Insets(0, 5, 0, 5), 0, 0));

      lblMaxDegree.setText("Maximum Degree");
      unDirVertexDegreePanel.add(
          lblMaxDegree,
          new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, 17, 0, new Insets(0, 5, 0, 5), 0, 0));

      tfMinDegree.setMinimumSize(new java.awt.Dimension(40, 20));
      unDirVertexDegreePanel.add(
          tfMinDegree,
          new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, 10, 0, new Insets(0, 0, 0, 0), 0, 0));

      tfMaxDegree.setMinimumSize(new java.awt.Dimension(40, 20));
      unDirVertexDegreePanel.add(
          tfMaxDegree,
          new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, 10, 0, new Insets(0, 0, 0, 0), 0, 0));

      lblInstructionsDir.setText(
          "<html>Enter degree values by which to filter graph. Leave blank to use minimum or maximum value.</html>");
      unDirVertexDegreePanel.add(
          lblInstructionsDir,
          new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0, 10, 1, new Insets(0, 0, 0, 0), 0, 0));

      btnFilterUndirectedGraph.setText("Filter Graph");
      tbUndirectedGraph.add(
          btnFilterUndirectedGraph,
          new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, 17, 0, new Insets(5, 5, 5, 5), 0, 0));
      btnFilterUndirectedGraph.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              btnFilterUndirectedGraphActionPerformed(evt);
            }
          });

      postInitGUI();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  private void jbInit() throws Exception {
    hierarTreePanel.setEnabled(false);
    warehousePanel.setLayout(borderLayout1);
    warehouseForm.setVOClassName("org.jallinone.warehouse.java.WarehouseVO");
    this.setTitle(ClientSettings.getInstance().getResources().getResource("warehouse detail"));
    buttonsPanel.setLayout(flowLayout1);
    flowLayout1.setAlignment(FlowLayout.LEFT);
    insertButton.setText("insertButton1");
    reloadButton.setText("reloadButton1");
    deleteButton.setText("deleteButton1");
    warehouseForm.setInsertButton(insertButton);
    warehouseForm.setCopyButton(copyButton);
    warehouseForm.setEditButton(editButton);
    warehouseForm.setReloadButton(reloadButton);
    warehouseForm.setDeleteButton(deleteButton);
    warehouseForm.setSaveButton(saveButton);
    warehouseForm.setFunctionId("WAR01");
    warehouseForm.setLayout(gridBagLayout1);
    controlZip.setAttributeName("zipWAR01");
    controlZip.setCanCopy(true);
    controlZip.setLinkLabel(labelZip);
    controlZip.setMaxCharacters(20);
    controlProv.setAttributeName("provinceWAR01");
    controlProv.setCanCopy(true);
    controlProv.setLinkLabel(labelProv);
    controlProv.setMaxCharacters(20);
    controlProv.setTrimText(true);
    controlProv.setUpperCase(true);
    controlCity.setAttributeName("cityWAR01");
    controlCity.setCanCopy(true);
    controlCity.setLinkLabel(labelCity);
    controlAddress.setAttributeName("addressWAR01");
    controlAddress.setCanCopy(true);
    controlAddress.setLinkLabel(labelAddress);
    labelAddress.setText("address");
    controlCountry.setAttributeName("countryWAR01");
    controlCountry.setCanCopy(true);
    controlCountry.setLinkLabel(labelCountry);
    controlCountry.setMaxCharacters(20);
    controlCountry.setTrimText(true);
    controlCountry.setUpperCase(true);
    labelZip.setText("zip");
    labelCity.setText("city");
    labelCountry.setText("country");
    labelProv.setText("prov");
    controlWarCode.setAttributeName("warehouseCodeWAR01");
    controlWarCode.setLinkLabel(labelWarCode);
    controlWarCode.setMaxCharacters(20);
    controlWarCode.setRequired(true);
    controlWarCode.setRpadding(false);
    controlWarCode.setTrimText(true);
    controlWarCode.setUpperCase(true);
    controlWarCode.setEnabledOnEdit(false);
    labelWarCode.setText("warehouseCodeWAR01");
    labelDescr.setText("descriptionWAR01");
    controlDescr.setAttributeName("descriptionWAR01");
    controlDescr.setLinkLabel(labelDescr);
    controlDescr.setRequired(true);
    labelCompanyCode.setText("companyCodeSys01WAR01");
    controlCompaniesCombo.setAttributeName("companyCodeSys01WAR01");
    controlCompaniesCombo.setCanCopy(true);
    controlCompaniesCombo.setLinkLabel(labelCompanyCode);
    controlCompaniesCombo.setRequired(true);
    controlCompaniesCombo.setEnabledOnEdit(false);
    labelRoles.setText("edit/delete warehouse role");
    controlRoles.setAttributeName("progressiveSys04WAR01");
    controlRoles.setDomainId("USERROLES");
    controlRoles.setLinkLabel(labelRoles);
    locationsPanel.setLayout(borderLayout2);
    tabbedPane.add(warehousePanel, "warehousePanel");
    this.getContentPane().add(buttonsPanel, BorderLayout.NORTH);
    this.getContentPane().add(tabbedPane, BorderLayout.CENTER);
    warehouseForm.add(
        labelZip,
        new GridBagConstraints(
            3,
            4,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5),
            0,
            0));
    warehouseForm.add(
        labelCity,
        new GridBagConstraints(
            0,
            4,
            2,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5),
            0,
            0));
    warehouseForm.add(
        labelAddress,
        new GridBagConstraints(
            0,
            3,
            2,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5),
            0,
            0));
    warehouseForm.add(
        controlAddress,
        new GridBagConstraints(
            2,
            3,
            3,
            1,
            1.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(5, 5, 5, 5),
            0,
            0));
    warehouseForm.add(
        controlCity,
        new GridBagConstraints(
            2,
            4,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5),
            100,
            0));
    warehouseForm.add(
        controlZip,
        new GridBagConstraints(
            4,
            4,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5),
            0,
            0));
    warehouseForm.add(
        controlWarCode,
        new GridBagConstraints(
            2,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5),
            100,
            0));
    warehousePanel.add(warehouseForm, BorderLayout.CENTER);
    buttonsPanel.add(insertButton, null);
    buttonsPanel.add(copyButton, null);
    buttonsPanel.add(editButton, null);
    buttonsPanel.add(saveButton, null);
    buttonsPanel.add(reloadButton, null);
    buttonsPanel.add(deleteButton, null);
    buttonsPanel.add(navigatorBar, null);
    warehouseForm.add(
        labelWarCode,
        new GridBagConstraints(
            0,
            1,
            2,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 5, 5, 5),
            0,
            0));
    warehouseForm.add(
        labelDescr,
        new GridBagConstraints(
            0,
            2,
            2,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5),
            0,
            0));
    warehouseForm.add(
        controlDescr,
        new GridBagConstraints(
            2,
            2,
            3,
            1,
            1.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(5, 5, 5, 5),
            0,
            0));
    warehouseForm.add(
        controlCountry,
        new GridBagConstraints(
            4,
            5,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5),
            0,
            0));
    warehouseForm.add(
        labelCountry,
        new GridBagConstraints(
            3,
            5,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5),
            0,
            0));
    warehouseForm.add(
        labelProv,
        new GridBagConstraints(
            0,
            5,
            1,
            2,
            0.0,
            0.0,
            GridBagConstraints.NORTHWEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 0, 0),
            0,
            0));
    warehouseForm.add(
        controlProv,
        new GridBagConstraints(
            2,
            5,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTHWEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5),
            0,
            0));
    warehouseForm.add(
        labelCompanyCode,
        new GridBagConstraints(
            0,
            0,
            2,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5),
            0,
            0));
    tabbedPane.add(locationsPanel, "locationsPanel");
    locationsPanel.add(split, BorderLayout.CENTER);
    split.setDividerLocation(150);
    split.add(hierarTreePanel, JSplitPane.LEFT);
    split.add(availPanel, JSplitPane.RIGHT);
    tabbedPane.add(bookedItemsPanel, "bookedItemsPanel");
    tabbedPane.add(orderedItemsPanel, "orderedItemsPanel");
    hierarTreePanel.setFunctionId("WAR01");
    tabbedPane.setTitleAt(
        0, ClientSettings.getInstance().getResources().getResource("warehouse detail"));
    tabbedPane.setTitleAt(1, ClientSettings.getInstance().getResources().getResource("positions"));
    tabbedPane.setTitleAt(
        2, ClientSettings.getInstance().getResources().getResource("bookedItemsPanel"));
    tabbedPane.setTitleAt(
        3, ClientSettings.getInstance().getResources().getResource("orderedItemsPanel"));

    warehouseForm.add(
        controlCompaniesCombo,
        new GridBagConstraints(
            2,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(5, 5, 5, 5),
            0,
            0));
    warehouseForm.add(
        controlRoles,
        new GridBagConstraints(
            2,
            6,
            1,
            2,
            0.0,
            1.0,
            GridBagConstraints.NORTHWEST,
            GridBagConstraints.HORIZONTAL,
            new Insets(5, 5, 5, 5),
            0,
            0));
    warehouseForm.add(
        labelRoles,
        new GridBagConstraints(
            0,
            7,
            2,
            1,
            0.0,
            1.0,
            GridBagConstraints.NORTHWEST,
            GridBagConstraints.NONE,
            new Insets(5, 5, 5, 5),
            0,
            0));
  }
Exemple #30
0
 /**
  * handles property change events
  *
  * @param evt the event
  * @see TagMergeModel
  * @see ListMergeModel
  * @see PropertiesMergeModel
  */
 @Override
 public void propertyChange(PropertyChangeEvent evt) {
   if (evt.getPropertyName().equals(TagMergeModel.PROP_NUM_UNDECIDED_TAGS)) {
     int newValue = (Integer) evt.getNewValue();
     if (newValue == 0) {
       tabbedPane.setTitleAt(1, tr("Tags"));
       tabbedPane.setToolTipTextAt(1, tr("No pending tag conflicts to be resolved"));
       tabbedPane.setIconAt(1, mergeComplete);
     } else {
       tabbedPane.setTitleAt(
           1, trn("Tags({0} conflict)", "Tags({0} conflicts)", newValue, newValue));
       tabbedPane.setToolTipTextAt(
           1,
           trn(
               "{0} pending tag conflict to be resolved",
               "{0} pending tag conflicts to be resolved", newValue, newValue));
       tabbedPane.setIconAt(1, mergeIncomplete);
     }
     updateResolvedCompletely();
   } else if (evt.getPropertyName().equals(ListMergeModel.FROZEN_PROP)) {
     boolean frozen = (Boolean) evt.getNewValue();
     if (evt.getSource() == nodeListMerger.getModel() && my instanceof Way) {
       if (frozen) {
         tabbedPane.setTitleAt(2, tr("Nodes(resolved)"));
         tabbedPane.setToolTipTextAt(
             2, tr("Merged node list frozen. No pending conflicts in the node list of this way"));
         tabbedPane.setIconAt(2, mergeComplete);
       } else {
         tabbedPane.setTitleAt(2, tr("Nodes(with conflicts)"));
         tabbedPane.setToolTipTextAt(2, tr("Pending conflicts in the node list of this way"));
         tabbedPane.setIconAt(2, mergeIncomplete);
       }
     } else if (evt.getSource() == relationMemberMerger.getModel() && my instanceof Relation) {
       if (frozen) {
         tabbedPane.setTitleAt(3, tr("Members(resolved)"));
         tabbedPane.setToolTipTextAt(
             3,
             tr(
                 "Merged member list frozen. No pending conflicts in the member list of this relation"));
         tabbedPane.setIconAt(3, mergeComplete);
       } else {
         tabbedPane.setTitleAt(3, tr("Members(with conflicts)"));
         tabbedPane.setToolTipTextAt(
             3, tr("Pending conflicts in the member list of this relation"));
         tabbedPane.setIconAt(3, mergeIncomplete);
       }
     }
     updateResolvedCompletely();
   } else if (evt.getPropertyName().equals(PropertiesMergeModel.RESOLVED_COMPLETELY_PROP)) {
     boolean resolved = (Boolean) evt.getNewValue();
     if (resolved) {
       tabbedPane.setTitleAt(0, tr("Properties"));
       tabbedPane.setToolTipTextAt(0, tr("No pending property conflicts"));
       tabbedPane.setIconAt(0, mergeComplete);
     } else {
       tabbedPane.setTitleAt(0, tr("Properties(with conflicts)"));
       tabbedPane.setToolTipTextAt(0, tr("Pending property conflicts to be resolved"));
       tabbedPane.setIconAt(0, mergeIncomplete);
     }
     updateResolvedCompletely();
   } else if (PropertiesMergeModel.DELETE_PRIMITIVE_PROP.equals(evt.getPropertyName())) {
     for (IConflictResolver resolver : conflictResolvers) {
       resolver.deletePrimitive((Boolean) evt.getNewValue());
     }
   }
 }