當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。