Package network

Examples of network.Host


        frame.setContentPane(panel);
        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        panel.reloadComboOptions();
       
        // Seleccionar el hostName indicado por parametro
        Host host = Host.findHost(hostName);
        if (host != null)
            panel.getHostComboBox().setSelectedItem(host);
       
        panel.setImg(ClipboardManager.getClipboard());
        if (panel.getImg()==null)
View Full Code Here


            JOptionPane.showMessageDialog(null, "ESTAS OFFLINE!!", Constants.APPLICATION_NAME_MSG, JOptionPane.INFORMATION_MESSAGE);
            return;
        }
    
        // esta online el destinatario?
        Host host = Host.findHost(hostName);
        if (host == null || !host.isConnected())
            return;
   
        System.out.println("Enviar una imagen..." );

        Message message = new Message();
View Full Code Here

     */
    private synchronized void reloadComboOptions()
    {
     
        hostComboBox.removeAllItems();
        hostComboBox.addItem(new Host(Constants.MASS_MESSAGE_TEXT, Constants.MASS_MESSAGE_TEXT, true));
        Iterator<Host> it = Globals.hosts.iterator();
        while (it.hasNext())
            hostComboBox.addItem(it.next());           
    }
View Full Code Here

    private void generateHostsSubMenu(PopupMenu popupMenu, String action, ActionListener listener)
    {
        Iterator<Host> it = Globals.hosts.iterator();
        while (it.hasNext())
        {
            Host host = it.next();
            if (!host.isConnected())
              continue;
            MenuItem menuItemMensaje = new MenuItem(host.getHostName());
            menuItemMensaje.setActionCommand(action);
            menuItemMensaje.addActionListener(listener);
            popupMenu.add(menuItemMensaje);
        }
    }
View Full Code Here

            appendText(" ** Estas offline!! ** ", "maroon");
            return;
        }
       
        // si el destinatario no esta online, no puedo enviarle
        Host host = (Host)hostComboBox.getSelectedItem();
        if (!host.isConnected())
            return;
        String target = host.getHostName();
        if (target.equalsIgnoreCase(Constants.MASS_MESSAGE_TEXT))
            sendMassMessage(textToSend.getText());
        else
            sendMessage(((Host)hostComboBox.getSelectedItem()).getHostName(), ((Host)hostComboBox.getSelectedItem()).getHostIP(), textToSend.getText(), false);
    }
View Full Code Here

     * Visualizar la ventana, recargar el combo de hosts.
     */
    public void toggleViewState(String hostName)
    {
        reloadComboOptions();
        Host host = Host.findHost(hostName);
        if (host != null)
            hostComboBox.setSelectedItem(host);
        setVisible(true);
    }
View Full Code Here

     * Cargar las entradas del comboBox
     */
    private void reloadComboOptions()
    {
        hostComboBox.removeAllItems();
        hostComboBox.addItem(new Host(Constants.MASS_MESSAGE_TEXT, Constants.MASS_MESSAGE_TEXT, true));
        Iterator<Host> it = Globals.hosts.iterator();
        while (it.hasNext())
            hostComboBox.addItem(it.next());
    }
View Full Code Here

            ImageFrame.showReceivedImage((ImageIcon)message.getMessageContent(), message.getSender());
        }
        else if (message.getMessageKind() == Constants.MESSAGE_KIND_STATUS)
        {
            boolean newStatus = (Boolean)message.getMessageContent();
            Host host = Host.findHost(message.getSender());
            if (host == null)
            {
              System.out.println("ChatFrame.update() Imposible encontrar el host a actualizar");
              return;
            }
            host.setConnected(newStatus);
            setTitle("Chitero... " + Globals.localHostName + " - " + (Globals.online?"ONLINE":"OFFLINE"));
            appendText(getTimeStr() + " <b> ** " + message.getSender().toUpperCase() + " ESTA " + (newStatus?"ONLINE!":"OFFLINE") + " </b> ", "purple");
            reloadComboOptions();
            if (owner.getMenu() != null)
              owner.getMenu().updatePopupSubMenu();
View Full Code Here

TOP

Related Classes of network.Host

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.