📄 detailedlistview.java
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: DetailedListView.java
package org.gudy.azureus2.ui.swt.views;
import com.aelitis.azureus.core.AzureusCore;
import com.aelitis.azureus.ui.common.table.*;
import com.aelitis.azureus.ui.selectedcontent.SelectedContentManager;
import java.io.PrintStream;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
import org.gudy.azureus2.core3.config.COConfigurationManager;
import org.gudy.azureus2.core3.download.DownloadManager;
import org.gudy.azureus2.core3.internat.MessageText;
import org.gudy.azureus2.core3.util.IndentWriter;
import org.gudy.azureus2.plugins.download.Download;
import org.gudy.azureus2.pluginsimpl.local.PluginCoreUtils;
import org.gudy.azureus2.ui.swt.debug.ObfusticateImage;
import org.gudy.azureus2.ui.swt.pluginsimpl.UISWTViewImpl;
import org.gudy.azureus2.ui.swt.views.table.TableViewSWT;
import org.gudy.azureus2.ui.swt.views.table.utils.TableColumnCreator;
import org.gudy.azureus2.ui.swt.views.table.utils.TableColumnManager;
// Referenced classes of package org.gudy.azureus2.ui.swt.views:
// AbstractIView, IView, IViewExtension, ManagerView,
// MyTorrentsView
public class DetailedListView extends AbstractIView
implements ObfusticateImage, IViewExtension
{
private static int SASH_WIDTH = 8;
static final TableColumnCore tableIncompleteItems[] = TableColumnCreator.createIncompleteDM("MyTorrents");
private AzureusCore azureus_core;
private MyTorrentsView torrentview;
private UISWTViewImpl managerview;
private Composite managerview_parent;
private Composite form;
private MyTorrentsView lastSelectedView;
public DetailedListView(AzureusCore _azureus_core)
{
azureus_core = _azureus_core;
TableColumnManager tcManager = TableColumnManager.getInstance();
tcManager.addColumns(tableIncompleteItems);
}
public Composite getComposite()
{
return form;
}
public void delete()
{
if (torrentview != null)
torrentview.delete();
super.delete();
}
public void initialize(Composite parent)
{
if (form != null)
return;
form = new Composite(parent, 0);
FormLayout flayout = new FormLayout();
flayout.marginHeight = 0;
flayout.marginWidth = 0;
form.setLayout(flayout);
GridData gridData = new GridData(1808);
form.setLayoutData(gridData);
final Composite child1 = new Composite(form, 0);
GridLayout 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, "DetailedTorrentList", false, tableIncompleteItems);
torrentview.initialize(child1);
torrentview.getTableView().addSelectionListener(new TableSelectionAdapter() {
final DetailedListView this$0;
public void selected(TableRowCore rows[])
{
try
{
DownloadManager dms[] = new DownloadManager[rows.length];
for (int i = 0; i < rows.length; i++)
dms[i] = (DownloadManager)rows[i].getDataSource(true);
refreshDownloadView(dms);
}
catch (Exception e)
{
e.printStackTrace();
}
}
{
this$0 = DetailedListView.this;
super();
}
}, true);
final Sash sash = new Sash(form, 256);
Composite child2 = new Composite(form, 0);
managerview_parent = child2;
layout = new GridLayout();
layout.numColumns = 1;
layout.horizontalSpacing = 0;
layout.verticalSpacing = 0;
layout.marginHeight = 0;
layout.marginWidth = 0;
child2.setLayout(layout);
FormData 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;
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);
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);
int weight = (int)COConfigurationManager.getFloatParameter("DetailedList.SplitAt");
if (weight > 10000)
weight = 10000;
else
if (weight < 100)
weight *= 100;
if (weight < 500)
weight = 500;
else
if (weight > 9000)
weight = 9000;
sash.setData("PCT", new Double((float)weight / 10000F));
child2.setLayoutData(formData);
sash.addSelectionListener(new SelectionAdapter() {
final FormData val$child1Data;
final Composite val$child1;
final Sash val$sash;
final DetailedListView this$0;
public void widgetSelected(SelectionEvent e)
{
boolean FASTDRAG = true;
if (e.detail == 1)
return;
child1Data.height = (e.y + e.height) - DetailedListView.SASH_WIDTH;
form.layout();
Double l = new Double((double)child1.getBounds().height / (double)form.getBounds().height);
sash.setData("PCT", l);
if (e.detail != 1)
COConfigurationManager.setParameter("DetailedList.SplitAt", (int)(l.doubleValue() * 10000D));
}
{
this$0 = DetailedListView.this;
child1Data = formdata;
child1 = composite;
sash = sash1;
super();
}
});
form.addListener(11, new Listener() {
final Sash val$sash;
final FormData val$child1Data;
final DetailedListView this$0;
public void handleEvent(Event e)
{
Double l = (Double)sash.getData("PCT");
if (l != null)
{
child1Data.height = (int)((double)form.getBounds().height * l.doubleValue());
form.layout();
}
}
{
this$0 = DetailedListView.this;
sash = sash1;
child1Data = formdata;
super();
}
});
}
public void refresh()
{
if (getComposite() == null || getComposite().isDisposed())
{
return;
} else
{
torrentview.refresh();
return;
}
}
public void updateLanguage()
{
if (getComposite() == null || getComposite().isDisposed())
{
return;
} else
{
torrentview.updateLanguage();
return;
}
}
public String getFullTitle()
{
return MessageText.getString("DetailedListView.title");
}
private MyTorrentsView getCurrentView()
{
try
{
if (torrentview.isTableFocus())
lastSelectedView = torrentview;
}
catch (Exception ignore) { }
return lastSelectedView;
}
public boolean isEnabled(String itemKey)
{
IView currentView = getCurrentView();
if (currentView != null)
return currentView.isEnabled(itemKey);
else
return false;
}
public void itemActivated(String itemKey)
{
IView currentView = getCurrentView();
if (currentView != null)
currentView.itemActivated(itemKey);
}
public String getIconBarPluginIdentity()
{
return "torrents";
}
public Object[] getIconBarPluginContextData()
{
DownloadManager dms[] = getSelectedDownloads();
if (dms == null)
return null;
Download res[] = new Download[dms.length];
for (int i = 0; i < res.length; i++)
res[i] = PluginCoreUtils.wrap(dms[i]);
return res;
}
public DownloadManager[] getSelectedDownloads()
{
MyTorrentsView currentView = getCurrentView();
if (currentView == null)
return null;
else
return currentView.getSelectedDownloads();
}
public void generateDiagnostics(IndentWriter writer)
{
super.generateDiagnostics(writer);
writer.indent();
writer.println("Downloading");
writer.indent();
torrentview.generateDiagnostics(writer);
writer.exdent();
writer.exdent();
break MISSING_BLOCK_LABEL_49;
Exception exception;
exception;
writer.exdent();
writer.exdent();
throw exception;
writer.indent();
writer.println("Seeding");
writer.indent();
writer.exdent();
writer.exdent();
break MISSING_BLOCK_LABEL_85;
Exception exception1;
exception1;
writer.exdent();
writer.exdent();
throw exception1;
}
public Image obfusticatedImage(Image image, Point shellOffset)
{
if (torrentview != null)
torrentview.obfusticatedImage(image, shellOffset);
return image;
}
public Menu getPrivateMenu()
{
return null;
}
public void viewActivated()
{
IView currentView = getCurrentView();
if (currentView instanceof IViewExtension)
((IViewExtension)currentView).viewActivated();
if (currentView instanceof MyTorrentsView)
((MyTorrentsView)currentView).updateSelectedContent();
}
public void viewDeactivated()
{
IView currentView = getCurrentView();
if (currentView == null)
return;
if (currentView instanceof IViewExtension)
((IViewExtension)currentView).viewDeactivated();
String ID = currentView.getShortTitle();
if (currentView instanceof MyTorrentsView)
ID = ((MyTorrentsView)currentView).getTableView().getTableID();
SelectedContentManager.changeCurrentlySelectedContent(ID, null, torrentview != null ? ((com.aelitis.azureus.ui.common.table.TableView) (torrentview.getTableView())) : null);
}
public void refreshDownloadView(DownloadManager dms[])
{
System.out.println("refreshDownloadView change");
if (dms.length != 1)
return;
boolean change = managerview == null || !dms[0].equals(managerview.getDataSource());
if (!change)
return;
if (managerview != null)
managerview.delete();
try
{
managerview = new UISWTViewImpl(null, "DMView", new ManagerView(), dms[0]);
managerview.setUseCoreDataSource(true);
managerview.initialize(managerview_parent);
managerview_parent.layout();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -