⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mytorrentssuperview.java

📁 java 文件下载器。可自定义
💻 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:   MyTorrentsSuperView.java

package org.gudy.azureus2.ui.swt.views;

import com.aelitis.azureus.core.AzureusCore;
import com.aelitis.azureus.core.AzureusCoreFactory;
import com.aelitis.azureus.ui.common.table.TableColumnCore;
import com.aelitis.azureus.ui.selectedcontent.SelectedContentManager;
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.ui.swt.debug.ObfusticateImage;
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, MyTorrentsView

public class MyTorrentsSuperView extends AbstractIView
	implements ObfusticateImage, IViewExtension
{

	private static int SASH_WIDTH = 5;
	private AzureusCore azureus_core;
	private MyTorrentsView torrentview;
	private MyTorrentsView seedingview;
	private Composite form;
	private MyTorrentsView lastSelectedView;

	public MyTorrentsSuperView()
	{
		this(AzureusCoreFactory.getSingleton());
	}

	public MyTorrentsSuperView(AzureusCore _azureus_core)
	{
		azureus_core = _azureus_core;
		TableColumnManager tcManager = TableColumnManager.getInstance();
		tcManager.addColumns(getCompleteColumns());
		tcManager.addColumns(getIncompleteColumns());
	}

	public Composite getComposite()
	{
		return form;
	}

	public void delete()
	{
		if (torrentview != null)
			torrentview.delete();
		if (seedingview != null)
			seedingview.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 = createTorrentView(azureus_core, "MyTorrents", false, getIncompleteColumns(), child1);
		final Sash sash = new Sash(form, 256);
		Composite child2 = new Composite(form, 0);
		layout = new GridLayout();
		layout.numColumns = 1;
		layout.horizontalSpacing = 0;
		layout.verticalSpacing = 0;
		layout.marginHeight = 0;
		layout.marginWidth = 0;
		child2.setLayout(layout);
		seedingview = createTorrentView(azureus_core, "MySeeders", true, getCompleteColumns(), child2);
		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("MyTorrents.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 MyTorrentsSuperView this$0;

			public void widgetSelected(SelectionEvent e)
			{
				boolean FASTDRAG = true;
				if (e.detail == 1)
					return;
				child1Data.height = (e.y + e.height) - MyTorrentsSuperView.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("MyTorrents.SplitAt", (int)(l.doubleValue() * 10000D));
			}

			
			{
				this$0 = MyTorrentsSuperView.this;
				child1Data = formdata;
				child1 = composite;
				sash = sash1;
				super();
			}
		});
		form.addListener(11, new Listener() {

			final Sash val$sash;
			final FormData val$child1Data;
			final MyTorrentsSuperView 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 = MyTorrentsSuperView.this;
				sash = sash1;
				child1Data = formdata;
				super();
			}
		});
	}

	public void refresh()
	{
		if (getComposite() == null || getComposite().isDisposed())
			return;
		if (seedingview != null)
			seedingview.refresh();
		if (torrentview != null)
			torrentview.refresh();
	}

	public void updateLanguage()
	{
		if (getComposite() == null || getComposite().isDisposed())
			return;
		if (seedingview != null)
			seedingview.updateLanguage();
		if (torrentview != null)
			torrentview.updateLanguage();
	}

	public String getFullTitle()
	{
		return MessageText.getString("MyTorrentsView.mytorrents");
	}

	private MyTorrentsView getCurrentView()
	{
		try
		{
			if (torrentview != null && torrentview.isTableFocus())
				lastSelectedView = torrentview;
			else
			if (seedingview != null && seedingview.isTableFocus())
				lastSelectedView = seedingview;
		}
		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 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();
		seedingview.generateDiagnostics(writer);
		writer.exdent();
		writer.exdent();
		break MISSING_BLOCK_LABEL_93;
		Exception exception1;
		exception1;
		writer.exdent();
		writer.exdent();
		throw exception1;
	}

	public Image obfusticatedImage(Image image, Point shellOffset)
	{
		if (torrentview != null)
			torrentview.obfusticatedImage(image, shellOffset);
		if (seedingview != null)
			seedingview.obfusticatedImage(image, shellOffset);
		return image;
	}

	public Menu getPrivateMenu()
	{
		return null;
	}

	public void viewActivated()
	{
		SelectedContentManager.clearCurrentlySelectedContent();
		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();
	}

	protected TableColumnCore[] getIncompleteColumns()
	{
		return TableColumnCreator.createIncompleteDM("MyTorrents");
	}

	protected TableColumnCore[] getCompleteColumns()
	{
		return TableColumnCreator.createCompleteDM("MySeeders");
	}

	protected MyTorrentsView createTorrentView(AzureusCore _azureus_core, String tableID, boolean isSeedingView, TableColumnCore columns[], Composite c)
	{
		MyTorrentsView view = new MyTorrentsView(_azureus_core, tableID, isSeedingView, columns);
		view.initialize(c);
		c.addListener(26, new Listener() {

			final MyTorrentsSuperView this$0;

			public void handleEvent(Event event)
			{
				viewActivated();
			}

			
			{
				this$0 = MyTorrentsSuperView.this;
				super();
			}
		});
		c.addListener(27, new Listener() {

			final MyTorrentsSuperView this$0;

			public void handleEvent(Event event)
			{
				viewDeactivated();
			}

			
			{
				this$0 = MyTorrentsSuperView.this;
				super();
			}
		});
		return view;
	}

	public MyTorrentsView getTorrentview()
	{
		return torrentview;
	}

	public MyTorrentsView getSeedingview()
	{
		return seedingview;
	}



}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -