Methods Summary |
---|
public void | delete()
if (torrentview != null)
torrentview.delete();
if (seedingview != null)
seedingview.delete();
super.delete();
|
public void | generateDiagnostics(org.gudy.azureus2.core3.util.IndentWriter writer)
super.generateDiagnostics( writer );
try{
writer.indent();
writer.println( "Downloading" );
writer.indent();
torrentview.generateDiagnostics( writer );
}finally{
writer.exdent();
writer.exdent();
}
try{
writer.indent();
writer.println( "Seeding" );
writer.indent();
seedingview.generateDiagnostics( writer );
}finally{
writer.exdent();
writer.exdent();
}
|
public Composite | getComposite()
return form;
|
private MyTorrentsView | getCurrentView()
// wrap in a try, since the controls may be disposed
try {
if (torrentview.isTableFocus())
return torrentview;
else if (seedingview.isTableFocus())
return seedingview;
} catch (Exception ignore) {/*ignore*/}
return null;
|
public java.lang.String | getFullTitle()
return MessageText.getString("MyTorrentsView.mytorrents");
|
public Menu | getPrivateMenu()
return null;
|
public org.gudy.azureus2.core3.download.DownloadManager[] | getSelectedDownloads()
MyTorrentsView currentView = getCurrentView();
if (currentView == null) {return null;}
return currentView.getSelectedDownloads();
|
public void | initialize(Composite parent)
if (form != null) {
return;
}
form = new Composite(parent, SWT.NONE);
FormLayout flayout = new FormLayout();
flayout.marginHeight = 0;
flayout.marginWidth = 0;
form.setLayout(flayout);
GridData gridData;
gridData = new GridData(GridData.FILL_BOTH);
form.setLayoutData(gridData);
GridLayout layout;
final Composite child1 = new Composite(form,SWT.NULL);
layout = new GridLayout();
layout.numColumns = 1;
layout.horizontalSpacing = 0;
layout.verticalSpacing = 0;
layout.marginHeight = 0;
layout.marginWidth = 0;
child1.setLayout(layout);
torrentview = new MyTorrentsView(azureus_core, false, tableIncompleteItems);
torrentview.initialize(child1);
final Sash sash = new Sash(form, SWT.HORIZONTAL);
final Composite child2 = new Composite(form,SWT.NULL);
layout = new GridLayout();
layout.numColumns = 1;
layout.horizontalSpacing = 0;
layout.verticalSpacing = 0;
layout.marginHeight = 0;
layout.marginWidth = 0;
child2.setLayout(layout);
seedingview = new MyTorrentsView(azureus_core, true, tableCompleteItems);
seedingview.initialize(child2);
FormData formData;
// FormData for table child1
formData = new FormData();
formData.left = new FormAttachment(0, 0);
formData.right = new FormAttachment(100, 0);
formData.top = new FormAttachment(0, 0);
child1.setLayoutData(formData);
final FormData child1Data = formData;
// sash
formData = new FormData();
formData.left = new FormAttachment(0, 0);
formData.right = new FormAttachment(100, 0);
formData.top = new FormAttachment(child1);
formData.height = SASH_WIDTH;
sash.setLayoutData(formData);
// child2
formData = new FormData();
formData.left = new FormAttachment(0, 0);
formData.right = new FormAttachment(100, 0);
formData.bottom = new FormAttachment(100, 0);
formData.top = new FormAttachment(sash);
// More precision, times by 100
int weight = (int) (COConfigurationManager.getFloatParameter("MyTorrents.SplitAt"));
if (weight > 10000) {
weight = 10000;
} else if (weight < 100) {
weight *= 100;
}
// Min/max of 5%/95%
if (weight < 500) {
weight = 500;
} else if (weight > 9000) {
weight = 9000;
}
// height will be set on first resize call
sash.setData("PCT", new Double((float)weight / 10000));
child2.setLayoutData(formData);
// Listeners to size the folder
sash.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
final boolean FASTDRAG = true;
if (FASTDRAG && e.detail == SWT.DRAG)
return;
child1Data.height = e.y + e.height - SASH_WIDTH;
form.layout();
Double l = new Double((double) child1.getBounds().height
/ form.getBounds().height);
sash.setData("PCT", l);
if (e.detail != SWT.DRAG)
COConfigurationManager.setParameter("MyTorrents.SplitAt", (int) (l
.doubleValue() * 10000));
}
});
form.addListener(SWT.Resize, new Listener() {
public void handleEvent(Event e) {
Double l = (Double) sash.getData("PCT");
if (l != null) {
child1Data.height = (int) (form.getBounds().height * l
.doubleValue());
form.layout();
}
}
});
|
public boolean | isEnabled(java.lang.String itemKey)
IView currentView = getCurrentView();
if (currentView != null)
return currentView.isEnabled(itemKey);
else
return false;
|
public void | itemActivated(java.lang.String itemKey)
IView currentView = getCurrentView();
if (currentView != null)
currentView.itemActivated(itemKey);
|
public org.eclipse.swt.graphics.Image | obfusticatedImage(org.eclipse.swt.graphics.Image image, org.eclipse.swt.graphics.Point shellOffset)
if (torrentview != null) {
torrentview.obfusticatedImage(image, shellOffset);
}
if (seedingview != null) {
seedingview.obfusticatedImage(image, shellOffset);
}
return image;
|
public void | refresh()
if (getComposite() == null || getComposite().isDisposed())
return;
seedingview.refresh();
torrentview.refresh();
|
public void | updateLanguage()
// no super call, the views will do their own
if (getComposite() == null || getComposite().isDisposed())
return;
seedingview.updateLanguage();
torrentview.updateLanguage();
|
public void | viewActivated()
IView currentView = getCurrentView();
if (currentView instanceof IViewExtension) {
((IViewExtension)currentView).viewActivated();
}
|
public void | viewDeactivated()
IView currentView = getCurrentView();
if (currentView instanceof IViewExtension) {
((IViewExtension)currentView).viewDeactivated();
}
|