コード例 #1
0
 public void putValue(String key, Object newValue) {
   super.putValue(key, newValue);
   if (key == Actions.SELECTED_KEY) {
     if (palette != null) {
       AbstractOSXApplication application = getApplication();
       boolean b = (Boolean) newValue;
       if (b) {
         application.addPalette(palette);
         palette.setVisible(true);
       } else {
         application.removePalette(palette);
         palette.setVisible(false);
       }
     }
   }
 }
コード例 #2
0
  public void setPalette(Window newValue) {
    AbstractOSXApplication application = getApplication();
    if (palette != null) {
      palette.removeWindowListener(windowHandler);
    }

    palette = newValue;

    if (palette != null) {
      palette.addWindowListener(windowHandler);
      if (getValue(Actions.SELECTED_KEY) == Boolean.TRUE) {
        application.addPalette(palette);
        palette.setVisible(true);
      } else {
        application.removePalette(palette);
        palette.setVisible(false);
      }
    }
  }