当前位置: 首页>>代码示例>>Java>>正文


Java WindowStateManager类代码示例

本文整理汇总了Java中chatty.gui.WindowStateManager的典型用法代码示例。如果您正苦于以下问题:Java WindowStateManager类的具体用法?Java WindowStateManager怎么用?Java WindowStateManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


WindowStateManager类属于chatty.gui包,在下文中一共展示了WindowStateManager类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: WindowSettings

import chatty.gui.WindowStateManager; //导入依赖的package包/类
public WindowSettings(final SettingsDialog d) {
    
    JPanel dialogs = addTitledPanel("Dialogs Location/Size", 0);
    
    dialogs.add(new JLabel("Restore dialogs:"), d.makeGbc(0, 0, 1, 1));
    
    Map<Long, String> restoreModeOptions = new LinkedHashMap<>();
    restoreModeOptions.put((long)WindowStateManager.RESTORE_MAIN, "Open dialogs in default location");
    restoreModeOptions.put((long)WindowStateManager.RESTORE_ALL, "Keep location during session");
    restoreModeOptions.put((long)WindowStateManager.RESTORE_ON_START, "Restore dialogs from last session");
    restoreModeOptions.put((long)WindowStateManager.REOPEN_ON_START, "Reopen dialogs from last session");
    ComboLongSetting restoreMode = new ComboLongSetting(restoreModeOptions);
    d.addLongSetting("restoreMode", restoreMode);
    dialogs.add(restoreMode, d.makeGbc(1, 0, 1, 1));

    JPanel other = addTitledPanel("Other", 1);
    
    other.add(d.addBooleanSetting("urlPrompt", "Prompt dialog when opening URL",
            "Show a prompt to confirm you want to open an URL."),
            d.makeGbc(0, 0, 2, 1, GridBagConstraints.WEST));
    
    other.add(new JLabel("Tab Order:"), d.makeGbc(0, 1, 1, 1, GridBagConstraints.WEST));
    other.add(
            d.addComboStringSetting("tabOrder", 1, false, new String[]{"normal", "alphabetical"}),
            d.makeGbc(1, 1, 1, 1)
    );

    other.add(new JLabel("Default Userlist Width:"),
            d.makeGbc(0, 2, 1, 1, GridBagConstraints.WEST));
    other.add(d.addSimpleLongSetting("userlistWidth", 3, true),
            d.makeGbc(1, 2, 1, 1, GridBagConstraints.WEST));
    
    
}
 
开发者ID:pokemane,项目名称:TwitchChatClient,代码行数:35,代码来源:WindowSettings.java

示例2: WindowSettings

import chatty.gui.WindowStateManager; //导入依赖的package包/类
public WindowSettings(final SettingsDialog d) {
    
    JPanel dialogs = addTitledPanel("Dialogs Location/Size", 0);
    
    dialogs.add(new JLabel("Restore dialogs:"), d.makeGbc(0, 0, 1, 1));
    
    Map<Long, String> restoreModeOptions = new LinkedHashMap<>();
    restoreModeOptions.put((long)WindowStateManager.RESTORE_MAIN, "Open dialogs in default location");
    restoreModeOptions.put((long)WindowStateManager.RESTORE_ALL, "Keep location during session");
    restoreModeOptions.put((long)WindowStateManager.RESTORE_ON_START, "Restore dialogs from last session");
    restoreModeOptions.put((long)WindowStateManager.REOPEN_ON_START, "Reopen dialogs from last session");
    ComboLongSetting restoreMode = new ComboLongSetting(restoreModeOptions);
    d.addLongSetting("restoreMode", restoreMode);
    dialogs.add(restoreMode, d.makeGbc(1, 0, 1, 1));
    
    dialogs.add(d.addSimpleBooleanSetting("restoreOnlyIfOnScreen",
            "Restore position only if on screen",
            "Opens on default position if not clearly visible in the current screen area."),
            d.makeGbc(0, 1, 2, 1, GridBagConstraints.WEST));
    
    dialogs.add(d.addSimpleBooleanSetting("attachedWindows",
            "Attach dialogs position to main window",
            "Moves the dialogs when you move the main window."),
            d.makeGbc(0, 2, 2, 1, GridBagConstraints.WEST));

    
    JPanel other = addTitledPanel("Other", 1);
    
    other.add(d.addSimpleBooleanSetting("urlPrompt", "Open URL Prompt",
            "Show a prompt to confirm you want to open an URL."),
            d.makeGbc(0, 0, 1, 1, GridBagConstraints.WEST));
    
    other.add(d.addSimpleBooleanSetting("chatScrollbarAlways", "Always show chat scrollbar",
            "Always show scrollbar in chat window, even if no scrolling is necessary."),
            d.makeGbc(1, 0, 3, 1, GridBagConstraints.WEST));
    
    other.add(d.addSimpleBooleanSetting("minimizeToTray", "Minimize to tray",
            "When minimizing Chatty, it will be hidden to the tray icon."),
            d.makeGbc(0, 1, 1, 1, GridBagConstraints.WEST));
    
    other.add(d.addSimpleBooleanSetting("closeToTray", "Close to tray",
            "When closing the window, Chatty will not exit but instead be minimized to the tray icon."),
            d.makeGbc(1, 1, 3, 1, GridBagConstraints.WEST));

    other.add(new JLabel("Default Userlist Width:"),
            d.makeGbc(0, 4, 1, 1, GridBagConstraints.WEST));
    other.add(d.addSimpleLongSetting("userlistWidth", 3, true),
            d.makeGbc(1, 4, 1, 1, GridBagConstraints.WEST));
    
    other.add(new JLabel("Min. Width:"),
            d.makeGbc(2, 4, 1, 1, GridBagConstraints.WEST));
    other.add(d.addSimpleLongSetting("userlistMinWidth", 3, true),
            d.makeGbc(3, 4, 1, 1, GridBagConstraints.WEST));

    other.add(d.addSimpleBooleanSetting("userlistEnabled",
            "Enable userlist by default",
            "Enables the userlist by default when joining a channel (you can always use Shift+F10 to toggle it)"),
            d.makeGbc(0,5,1,1, GridBagConstraints.WEST));
    
    
    JPanel popout = addTitledPanel("Popout", 2);
    
    popout.add(d.addSimpleBooleanSetting("popoutSaveAttributes", "Restore location/size",
            "Save and restore the location and size of popout dialogs during the same session"),
            d.makeGbc(0,0,1,1));
    popout.add(d.addSimpleBooleanSetting("popoutCloseLastChannel", "Close popout when only channel",
            "Automatically close a popout if the last channel in the main window is closed"),
            d.makeGbc(1, 0, 1, 1));
    
}
 
开发者ID:chatty,项目名称:chatty,代码行数:71,代码来源:WindowSettings.java

示例3: WindowSettings

import chatty.gui.WindowStateManager; //导入依赖的package包/类
public WindowSettings(final SettingsDialog d) {
    
    JPanel dialogs = addTitledPanel("Dialogs Location/Size", 0);
    
    dialogs.add(new JLabel("Restore dialogs:"), d.makeGbc(0, 0, 1, 1));
    
    Map<Long, String> restoreModeOptions = new LinkedHashMap<>();
    restoreModeOptions.put((long)WindowStateManager.RESTORE_MAIN, "Open dialogs in default location");
    restoreModeOptions.put((long)WindowStateManager.RESTORE_ALL, "Keep location during session");
    restoreModeOptions.put((long)WindowStateManager.RESTORE_ON_START, "Restore dialogs from last session");
    restoreModeOptions.put((long)WindowStateManager.REOPEN_ON_START, "Reopen dialogs from last session");
    ComboLongSetting restoreMode = new ComboLongSetting(restoreModeOptions);
    d.addLongSetting("restoreMode", restoreMode);
    dialogs.add(restoreMode, d.makeGbc(1, 0, 1, 1));
    
    dialogs.add(d.addSimpleBooleanSetting("attachedWindows",
            "Attach dialogs position to main window",
            "Moves the dialogs when you move the main window."),
            d.makeGbc(0, 1, 2, 1, GridBagConstraints.WEST));

    JPanel other = addTitledPanel("Other", 1);
    
    other.add(d.addSimpleBooleanSetting("urlPrompt", "Open URL Prompt",
            "Show a prompt to confirm you want to open an URL."),
            d.makeGbc(0, 0, 1, 1, GridBagConstraints.WEST));
    
    other.add(d.addSimpleBooleanSetting("chatScrollbarAlways", "Always show chat scrollbar",
            "Always show scrollbar in chat window, even if no scrolling is necessary."),
            d.makeGbc(1, 0, 1, 1, GridBagConstraints.WEST));
    
    other.add(d.addSimpleBooleanSetting("minimizeToTray", "Minimize to tray",
            "When minimizing Chatty, it will be hidden to the tray icon."),
            d.makeGbc(0, 1, 1, 1, GridBagConstraints.WEST));
    
    other.add(d.addSimpleBooleanSetting("closeToTray", "Close to tray",
            "When closing the window, Chatty will not exit but instead be minimized to the tray icon."),
            d.makeGbc(1, 1, 1, 1, GridBagConstraints.WEST));
    
    other.add(new JLabel("Tab Order:"), d.makeGbc(0, 2, 1, 1, GridBagConstraints.WEST));
    other.add(
            d.addComboStringSetting("tabOrder", 1, false, new String[]{"normal", "alphabetical"}),
            d.makeGbc(1, 2, 1, 1, GridBagConstraints.WEST)
    );

    other.add(new JLabel("Default Userlist Width:"),
            d.makeGbc(0, 3, 1, 1, GridBagConstraints.WEST));
    other.add(d.addSimpleLongSetting("userlistWidth", 3, true),
            d.makeGbc(1, 3, 1, 1, GridBagConstraints.WEST));
    
    
    
    
    JPanel popout = addTitledPanel("Popout", 2);
    
    popout.add(d.addSimpleBooleanSetting("popoutSaveAttributes", "Restore location/size",
            "Save and restore the location and size of popout dialogs during the same session"),
            d.makeGbc(0,0,1,1));
    popout.add(d.addSimpleBooleanSetting("popoutCloseLastChannel", "Close popout when only channel",
            "Automatically close a popout if the last channel in the main window is closed"),
            d.makeGbc(1, 0, 1, 1));
    
}
 
开发者ID:partouf,项目名称:Chatty-Twitch-Client,代码行数:63,代码来源:WindowSettings.java


注:本文中的chatty.gui.WindowStateManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。