Ejemplo n.º 1
0
  /**
   * Restores window state from the preferences storage, including window size and position, and
   * splitter bar position.
   */
  private void restoreWindowState() {
    Preferences prefs = Preferences.userNodeForPackage(getClass()).node(NODENAME);

    mSizePosSaver.restoreSizeAndPosition();

    mChatSplitter.setDividerLocation(prefs.getInt(CHAT_SPLIT_POS, getHeight() - 100));
  }
Ejemplo n.º 2
0
  /**
   * Saves window state to the preferences storage, including window size and position, and splitter
   * bar position.
   */
  private void saveWindowState() {
    Preferences prefs = Preferences.userNodeForPackage(getClass()).node(NODENAME);

    mSizePosSaver.saveSizeAndPosition();

    prefs.putInt(CHAT_SPLIT_POS, mChatSplitter.getDividerLocation());
  }
Ejemplo n.º 3
0
  /** Populates the frame with UI controls. */
  private void buildUI() {
    Container cPane = getContentPane();
    cPane.setLayout(new BorderLayout());

    // Split pane for message text area and input text area
    mChatSplitter = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
    mChatSplitter.setResizeWeight(1);
    mChatSplitter.setBorder(BorderFactory.createEmptyBorder());

    mLog = new ChatLogPanel(mColorMap);
    mChatSplitter.setTopComponent(mLog);

    mInputText = new JTextArea();
    mInputText.setLineWrap(true);
    mInputText.setWrapStyleWord(true);
    mInputText.setBorder(BorderFactory.createEmptyBorder(1, 4, 1, 4));
    mChatSplitter.setBottomComponent(new JScrollPane(mInputText));

    cPane.add(mChatSplitter, BorderLayout.CENTER);

    // Necessary for all windows, for Mac support
    AppMenuBar.applyPlatformMenuBar(this);
  }