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; }
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)); } } }