FileDocCategorySizeDatePackage
NewTorrentWizard.javaAPI DocAzureus 3.0.3.47724Fri Sep 14 11:21:26 BST 2007org.gudy.azureus2.ui.swt.maketorrent

NewTorrentWizard

public class NewTorrentWizard extends org.gudy.azureus2.ui.swt.wizard.Wizard
author
Olivier

Fields Summary
static final int
TT_LOCAL
static final int
TT_EXTERNAL
static final int
TT_DECENTRAL
static final String
TT_EXTERNAL_DEFAULT
static final String
TT_DECENTRAL_DEFAULT
private static String
default_open_dir
private static String
default_save_dir
private static String
comment
private static int
tracker_type
boolean
create_from_dir
String
singlePath
String
directoryPath
String
savePath
String
trackerURL
boolean
computed_piece_size
long
manual_piece_size
boolean
useMultiTracker
boolean
useWebSeed
private boolean
addOtherHashes
String
multiTrackerConfig
List
trackers
String
webSeedConfig
Map
webseeds
boolean
autoOpen
boolean
autoHost
boolean
permitDHT
boolean
privateTorrent
org.gudy.azureus2.core3.torrent.TOTorrentCreator
creator
Constructors Summary
public NewTorrentWizard(AzureusCore azureus_core, org.eclipse.swt.widgets.Display display)


   
  
  			
	 		 
  
    super(azureus_core, "wizard.title");
    
    cancel.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event arg0) {
        if(creator != null) creator.cancel();
      }
    });
    
    trackers.add(new ArrayList());
    trackerURL = Utils.getLinkFromClipboard(display,false);
    ModePanel panel = new ModePanel(this, null);
    createDropTarget(getWizardWindow());
    this.setFirstPanel(panel);
    
  
Methods Summary
private voidcreateDropTarget(org.eclipse.swt.widgets.Control control)

    DropTarget dropTarget = new DropTarget(control, DND.DROP_DEFAULT | DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK);
    dropTarget.setTransfer(new Transfer[] { URLTransfer.getInstance(), FileTransfer.getInstance()});
    dropTarget.addDropListener(new DropTargetAdapter() {
      public void dragOver(DropTargetEvent event) {
        if(URLTransfer.getInstance().isSupportedType(event.currentDataType)) {
          event.detail = getCurrentPanel() instanceof ModePanel ? DND.DROP_LINK : DND.DROP_NONE;
        }
      }
      public void drop(DropTargetEvent event) {
        if (event.data instanceof String[]) {
          String[] sourceNames = (String[]) event.data;
          if (sourceNames == null || sourceNames.length != 1)
            event.detail = DND.DROP_NONE;
          if (event.detail == DND.DROP_NONE)
            return;
          File droppedFile = new File(sourceNames[0]);
          if (getCurrentPanel() instanceof ModePanel) {
            if (droppedFile.isFile()) {
              singlePath = droppedFile.getAbsolutePath();
              ((ModePanel) getCurrentPanel()).activateMode(true);
            } else if (droppedFile.isDirectory()) {
              directoryPath = droppedFile.getAbsolutePath();
              ((ModePanel) getCurrentPanel()).activateMode(false);
            }
          } else if (getCurrentPanel() instanceof DirectoryPanel) {
            if (droppedFile.isDirectory())
              ((DirectoryPanel) getCurrentPanel()).setFilename(droppedFile.getAbsolutePath());
          } else if (getCurrentPanel() instanceof SingleFilePanel) {
            if (droppedFile.isFile())
              ((SingleFilePanel) getCurrentPanel()).setFilename(droppedFile.getAbsolutePath());
          }
         } else if (getCurrentPanel() instanceof ModePanel) {
           trackerURL = ((URLTransfer.URLType)event.data).linkURL;
           ((ModePanel) getCurrentPanel()).updateTrackerURL();
         }
       }
    });
  
protected booleangetAddOtherHashes()

  	return( addOtherHashes );
  
java.lang.StringgetComment()

    return (comment);
  
protected java.lang.StringgetDefaultOpenDir()

  	return( default_open_dir );
  
protected java.lang.StringgetDefaultSaveDir()

  	return( default_save_dir );
  
public booleangetPieceSizeComputed()

  	return( computed_piece_size );
  
protected longgetPieceSizeManual()

  	return( manual_piece_size );
  
protected intgetTrackerType()

   	return( tracker_type );
  
protected voidsetAddOtherHashes(boolean o)

	  addOtherHashes = o;
	  
	  COConfigurationManager.setParameter( "CreateTorrent.default.addhashes", addOtherHashes );
		 
  
voidsetComment(java.lang.String s)

    comment = s;
    
    COConfigurationManager.setParameter("CreateTorrent.default.comment",comment);
  
protected voidsetDefaultOpenDir(java.lang.String d)

  	default_open_dir	= d;
  	
  	COConfigurationManager.setParameter( "CreateTorrent.default.open", default_open_dir );
  
protected voidsetDefaultSaveDir(java.lang.String d)

  	default_save_dir	= d;
  	
 	COConfigurationManager.setParameter( "CreateTorrent.default.save", default_save_dir );
  
protected voidsetPieceSizeComputed()

  	computed_piece_size = true;
  
protected voidsetPieceSizeManual(long _value)

  	computed_piece_size	= false;
  	manual_piece_size	= _value;
  
protected voidsetTrackerType(int type)

	tracker_type = type;

	COConfigurationManager.setParameter( "CreateTorrent.default.trackertype", tracker_type );