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

📄 mainwindow.java

📁 java 文件下载器。可自定义
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
				this$0 = MainWindow.this;
				share_manager = sharemanager;
				super();
			}
			});
			if (share_manager.getShares().length > 0 || COConfigurationManager.getIntParameter("GUI_SWT_share_count_at_close") > 0)
				Utils.execSWTThreadLater(delay += delayInc, new Runnable() {

					final MainWindow this$0;

					public void run()
					{
						showMyShares();
					}

			
			{
				this$0 = MainWindow.this;
				super();
			}
				});
		}
		catch (ShareException e)
		{
			Debug.out(e);
		}
		if (!Constants.isSafeMode && COConfigurationManager.getBooleanParameter("Open MyTorrents"))
			Utils.execSWTThreadLater(delay += delayInc, new Runnable() {

				final MainWindow this$0;

				public void run()
				{
					showMyTorrents();
				}

			
			{
				this$0 = MainWindow.this;
				super();
			}
			});
		new ProgressWindow();
		if (!Constants.isSafeMode && COConfigurationManager.getBooleanParameter("Open Console"))
			Utils.execSWTThreadLater(delay += delayInc, new Runnable() {

				final MainWindow this$0;

				public void run()
				{
					showConsole();
				}

			
			{
				this$0 = MainWindow.this;
				super();
			}
			});
		events = null;
		if (Constants.isSafeMode || COConfigurationManager.getBooleanParameter("Open Config"))
			Utils.execSWTThreadLater(delay += delayInc, new Runnable() {

				final MainWindow this$0;

				public void run()
				{
					showConfig();
				}

			
			{
				this$0 = MainWindow.this;
				super();
			}
			});
		if (!Constants.isSafeMode && COConfigurationManager.getBooleanParameter("Open Stats On Start"))
			Utils.execSWTThreadLater(delay += delayInc, new Runnable() {

				final MainWindow this$0;

				public void run()
				{
					showStats();
				}

			
			{
				this$0 = MainWindow.this;
				super();
			}
			});
		if (!Constants.isSafeMode && COConfigurationManager.getBooleanParameter("Open Transfer Bar On Start"))
			Utils.execSWTThreadLater(delay += delayInc, new Runnable() {

				final MainWindow this$0;

				public void run()
				{
					uiFunctions.showGlobalTransferBar();
				}

			
			{
				this$0 = MainWindow.this;
				super();
			}
			});
		COConfigurationManager.addAndFireParameterListener("IconBar.enabled", new ParameterListener() {

			final MainWindow this$0;

			public void parameterChanged(String parameterName)
			{
				setIconBarEnabled(COConfigurationManager.getBooleanParameter(parameterName));
			}

			
			{
				this$0 = MainWindow.this;
				super();
			}
		});
		if (initializer != null)
			initializer.abortProgress();
	}

	protected boolean getIconBarEnabled()
	{
		return bIconBarEnabled;
	}

	protected void setIconBarEnabled(boolean enabled)
	{
		if (enabled == bIconBarEnabled || shell.isDisposed())
			return;
		bIconBarEnabled = enabled;
		COConfigurationManager.setParameter("IconBar.enabled", bIconBarEnabled);
		if (bIconBarEnabled)
			try
			{
				iconBar = new IconBar(parent);
				iconBar.setCurrentEnabler(this);
				Composite cIconBar = iconBar.getComposite();
				FormData folderLayoutData = (FormData)folder.getLayoutData();
				FormData formData = new FormData();
				if (folderLayoutData.top != null && folderLayoutData.top.control != null)
					formData.top = new FormAttachment(folderLayoutData.top.control);
				else
					formData.top = new FormAttachment(0, 0);
				folderLayoutData.top = new FormAttachment(cIconBar);
				formData.left = new FormAttachment(0, 0);
				formData.right = new FormAttachment(100, 0);
				iconBar.setLayoutData(formData);
			}
			catch (Exception e)
			{
				Logger.log(new LogEvent(LOGID, "Creating Icon Bar", e));
			}
		else
		if (iconBar != null)
			try
			{
				FormData folderLayoutData = (FormData)folder.getLayoutData();
				FormData iconBarLayoutData = (FormData)iconBar.getComposite().getLayoutData();
				if (iconBarLayoutData.top != null && iconBarLayoutData.top.control != null)
					folderLayoutData.top = new FormAttachment(iconBarLayoutData.top.control);
				else
					folderLayoutData.top = new FormAttachment(0, 0);
				iconBar.delete();
				iconBar = null;
			}
			catch (Exception e)
			{
				Logger.log(new LogEvent(LOGID, "Removing Icon Bar", e));
			}
		shell.layout(true, true);
	}

	private void showMainWindow()
	{
		COConfigurationManager.addAndFireParameterListener("Show Download Basket", this);
		if (!bShowMainWindow)
			return;
		boolean bEnableTray = COConfigurationManager.getBooleanParameter("Enable System Tray") && (!Constants.isOSX || SWT.getVersion() > 3300);
		boolean bPassworded = COConfigurationManager.getBooleanParameter("Password enabled");
		boolean bStartMinimize = bEnableTray && (bPassworded || COConfigurationManager.getBooleanParameter("Start Minimized"));
		if (!bStartMinimize)
		{
			shell.layout();
			shell.open();
			if (!Constants.isOSX)
				shell.forceActive();
		} else
		if (Constants.isOSX)
		{
			shell.setMinimized(true);
			shell.setVisible(true);
		}
		if (bEnableTray)
		{
			try
			{
				systemTraySWT = new SystemTraySWT();
			}
			catch (Throwable e)
			{
				Logger.log(new LogEvent(LOGID, 3, "Upgrade to SWT3.0M8 or later for system tray support."));
			}
			if (bStartMinimize)
				minimizeToTray(null);
			else
			if (bPassworded)
			{
				minimizeToTray(null);
				setVisible(true, true);
			}
		}
		if (initializer != null)
			initializer.initializationComplete();
		checkForWhatsNewWindow();
		AssociationChecker.checkAssociations();
		Map map = VersionCheckClient.getSingleton().getMostRecentVersionCheckData();
		DonationWindow.setInitialAskHours(MapUtils.getMapInt(map, "donations.askhrs", DonationWindow.getInitialAskHours()));
		azureus_core.triggerLifeCycleComponentCreated(uiFunctions);
	}

	protected void showMyTracker()
	{
		if (my_tracker_tab == null)
		{
			my_tracker_tab = mainTabSet.createTabItem(new MyTrackerView(azureus_core), true);
			mainTabSet.getView(my_tracker_tab).getComposite().addDisposeListener(new DisposeListener() {

				final MainWindow this$0;

				public void widgetDisposed(DisposeEvent e)
				{
					my_tracker_tab = null;
				}

			
			{
				this$0 = MainWindow.this;
				super();
			}
			});
		} else
		{
			mainTabSet.setFocus(my_tracker_tab);
			refreshIconBar();
			refreshTorrentMenu();
		}
	}

	protected void showMyShares()
	{
		if (my_shares_tab == null)
		{
			my_shares_tab = mainTabSet.createTabItem(new MySharesView(azureus_core), true);
			mainTabSet.getView(my_shares_tab).getComposite().addDisposeListener(new DisposeListener() {

				final MainWindow this$0;

				public void widgetDisposed(DisposeEvent e)
				{
					my_shares_tab = null;
				}

			
			{
				this$0 = MainWindow.this;
				super();
			}
			});
		} else
		{
			mainTabSet.setFocus(my_shares_tab);
			refreshIconBar();
			refreshTorrentMenu();
		}
	}

	protected void showMyTorrents()
	{
		if (mytorrents == null)
		{
			MyTorrentsSuperView view = new MyTorrentsSuperView(azureus_core);
			mytorrents = mainTabSet.createTabItem(view, true);
			mainTabSet.getView(mytorrents).getComposite().addDisposeListener(new DisposeListener() {

				final MainWindow this$0;

				public void widgetDisposed(DisposeEvent e)
				{
					mytorrents = null;
				}

			
			{
				this$0 = MainWindow.this;
				super();
			}
			});
		} else
		{
			mainTabSet.setFocus(mytorrents);
		}
		refreshIconBar();
		refreshTorrentMenu();
	}

	protected void showDetailedListView()
	{
		if (detailed_list == null)
		{
			DetailedListView view = new DetailedListView(azureus_core);
			detailed_list = mainTabSet.createTabItem(view, true);
			mainTabSet.getView(detailed_list).getComposite().addDisposeListener(new DisposeListener() {

				final MainWindow this$0;

				public void widgetDisposed(DisposeEvent e)
				{
					detailed_list = null;
				}

			
			{
				this$0 = MainWindow.this;
				super();
			}
			});
		} else
		{
			mainTabSet.setFocus(detailed_list);
		}
		refreshIconBar();
		refreshTorrentMenu();
	}

	protected void showAllPeersView()
	{
		if (all_peers == null)
		{
			PeerSuperView view = new PeerSuperView(azureus_core.getGlobalManager());
			all_peers = mainTabSet.createTabItem(view, true);
			mainTabSet.getView(all_peers).getComposite().addDisposeListener(new DisposeListener() {

				final MainWindow this$0;

				public void widgetDisposed(DisposeEvent e)
				{
					all_peers = null;
				}

			
			{
				this$0 = MainWindow.this;
				super();
			}
			});
		} else
		{
			mainTabSet.setFocus(all_peers);
		}
		refreshIconBar();
		refreshTorrentMenu();
	}

	protected void showMultiOptionsView(DownloadManager managers[])
	{
		if (multi_options_tab != null)
			multi_options_tab.dispose();
		TorrentOptionsView view = new TorrentOptionsView(managers);
		multi_options_tab = mainTabSet.createTabItem(view, true);
		view.getComposite().addDisposeListener(new DisposeListener() {

			final MainWindow this$0;

			public void widgetDisposed(DisposeEvent e)
			{
				multi_options_tab = null;
			}

			
			{
				this$0 = MainWindow.this;
				super();
			}
		});
		refreshIconBar();
		refreshTorrentMenu();
	}

	private void minimizeToTray(ShellEvent event)
	{
		if (event != null)
			event.doit = false;
		COConfigurationManager.setParameter("window.maximized", shell.getMaximized());
		shell.setVisible(false);
		if (downloadBasket != null)
			downloadBasket.setVisible(true);
		MiniBarManager.getManager().setAllVisible(true);
	}

	private void updateComponents()
	{
		if (mainStatusBar != null)
			mainStatusBar.refreshStatusText();
		if (mainTabSet != null)
			mainTabSet.update();
	}

	private void downloadManagerAdded(DownloadManager created)
	{
		if (uiSWTInstanceImpl != null && !created.getDownloadState().getFlag(16L))
			DonationWindow.checkForDonationPopup();
	}

	protected void openManagerView(DownloadManager downloadManager)
	{
		downloadViews_mon.enter();
		if (downloadViews.containsKey(downloadManager))
		{
			mainTabSet.setFocus((Item)downloadViews.get(downloadManager));
			refreshIconBar();
			refreshTorrentMenu();
		} else
		{
			Item tab = openPluginView(null, "DMView", new ManagerView(), downloadManager, true, true);
			downloadViews.put(downloadManager, tab);
		}
		downloadViews_mon.exit();
		break MISSING_BLOCK_LABEL_96;
		Exception exception;
		exception;
		downloadViews_mon.exit();
		throw exception;
	}

	protected void removeManagerView(DownloadManager downloadManager)
	{
		downloadViews_mon.enter();
		downloadViews.remove(downloadManager);
		downloadViews_mon.exit();
		break MISSING_BLOCK_LABEL_36;
		Exception exception;
		exception;
		downloadViews_mon.exit();
		throw exception;
	}

	private void downloadManagerRemoved(DownloadManager removed)
	{
		downloadViews_mon.enter();
		if (downloadViews.containsKey(removed))
		{
			final Item tab = (Item)downloadViews.get(removed);
			Utils.execSWTThread(new AERunnable() {

				final Item val$tab;
				final MainWindow this$0;

⌨️ 快捷键说明

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