public void actionPerformed(ActionEvent e){
  Object source=e.getSource();
  String command=e.getActionCommand();
  String interString;
  Paint tmpPaint;
  if (command == LineColorCommand && linePaint instanceof Color) {
    interString=i18n.get(DrawingAttributes.class,"chooseLineColor","Choose Line Color");
    tmpPaint=getNewPaint((Component)source,interString,(Color)linePaint);
    if (tmpPaint != null) {
      setLinePaint(tmpPaint);
    }
  }
 else   if (command == FillColorCommand && fillPaint instanceof Color) {
    interString=i18n.get(DrawingAttributes.class,"chooseFillColor","Choose Fill Color");
    tmpPaint=getNewPaint((Component)source,interString,(Color)fillPaint);
    if (tmpPaint != null) {
      setFillPaint(tmpPaint);
    }
  }
 else   if (command == SelectColorCommand && selectPaint instanceof Color) {
    interString=i18n.get(DrawingAttributes.class,"chooseSelectColor","Choose Select Color");
    tmpPaint=getNewPaint((Component)source,interString,(Color)selectPaint);
    if (tmpPaint != null) {
      setSelectPaint(tmpPaint);
    }
  }
 else   if (command == MattingColorCommand && mattingPaint instanceof Color) {
    interString=i18n.get(DrawingAttributes.class,"chooseMattingColor","Choose Matting Color");
    tmpPaint=getNewPaint((Component)source,interString,(Color)mattingPaint);
    if (tmpPaint != null) {
      setMattingPaint(tmpPaint);
    }
  }
 else   if (command == MattedCommand) {
    setMatted(mattedEnabledItem.getState());
  }
 else {
    if (logger.isLoggable(Level.FINE)) {
      logger.fine("unrecognized command > " + command);
    }
  }
}

public void actionPerformed ( ActionEvent e ) { Object source = e . getSource ( ) ; String command = e . getActionCommand ( ) ; String interString ; Paint tmpPaint ; if ( command == LineColorCommand && linePaint instanceof Color ) { interString = i18n . get ( DrawingAttributes . class , "chooseLineColor" , "Choose Line Color" ) ; tmpPaint = getNewPaint ( ( Component ) source , interString , ( Color ) linePaint ) ; if ( tmpPaint != null ) { setLinePaint ( tmpPaint ) ; } } else if ( command == FillColorCommand && fillPaint instanceof Color ) { interString = i18n . get ( DrawingAttributes . class , "chooseFillColor" , "Choose Fill Color" ) ; tmpPaint = getNewPaint ( ( Component ) source , interString , ( Color ) fillPaint ) ; if ( tmpPaint != null ) { setFillPaint ( tmpPaint ) ; } } else if ( command == SelectColorCommand && selectPaint instanceof Color ) { interString = i18n . get ( DrawingAttributes . class , "chooseSelectColor" , "Choose Select Color" ) ; tmpPaint = getNewPaint ( ( Component ) source , interString , ( Color ) selectPaint ) ; if ( tmpPaint != null ) { setSelectPaint ( tmpPaint ) ; } } else if ( command == MattingColorCommand && mattingPaint instanceof Color ) { interString = i18n . get ( DrawingAttributes . class , "chooseMattingColor" , "Choose Matting Color" ) ; tmpPaint = getNewPaint ( ( Component ) source , interString , ( Color ) mattingPaint ) ; if ( tmpPaint != null ) { setMattingPaint ( tmpPaint ) ; } } else if ( command == MattedCommand ) { setMatted ( mattedEnabledItem . getState ( ) ) ; } else { if ( logger . isLoggable ( Level . FINE ) ) { logger . fine ( "unrecognized command > " + command ) ; } } }
the drawingattributes method for handling actionevents . used to handle the gui actions , like changing the colors , line widths , etc .
