public int getOpenCount() { int num = tabbedToolPanel.getComponentCount(); if (num != 1) return num; Component comp = tabbedToolPanel.getComponent(0); if (comp instanceof JTabbedPane) { JTabbedPane tp = (JTabbedPane) comp; num = tp.getTabCount(); if (num != 1) return num; comp = tp.getComponentAt(0); } if (comp instanceof VToolPanel) num = ((VToolPanel) comp).getOpenCount(); else if (comp instanceof PushpinIF) { if (!((PushpinIF) comp).isOpen()) num = 0; } return num; }
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 boolean containTool(JComponent obj) { int k, num; if (obj == null) return false; Component src = (Component) obj; Component comp; if (tabbedPane != null) { num = tabbedPane.getTabCount(); for (k = 0; k < num; k++) { comp = tabbedPane.getComponentAt(k); if (src == comp) return true; } } if (tabbedToolPanel != null) { num = tabbedToolPanel.getComponentCount(); for (k = 0; k < num; k++) { comp = tabbedToolPanel.getComponent(k); if (src == comp) return true; } } return false; }