コード例 #1
0
ファイル: ChatWindow.java プロジェクト: jmacdotorg/volity
  /**
   * 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));
  }
コード例 #2
0
ファイル: ChatWindow.java プロジェクト: jmacdotorg/volity
  /**
   * 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());
  }
コード例 #3
0
ファイル: ChatWindow.java プロジェクト: jmacdotorg/volity
  /** 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);
  }