public void valueChanged(ListSelectionEvent evt) { if (evt.getSource() == mYParamList.getJList()) { mSelYParam = mYParamList.getJList().getSelectedIndex(); setAdvancedValues(); } generatePlotName(); }
public void generatePlotName() { String yVarText = (String) mYParamList.getJList().getSelectedValue(); if (yVarText == null || yVarText.length() == 0) { yVarText = "?"; } String offsetStr = null; if (b1.isSelected()) { offsetStr = "Seq"; } else if (b2.isSelected()) { offsetStr = "Dist"; } else { offsetStr = "Time"; } String nameString = new String(yVarText + "-" + offsetStr + " (" + mFileViewer.mFileViewerName + ")"); mNameField.setText(nameString); }
public StnPlotSpecification createPlotSpec() { StnPlotSpecification ps = new StnPlotSpecification(); // get the colors ps.setFGColor(axesColor.getColor()); ps.setBGColor(plotBg.getColor()); ps.setSectionType(mOffset); ps.setFileViewer(mFileViewer); ps.setXStnVarCode(mSelYParam); ps.setYStnVarName(new String((String) mYParamList.getJList().getSelectedValue())); ps.setWinTitle(mNameField.getText()); ps.setYGrid(mPlotYGrid.isSelected()); ps.setXGrid(mPlotXGrid.isSelected()); ps.setReverseY(mReverseY.isSelected()); ps.setSymbol(mCurrSymbol); ps.setSymbolSize(((Integer) mSizeField.getValue()).intValue()); ps.setConnectObs(mConnectObs.isSelected()); ps.setLineColor(mLineColorSwatch.getColor()); ps.setSymbolColor(mSymbolColorSwatch.getColor()); boolean error = false; try { ps.setWinYPlotMin(Double.valueOf(yMin.getText()).doubleValue()); } catch (NumberFormatException ex) { error = true; } try { ps.setWinYPlotMax(Double.valueOf(yMax.getText()).doubleValue()); } catch (NumberFormatException ex) { error = true; } try { ps.setYInc(Double.valueOf(yInc.getText()).doubleValue()); } catch (NumberFormatException ex) { error = true; } ps.setYTics(((Integer) yTics.getValue()).intValue()); if (mOffset == JOAConstants.PROFSEQUENCE || mOffset == JOAConstants.PROFDISTANCE) { try { ps.setWinXPlotMin(Double.valueOf(xMin.getText()).doubleValue()); } catch (NumberFormatException ex) { error = true; } try { ps.setWinXPlotMax(Double.valueOf(xMax.getText()).doubleValue()); } catch (NumberFormatException ex) { error = true; } try { ps.setXInc(Double.valueOf(xInc.getText()).doubleValue()); } catch (NumberFormatException ex) { error = true; } } else { long startTime = ((Date) mStartSpinner.getValue()).getTime(); long endTime = ((Date) mEndSpinner.getValue()).getTime(); ps.setWinXPlotMin(startTime); ps.setWinXPlotMax(endTime); } ps.setXTics(((Integer) xTics.getValue()).intValue()); if (error) { // post alert } return ps; }