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


Java MainGui类代码示例

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


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

示例1: HighlightedMessages

import chatty.gui.MainGui; //导入依赖的package包/类
/**
 * Creates a new dialog.
 * 
 * @param owner Reference to the MainGui, required for the text pane
 * @param styleServer The style server, style information for the text pane
 * @param title The title to display for the dialog
 * @param label What to show as description of the messges in the text pane
 * (when the channel name is output)
 * @param contextMenuListener
 */
public HighlightedMessages(MainGui owner, StyleServer styleServer,
        String title, String label, ContextMenuListener contextMenuListener) {
    super(owner);
    this.title = title;
    this.label = label;
    this.contextMenuListener = contextMenuListener;
    updateTitle();
    
    this.addComponentListener(new MyVisibleListener());
    
    messages = new TextPane(owner, styleServer);
    messages.setContextMenuListener(new MyContextMenuListener());
    //messages.setLineWrap(true);
    //messages.setWrapStyleWord(true);
    //messages.setEditable(false);
    
    JScrollPane scroll = new JScrollPane(messages);
    messages.setScrollPane(scroll);
    
    add(scroll);
    
    setPreferredSize(new Dimension(400,300));
    
    pack();
}
 
开发者ID:chatty,项目名称:chatty,代码行数:36,代码来源:HighlightedMessages.java

示例2: StreamChat

import chatty.gui.MainGui; //导入依赖的package包/类
public StreamChat(MainGui g, StyleManager styles, ContextMenuListener contextMenuListener,
        boolean startAtBottom) {
    super(g);
    this.contextMenuListener = contextMenuListener;
    setTitle("Stream Chat");

    textPane = new TextPane(g, styles, startAtBottom);
    textPane.setContextMenuListener(new MyContextMenuListener());
    JScrollPane scroll = new JScrollPane(textPane);
    scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    textPane.setScrollPane(scroll);
    textPane.setPreferredSize(new Dimension(200,100));
    
    add(scroll, BorderLayout.CENTER);
    
    pack();
}
 
开发者ID:chatty,项目名称:chatty,代码行数:18,代码来源:StreamChat.java

示例3: ChannelTextPane

import chatty.gui.MainGui; //导入依赖的package包/类
public ChannelTextPane(MainGui main, StyleServer styleServer) {
    ChannelTextPane.styleServer = styleServer;
    this.main = main;
    this.setBackground(BACKGROUND_COLOR);
    this.addMouseListener(linkController);
    this.addMouseMotionListener(linkController);
    linkController.setUserListener(main.getUserListener());
    linkController.setLinkListener(this);
    setEditorKit(new MyEditorKit());
    this.setDocument(new MyDocument());
    doc = getStyledDocument();
    setEditable(false);
    DefaultCaret caret = (DefaultCaret)getCaret();
    caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
    styles.setStyles();
}
 
开发者ID:pokemane,项目名称:TwitchChatClient,代码行数:17,代码来源:ChannelTextPane.java

示例4: HighlightedMessages

import chatty.gui.MainGui; //导入依赖的package包/类
public HighlightedMessages(MainGui owner, StyleServer styleServer) {
    super(owner);
    setTitle("Highlighted Messages");
    
    messages = new TextPane(owner, styleServer);
    //messages.setLineWrap(true);
    //messages.setWrapStyleWord(true);
    //messages.setEditable(false);
    
    JScrollPane scroll = new JScrollPane(messages);
    messages.setScrollPane(scroll);
    
    add(scroll);
    
    setPreferredSize(new Dimension(400,300));
    
    pack();
}
 
开发者ID:pokemane,项目名称:TwitchChatClient,代码行数:19,代码来源:HighlightedMessages.java

示例5: UpdateTimer

import chatty.gui.MainGui; //导入依赖的package包/类
public UpdateTimer(final MainGui g) {
     task = new TimerTask() {

         @Override
         public void run() {
             g.updateState();
         }
     };
     schedule(task, DELAY*1000, DELAY*1000); 
}
 
开发者ID:chatty,项目名称:chatty,代码行数:11,代码来源:UpdateTimer.java

示例6: HotkeyManager

import chatty.gui.MainGui; //导入依赖的package包/类
public HotkeyManager(MainGui main) {
    this.main = main;
            
    if (Chatty.HOTKEY) {
        try {
            globalHotkeys = new GlobalHotkeySetter(new GlobalHotkeySetter.GlobalHotkeyListener() {

                @Override
                public void onHotkey(Object hotkeyId) {
                    onGlobalHotkey(hotkeyId);
                }
            });
            // If an error occured during initialization, then set to null
            // which means it's not going to be used.
            if (!globalHotkeys.isInitalized()) {
                globalHotkeyErrorWarning = globalHotkeys.getError();
                globalHotkeys = null;
            }
        } catch (NoClassDefFoundError ex) {
            LOGGER.warning("Failed to initialize hotkey setter [" + ex + "]");
            globalHotkeyErrorWarning = "Failed to initialize global hotkeys (jintellitype-xx.jar not found).";
            globalHotkeys = null;
        }
    }

    KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
    kfm.addKeyEventDispatcher(new KeyEventDispatcher() {

        @Override
        public boolean dispatchKeyEvent(KeyEvent e) {
            return applicationKeyTriggered(e);
        }
    });
}
 
开发者ID:chatty,项目名称:chatty,代码行数:35,代码来源:HotkeyManager.java

示例7: NotificationManager

import chatty.gui.MainGui; //导入依赖的package包/类
public NotificationManager(MainGui main,
        Settings settings) {
    this.settings = settings;
    this.main = main;
    loadFromSettings();
    settings.addSettingChangeListener((s, t, v) -> {
        if (s.equals(SETTING_NAME)) {
            loadFromSettings();
        }
    });
}
 
开发者ID:chatty,项目名称:chatty,代码行数:12,代码来源:NotificationManager.java

示例8: ChannelTextPane

import chatty.gui.MainGui; //导入依赖的package包/类
public ChannelTextPane(MainGui main, StyleServer styleServer, boolean special, boolean startAtBottom) {
    lineSelection = new LineSelection(main.getUserListener());
    ChannelTextPane.styleServer = styleServer;
    this.main = main;
    this.setBackground(BACKGROUND_COLOR);
    this.addMouseListener(linkController);
    this.addMouseMotionListener(linkController);
    linkController.addUserListener(main.getUserListener());
    linkController.addUserListener(lineSelection);
    linkController.setLinkListener(this);
    scrollManager = new ScrollManager();
    this.addMouseListener(scrollManager);
    this.addMouseMotionListener(scrollManager);
    setEditorKit(new MyEditorKit(startAtBottom));
    this.setDocument(new MyDocument());
    doc = getStyledDocument();
    setEditable(false);
    DefaultCaret caret = (DefaultCaret)getCaret();
    caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
    styles.setStyles();
    
    if (special) {
        updateTimer = new javax.swing.Timer(2000, new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                removeOldLines();
            }
        });
        updateTimer.setRepeats(true);
        updateTimer.start();
    } else {
        updateTimer = null;
    }
    
    FixSelection.install(this);
}
 
开发者ID:chatty,项目名称:chatty,代码行数:38,代码来源:ChannelTextPane.java

示例9: CommercialPanel

import chatty.gui.MainGui; //导入依赖的package包/类
public CommercialPanel(MainGui main) {
    
    GridBagConstraints gbc;
    
    this.main = main;
    
    setLayout(new GridBagLayout());
    
    gbc = makeGbc(0,1,1,1);
    add(new JLabel("Run commercial: "), gbc);
    gbc = makeGbc(1,1,4,1);
    gbc.insets = new Insets(5,5,0,5);
    add(createCommercialButtons(), gbc);
    
    gbc = makeGbc(1,2,1,1);
    gbc.insets = new Insets(0,5,5,5);
    add(useCommercialDelay, gbc);
    gbc = makeGbc(2,2,1,1);
    gbc.insets = new Insets(0,5,5,5);
    gbc.anchor = GridBagConstraints.WEST;
    add(commercialDelay, gbc);
    
    gbc = makeGbc(3,2,1,1);
    gbc.insets = new Insets(0,5,5,5);
    add(repeatCommercial, gbc);
    
    gbc = makeGbc(4,2,1,1);
    gbc.insets = new Insets(0,10,5,5);
    add(lastCommercialInfo, gbc);

    commercialResult = new JLabel("...");
    gbc = makeGbc(0,3,5,1);
    gbc.insets = new Insets(3,5,15,5);
    add(commercialResult, gbc);
    
    setCommercialResult("");
    
}
 
开发者ID:chatty,项目名称:chatty,代码行数:39,代码来源:CommercialPanel.java

示例10: ModerationLog

import chatty.gui.MainGui; //导入依赖的package包/类
public ModerationLog(MainGui owner) {
    super(owner);
    log = createLogArea();
    setTitle("Moderator Actions");
    
    scroll = new JScrollPane(log);
    scroll.setPreferredSize(new Dimension(300, 200));
    add(scroll, BorderLayout.CENTER);
    
    pack();
}
 
开发者ID:chatty,项目名称:chatty,代码行数:12,代码来源:ModerationLog.java

示例11: showSearchDialog

import chatty.gui.MainGui; //导入依赖的package包/类
public static void showSearchDialog(Channel channel, MainGui g, Window owner) {
    SearchDialog dialog = created.get(owner);
    if (dialog == null) {
        dialog = new SearchDialog(g, owner);
        dialog.setLocationRelativeTo(owner);
        GuiUtil.installEscapeCloseOperation(dialog);
        created.put(owner, dialog);
    }
    dialog.setVisible(true);
}
 
开发者ID:chatty,项目名称:chatty,代码行数:11,代码来源:SearchDialog.java

示例12: TextPane

import chatty.gui.MainGui; //导入依赖的package包/类
public TextPane(MainGui main, StyleServer styleServer, boolean startAtBottom) {
    // Enables the "special" parameter to be able to remove old lines
    super(main, styleServer, true, startAtBottom);
    
    // Overriding constructor is required to set the custom context menu
    linkController.setDefaultContextMenu(new HighlightsContextMenu());
}
 
开发者ID:chatty,项目名称:chatty,代码行数:8,代码来源:StreamChat.java

示例13: HotkeyManager

import chatty.gui.MainGui; //导入依赖的package包/类
public HotkeyManager(MainGui main) {
    this.main = main;
            
    if (Chatty.HOTKEY) {
        try {
            globalHotkeys = new GlobalHotkeySetter(new GlobalHotkeySetter.GlobalHotkeyListener() {

                @Override
                public void onHotkey(Object hotkeyId) {
                    onGlobalHotkey(hotkeyId);
                }
            });
            // If an error occured during initialization, then set to null
            // which means it's not going to be used.
            if (!globalHotkeys.isInitalized()) {
                globalHotkeys = null;
            }
        } catch (NoClassDefFoundError ex) {
            LOGGER.warning("Failed to initialize hotkey setter [" + ex + "]");
            LOGGER.log(Logging.USERINFO, "Failed to initialize global "
                    + "hotkeys (if you don't use global hotkeys you can "
                    + "just ignore this).");
            globalHotkeys = null;
        }
    }

    KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
    kfm.addKeyEventDispatcher(new KeyEventDispatcher() {

        @Override
        public boolean dispatchKeyEvent(KeyEvent e) {
            return applicationKeyTriggered(e);
        }
    });
}
 
开发者ID:partouf,项目名称:Chatty-Twitch-Client,代码行数:36,代码来源:HotkeyManager.java

示例14: ChannelTextPane

import chatty.gui.MainGui; //导入依赖的package包/类
public ChannelTextPane(MainGui main, StyleServer styleServer, boolean special) {
    lineSelection = new LineSelection(main.getUserListener());
    ChannelTextPane.styleServer = styleServer;
    this.main = main;
    this.setBackground(BACKGROUND_COLOR);
    this.addMouseListener(linkController);
    this.addMouseMotionListener(linkController);
    linkController.addUserListener(main.getUserListener());
    linkController.addUserListener(lineSelection);
    linkController.setLinkListener(this);
    setEditorKit(new MyEditorKit());
    this.setDocument(new MyDocument());
    doc = getStyledDocument();
    setEditable(false);
    DefaultCaret caret = (DefaultCaret)getCaret();
    caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
    styles.setStyles();
    
    if (special) {
        javax.swing.Timer timer = new javax.swing.Timer(2000, new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                removeOldLines();
            }
        });
        timer.setRepeats(true);
        timer.start();
    }
}
 
开发者ID:partouf,项目名称:Chatty-Twitch-Client,代码行数:31,代码来源:ChannelTextPane.java

示例15: StreamChat

import chatty.gui.MainGui; //导入依赖的package包/类
public StreamChat(MainGui g, StyleManager styles) {
    super(g);
    setTitle("Stream Chat");

    textPane = new ChannelTextPane(g, styles, true);
    JScrollPane scroll = new JScrollPane(textPane);
    scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    textPane.setScrollPane(scroll);
    textPane.setPreferredSize(new Dimension(200,100));
    
    add(scroll, BorderLayout.CENTER);
    
    pack();
}
 
开发者ID:partouf,项目名称:Chatty-Twitch-Client,代码行数:15,代码来源:StreamChat.java


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