コード例 #1
0
  protected JXTaskPane getResourcesPane() {
    if (resourcesPane == null) {
      resourcesPane = new JXTaskPane(STLConstants.K1062_SEL_RESOURCES.getValue());
      resourcesPane.setUI(new IntelTaskPaneUI());
      // turned off animation because it has some issues with JScrollPane
      // under our current BorderLayout. Basically we use BorderLayout
      // because we want the <code>resourcePane</code> takes all the
      // remainder space. But the animation intends to specify
      // resourcePane's size (fixed size). The confliction between the the
      // LayoutManager and the animation causes issues. So we turned
      // animation off here.
      resourcesPane.setAnimated(false);

      JPanel content = (JPanel) resourcesPane.getContentPane();
      content.setLayout(new BorderLayout());
      resourcesPanel = new JPanel();
      resourcesPanel.setBackground(UIConstants.INTEL_WHITE);
      resourcesPanel.setBorder(
          BorderFactory.createMatteBorder(2, 2, 2, 2, UIConstants.INTEL_BACKGROUND_GRAY));
      resourcesPanel.setLayout(new GridBagLayout());
      JScrollPane listScroller = new JScrollPane(resourcesPanel);
      listScroller.setBorder(null);
      content.add(listScroller, BorderLayout.CENTER);
    }
    return resourcesPane;
  }
コード例 #2
0
ファイル: JXTaskPane.java プロジェクト: holatuwol/kolmafia
  /** Creates a new empty <code>JXTaskPane</code>. */
  public JXTaskPane() {
    collapsePane = new JXCollapsiblePane();
    super.setLayout(new BorderLayout(0, 0));
    super.addImpl(collapsePane, BorderLayout.CENTER, -1);

    updateUI();
    setFocusable(true);

    // disable animation if specified in UIManager
    setAnimated(!Boolean.FALSE.equals(UIManager.get("TaskPane.animate")));

    // listen for animation events and forward them to registered listeners
    collapsePane.addPropertyChangeListener(
        JXCollapsiblePane.ANIMATION_STATE_KEY,
        new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent evt) {
            JXTaskPane.this.firePropertyChange(
                evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
          }
        });
  }