Exemplo n.º 1
1
    public MainScreen() {

      Eve.setLayout(
          new MigLayout(
              "wrap 2", "[0:0, grow 50, fill][0:0, grow 50, fill]", "[pref!][grow, fill]"));

      quick.addActionListener(
          (ActionEvent e) -> {
            DraftScreen draft = new DraftScreen(null, this);
            draft.Switch();
          });

      viewAll.addActionListener(
          (ActionEvent e) -> {
            called = new BrowseScreen(this);
            called.Switch();
          });

      manageTeams.addActionListener(
          (ActionEvent e) -> {
            called = new ManageScreen("team", this);
            called.Switch();
          });

      managePlayers.addActionListener(
          (ActionEvent e) -> {
            called = new ManageScreen("player", this);
            called.Switch();
          });

      teams.setBorder(BorderFactory.createLineBorder(Color.black));
      players.setBorder(BorderFactory.createLineBorder(Color.black));

      teamScroll.setBorder(BorderFactory.createEmptyBorder());
      teamScroll.getVerticalScrollBar().setUnitIncrement(16);
      teamScroll.setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_NEVER);
      playerScroll.setBorder(BorderFactory.createEmptyBorder());
      playerScroll.getVerticalScrollBar().setUnitIncrement(16);
      playerScroll.setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_NEVER);

      this.drawScreen();

      Adam.setMinimumSize(windowSize);
      Adam.setLocationRelativeTo(null);
      Adam.setVisible(true);
    }
Exemplo n.º 2
0
 @Override
 void refresh() {
   Adam.revalidate();
   Adam.setMinimumSize(windowSize);
   Adam.setSize(windowSize);
   Adam.repaint();
 }
Exemplo n.º 3
0
 @Override
 void Switch() {
   Adam.remove(caller.Eve);
   Adam.add(Eve);
   Adam.revalidate();
   Adam.setMinimumSize(windowSize);
   Adam.repaint();
 }
Exemplo n.º 4
0
 @Override
 void Return() {
   Adam.remove(called.Eve);
   Adam.add(Eve);
   Adam.revalidate();
   Adam.setMinimumSize(windowSize);
   Adam.repaint();
 }