Package com.cellasoft.jchat.utils

Examples of com.cellasoft.jchat.utils.ChatArea


     * @return Ritorna la JTextArea
     * @throws RemoteException
     */
    public ChatArea addPrivateArea(MobileServer builder) throws RemoteException {
        String nick = builder.getUsername();
        ChatArea area = new ChatArea(htmlKit);
        area.setEditable(false);
        tabbedPane.add(nick, new JScrollPane(area));
        new CloseTabButton(tabbedPane, tabbedPane.getTabCount() - 1);
        tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1);
        inputTF.grabFocus();
        return area;
View Full Code Here


        jSplitPane1 = new javax.swing.JSplitPane();
        jScrollPane2 = new javax.swing.JScrollPane();
        userList = new javax.swing.JList();
        tabbedPane = new javax.swing.JTabbedPane();
        jScrollPane1 = new javax.swing.JScrollPane();
        chatArea = new ChatArea(htmlKit);
        jToolBar1 = new javax.swing.JToolBar();
        filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(3, 0), new java.awt.Dimension(3, 0), new java.awt.Dimension(3, 32767));
        colorTB = new MenuToggleButton(new javax.swing.ImageIcon(System.getProperty("user.dir") + "/chat/resources/fore.gif"), true);
        emoticonTB = new MenuToggleButton(new javax.swing.ImageIcon(System.getProperty("user.dir") + "/chat/emoticon/smile.png"),false);
        jPanel2 = new javax.swing.JPanel();
View Full Code Here

     * @return
     * @throws RemoteException
     */
    public ChatArea addPrivateArea(MobileServer builder) throws RemoteException {
        String nick = builder.getUsername();
        ChatArea area = new ChatArea(htmlKit);
        area.setEditable(false);
        tabbedPane.add(nick, new JScrollPane(area));
        new CloseTabButton(tabbedPane, tabbedPane.getTabCount() - 1);
        tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1);
        inputTF.grabFocus();
        return area;
View Full Code Here

        jPanel1 = new javax.swing.JPanel();
        splitPane = new javax.swing.JSplitPane();
        tabbedPane = new javax.swing.JTabbedPane();
        jScrollPane1 = new javax.swing.JScrollPane();
        chatArea = new ChatArea(htmlKit);
        jScrollPane2 = new javax.swing.JScrollPane();
        userList = new javax.swing.JList();
        jToolBar1 = new javax.swing.JToolBar();
        filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(2, 0), new java.awt.Dimension(2, 0), new java.awt.Dimension(2, 32767));
        colorTB = new MenuToggleButton(new javax.swing.ImageIcon(System.getProperty("user.dir") + "/chat/resources/fore.gif"), true)
View Full Code Here

     * @throws RemoteException eccezione remota
     */
    @Override
    public void sendMessage(Message msg) throws RemoteException {
        String sender = msg.getSender();
        ChatArea area = null;
        switch (msg.getType()) {
            case Message.PRIVATE_MASSAGE:
                area = chatGUI.getPrivateArea(sender);
                if (area == null) {
                    break;
                }
                area.append(msg);
                break;
            case Message.PUBLIC_MASSAGE:
                area = chatGUI.getPublicArea();
                area.append(msg);
                break;
            case Message.CONNECT_MESSAGE:
                chatGUI.updateList(sender,true);
                area = chatGUI.getPublicArea();
                area.append(msg);
                break;
            case Message.DISCONNECT_MESSAGE:
                if (privateUsersList.containsKey(sender)) {
                    removePrivateChat(sender);
                    chatGUI.removePrivateArea(sender);
                }
                chatGUI.updateList(sender,false);
                area = chatGUI.getPublicArea();
                area.append(msg);
                break;
            case Message.KICK_MESSAGE:
                reset();
                JOptionPane.showMessageDialog(chatGUI.getFrame(), msg.getMessage(), "Kick message", JOptionPane.INFORMATION_MESSAGE);
                chatGUI.close();
                break;
        }
        if (area != null) {
            area.setCaretPosition(area.getText().length());
        }
    }
View Full Code Here

     */
    @Override
    public void sendMessage(Message msg) throws RemoteException {
        String message = msg.getMessage();
        String sender = msg.getSender();
        ChatArea area = null;
        switch (msg.getType()) {
            case Message.PRIVATE_MASSAGE:
                area = chatGUI.getPrivateArea(sender);
                if (area == null) {
                    break;
                }
                area.append(msg);
                break;
            case Message.PUBLIC_MASSAGE:
                area = chatGUI.getPublicArea();
                area.append(msg);
                break;
            case Message.CONNECT_MESSAGE:
                chatGUI.updateList(sender, true);
                area = chatGUI.getPublicArea();
                area.append(msg);
                break;
            case Message.DISCONNECT_MESSAGE:
                if (privateUsersList.containsKey(sender)) {
                    removePrivateChat(sender);
                    chatGUI.removePrivateArea(sender);
                }
                chatGUI.updateList(sender, false);
                area = chatGUI.getPublicArea();
                area.append(msg);
                break;
            case Message.KICK_MESSAGE:
                reset();
                JOptionPane.showMessageDialog(chatGUI.getFrame(), msg.getMessage(), "Kick message", JOptionPane.INFORMATION_MESSAGE);
                chatGUI.close();
                break;
        }
        if (area != null) {
            area.setCaretPosition(area.getText().length());
        }
    }
View Full Code Here

TOP

Related Classes of com.cellasoft.jchat.utils.ChatArea

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.