/** * Filters a PMData's measurements by the modifier of each measurement... the format for the data * should be such for each modifier, there is parameter name/value pairs for each parameter name * supplied. the resulting list is a list of String arrays with the parameters * * @param data PMData: the PM data object * @param params String[]: the PM parameters * @param includeMod boolean: include modifier as first value if true * @return ArrayList: a list of string arrays */ public static ArrayList processByMod(PMData data, String[] params, boolean includeMod) { if (data != null) { // table for temporary storage of param lists... Hashtable ht = new Hashtable(); // for each param... for (int i = 0; i < params.length; i++) { PmMeasurement[] m = data.getMeasurementList(); for (int j = 0; j < m.length; j++) { if (m[j].getParameterName().equals(params[i])) { String mod = m[j].getModifier(); if (mod == null) { mod = "?"; } String[] datum = (String[]) ht.get(mod); int offset = (includeMod ? 1 : 0); if (datum == null) { if (includeMod) { datum = new String[params.length + 1]; datum[0] = mod; } else { datum = new String[params.length]; } for (int k = 0; k < params.length; k++) { datum[k + offset] = ""; } } datum[i + offset] = m[j].getParameterValue(); ht.put(mod, datum); } } } return new ArrayList(ht.values()); } return null; }
/** * Implements ChangeListener.stateChanged. Enables the hangup button if ones selects a tab in the * main tabbed pane that contains a call panel. */ public void stateChanged(ChangeEvent e) { this.updateButtonsStateAccordingToSelectedPanel(); Component selectedPanel = mainFrame.getSelectedTab(); if (selectedPanel == null || !(selectedPanel instanceof CallPanel)) { Iterator callPanels = activeCalls.values().iterator(); while (callPanels.hasNext()) { CallPanel callPanel = (CallPanel) callPanels.next(); callPanel.removeDialogs(); } } }