Java Code Examples for com.alee.extended.panel.GroupPanel#setMargin()

The following examples show how to use com.alee.extended.panel.GroupPanel#setMargin() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConfigurationDialog.java    From desktopclient-java with GNU General Public License v3.0 6 votes vote down vote up
PrivacyPanel() {
    GroupPanel groupPanel = new GroupPanel(View.GAP_DEFAULT, false);
    groupPanel.setMargin(View.MARGIN_BIG);

    groupPanel.add(new WebLabel(Tr.tr("Privacy Settings")).setBoldFont());
    groupPanel.add(new WebSeparator(true, true));

    mSubscriptionBox = createCheckBox(Tr.tr("Automatically grant authorization"),
             Tr.tr("Automatically grant online status authorization requests from other users"),
            mConf.getBoolean(Config.NET_AUTO_SUBSCRIPTION));
    groupPanel.add(new GroupPanel(mSubscriptionBox, new WebSeparator()));

    mChatStateBox = createCheckBox(Tr.tr("Send chatstate notification"),
            Tr.tr("Send chat activity (typing,…) to other users"),
            mConf.getBoolean(Config.NET_SEND_CHAT_STATE));
    groupPanel.add(new GroupPanel(mChatStateBox, new WebSeparator()));

    mRosterNameBox = createCheckBox(Tr.tr("Upload contact names"),
            Tr.tr("Upload your contact names to the server for client synchronization"),
            mConf.getBoolean(Config.NET_SEND_ROSTER_NAME));
    groupPanel.add(new GroupPanel(mRosterNameBox, new WebSeparator()));

    this.add(groupPanel);
}
 
Example 2
Source File: ImportDialog.java    From desktopclient-java with GNU General Public License v3.0 6 votes vote down vote up
IntroPanel() {
    GroupPanel groupPanel = new GroupPanel(View.GAP_DEFAULT, false);
    groupPanel.setMargin(View.MARGIN_BIG);

    groupPanel.add(new WebLabel(Tr.tr("Get Started")).setBoldFont());
    groupPanel.add(new WebSeparator(true, true));

    // html tag for word wrap
    String text = "<html>"+
            Tr.tr("Welcome to the import wizard.")+" "
            +Tr.tr("To use the Kontalk desktop client you need an existing account.")+" "
            +Tr.tr("Please export the personal key files from your Android device and select them on the next page.")
            +"</html>";
    groupPanel.add(new WebLabel(text));

    this.add(groupPanel);
}
 
Example 3
Source File: ConfigurationDialog.java    From desktopclient-java with GNU General Public License v3.0 5 votes vote down vote up
MainPanel() {
    GroupPanel groupPanel = new GroupPanel(View.GAP_DEFAULT, false);
    groupPanel.setMargin(View.MARGIN_BIG);

    groupPanel.add(new WebLabel(Tr.tr("Main Settings")).setBoldFont());
    groupPanel.add(new WebSeparator(true, true));

    mTrayBox = createCheckBox(Tr.tr("Show tray icon"),
            "",
            mConf.getBoolean(Config.MAIN_TRAY));
    mTrayBox.addItemListener(new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e) {
            mCloseTrayBox.setEnabled(e.getStateChange() == ItemEvent.SELECTED);
        }
    });
    mCloseTrayBox = createCheckBox(Tr.tr("Close to tray"),
            "",
            mConf.getBoolean(Config.MAIN_TRAY_CLOSE));
    mCloseTrayBox.setEnabled(mTrayBox.isSelected());
    groupPanel.add(new GroupPanel(View.GAP_DEFAULT, mTrayBox, mCloseTrayBox));

    mEnterSendsBox = createCheckBox(Tr.tr("Enter key sends"),
            Tr.tr("Enter key sends text, Control+Enter adds new line - or vice versa"),
            mConf.getBoolean(Config.MAIN_ENTER_SENDS));
    groupPanel.add(new GroupPanel(mEnterSendsBox, new WebSeparator()));

    mShowUserBox = createCheckBox(Tr.tr("Display yourself in contacts"),
            Tr.tr("Display yourself in the contact list"),
            mConf.getBoolean(Config.VIEW_USER_CONTACT));
    groupPanel.add(new GroupPanel(mShowUserBox, new WebSeparator()));

    mHideBlockedBox = createCheckBox(Tr.tr("Hide blocked contacts"),
            Tr.tr("Hide blocked contacts in the contact list"),
            mConf.getBoolean(Config.VIEW_HIDE_BLOCKED));
    groupPanel.add(new GroupPanel(mHideBlockedBox, new WebSeparator()));

    this.add(groupPanel);
}
 
Example 4
Source File: ImportDialog.java    From desktopclient-java with GNU General Public License v3.0 5 votes vote down vote up
ResultPanel() {
    mImporter = mView.getControl().createAccountImporter();
    mImporter.addObserver(this);

    GroupPanel groupPanel = new GroupPanel(View.GAP_DEFAULT, false);
    groupPanel.setMargin(View.MARGIN_BIG);

    groupPanel.add(new WebLabel(Tr.tr("Import results")).setBoldFont());
    groupPanel.add(new WebSeparator(true, true));

    mResultLabel = new WebLabel();
    groupPanel.add(mResultLabel);
    mErrorLabel = new WebLabel();
    groupPanel.add(mErrorLabel);

    mPassPanel = new ComponentUtils.PassPanel(false) {
        @Override
        void onValidInput() {
            mFinishButton.setEnabled(true);
        }
        @Override
        void onInvalidInput() {
            mFinishButton.setEnabled(false);
        }
    };
    groupPanel.add(mPassPanel);

    this.add(groupPanel);
}
 
Example 5
Source File: ConfigurationDialog.java    From desktopclient-java with GNU General Public License v3.0 4 votes vote down vote up
NetworkPanel() {
    GroupPanel groupPanel = new GroupPanel(View.GAP_DEFAULT, false);
    groupPanel.setMargin(View.MARGIN_BIG);

    groupPanel.add(new WebLabel(Tr.tr("Network Settings")).setBoldFont());
    groupPanel.add(new WebSeparator(true, true));

    mConnectStartupBox = createCheckBox(Tr.tr("Connect on startup"),
            "",
            mConf.getBoolean(Config.MAIN_CONNECT_STARTUP));
    groupPanel.add(mConnectStartupBox);

    mConnectRetryBox = createCheckBox(Tr.tr("Retry on connection failure"),
            Tr.tr("Try automatic (re-)connect after connection failure"),
            mConf.getBoolean(Config.NET_RETRY_CONNECT));
    groupPanel.add(new GroupPanel(mConnectRetryBox, new WebSeparator()));

    mRequestAvatars = createCheckBox(Tr.tr("Download profile pictures"),
            Tr.tr("Download the profile pictures of your contacts"),
            mConf.getBoolean(Config.NET_REQUEST_AVATARS));
    groupPanel.add(new GroupPanel(mRequestAvatars, new WebSeparator()));

    mImgResizeMap = new LinkedHashMap<>();
    mImgResizeMap.put(-1, Tr.tr("Original"));
    mImgResizeMap.put(300 * 1000, Tr.tr("Small (0.3MP)"));
    mImgResizeMap.put(500 * 1000, Tr.tr("Medium (0.5MP)"));
    mImgResizeMap.put(800 * 1000, Tr.tr("Large (0.8MP)"));

    mMaxImgSizeBox = new WebComboBox(new ArrayList<>(mImgResizeMap.values()).toArray());
    int maxImgIndex = new ArrayList<>(mImgResizeMap.keySet()).indexOf(
            mConf.getInt(Config.NET_MAX_IMG_SIZE));
    if (maxImgIndex >= 0)
        mMaxImgSizeBox.setSelectedIndex(maxImgIndex);
    TooltipManager.addTooltip(mMaxImgSizeBox, Tr.tr("Reduce size of images before sending"));

    groupPanel.add(new GroupPanel(View.GAP_DEFAULT,
            new WebLabel(Tr.tr("Resize image attachments:")),
            mMaxImgSizeBox,
            new WebSeparator()));

    this.add(groupPanel);
}
 
Example 6
Source File: ConfigurationDialog.java    From desktopclient-java with GNU General Public License v3.0 4 votes vote down vote up
ViewPanel() {
    GroupPanel groupPanel = new GroupPanel(View.GAP_DEFAULT, false);
    groupPanel.setMargin(View.MARGIN_BIG);

    groupPanel.add(new WebLabel(Tr.tr("View Settings")).setBoldFont());
    groupPanel.add(new WebSeparator(true, true));

    String bgPath = mConf.getString(Config.VIEW_CHAT_BG);
    mBGBox = createCheckBox(Tr.tr("Custom background:")+" ",
            "",
            !bgPath.isEmpty());
    mBGBox.addItemListener(new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e) {
            mBGChooser.setEnabled(e.getStateChange() == ItemEvent.SELECTED);
            mBGChooser.getChooseButton().setEnabled(e.getStateChange() == ItemEvent.SELECTED);
        }
    });
    TooltipManager.addTooltip(mBGBox, Tr.tr("Background image for all chats"));
    mBGChooser = Utils.createImageChooser(bgPath);
    mBGChooser.setEnabled(mBGBox.isSelected());
    groupPanel.add(new GroupPanel(GroupingType.fillLast, mBGBox, mBGChooser));

    mMessageFontSizeMap = new LinkedHashMap<>();
    mMessageFontSizeMap.put(Tr.tr("Small"), 1);
    mMessageFontSizeMap.put(Tr.tr("Normal"), -1);
    mMessageFontSizeMap.put(Tr.tr("Large"), 2);
    mMessageFontSizeMap.put(Tr.tr("Huge"), 3);

    mMessageFontSizeBox = new WebComboBox(new ArrayList<>(mMessageFontSizeMap.keySet()).toArray());
    int fontSizeIndex = new ArrayList<>(mMessageFontSizeMap.values()).indexOf(
            mConf.getInt(Config.VIEW_MESSAGE_FONT_SIZE));
    if (fontSizeIndex >= 0)
        mMessageFontSizeBox.setSelectedIndex(fontSizeIndex);
    TooltipManager.addTooltip(mMessageFontSizeBox, Tr.tr("Font size for message text and date"));

    groupPanel.add(new GroupPanel(View.GAP_DEFAULT,
            new WebLabel(Tr.tr("Font size for chat messages:")),
            mMessageFontSizeBox,
            new WebSeparator()));

    this.add(groupPanel);
}