public void actionPerformed(ActionEvent e){
  super.actionPerformed(e);
  String cmd=e.getActionCommand();
  if (cmd == showMapsCommand) {
    JCheckBox mapCheck=(JCheckBox)e.getSource();
    viewAttributes.showMaps=mapCheck.isSelected();
    repaint();
  }
 else   if (cmd == showInfoCommand) {
    JCheckBox infoCheck=(JCheckBox)e.getSource();
    boolean showInfo=infoCheck.isSelected();
    viewAttributes.showInfo=showInfo;
    showSubframes(showInfo);
    doPrepare();
  }
 else   if (cmd == lockSeriesCommand) {
    JCheckBox lockCheck=(JCheckBox)e.getSource();
    boolean locked=lockCheck.isSelected();
    if (locked) {
      List<RpfCoverageBox> coverageBoxes=getCoverageBoxes();
      String seriesName;
      if (coverageBoxes == null || coverageBoxes.isEmpty()) {
        seriesName=RpfViewAttributes.ANY;
      }
 else {
        seriesName=coverageBoxes.get(0).chartCode;
      }
      if (seriesName == null) {
        seriesName=RpfViewAttributes.ANY;
        fireRequestMessage("The " + getName() + " Layer is having trouble determining what kind\nof charts are being displayed.  Can't establish lock for charts\ncurrently being viewed.");
      }
      lockCheck.setText(lockedButtonTitle + " - " + seriesName);
      viewAttributes.chartSeries=seriesName;
    }
 else {
      lockCheck.setText(unlockedButtonTitle);
      viewAttributes.chartSeries=RpfViewAttributes.ANY;
    }
  }
 else   if (cmd == showCoverageCommand) {
    if (coverage != null) {
      JCheckBox coverageCheck=(JCheckBox)e.getSource();
      coverage.setInUse(coverageCheck.isSelected());
      doPrepare();
    }
  }
 else {
    doPrepare();
  }
}

public void actionPerformed ( ActionEvent e ) { super . actionPerformed ( e ) ; String cmd = e . getActionCommand ( ) ; if ( cmd == showMapsCommand ) { JCheckBox mapCheck = ( JCheckBox ) e . getSource ( ) ; viewAttributes . showMaps = mapCheck . isSelected ( ) ; repaint ( ) ; } else if ( cmd == showInfoCommand ) { JCheckBox infoCheck = ( JCheckBox ) e . getSource ( ) ; boolean showInfo = infoCheck . isSelected ( ) ; viewAttributes . showInfo = showInfo ; showSubframes ( showInfo ) ; doPrepare ( ) ; } else if ( cmd == lockSeriesCommand ) { JCheckBox lockCheck = ( JCheckBox ) e . getSource ( ) ; boolean locked = lockCheck . isSelected ( ) ; if ( locked ) { List < RpfCoverageBox > coverageBoxes = getCoverageBoxes ( ) ; String seriesName ; if ( coverageBoxes == null || coverageBoxes . isEmpty ( ) ) { seriesName = RpfViewAttributes . ANY ; } else { seriesName = coverageBoxes . get ( 0 ) . chartCode ; } if ( seriesName == null ) { seriesName = RpfViewAttributes . ANY ; fireRequestMessage ( "The " + getName ( ) + " Layer is having trouble determining what kind\nof charts are being displayed.  Can't establish lock for charts\ncurrently being viewed." ) ; } lockCheck . setText ( lockedButtonTitle + " - " + seriesName ) ; viewAttributes . chartSeries = seriesName ; } else { lockCheck . setText ( unlockedButtonTitle ) ; viewAttributes . chartSeries = RpfViewAttributes . ANY ; } } else if ( cmd == showCoverageCommand ) { if ( coverage != null ) { JCheckBox coverageCheck = ( JCheckBox ) e . getSource ( ) ; coverage . setInUse ( coverageCheck . isSelected ( ) ) ; doPrepare ( ) ; } } else { doPrepare ( ) ; } }
the action listener method , that reacts to the palette widgets actions .
