コード例 #1
0
  protected void doPaintIcon(@NotNull Graphics2D g, @NotNull Icon icon, int offset) {
    final Container parent = getParent();
    Color iconBackgroundColor = null;
    if ((isOpaque() || isIconOpaque()) && !isTransparentIconBackground()) {
      if (parent != null && !myFocusBorderAroundIcon && !UIUtil.isFullRowSelectionLAF()) {
        iconBackgroundColor = parent.getBackground();
      } else {
        iconBackgroundColor = getBackground();
      }
    }

    if (iconBackgroundColor != null) {
      g.setColor(iconBackgroundColor);
      g.fillRect(offset, 0, icon.getIconWidth() + myIpad.left + myIconTextGap, getHeight());
    }

    paintIcon(g, icon, offset + myIpad.left);
  }
コード例 #2
0
ファイル: Step2Panel.java プロジェクト: ambro2/popeye
  private JPanel getContentPanel(WizardData wzd) {

    JPanel contentPanel1 = new JPanel();

    welcomeTitle = new JLabel();

    contentPanel1.setLayout(new java.awt.BorderLayout());

    welcomeTitle.setFont(new java.awt.Font("MS Sans Serif", Font.BOLD, 11));
    welcomeTitle.setText("Please insert already existing language files!");
    contentPanel1.add(welcomeTitle, BorderLayout.NORTH);

    // ------------------------------------------------------------------------
    Container mainPanel = new JPanel();
    SpringLayout layout = new SpringLayout();
    mainPanel.setLayout(layout);

    JTextArea infoText = new JTextArea();
    infoText.setLineWrap(false);
    infoText.setEditable(false);
    infoText.setFocusable(false);
    infoText.setBackground(mainPanel.getBackground());
    infoText.append(TInfoText.runtime.getText("newwizard", "site2"));

    JDialog parent = null;
    if (wzd.getWizard() != null) {
      parent = wzd.getWizard().getDialog();
    }
    table = new LanguageManagerPanel(TGlobal.projects.getCurrentProject(), parent, true);

    rescanButton.addActionListener(this);
    baseButton.addActionListener(this);

    // Create and add the components.
    mainPanel.add(infoText);
    mainPanel.add(baseLabel);
    mainPanel.add(baseField);
    mainPanel.add(baseButton);
    mainPanel.add(rescanButton);
    mainPanel.add(table);

    // infoText
    layout.putConstraint(SpringLayout.WEST, infoText, 5, SpringLayout.WEST, mainPanel);
    layout.putConstraint(SpringLayout.NORTH, infoText, 5, SpringLayout.NORTH, mainPanel);

    // baseLabel -------------------------------------------------------------
    layout.putConstraint(SpringLayout.WEST, baseLabel, 0, SpringLayout.WEST, infoText);
    layout.putConstraint(SpringLayout.NORTH, baseLabel, 12, SpringLayout.SOUTH, infoText);

    // nameField
    layout.putConstraint(SpringLayout.WEST, baseField, 5, SpringLayout.EAST, baseLabel);
    layout.putConstraint(SpringLayout.NORTH, baseField, 10, SpringLayout.SOUTH, infoText);

    // baseButton
    layout.putConstraint(SpringLayout.WEST, baseButton, 5, SpringLayout.EAST, baseField);
    layout.putConstraint(SpringLayout.NORTH, baseButton, 7, SpringLayout.SOUTH, infoText);

    // rescanButton
    layout.putConstraint(SpringLayout.WEST, rescanButton, 5, SpringLayout.EAST, baseButton);
    layout.putConstraint(SpringLayout.NORTH, rescanButton, 7, SpringLayout.SOUTH, infoText);

    // table
    layout.putConstraint(SpringLayout.WEST, table, 5, SpringLayout.WEST, mainPanel);
    layout.putConstraint(SpringLayout.NORTH, table, 15, SpringLayout.SOUTH, baseField);

    // panel edges ------------------------------------------------------
    layout.putConstraint(SpringLayout.EAST, mainPanel, 5, SpringLayout.EAST, infoText);
    layout.putConstraint(SpringLayout.SOUTH, mainPanel, 5, SpringLayout.SOUTH, table);

    layout.layoutContainer(mainPanel);
    contentPanel1.add(mainPanel, BorderLayout.CENTER);

    return contentPanel1;
  }