Package org.jmule.core

Examples of org.jmule.core.JMThread


    Utils.centreWindow(shell);
   
    shell.setAlpha(0);     
    shell.open();

    new JMThread(new JMRunnable() {
        int i;
        private static final int INCREMENT = 10;
        public void JMRun() {
          for(i = 0; i<255;i+=INCREMENT ) {
          display.syncExec(new JMRunnable() {
View Full Code Here


    if (file_list_updater!=null)
      if (file_list_updater.isAlive()) {
        file_list_updater.JMStop();
      }

    file_list_updater = new JMThread() {
      private boolean stop = false;
     
      public void JMStop() {
        stop = true;
        interrupt();
View Full Code Here

 
  private JMThread sort_thread;
  protected void sortColumn(final int columnID,final boolean sortOrder) {
    if (sort_thread!=null)
      if (sort_thread.isAlive()) return ;
    sort_thread = new JMThread(new JMRunnable() {
      public void JMRun() {
        last_sort_column = columnID;
        last_sort_dir = sortOrder;
        Collections.sort(line_list, new Comparator() {
            public int compare(Object arg0, Object arg1) {
View Full Code Here

  private JMThread reset_order_thread;
 
  private void resetOrdering() {
    if (reset_order_thread != null)
      if (reset_order_thread.isAlive()) return ;
    reset_order_thread =  new JMThread(new JMRunnable() {
      public void JMRun() {
        for(int i = 0;i<default_line_list.size(); i++) {
          line_list.set(i, default_line_list.get(i));
        }
        SWTThread.getDisplay().syncExec(new JMRunnable() {
View Full Code Here

        file_chooser.setMultiSelectionEnabled(false);
        file_chooser.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent event) {
            if(event.getActionCommand() == JFileChooser.APPROVE_SELECTION) { 
                  final File file = file_chooser.getSelectedFile();
                  (new JMThread(new JMRunnable() {
                   public void JMRun() {
                    try {
                   _server_manager.importList(file.getAbsolutePath());
                 } catch (Throwable e) {
                   e.printStackTrace();
View Full Code Here

        return this;
       }
     });
     paste_ed2k_links.addActionListener(new ActionListener() {
       public void actionPerformed(ActionEvent event) {
            (new JMThread(new JMRunnable() {
               public void JMRun() {
               try
                 Object clipboard_contents = clipboard.getData(DataFlavor.stringFlavor);
                 List<ED2KFileLink> clipboard_file_links = ED2KFileLink.extractLinks(clipboard_contents.toString());
               if( clipboard_file_links.size() != 0
View Full Code Here

                  warning_window.getCoreComponents();
                  warning_window.initUIComponents();
              }
             
              // show log messages
              new JMThread(new JMRunnable() {
                public void JMRun() {
                  logger.fine(Localizer._("mainwindow.logtab.message_jmule_started",  JMConstants.JMULE_FULL_NAME));
                  logger.fine(Localizer._("mainwindow.logtab.message_servers_loaded", _core.getServerManager().getServersCount() + ""));
                  logger.fine(Localizer._("mainwindow.logtab.message_shared_loaded", _core.getSharingManager().getFileCount() + ""));
                  logger.fine(Localizer._("mainwindow.logtab.message_partial_loaded", _core.getDownloadManager().getDownloadCount() + ""));
                }}).start();
             
              _core.addEventListener(new JMuleCoreEventListener() {
          public void eventOccured(JMuleCoreEvent event, final EventDescriptor eventDescriptor) {
            if( event == JMuleCoreEvent.NOT_ENOUGH_SPACE ) {
              display.syncExec(new JMRunnable() {
                NotEnoughSpaceDownloadingFile nes = (NotEnoughSpaceDownloadingFile)eventDescriptor;
                public void JMRun() {
                  Utils.showErrorMessage(shell,
                      _._("mainwindow.not_enough_space_dialog.title"),
                      _._("mainwindow.not_enough_space_dialog.message",
                          nes.getFileName(),
                          FileFormatter.formatFileSize( nes.getTotalSpace() ),
                          FileFormatter.formatFileSize( nes.getFreeSpace() )));
                }
              });
            }
          }
              });
              // Update checker
              if (SWTPreferences.getInstance().updateCheckAtStartup()) {
                new JMThread(new JMRunnable() {
                  public void JMRun() {
                    try {
                JMUpdater.getInstance().checkForUpdates();
                if (JMUpdater.getInstance().isNewVersionAvailable())
                  SWTThread.getDisplay().asyncExec(new JMRunnable() {
                          public void JMRun() {
                            if (JMUpdater.getInstance().isNewVersionAvailable()) {
                        if (Utils.showConfirmMessage(shell, _._("mainwindow.new_version_available.title"), _._("mainwindow.new_version_available"))) {
                          UpdaterWindow window = new UpdaterWindow();
                          window.getCoreComponents();
                          window.initUIComponents();
                        } }
                        }});
              } catch (JMUpdaterException e) {}
                  }
                }).start();
              }
              shell.addListener(SWT.Close, new Listener() {
          public void handleEvent(Event arg0) {
            boolean exit = SWTPreferences.getInstance().promptOnExit() ?
                Utils.showConfirmMessage(shell, _._("mainwindow.exit_prompt_title"), _._("mainwindow.exit_prompt")) : true;
            arg0.doit = exit;
          }
              });
              shell.addDisposeListener(new DisposeListener() {
          public void widgetDisposed(DisposeEvent arg0) {
            new JMThread(new JMRunnable() {
              public void JMRun() {
                try {
                  JMuleUIManager.getSingleton().shutdown();
                } catch (JMuleUIManagerException e) {
                  e.printStackTrace();
View Full Code Here

         });
         paste_ed2k_links = new JMenuItem("Paste ed2k link(s)");
         paste_ed2k_links.setIcon(ImgRep.getIcon("ed2k_link_paste.png"));
         paste_ed2k_links.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent event) {
                  (new JMThread(new JMRunnable() {
                     public void JMRun() {
                     try
                       Object clipboard_contents = clipboard.getData(DataFlavor.stringFlavor);
                       List<ED2KFileLink> clipboard_file_links = ED2KFileLink.extractLinks(clipboard_contents.toString());
                     if( clipboard_file_links.size() != 0
View Full Code Here

    if(jm_socket_channel.write(packet.getAsByteBuffer()) == -1 )
        notifyDisconnect();
  }
 
  void connect() {
    connecting_thread = new JMThread() {
      public void run() {     
        try {
          connection_status = ConnectionStatus.CONNECTING;
          SocketChannel channel = SocketChannel.open();
         
View Full Code Here

    sender_thread.JMStop();
  }
 
 
  private void createReceiverThread() {
    receiver_thread = new JMThread() {
      
      private boolean stop_thread = false;
     
      public void run() {
        while(!stop_thread) {
View Full Code Here

TOP

Related Classes of org.jmule.core.JMThread

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.