private void doTextFieldActionPerformed(JTextField source) { if (isUpdating) return; try { String inputText = source.getText().trim(); NumberValue nv; nv = app.getKernel().getAlgebraProcessor().evaluateToNumeric(inputText, false); double value = nv.getDouble(); if (source == fldXMin) { settings.xMin = value; firePropertyChange("settings", true, false); } else if (source == fldXMax) { settings.xMax = value; firePropertyChange("settings", true, false); } else if (source == fldYMax) { settings.yMax = value; firePropertyChange("settings", true, false); } else if (source == fldYMin) { settings.yMin = value; firePropertyChange("settings", true, false); } else if (source == fldXInterval) { settings.xAxesInterval = value; firePropertyChange("settings", true, false); } else if (source == fldYInterval) { settings.yAxesInterval = value; firePropertyChange("settings", true, false); } } catch (NumberFormatException e) { e.printStackTrace(); } }
public void actionPerformed(ActionEvent e) { if (isUpdating) return; Object source = e.getSource(); if (source instanceof JTextField) { doTextFieldActionPerformed((JTextField) source); } else if (source == ckManual) { settings.useManualClasses = ckManual.isSelected(); firePropertyChange("settings", true, false); } else if (source == ckCumulative) { settings.isCumulative = ckCumulative.isSelected(); firePropertyChange("settings", true, false); } else if (source == rbFreq) { settings.frequencyType = StatPanelSettings.TYPE_COUNT; firePropertyChange("settings", true, false); } else if (source == rbRelative) { settings.frequencyType = StatPanelSettings.TYPE_RELATIVE; firePropertyChange("settings", true, false); } else if (source == rbNormalized) { settings.frequencyType = StatPanelSettings.TYPE_NORMALIZED; firePropertyChange("settings", true, false); } else if (source == ckOverlayNormal) { settings.hasOverlayNormal = ckOverlayNormal.isSelected(); firePropertyChange("settings", true, false); } else if (source == ckOverlayPolygon) { settings.hasOverlayPolygon = ckOverlayPolygon.isSelected(); firePropertyChange("settings", true, false); } else if (source == ckShowGrid) { settings.showGrid = ckShowGrid.isSelected(); firePropertyChange("settings", true, false); } else if (source == ckAutoWindow) { settings.isAutomaticWindow = ckAutoWindow.isSelected(); firePropertyChange("settings", true, false); } else if (source == ckShowFrequencyTable) { settings.showFrequencyTable = ckShowFrequencyTable.isSelected(); firePropertyChange("settings", true, false); } else if (source == rbLeftRule || source == rbRightRule) { settings.isLeftRule = rbLeftRule.isSelected(); firePropertyChange("settings", true, false); } else if (source == this.ckShowLines) { settings.showScatterplotLine = ckShowLines.isSelected(); firePropertyChange("settings", true, false); } else { firePropertyChange("settings", true, false); } updateGUI(); }