コード例 #1
0
  /** Initialize the common user interface components. */
  private void initUI() {
    /* initialize fields */
    {
      pFileSeqPanels = new TreeMap<FileSeq, JFileSeqPanel>();
    }

    /* initialize the popup menus */
    {
      initBasicMenus(true, false);
      updateMenuToolTips();
    }

    /* initialize the panel components */
    {
      setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

      /* header */
      {
        pApplyToolTipText = "Replace the working area files with the selected checked-in files.";
        pUnApplyToolTipText = "There are no unsaved changes to Apply at this time.";

        JPanel panel = initHeader(true);
        add(panel);
      }

      add(Box.createRigidArea(new Dimension(0, 4)));

      /* full node name */
      {
        LinkedList<Component> extra = new LinkedList<Component>();
        extra.add(Box.createRigidArea(new Dimension(4, 0)));
        {
          JButton btn = new JButton();
          pSeqLayoutButton = btn;
          btn.setName(pIsListLayout ? "ListLayoutButton" : "TabbedLayoutButton");

          Dimension size = new Dimension(19, 19);
          btn.setMinimumSize(size);
          btn.setMaximumSize(size);
          btn.setPreferredSize(size);

          btn.setActionCommand("seq-layout-changed");
          btn.addActionListener(this);

          extra.add(btn);
        }

        initNameField(this, extra);

        pNodeNameField.setFocusable(true);
        pNodeNameField.addKeyListener(this);
        pNodeNameField.addMouseListener(this);
      }

      add(Box.createRigidArea(new Dimension(0, 4)));

      {
        JTabbedPane tab = new JTabbedPane();
        pFileSeqsTab = tab;
        tab.setVisible(!pIsListLayout);
        add(tab);
      }

      {
        Box vbox = new Box(BoxLayout.Y_AXIS);
        pFileSeqsBox = vbox;

        {
          JScrollPane scroll = UIFactory.createVertScrollPane(vbox);
          pFileSeqsScroll = scroll;
          scroll.setVisible(!pIsListLayout);

          add(scroll);
        }
      }

      Dimension size = new Dimension(sSize + 22, 120);
      setMinimumSize(size);
      setPreferredSize(size);

      setFocusable(true);
      addKeyListener(this);
      addMouseListener(this);
    }

    updateNodeStatus(null, null, null);
  }