/** Creates new form WkKgEditor. */
  public WkGwEditor() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    initComponents();

    tpMain.setUI(new TabbedPaneUITransparent());
  }
Example #2
0
  public RehaHMKTab() {
    super();
    setLayout(new BorderLayout());
    hmkTab = new JTabbedPane();
    hmkTab.setUI(new WindowsTabbedPaneUI());

    rehaHMKPanel1 = new RehaHMKPanel1(this);
    rehaHMKPanel2 = new RehaHMKPanel2(this);
    hmkTab.addTab("Passenden Indikatiosschlüssel suchen", RehaHMK.icons.get("lupe"), rehaHMKPanel1);
    hmkTab.addTab("Rezeptänderung beantragen", RehaHMK.icons.get("blitz"), rehaHMKPanel2);
    /*
    sqlEditPanel = new RehaSqlEdit(this);
    hmkTab.add("Sql-Befehle entwerfen/bearbeiten",sqlEditPanel);
    */

    jxh = new JXHeader();
    ((JLabel) jxh.getComponent(1)).setVerticalAlignment(JLabel.NORTH);

    /*
    jxh.setTitle("Nach machbaren Indikationsschlüsseln suchen");
    jxh.setDescription("<html><br>Sie wissen welche Behandlungsformen gut sind für Ihren Patienten?<br>"+
    		"Sie wissen aber nicht welche Indikationsschlüssel für diese Behandlung(en) möglich sind?<br><br>"+
    		"<b>Dann ist diese Seite genau das Richtige für Sie!</b>");
    jxh.setIcon(RehaHMK.icons.get("erde"));
    */
    add(getHeader(0), BorderLayout.NORTH);
    add(hmkTab, BorderLayout.CENTER);
    hmkTab.validate();
    hmkTab.addChangeListener(this);
    validate();
  }
Example #3
0
  @Override
  protected Container getMainPane(JPanel taskPanel, JPanel systemPanel) {
    JTabbedPane pane = new JTabbedPane();
    pane.setUI(new WindowsTabbedPaneUI());

    JScrollPane taskPane = new JScrollPane();
    taskPane.setViewportView(taskPanel);
    pane.add(STRINGS.TASK_GRAPH, taskPane);

    JScrollPane systemPane = new JScrollPane();
    systemPane.setViewportView(systemPanel);
    pane.add(STRINGS.SYSTEM_GRAPH, systemPane);
    return pane;
  }
Example #4
0
  public Editor(T document) {
    super(new BorderLayout());
    this.document = document;

    setBackground(Color.LIGHT_GRAY);
    inputTabs = new JTabbedPane(JTabbedPane.LEFT, JTabbedPane.SCROLL_TAB_LAYOUT);
    inputTabs.setUI(new VerticalTabbedPaneUI());

    inputTabs.setFont(inputTabs.getFont().deriveFont(8));
    inputTabsChangeListener = new InputTabsChangeListener();
    inputTabs.addChangeListener(inputTabsChangeListener);

    inspectorPanel = JInspectorPanelFactory.build(inputTabs);
    add(inspectorPanel.getComponent(), BorderLayout.CENTER);
  }
  /** Update the UI of this JTabbedPane to contain a progress bar */
  public static void extendUI(JTabbedPane pane) {
    TabbedPaneUI oldUI = pane.getUI();
    TabbedPaneUI newUI = oldUI;

    if (aquaUI != null && aquaUI.isInstance(oldUI))
      newUI = createNewUI("com.limegroup.gnutella.gui.AquaTab", newUI);
    else if (macUI != null && macUI.isInstance(oldUI))
      newUI = createNewUI("com.limegroup.gnutella.gui.MacTab", newUI);
    else if (windowsUI != null && windowsUI.isInstance(oldUI))
      newUI = createNewUI("com.limegroup.gnutella.gui.WinTab", newUI);
    else if (metalUI != null && metalUI.isInstance(oldUI)) newUI = new MetalTab();
    // Note that this last check is an == check.
    // This is because lots of UIs are going to extend from BasicUI
    // and we only want to use the BasicTab if we are positive that
    // the actual tab is using a BasicUI.
    else if (oldUI.getClass() == basicUI) newUI = new BasicTab();

    pane.setUI(newUI);
  }
  // ------------------------------------------------------------------------------------------------------
  protected void createGui() {
    mainFrame = new JFrame(myGaggleName);
    MiscUtil.setApplicationIcon(mainFrame);

    mainFrame.setJMenuBar(createMenuBar());
    mainFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    JPanel outerPanel = new JPanel();
    mainFrame.getContentPane().add(outerPanel);
    outerPanel.setLayout(new BorderLayout());

    JToolBar toolbar = new JToolBar();
    toolbar.setFloatable(false);
    JButton bossButton = new JButton("Boss");
    bossButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            try {
              gaggleBoss.show("boss");
            } catch (RemoteException rex) {
              rex.printStackTrace();
            }
          }
        });

    toolbar.add(bossButton);
    outerPanel.add(toolbar, BorderLayout.NORTH);

    tabbedPane = new JTabbedPane();
    tabbedPane.setUI(new MyTabbedPaneUI());

    outerPanel.add(tabbedPane, BorderLayout.CENTER);

    mainFrame.pack();
    mainFrame.setSize(800, 800);
    mainFrame.setVisible(true);
    MiscUtil.placeInCenter(mainFrame);
  } // createGui
Example #7
0
  public RehaUrlaubTab() {
    super();
    setLayout(new BorderLayout());

    String cmd = UrlaubFunktionen.getUrlaubTableDef("");
    SqlInfo.sqlAusfuehren(cmd);

    billEditTab = new JTabbedPane();
    billEditTab.setUI(new WindowsTabbedPaneUI());

    urlaubPanel = new RehaUrlaubPanel(this);
    billEditTab.add("Stundenerfassung", urlaubPanel);

    /*
    altimportPanel = new AltImport(this);
    billEditTab.add("alten RTA-Urlaub importieren",altimportPanel);
    */

    urlaubTabelle = new RehaUrlaubTabelle(this);
    billEditTab.add("Urlaubtabelle", urlaubTabelle);

    jxh = new JXHeader();
    ((JLabel) jxh.getComponent(1)).setVerticalAlignment(JLabel.NORTH);
    add(jxh, BorderLayout.NORTH);
    add(billEditTab, BorderLayout.CENTER);

    jxh.validate();
    billEditTab.validate();
    validate();
    new SwingWorker() {
      @Override
      protected Object doInBackground() throws Exception {
        holeKalUser();
        return null;
      }
    }.execute();
  }
  private void makeFrame(final Editor editor) {
    dialog = new JFrame(title);
    dialog.setMinimumSize(new Dimension(750, 500));
    tabbedPane = new JTabbedPane();

    makeAndShowTab(false, true);

    tabbedPane.addTab("Libraries", null, librariesContributionTab.panel, "Libraries");
    tabbedPane.setMnemonicAt(0, KeyEvent.VK_1);

    tabbedPane.addTab("Modes", null, modesContributionTab.panel, "Modes");
    tabbedPane.setMnemonicAt(1, KeyEvent.VK_2);

    tabbedPane.addTab("Tools", null, toolsContributionTab.panel, "Tools");
    tabbedPane.setMnemonicAt(2, KeyEvent.VK_3);

    tabbedPane.addTab("Examples", null, examplesContributionTab.panel, "Examples");
    tabbedPane.setMnemonicAt(3, KeyEvent.VK_4);

    tabbedPane.addTab("Updates", null, updatesContributionTab.panel, "Updates");
    tabbedPane.setMnemonicAt(4, KeyEvent.VK_5);

    tabbedPane.setUI(new SpacedTabbedPaneUI());
    tabbedPane.setBackground(new Color(0x132638));
    tabbedPane.setOpaque(true);

    for (int i = 0; i < 5; i++) {
      tabbedPane.setToolTipTextAt(i, null);
    }

    makeAndSetTabComponents();

    tabbedPane.addChangeListener(
        new ChangeListener() {

          @Override
          public void stateChanged(ChangeEvent e) {
            for (int i = 0; i < 4; i++) {
              tabLabels[i].setBackground(new Color(0x2d4251));
              tabLabels[i].setForeground(Color.WHITE);
            }
            updateTabPanel.setBackground(new Color(0x2d4251));
            updateTabLabel.setForeground(Color.WHITE);
            int currentIndex = tabbedPane.getSelectedIndex();
            if (currentIndex != 4) {
              tabbedPane
                  .getTabComponentAt(tabbedPane.getSelectedIndex())
                  .setBackground(new Color(0xe0fffd));
              tabbedPane
                  .getTabComponentAt(tabbedPane.getSelectedIndex())
                  .setForeground(Color.BLACK);
            } else {
              updateTabPanel.setBackground(new Color(0xe0fffd));
              updateTabLabel.setForeground(Color.BLACK);
            }
            getActiveTab().contributionListPanel.scrollPane.requestFocusInWindow();
            //        // When the tab is changed update status to the current selected panel
            //        ContributionPanel currentPanel = getActiveTab().contributionListPanel
            //          .getSelectedPanel();
            //        if (currentPanel != null) {
            //          getActiveTab().contributionListPanel.setSelectedPanel(currentPanel);
            //        }
          }
        });

    //    tabbedPane.setSize(450, 400);
    setLayout();

    restartButton = new JButton(Language.text("contrib.restart"));
    restartButton.setVisible(false);
    restartButton.addActionListener(
        new ActionListener() {

          @Override
          public void actionPerformed(ActionEvent arg0) {

            Iterator<Editor> iter = editor.getBase().getEditors().iterator();
            while (iter.hasNext()) {
              Editor ed = iter.next();
              if (ed.getSketch().isModified()) {
                int option =
                    Messages.showYesNoQuestion(
                        editor,
                        title,
                        Language.text("contrib.unsaved_changes"),
                        Language.text("contrib.unsaved_changes.prompt"));

                if (option == JOptionPane.NO_OPTION) return;
                else break;
              }
            }

            // Thanks to http://stackoverflow.com/a/4160543
            StringBuilder cmd = new StringBuilder();
            cmd.append(
                System.getProperty("java.home")
                    + File.separator
                    + "bin"
                    + File.separator
                    + "java ");
            for (String jvmArg : ManagementFactory.getRuntimeMXBean().getInputArguments()) {
              cmd.append(jvmArg + " ");
            }
            cmd.append("-cp ")
                .append(ManagementFactory.getRuntimeMXBean().getClassPath())
                .append(" ");
            cmd.append(Base.class.getName());

            try {
              Runtime.getRuntime().exec(cmd.toString());
              System.exit(0);
            } catch (IOException e) {
              e.printStackTrace();
            }
          }
        });

    Toolkit.setIcon(dialog);
    registerDisposeListeners();

    dialog.pack();
    dialog.setLocationRelativeTo(null);
  }
Example #9
0
 /** Ignore any non OptionsTabbedPaneUI objects. */
 public void setUI(TabbedPaneUI ui) {
   if (ui instanceof OptionsTabbedPaneUI) {
     super.setUI(ui);
   }
 }
  /*
   * (non-Javadoc)
   *
   * @see org.jajuk.ui.views.IView#populate()
   */
  @Override
  public void initUI() {
    tabs = new JTabbedPane();
    // Remove tab border, see
    // http://forum.java.sun.com/thread.jspa?threadID=260746&messageID=980405
    class MyTabbedPaneUI extends javax.swing.plaf.basic.BasicTabbedPaneUI {
      @Override
      protected Insets getContentBorderInsets(int tabPlacement) {
        return new Insets(0, 0, 0, 0);
      }

      @Override
      protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex) {
        // nothing to do here...
      }
    }
    // Now use the new TabbedPaneUI
    tabs.setUI(new MyTabbedPaneUI());
    // Fill tabs with empty tabs
    tabs.addTab(
        Messages.getString("SuggestionView.1"),
        UtilGUI.getCentredPanel(new JLabel(Messages.getString("WikipediaView.3"))));
    tabs.addTab(
        Messages.getString("SuggestionView.2"),
        UtilGUI.getCentredPanel(new JLabel(Messages.getString("WikipediaView.3"))));
    tabs.addTab(
        Messages.getString("SuggestionView.5"),
        UtilGUI.getCentredPanel(new JLabel(Messages.getString("WikipediaView.3"))));
    tabs.addTab(
        Messages.getString("SuggestionView.3"), new JLabel(Messages.getString("SuggestionView.7")));
    tabs.addTab(
        Messages.getString("SuggestionView.4"), new JLabel(Messages.getString("SuggestionView.7")));
    // Refresh tabs on demand only, add changelisterner after tab creation to
    // avoid that the stored tab is overwrited at startup
    tabs.addChangeListener(
        new ChangeListener() {
          @Override
          public void stateChanged(ChangeEvent arg0) {
            refreshLastFMCollectionTabs();
            // store the selected tab
            Conf.setProperty(
                getClass().getName()
                    + "_"
                    + ((getPerspective() == null) ? "solo" : getPerspective().getID()),
                Integer.toString(tabs.getSelectedIndex()).toString());
          }
        });
    if (Conf.containsProperty(
        getClass().getName()
            + "_"
            + ((getPerspective() == null) ? "solo" : getPerspective().getID()))) {
      int index =
          Conf.getInt(
              getClass().getName()
                  + "_"
                  + ((getPerspective() == null) ? "solo" : getPerspective().getID()));
      if (index > 0 && index < tabs.getTabCount()) {
        tabs.setSelectedIndex(index);
      }
    }
    // Add panels
    refreshLocalCollectionTabs();
    // Add tabs
    setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
    add(tabs);
    // Look for events
    ObservationManager.register(this);
  }