示例#1
0
  public boolean closeDialog(DialogTab dialogTab) {
    for (int i = 0; i < dialogTabArrayList.size(); i++) {
      if (dialogTabArrayList.get(i).equals(dialogTab)) {
        dialogPanelArrayList.remove(i);
        dialogTabArrayList.remove(i);
        if (!(currentDialogPanel == null)) currentDialogPanel.setVisible(false);
        if (dialogTabArrayList.size() == 0) {
          dialogTabsPanel.setVisible(false);
          currentDialogTab = null;
          currentDialogPanel = null;
          repaint();
          revalidate();
          return true;
        }

        if ((dialogTab.equals(currentDialogTab))) {
          if (i > 0) {
            currentDialogPanel = dialogPanelArrayList.get(i - 1);
            currentDialogTab = dialogTabArrayList.get(i - 1);
          } else {
            currentDialogPanel = dialogPanelArrayList.get(i);
            currentDialogTab = dialogTabArrayList.get(i);
          }
        }

        if (!(currentDialogPanel == null)) {
          currentDialogTab.setBorder(new LineBorder(Color.RED));
          currentDialogPanel.setBounds(0, 84, 960, 1000);
          bigPanel.add(currentDialogPanel);
          currentDialogPanel.setVisible(true);
        }

        dialogTabsPanel.setVisible(false);
        if (dialogTabArrayList.size() > 0) repaintDialogTabsPanel();
        bigPanel.repaint();
        bigPanel.revalidate();
        break;
      }
    }
    return false;
  }
示例#2
0
  public void friendPanelMode() {
    if (isFriendPanelOpened) {
      friendPanelButton.addMouseListener(
          new MouseAdapter() {
            @Override
            public void mouseEntered(MouseEvent e) {
              friendPanelButton.setIcon(friendSideCloseIconEntered);
            }

            @Override
            public void mouseExited(MouseEvent e) {
              friendPanelButton.setIcon(friendSideCloseIcon);
            }
          });
      friendPanelButton.setIcon(friendSideCloseIcon);
      setSize(1300, 610);
    } else {
      setSize(960, 610);
      friendPanelButton.setIcon(friendSideOpenIcon);
      friendPanelButton.addMouseListener(
          new MouseAdapter() {
            @Override
            public void mouseEntered(MouseEvent e) {
              friendPanelButton.setIcon(friendSideOpenIconEntered);
            }

            @Override
            public void mouseExited(MouseEvent e) {
              friendPanelButton.setIcon(friendSideOpenIcon);
            }
          });
    }
    bigPanel.revalidate();
    bigPanel.repaint();
    bigPanel.updateUI();
  }