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;
 }
Esempio n. 2
0
  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;
  }
Esempio n. 3
0
  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;
  }
Esempio n. 4
0
 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));
     }
   }
 }