コード例 #1
0
  public synchronized void toggleCurrentSQLResultTabSticky() {
    if (null != _stickyTab) {
      if (_stickyTab.equals(_tabbedExecutionsPanel.getSelectedComponent())) {
        // Sticky is turned off. Just remove sticky and return.
        _stickyTab = null;
        _tabbedExecutionsPanel.setIconAt(_tabbedExecutionsPanel.getSelectedIndex(), null);
        return;

      } else {
        // remove old sticky tab
        int indexOfStickyTab = getIndexOfTab(_stickyTab);
        if (-1 != indexOfStickyTab) {
          _tabbedExecutionsPanel.setIconAt(indexOfStickyTab, null);
        }
        _stickyTab = null;
      }
    }

    if (false == _tabbedExecutionsPanel.getSelectedComponent() instanceof IResultTab) {
      // i18n[SQLResultExecuterPanel.nonStickyPanel=Cannot make a cancel panel sticky]
      String msg = s_stringMgr.getString("SQLResultExecuterPanel.nonStickyPanel");
      JOptionPane.showMessageDialog(_session.getApplication().getMainFrame(), msg);
      return;
    }

    _stickyTab = (IResultTab) _tabbedExecutionsPanel.getSelectedComponent();
    int selectedIndex = _tabbedExecutionsPanel.getSelectedIndex();

    ImageIcon icon = getStickyIcon();

    _tabbedExecutionsPanel.setIconAt(selectedIndex, icon);
  }
コード例 #2
0
 private void writeCurrentBinding() {
   if (fileType.getSelectedComponent() == bindingLayers) {
     BindingPanel bindingPanel = (BindingPanel) bindingLayers.getSelectedComponent();
     int fileIndex = bindingPanel.fileSelector.getSelectedIndex();
     if (fileIndex >= 0) writeBinding(fileIndex);
   }
 }
コード例 #3
0
  private List<OsmPrimitive> getSelectedSubjectPrimitives() {
    List<OsmPrimitive> selection = new ArrayList<>();
    if (tabbedPane == null || tabbedPane.getSelectedComponent() == null) return selection;

    if (tabbedPane.getSelectedComponent().equals(matchTable)) {
      for (SimpleMatch c : matches.getSelected()) {
        selection.add(c.getSubjectObject());
      }
    } else if (tabbedPane.getSelectedComponent().equals(subjectOnlyList)) {
      selection.addAll(subjectOnlyList.getSelectedValuesList());
    }
    return selection;
  }
コード例 #4
0
 private IBrowserComponent getActivePage() {
   JComponent activeComponent = (JComponent) myComponent.getSelectedComponent();
   if (activeComponent == null) {
     return null;
   }
   return (IBrowserComponent) activeComponent.getClientProperty(this);
 }
コード例 #5
0
 // {{{ processKeyEvent() method
 private void pluginListUpdated() {
   Component selected = tabPane.getSelectedComponent();
   if (selected == installer || selected == updater) {
     installer.updateModel();
     updater.updateModel();
   }
 } // }}}
コード例 #6
0
 /**
  * Returns key in chatPanes hash map for the currently active chat pane, or null in case of an
  * error.
  */
 public String getActiveChatPane() {
   Component c = tabs.getSelectedComponent();
   if (c == null) return null;
   for (String user : chatPanes.keySet()) {
     if (c.equals(chatPanes.get(user).component)) return user;
   }
   return null;
 }
コード例 #7
0
 @Override
 public synchronized void notifyListener() {
   if (isShowing()) {
     final StatePanelForCurrency statePanelForCurrency =
         (StatePanelForCurrency) jTabbedPaneCurrency.getSelectedComponent();
     statePanelForCurrency.notifyListener();
   }
 }
コード例 #8
0
 private void prikaziButtonActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_prikaziButtonActionPerformed
   JTabbedPane jtp = (JTabbedPane) this.getParent().getParent();
   jtp.setSelectedIndex(2);
   Putovanje b = ptm.getPutovanje(putovanjaTable.getSelectedRow());
   PrikazPutovanjaPanel ppp =
       (PrikazPutovanjaPanel) jtp.getSelectedComponent().getComponentAt(0, 0);
   ppp.prikaziPutovanje(b);
 } // GEN-LAST:event_prikaziButtonActionPerformed
コード例 #9
0
 @Override
 public void locationChangeCanceled(WebBrowserNavigationEvent e) {
   JWebBrowser webBrowser = e.getWebBrowser();
   JTabbedPane panel = (JTabbedPane) e.getWebBrowser().getParent();
   if (panel != null)
     if (panel.getSelectedComponent() == webBrowser) {
       updateNavigateButtons(webBrowser);
     }
 }
コード例 #10
0
ファイル: PropertyBox.java プロジェクト: pdh-git/JaamSim
  @Override
  public void updateValues(double simTime) {
    if (currentEntity == null) return;

    JTable propTable =
        (JTable)
            (((JScrollPane) jTabbedFrame.getSelectedComponent()).getViewport().getComponent(0));
    ((PropertyTableModel) propTable.getModel()).fireTableDataChanged();
  }
コード例 #11
0
  public void stateChanged(ChangeEvent e) {
    JScrollPane scrollPane = ((JScrollPane) upperTabbedPane.getSelectedComponent());
    frame.fileLoaded(scrollPane != null);
    if (scrollPane == null) return;

    currentTable = (MessagesTable) scrollPane.getViewport().getView();
    currentModel = (MessagesTableModel) currentTable.getModel();
    menuBar.setSelectedFilter(currentModel.getFilterType());
  }
コード例 #12
0
 @Override
 public void locationChanging(WebBrowserNavigationEvent e) {
   JWebBrowser webBrowser = e.getWebBrowser();
   JTabbedPane panel = (JTabbedPane) e.getWebBrowser().getParent();
   if (panel != null)
     if (panel.getSelectedComponent() == webBrowser) {
       // updateLocation(webBrowser);
       updateStopButton(webBrowser);
     }
 }
コード例 #13
0
 @Override
 public void statusChanged(WebBrowserEvent e) {
   JWebBrowser webBrowser = e.getWebBrowser();
   JTabbedPane panel = (JTabbedPane) e.getWebBrowser().getParent();
   if (panel != null)
     if (panel.getSelectedComponent() == webBrowser) {
       // updateLocation(webBrowser);
       updateStatusLabel(webBrowser);
     }
 }
コード例 #14
0
 public MetricCategory getSelectedCategory() {
   final Component component = tabbedPane.getSelectedComponent();
   for (MetricCategory category : MetricCategory.values()) {
     final JTable table = tables.get(category);
     if (table.getParent().getParent().equals(component)) {
       return category;
     }
   }
   return null;
 }
コード例 #15
0
 public void stateChanged(ChangeEvent e) {
   ConfigurationView view = (ConfigurationView) tabbedPane.getSelectedComponent();
   if (!view.isInitialized()) {
     try {
       view.initialize();
     } catch (Exception e1) {
       POSMessageDialog.showError(this, POSConstants.ERROR_MESSAGE, e1);
     }
   }
 }
コード例 #16
0
 @Override
 public void loadingProgressChanged(WebBrowserEvent e) {
   JWebBrowser webBrowser = e.getWebBrowser();
   JTabbedPane panel = (JTabbedPane) e.getWebBrowser().getParent();
   if (panel != null)
     if (panel.getSelectedComponent() == webBrowser) {
       // updateLocation(webBrowser);
       updateStatusProcessBar(webBrowser);
       updateStopButton(webBrowser);
     }
 }
コード例 #17
0
 public void clearGotoLine() {
   try {
     JTabbedPane tabbedPane = center.frame.getTabbedPane();
     SrcCodeViewer viewer = (SrcCodeViewer) tabbedPane.getSelectedComponent();
     if (viewer != null) {
       viewer.clearGotoLine();
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
コード例 #18
0
  public synchronized void closeAllButCurrentResultTabs() {
    Component selectedTab = _tabbedExecutionsPanel.getSelectedComponent();

    ArrayList<Component> allTabs = getAllTabs();

    for (Component tab : allTabs) {
      if (tab != selectedTab) {
        closeTab(tab);
      }
    }
  }
コード例 #19
0
ファイル: MainFrame.java プロジェクト: NESCent/Phylontal
  public MainFrame(String title, UserFrontEnd ptheApp) {
    super(title);
    theApp = ptheApp;
    // identify the OS

    if (theApp.runningOSX()) initForOSX(); // OSX specific inits
    else if (theApp.runningWindows()) { // Windows specific inits
      initForWindows();
    } else if (theApp.runningLinux()) {
      initForLinux();
    } else {
      JOptionPane.showMessageDialog(
          this,
          "Phylontal doesn't recognize your operating system (yet!)",
          "Operating System unknown",
          JOptionPane.WARNING_MESSAGE);
    }

    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    // add tabbed pane
    tabbedView = new JTabbedPane(JTabbedPane.TOP);
    tabbedView.addChangeListener(this);

    tabbedView.addTab("Project", projectTab = new ProjectTab(theApp));
    tabbedView.addTab("Matcher", matcherTab = new MatcherTab(theApp));

    int matchIndex = tabbedView.indexOfComponent(matcherTab);
    tabbedView.setToolTipTextAt(matchIndex, "Disabled until a project is specified");
    tabbedView.setEnabledAt(matchIndex, false);

    int projectIndex = tabbedView.indexOfComponent(projectTab);
    tabbedView.setToolTipTextAt(projectIndex, "Create or Load a project; specify components");

    currentTabComponent = tabbedView.getSelectedComponent();
    if (currentTabComponent instanceof TabView) {
      resetMenuBar();
      JMenuBar tmpBar = ((TabView) currentTabComponent).initializeMenus();
      if (tmpBar != null) {
        menuBar = tmpBar;
        setJMenuBar(menuBar);
      }
    }

    Container content = getContentPane(); // get content pane
    content.setLayout(new BorderLayout());
    content.add(tabbedView, BorderLayout.CENTER);

    // add icons

    // add preferences Dialog

    preferencesDialog = new PreferencesDialog(this);
  }
コード例 #20
0
ファイル: TemplateEditor.java プロジェクト: knabar/bioformats
  /** Add a new row to the current tab. */
  private void addColumn() {
    JPanel selected = (JPanel) tabPane.getSelectedComponent();
    FormLayout layout = (FormLayout) selected.getLayout();
    layout.appendColumn(new ColumnSpec("pref:grow"));

    int ndx = tabPane.getSelectedIndex();

    for (int i = 0; i < layout.getRowCount(); i++) {
      addIcon(selected, i, layout.getColumnCount() - 1, ndx);
    }
    tabPane.repaint();
  }
コード例 #21
0
  public void moveTab2End() {
    int idx = tabbedPane.getSelectedIndex();
    if (idx == -1 && idx >= tabbedPane.getTabCount()) {
      CC.getLogger().info("Can't move tab to right");
      return;
    }

    JSChannelsPane c = (JSChannelsPane) tabbedPane.getSelectedComponent();
    if (getChannelsPane(idx) != c) CC.getLogger().warning("Channels pane indices don't match");
    removeChannelsPane(c);
    addChannelsPane(c);
    tabbedPane.setSelectedComponent(c);
  }
コード例 #22
0
  public void moveTab2Left() {
    int idx = tabbedPane.getSelectedIndex();
    if (idx < 1) {
      CC.getLogger().info("Can't move tab to left");
      return;
    }

    JSChannelsPane c = (JSChannelsPane) tabbedPane.getSelectedComponent();
    if (getChannelsPane(idx) != c) CC.getLogger().warning("Channels pane indices don't match");
    removeChannelsPane(c);
    insertChannelsPane(c, idx - 1);
    tabbedPane.setSelectedComponent(c);
  }
コード例 #23
0
ファイル: WMSDialog.java プロジェクト: gb96/WorldWind-JAVA
  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();
  }
コード例 #24
0
ファイル: PathogenFrame.java プロジェクト: stevenhwu/ABI
  public JComponent getExportableComponent() {

    JComponent exportable = null;
    Component comp = tabbedPane.getSelectedComponent();

    if (comp instanceof Exportable) {
      exportable = ((Exportable) comp).getExportableComponent();
    } else if (comp instanceof JComponent) {
      exportable = (JComponent) comp;
    }

    return exportable;
  }
コード例 #25
0
ファイル: VTabbedToolPanel.java プロジェクト: timburrow/ovj3
  private Component getSelectedObj() {
    if (tabbedToolPanel.getComponentCount() < 1) return null;
    Component comp = tabbedToolPanel.getComponent(0);
    if (comp instanceof JTabbedPane) {
      JTabbedPane tp = (JTabbedPane) comp;
      if (tp.getTabCount() == 1) {
        comp = tp.getComponentAt(0);
      } else if (tp.getTabCount() > 1) {
        comp = tp.getSelectedComponent();
      }
    }
    if (comp instanceof VToolPanel) return comp;

    if (!(comp instanceof XMLToolPanel)) {
      if (comp instanceof PushpinIF) comp = ((PushpinIF) comp).getPinObj();
    }
    return comp;
  }
コード例 #26
0
ファイル: LaunchFrame.java プロジェクト: nekosune/AZLauncher
 /** Enables all items that are disabled upon launching */
 private void enableObjects() {
   tabbedPane.setEnabledAt(0, true);
   setNewsIcon();
   tabbedPane.setEnabledAt(1, true);
   tabbedPane.setEnabledAt(2, true);
   tabbedPane.setEnabledAt(3, true);
   //		tabbedPane.setEnabledAt(4, true);
   tabbedPane.getSelectedComponent().setEnabled(true);
   updateFooter();
   mapInstall.setEnabled(true);
   mapInstallLocation.setEnabled(true);
   serverMap.setEnabled(true);
   tpInstall.setEnabled(true);
   launch.setEnabled(true);
   users.setEnabled(true);
   serverbutton.setEnabled(true);
   tpInstallLocation.setEnabled(true);
 }
コード例 #27
0
 @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);
     }
   }
 }
コード例 #28
0
ファイル: VTabbedToolPanel.java プロジェクト: timburrow/ovj3
 private void tabChanged() {
   if (bChangeTool) return;
   int index = -1;
   previous_selectedTab = 0;
   if (tabbedPane.getTabCount() > 1) {
     index = tabbedPane.getSelectedIndex();
     Component comp = tabbedPane.getSelectedComponent();
     if (comp != null && (comp instanceof PushpinIF)) {
       PushpinIF pobj = (PushpinIF) comp;
       if (!pobj.isPopup()) previous_selectedTab = index;
     }
   }
   updateSelectedObj();
   if (index >= 0) {
     if (Util.getRQPanel() != null) {
       Util.getRQPanel().updatePopup(tabbedPane.getTitleAt(index));
     }
   }
 }
コード例 #29
0
  /**
   * Reacts to a change in the selected tab by calling refresh() for TabToDoTarget's & setTarget on
   * a TabModelTarget or TabFigTarget instance.
   *
   * <p>Called when the user selects a new tab, by clicking or otherwise.
   *
   * <p>{@inheritDoc}
   */
  public void stateChanged(ChangeEvent e) {
    LOG.log(Level.FINE, "DetailsPane state changed");
    Component sel = topLevelTabbedPane.getSelectedComponent();

    // update the previously selected tab
    if (lastNonNullTab >= 0) {
      JPanel tab = tabPanelList.get(lastNonNullTab);
      if (tab instanceof TargetListener) {
        // not visible any more - so remove as listener
        removeTargetListener((TargetListener) tab);
      }
    }
    Object target = TargetManager.getInstance().getSingleTarget();

    if (!(sel instanceof TabToDoTarget) && !(sel instanceof TabProps)) {
      // TODO: Bob says - tabs that listen for target changes
      // should register themselves not expect DetailsPane to
      // listen and pass on the event. Otherwise these tabs
      // always rely on DetailsPane. TabToDoTarget and TabProps
      // currently listen directly.

      // The other tabs need to be updated depending on the selection.
      if (sel instanceof TabTarget) {
        ((TabTarget) sel).setTarget(target);
      } else if (sel instanceof TargetListener) {
        removeTargetListener((TargetListener) sel);
        addTargetListener((TargetListener) sel);
        // Newly selected tab may have stale target info, so generate
        // a new set target event for it to refresh it
        ((TargetListener) sel)
            .targetSet(
                new TargetEvent(
                    this, TargetEvent.TARGET_SET, new Object[] {}, new Object[] {target}));
      }
    }

    if (target != null
        && Model.getFacade().isAUMLElement(target)
        && topLevelTabbedPane.getSelectedIndex() > 0) {
      lastNonNullTab = topLevelTabbedPane.getSelectedIndex();
    }
  }
コード例 #30
0
  /** Size the divider to the currently selected panel's preferred Size */
  private void resizeSelectedComponent() {
    /*
     * Set default resize behavior based on the currently
     * selected panel's preferredSize setting
     */
    Component panel = tabbedPane.getSelectedComponent();
    // Make sure we're not being notified that we've deleted
    // the last panel
    int width = 0;
    if (panel != null && cytoPanelContainer instanceof JSplitPane) {
      JSplitPane jsp = (JSplitPane) cytoPanelContainer;
      // if the panel is 0x0, it's probably not created, yet
      if (panel.getSize().width == 0 && panel.getSize().height == 0) return;

      if (panel.getPreferredSize() != null) {
        width = panel.getPreferredSize().width;
      }

      if (compassDirection == CytoPanelName.WEST) {
        if (width > WEST_MAX_WIDTH) width = WEST_MAX_WIDTH;
        else if (width < WEST_MIN_WIDTH) width = WEST_MIN_WIDTH;
        jsp.setDividerLocation(width + jsp.getInsets().left + jsp.getInsets().right);
      } else if (compassDirection == CytoPanelName.EAST) {
        if (width > EAST_MAX_WIDTH) width = EAST_MAX_WIDTH;
        else if (width < EAST_MIN_WIDTH) width = EAST_MIN_WIDTH;

        jsp.setDividerLocation(
            jsp.getSize().width
                - jsp.getInsets().right
                - jsp.getInsets().left
                - jsp.getDividerSize()
                - width);
      }
      // TODO: What's the right thing to do with SOUTH?
    }
  }