/** Implementation of ActionListener interface. */ public void actionPerformed(ActionEvent e) { // Determine which button was pressed. Object source = e.getSource(); if (source instanceof Button) { Button bpressed = (Button)source; if(bpressed==bSyncAll) { if (wList == null) return; // Select all items on list. Vector v = new Vector(); Integer I; for(int i=0; i<wList.getItemCount();++i) { wList.select(i); I = (Integer)vListMap.elementAt(i); v.addElement(I); } addWindows(v); } else if(bpressed==bUnsyncAll) { removeAllWindows(); } } else if (wList != null && source == wList) { // Doubleclick on entry in wList addSelections(); } }
/** Implementation of ActionListener interface. */ public void actionPerformed(ActionEvent e) { // Determine which button was pressed. Object source = e.getSource(); if (source instanceof Button) { Button bpressed = (Button)source; if(bpressed==bSyncAll) { if (wList == null) return; // Select all items on list. Vector v = new Vector(); Integer I; for(int i=0; i<wList.getItemCount();++i) { wList.select(i); I = (Integer)vListMap.elementAt(i); v.addElement(I); } addWindows(v); } else if(bpressed==bUnsyncAll) { removeAllWindows(); } } else if (wList != null && source == wList) { // Doubleclick on entry in wList addSelections(); } }
/** Item Listener method */ public void itemStateChanged(ItemEvent e) { // safest way to get matching of selected windows in list and in plugin: // deselect all windows in plugin and then select all in list // A List often does not do what you expect. if (wList != null && e.getSource() == wList) { if(vwins != null) { // unsynchronize all windows and remove from window list Integer I; for(int n = 0; n<vwins.size();++n) { I = (Integer)vwins.elementAt(n); removeWindow(I); } vwins.removeAllElements(); } addSelections(); } if (cCoords != null && e.getSource() == cCoords) { if (cScaling != null && e.getStateChange() == ItemEvent.DESELECTED) cScaling.setState(false); } if (cScaling != null && e.getSource() == cScaling) { if (cCoords != null && e.getStateChange() == ItemEvent.SELECTED) cCoords.setState(true); } }
/** Item Listener method */ public void itemStateChanged(ItemEvent e) { // safest way to get matching of selected windows in list and in plugin: // deselect all windows in plugin and then select all in list // A List often does not do what you expect. if (wList != null && e.getSource() == wList) { if(vwins != null) { // unsynchronize all windows and remove from window list Integer I; for(int n = 0; n<vwins.size();++n) { I = (Integer)vwins.elementAt(n); removeWindow(I); } vwins.removeAllElements(); } addSelections(); } if (cCoords != null && e.getSource() == cCoords) { if (cScaling != null && e.getStateChange() == ItemEvent.DESELECTED) cScaling.setState(false); } if (cScaling != null && e.getSource() == cScaling) { if (cCoords != null && e.getStateChange() == ItemEvent.SELECTED) cCoords.setState(true); } }