Пример #1
0
  private static Component createDescription(Example example, ExampleGroup group) {
    Color foreground = group.getPreferredForeground();

    WebLabel titleLabel = new WebLabel(example.getTitle(), JLabel.TRAILING);
    titleLabel.setDrawShade(true);
    titleLabel.setForeground(foreground);
    if (foreground.equals(Color.WHITE)) {
      titleLabel.setShadeColor(Color.BLACK);
    }

    if (example.getDescription() == null) {
      return titleLabel;
    } else {
      WebLabel descriptionLabel = new WebLabel(example.getDescription(), WebLabel.TRAILING);
      descriptionLabel.setForeground(Color.GRAY);
      SwingUtils.changeFontSize(descriptionLabel, -1);

      WebPanel vertical =
          new WebPanel(new VerticalFlowLayout(VerticalFlowLayout.MIDDLE, 0, 0, true, false));
      vertical.setOpaque(false);
      vertical.add(titleLabel);
      vertical.add(descriptionLabel);

      return vertical;
    }
  }
Пример #2
0
  public void BuildComponents() {
    pawnEdit.setDrawShade(true);
    pawnEdit.setShadeColor(new Color(221, 20, 20));

    TooltipManager.addTooltip(RRButton, "Clears map of all raiders");
    TooltipManager.addTooltip(
        CRButton, "Converts all raiders to colonists. This is unstable use at own risk");
    TooltipManager.addTooltip(CEButton, "Not completed, minimal features implemented");

    createBorder();
    app.add(pawnEdit);
    app.add(RRButton);
    app.add(CRButton);
    app.add(CEButton);

    pawnEdit.setBounds(260, 225, 80, 25);
    RRButton.setBounds(260, 250, 100, 25);
    CRButton.setBounds(360, 250, 100, 25);
    CEButton.setBounds(260, 275, 140, 25);

    RRButton.addActionListener(rrl);
    CRButton.addActionListener(crl);
    CEButton.addActionListener(cel);
  }