/** * notify listeners of a popup selection * * @param popStr popup selection string */ void popNotify(String popStr) { Enumeration en = popListeners.elements(); for (; en.hasMoreElements(); ) { PopListener listener = (PopListener) en.nextElement(); listener.popHappened(popStr); } } // popNotify()
public boolean comparePanelLayout(int currId, int newId) { if (currId >= nviews || newId >= nviews) return false; if (tp_paneInfo[currId].size() != tp_paneInfo[newId].size()) return true; String key; Object value1; Object value2; for (Enumeration e = tp_paneInfo[currId].keys(); e.hasMoreElements(); ) { key = (String) e.nextElement(); value1 = tp_paneInfo[currId].get(key); value2 = tp_paneInfo[newId].get(key); if (!value1.equals(value2)) return true; } return false; }
public void setViewPort(int id) { if (id >= nviews || id < 0) return; String key; String value; vpId = id; for (Enumeration e = tp_paneInfo[id].keys(); e.hasMoreElements(); ) { key = (String) e.nextElement(); value = (String) tp_paneInfo[id].get(key); if (value.equals("yes")) { JComponent comp = (JComponent) panes.get(key); if (comp instanceof VToolPanel) { ((VToolPanel) comp).setViewPort(id); } else { if (comp instanceof PushpinIF) comp = ((PushpinIF) comp).getPinObj(); if (comp instanceof XMLToolPanel) ((XMLToolPanel) comp).setViewPort(id); } } } }
/** * public void setCurrentLayout(int newId) { * * <p>if(newId >= nviews || vpId >= nviews) return; * * <p>String key; String newValue; String currValue; * * <p>for(int i=0; i<keys.size(); i++) { key = (String)keys.get(i); newValue = * (String)tp_paneInfo[newId].get(key); currValue = (String)tp_paneInfo[vpId].get(key); JComponent * obj = (JComponent)panes.get(key); if(newValue.equals("yes")) { if * (tabbedPane.indexOfComponent((Component)obj) < 0) tabbedPane.addTab(key, null, obj, ""); if * (obj instanceof PushpinIF) ((PushpinIF) obj).setAvailable(true); } else * if(newValue.equals("no")) { if (tabbedPane.indexOfComponent((Component)obj) >= 0) * tabbedPane.remove(obj); if (obj instanceof PushpinIF) ((PushpinIF) obj).setAvailable(false); } * } * * <p>tabbedToolPanel.removeAll(); if(tabbedPane.getTabCount() > 0) { if(tabbedPane.getTabCount() * == 1) { tabbedToolPanel.add(tabbedPane.getComponentAt(0)); } else if(tabbedPane.getTabCount() > * 1) { tabbedToolPanel.add(tabbedPane); } pinPanel.setStatus("open"); } else { * pinPanel.setStatus("close"); setVisible(false); } validate(); repaint(); } */ public void initPanel() { if (panes == null || panes.size() <= 0) return; setCurrentLayout(); String key; for (Enumeration e = panes.keys(); e.hasMoreElements(); ) { key = (String) e.nextElement(); JComponent comp = (JComponent) panes.get(key); if (comp instanceof VToolPanel) ((VToolPanel) comp).initPanel(); else { if (comp instanceof PushpinIF) comp = ((PushpinIF) comp).getPinObj(); if (comp instanceof XMLToolPanel) ((XMLToolPanel) comp).buildPanel(); } /** * ** if(comp instanceof XMLToolPanel) { ((XMLToolPanel)comp).buildPanel(); } else if(comp * instanceof VToolPanel) { ((VToolPanel)comp).initPanel(); } ** */ } if (pinPanel.isOpen()) { if (!pinPanel.isVisible()) pinPanel.setVisible(true); } else pinPanel.setVisible(false); }