public void actionPerformed(ActionEvent ae){
  String command=ae.getActionCommand();
  if (command == DisplayPaletteCmd) {
    if (Debug.debugging("layer")) {
      Debug.output(getName() + " displaying palette");
    }
    showPalette();
  }
 else   if (command == HidePaletteCmd) {
    if (Debug.debugging("layer")) {
      Debug.output(getName() + " hiding palette");
    }
    hidePalette();
  }
 else   if (command == DisplayPropertiesCmd) {
    Inspector inspector=new Inspector();
    inspector.inspectPropertyConsumer(this);
  }
}

public void actionPerformed ( ActionEvent ae ) { String command = ae . getActionCommand ( ) ; if ( command == DisplayPaletteCmd ) { if ( Debug . debugging ( "layer" ) ) { Debug . output ( getName ( ) + " displaying palette" ) ; } showPalette ( ) ; } else if ( command == HidePaletteCmd ) { if ( Debug . debugging ( "layer" ) ) { Debug . output ( getName ( ) + " hiding palette" ) ; } hidePalette ( ) ; } else if ( command == DisplayPropertiesCmd ) { Inspector inspector = new Inspector ( ) ; inspector . inspectPropertyConsumer ( this ) ; } }
the default actionperformed method for layer . make sure you call super . actionperformed if you care about receiving palette show / hide commands . this method is also set up to receive the displaypropertiescmd , and will bring up the inspector for the layer .
