private void saveSettings() {
   final JavaRefactoringSettings settings = JavaRefactoringSettings.getInstance();
   settings.INTRODUCE_PARAMETER_CREATE_FINALS = myDeclareFinalCheckBox.isSelected();
   if (myGetterPanel.isVisible()) {
     settings.INTRODUCE_PARAMETER_REPLACE_FIELDS_WITH_GETTERS = getReplaceFieldsWithGetter();
   }
   if (myForceReturnCheckBox.isEnabled() && mySignaturePanel.isVisible()) {
     GroovyApplicationSettings.getInstance().FORCE_RETURN = myForceReturnCheckBox.isSelected();
   }
 }
Esempio n. 2
0
 /**
  * Invoked when the mouse exits a component.
  *
  * @param e MouseEvent object pertaining to the component on which mouse exited
  */
 @Override
 public void mouseExited(MouseEvent e) {
   boolean notOnMain =
       introPanel.isVisible()
           || highScoresPanel.isVisible()
           || achievementsPanel.isVisible()
           || helpPanel.isVisible()
           || aboutPanel.isVisible();
   if (!pressed && !notOnMain) {
     ((JLabel) e.getComponent()).setIcon(new ImageIcon(getImage(e.getComponent())));
     getButton(e.getComponent(), false).setVisible(false);
   }
   tempEntered = false; // mouse has left component area
 }
Esempio n. 3
0
  public void enableControlPanel() {
    boolean bVisible = false;

    int nmembers = buttonPane.getComponentCount();
    for (int k = 0; k < nmembers; k++) {
      Component comp = buttonPane.getComponent(k);
      if (comp != null) {
        if (comp.isVisible() || comp.isEnabled()) {
          bVisible = true;
          break;
        }
      }
    }

    if (bVisible && !buttonPane.isVisible()) {
      Dimension dim = getSize();
      Dimension dim1 = buttonPane.getPreferredSize();
      int w = dim.width;
      int h = dim.height + dim1.height;
      if (dim1.width > w) w = dim1.width;
      if (w < 300) w = 300;
      if (h < 200) h = 200;
      setSize(w, h);
    }
    buttonPane.setVisible(bVisible);
  }
Esempio n. 4
0
 public void actionPerformed(ActionEvent e) {
   if (e.getSource() == enableDefaultEncryption) {
     loadStates();
   } else if (e.getSource() == cmdExpandAdvancedSettings) {
     pnlAdvancedSettings.setVisible(!pnlAdvancedSettings.isVisible());
   }
 }
Esempio n. 5
0
 /** @return If the style bar should be visible. */
 protected boolean isStyleBarVisible() {
   if (id == App.VIEW_EUCLIDIAN || id == App.VIEW_EUCLIDIAN2 || id == App.VIEW_ALGEBRA) {
     if (!app.getSettings().getLayout().isAllowingStyleBar()) {
       return false;
     }
   }
   return (showStyleBar || !titlePanel.isVisible());
 }
Esempio n. 6
0
  /**
   * If the <code>preferredSize</code> has been set to a non-<code>null</code> value just returns
   * it. If the UI delegate's <code>getPreferredSize</code> method returns a non <code>null</code>
   * value then return that; otherwise defer to the component's layout manager.
   *
   * @return the value of the <code>preferredSize</code> property
   * @see #setPreferredSize
   * @see javax.swing.plaf.ComponentUI
   */
  @Override
  public Dimension getPreferredSize() {
    if (listPanel == null) {
      return super.getPreferredSize();
    } else {

      Dimension d = listPanel.getPreferredSize();
      Component p = getRootPane();
      int h = listPanel.isVisible() ? d.height : 0;
      int w = p == null ? d.width : getParent().getWidth();
      return new Dimension(w, 3 + 3 + 30 + h);
    }
  }
Esempio n. 7
0
  /** Update the style bar visibility. */
  public void updateStyleBarVisibility() {

    if (!isVisible()) return;

    styleBarPanel.setVisible(isStyleBarVisible());
    updateToggleStyleBarButtons();
    updateTitleBar();

    if (isStyleBarVisible()) {
      setStyleBar();
      styleBar.setVisible(showStyleBar);
      styleBarButtonPanel.setVisible(!titlePanel.isVisible());
    }
  }
Esempio n. 8
0
  public boolean validateInput() {

    String left = textField.getText();
    if (StringUtils.isBlank(left)) {
      MessageDialogs.alert("WSCA0006");
      return false;
    }
    int leftColumnNumber = Integer.parseInt(left);

    if (leftColumnNumber <= 0) {
      MessageDialogs.alert("WSCA0007", SCBundle.get("key.columnNumber"));
      return false;
    }

    CellValue l = new CellValue(leftColumnNumber);

    String[] right = getRight();

    boolean columnVal =
        lowerPanel.isVisible() && colValCheckBox.isEnabled() && colValCheckBox.isSelected();
    boolean caseSensitive =
        lowerPanel.isVisible() && casecheckBox.isEnabled() && casecheckBox.isSelected();

    Criteria criteria = (Criteria) criteriaCombo.getSelectedItem();

    FilterConditionItem filterConditionItem;
    switch (criteria) {
      case IS_EMPTY:
      case IS_NOT_EMPTY:
      case IS_A_NUMERIC:
      case IS_NOT_A_NUMERIC:
      case EXISTS:
      case DOES_NOT_EXISTS:
        filterConditionItem = new FilterConditionItem(l, criteria);
        break;
      case MATCHES_THE_REGEX_OF:
        Regex regex = new Regex(right[0], caseSensitive);
        if (!regex.isValid()) {
          MessageDialogs.alert("WSCA0009", regex.getError());
          return false;
        }
        filterConditionItem =
            new FilterConditionItem(l, criteria, new FixedValue(right[0]), caseSensitive);
        break;
      default:
        IValue[] r = new IValue[right.length];
        for (int i = 0; i < r.length; i++) {
          if (columnVal) {
            if (!com.smoothcsv.commons.utils.StringUtils.isNumber(right[i])) {
              MessageDialogs.alert("WSCA0008", SCBundle.get("key.columnNumber"));
              return false;
            }
            int ri = Integer.parseInt(right[i]);
            if (ri <= 0) {
              MessageDialogs.alert("WSCA0007", SCBundle.get("key.columnNumber"));
              return false;
            }
            r[i] = new CellValue(ri);
          } else {
            switch (criteria) {
              case IS_A_NUMBER_GREATER_THAN:
              case IS_A_NUMBER_LESS_THAN:
              case IS_A_NUMBER_EQUAL_TO_OR_GREATER_THAN:
              case IS_A_NUMBER_EQUAL_TO_OR_LESS_THAN:
                if (!StringUtils.isNumeric(right[i])) {
                  MessageDialogs.alert("WSCA0010");
                  return false;
                }
                break;
              default:
                break;
            }
            r[i] = new FixedValue(right[i]);
          }
        }
        filterConditionItem = new FilterConditionItem(l, criteria, r, caseSensitive);
        break;
    }

    this.filterConditionItem = filterConditionItem;

    return true;
  }
 public JComponent getPreferredFocusedComponent() {
   return myDesignerCard.isVisible() ? myGlassLayer : myErrorPanel;
 }
 public void toggleDetailVisibility(String key) {
   JPanel p = keyDetailComponentMap.get(key);
   toggleDetailVisibility(key, !p.isVisible());
 }
Esempio n. 11
0
 public boolean isPanelVisible() {
   return controlPanel.isVisible();
 }
Esempio n. 12
0
 protected void updateTitleBarIfNecessary() {
   if (titlePanel.isVisible()) {
     updateTitleBar();
   }
 }
Esempio n. 13
0
  // Hotkeys!
  public void keyPressed(KeyEvent e) {
    int keyID = e.getKeyCode();

    if (scene == OVERWORLD) {
      if (keyID == KeyEvent.VK_UP || keyID == KeyEvent.VK_W) {
        moveUp = true;
      }
      if (keyID == KeyEvent.VK_DOWN || keyID == KeyEvent.VK_S) {
        moveDown = true;
      }
      if (keyID == KeyEvent.VK_LEFT || keyID == KeyEvent.VK_A) {
        moveLeft = true;
      }
      if (keyID == KeyEvent.VK_RIGHT || keyID == KeyEvent.VK_D) {
        moveRight = true;
      }

      if (keyID == KeyEvent.VK_ENTER) {
        // Toggle the visible state of the Game Menu
        Boolean visibleState = menuScreen.isVisible();
        menuScreen.setVisible(!visibleState);
      }

      for (int enemyNum = 0; enemyNum < enemies.size(); enemyNum++) {
        Enemy enemy = enemies.get(enemyNum);
        if (enemy.hitbox().intersects(player.hitbox())) {
          player.combatChange(true);
          enemy.combatChange(true);
          battleBegin();
        }
      }
    } else if (scene == BATTLE) {
      if (keyID == KeyEvent.VK_SPACE
          && player.getStamina() >= 33.3
          && !player.getDeath()
          && !battleWon) {
        int target = 0;
        spellsThrown.add(
            new Spell(
                0,
                new Color(153, 76, 0),
                player.centerX(),
                player.centerY(),
                enemies.get(target).centerX(),
                enemies.get(target).centerY(),
                target));
        player.staminaGain(-333);
      }
      if (keyID == KeyEvent.VK_ENTER
          && player.getStamina() == 100
          && !player.getDeath()
          && !battleWon) {
        int target = 0;
        spellsThrown.add(
            new Spell(
                1,
                Color.LIGHT_GRAY,
                player.centerX(),
                player.centerY(),
                enemies.get(target).centerX(),
                enemies.get(target).centerY(),
                target));
        player.staminaGain(-1000);
      }
      if ((keyID == KeyEvent.VK_ENTER || keyID == KeyEvent.VK_SPACE) && battleWon) {
        if (player.levelUp()) {
          nextWindow = true;
        } else {
          battleEnd();
        }
      }
    }
    repaint();
  }
Esempio n. 14
0
  @Override
  public void keyPressed(KeyEvent e) {

    switch (e.getKeyCode()) {
      case KeyEvent.VK_A:
        if (panel.isVisible()) {
          panel.setVisible(false);
          tempPanel = "achievements";
          achievementsPanel.setVisible(true);
        }
        break;
      case KeyEvent.VK_S:
        if (panel.isVisible()) {
          panel.setVisible(false);
          tempPanel = "highscores";
          highScoresPanel.setVisible(true);
        }
        break;
      case KeyEvent.VK_I:
        if (panel.isVisible()) {
          panel.setVisible(false);
          tempPanel = "about";
          aboutPanel.setVisible(true);
        }
        break;
      case KeyEvent.VK_P:
        if (panel.isVisible()) {
          introPanel.setVisible(true);
        }
        break;
      case KeyEvent.VK_Q:
        if (panel.isVisible()) {
          System.exit(0);
        }
        break;
      case KeyEvent.VK_ENTER:
        if (introPanel.isVisible()) {
          if (((InfoScreen) introPanel).getInfo().equals("introone"))
            ((InfoScreen) introPanel).setInfo("introfelix");
          else if (((InfoScreen) introPanel).getInfo().equals("introfelix"))
            ((InfoScreen) introPanel).setInfo("introtwo");
          else {
            menuMusic.stop();
            dispose();
            WordSearch ws = new WordSearch();
          }
        }
        break;
      case KeyEvent.VK_H:
        try {
          Runtime.getRuntime().exec("hh.exe assets/Help/FelixHelpMenu.chm");
        } catch (Exception ee) {
        }
        break;
      case KeyEvent.VK_B:
        if (!panel.isVisible()) {
          getPanel(tempPanel).setVisible(false);
          panel.setVisible(true);
        }
        break;
    }
  }