public void mousePressed(MouseEvent e){
  if (log.isDebugEnabled()) {
    log.debug("pressed " + (e.getModifiers() & MouseEvent.BUTTON1_MASK) + " "+ e.isPopupTrigger()+ " "+ (e.getModifiers() & (MouseEvent.ALT_MASK + MouseEvent.META_MASK + MouseEvent.CTRL_MASK))+ (" " + MouseEvent.ALT_MASK + "/"+ MouseEvent.META_MASK+ "/"+ MouseEvent.CTRL_MASK));
  }
  JToggleButton button=(JToggleButton)e.getSource();
  if (e.isPopupTrigger()) {
    popup.show(e.getComponent(),e.getX(),e.getY());
  }
 else   if (button.isEnabled() && ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0) && ((e.getModifiers() & (MouseEvent.ALT_MASK + MouseEvent.META_MASK + MouseEvent.CTRL_MASK)) == 0)&& !isLockable) {
    changeState(true);
  }
  button.setSelected(isOn);
}

public void mousePressed ( MouseEvent e ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "pressed " + ( e . getModifiers ( ) & MouseEvent . BUTTON1_MASK ) + " " + e . isPopupTrigger ( ) + " " + ( e . getModifiers ( ) & ( MouseEvent . ALT_MASK + MouseEvent . META_MASK + MouseEvent . CTRL_MASK ) ) + ( " " + MouseEvent . ALT_MASK + "/" + MouseEvent . META_MASK + "/" + MouseEvent . CTRL_MASK ) ) ; } JToggleButton button = ( JToggleButton ) e . getSource ( ) ; if ( e . isPopupTrigger ( ) ) { popup . show ( e . getComponent ( ) , e . getX ( ) , e . getY ( ) ) ; } else if ( button . isEnabled ( ) && ( ( e . getModifiers ( ) & MouseEvent . BUTTON1_MASK ) != 0 ) && ( ( e . getModifiers ( ) & ( MouseEvent . ALT_MASK + MouseEvent . META_MASK + MouseEvent . CTRL_MASK ) ) == 0 ) && ! isLockable ) { changeState ( true ) ; } button . setSelected ( isOn ) ; }
if the event is the popup trigger , which is dependent on the platform , present the popup menu . otherwise change the state of the function depending on the locking state of the button .
