Ejemplo n.º 1
0
  /**
   * The constructor that will add the items to this panel.
   *
   * @param freeColClient The <code>FreeColClient</code> for the game.
   * @param id The object identifier of the item to select.
   */
  public ColopediaPanel(FreeColClient freeColClient, String id) {
    super(
        freeColClient,
        new MigLayout("fill", "[200:]unrelated[550:, grow, fill]", "[][grow, fill][]"));

    header = GUI.getDefaultHeader(Messages.message("menuBar.colopedia"));
    add(header, "span, align center");

    listPanel = new MigPanel("ColopediaPanelUI");
    listPanel.setOpaque(true);
    JScrollPane sl =
        new JScrollPane(
            listPanel,
            JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    sl.getVerticalScrollBar().setUnitIncrement(16);
    sl.getViewport().setOpaque(false);
    add(sl);

    detailPanel = new MigPanel("ColopediaPanelUI");
    detailPanel.setOpaque(true);
    JScrollPane detail =
        new JScrollPane(
            detailPanel,
            JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    detail.getVerticalScrollBar().setUnitIncrement(16);
    detail.getViewport().setOpaque(false);
    add(detail, "grow");

    add(okButton, "newline 20, span, tag ok");

    getGUI().restoreSavedSize(this, 850, 600);
    tree = buildTree();

    select(id);
  }