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

📄 shellfactory.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:   ShellFactory.java

package org.gudy.azureus2.ui.swt.components.shell;

import com.aelitis.azureus.ui.swt.UIFunctionsManagerSWT;
import com.aelitis.azureus.ui.swt.UIFunctionsSWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.gudy.azureus2.core3.util.Constants;
import org.gudy.azureus2.ui.swt.Utils;
import org.gudy.azureus2.ui.swt.mainwindow.SWTThread;

// Referenced classes of package org.gudy.azureus2.ui.swt.components.shell:
//			ShellManager

public final class ShellFactory
{
	private static class AEShell extends Shell
	{

		private static int fixupStyle(int style)
		{
			if ((style & 0x38000) > 0 && Utils.anyShellHaveStyle(16416))
			{
				UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
				if (uiFunctions != null && uiFunctions.getMainShell() != null)
					style |= 0x4000;
			}
			return style;
		}

		protected void checkSubclass()
		{
		}

		public void setImage(Image image)
		{
			if (!Constants.isOSX)
				super.setImage(image);
		}

		public void setImages(Image images[])
		{
			if (!Constants.isOSX)
				super.setImages(images);
		}

		public void open()
		{
			UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
			if (uiFunctions != null)
			{
				Shell mainShell = uiFunctions.getMainShell();
				if (mainShell != null && mainShell.getMinimized())
					uiFunctions.bringToFront();
			}
			super.open();
		}

		private AEShell(int styles)
		{
			super(styles);
		}

		private AEShell(Display display)
		{
			super(display);
		}

		private AEShell(Display display, int styles)
		{
			super(display, fixupStyle(styles));
		}

		private AEShell(Shell parent)
		{
			super(parent);
		}

		private AEShell(Shell parent, int styles)
		{
			super(parent, fixupStyle(styles));
		}





	}


	public ShellFactory()
	{
	}

	public static Shell createMainShell(int styles)
	{
		Shell parent = null;
		UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
		if (uiFunctions != null)
			parent = uiFunctions.getMainShell();
		if (parent == null)
			return createShell(SWTThread.getInstance().getDisplay());
		else
			return createShell(parent, styles);
	}

	public static Shell createShell(Display disp, int styles)
	{
		return getRegisteredShell(new AEShell(disp, styles));
	}

	public static Shell createShell(Display disp)
	{
		return getRegisteredShell(new AEShell(disp));
	}

	public static Shell createShell(Shell parent, int styles)
	{
		if (parent != null && parent.isDisposed())
			return null;
		else
			return getRegisteredShell(new AEShell(parent, styles));
	}

	public static Shell createShell(Shell parent)
	{
		return getRegisteredShell(new AEShell(parent));
	}

	public static Shell createShell(int styles)
	{
		return getRegisteredShell(new AEShell(styles));
	}

	private static Shell getRegisteredShell(Shell toRegister)
	{
		if (null == toRegister)
			return null;
		if (Constants.isOSX)
		{
			UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
			if (uiFunctions == null)
				throw new IllegalStateException("Main window is not initialized yet");
			uiFunctions.createMainMenu(toRegister);
		}
		ShellManager.sharedManager().addWindow(toRegister);
		return toRegister;
	}
}

⌨️ 快捷键说明

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