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

📄 tablecellrefresher.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:   TableCellRefresher.java

package org.gudy.azureus2.plugins.ui.tables;

import java.util.*;
import org.gudy.azureus2.core3.util.AERunnable;
import org.gudy.azureus2.core3.util.AEThread2;
import org.gudy.azureus2.ui.swt.Utils;

// Referenced classes of package org.gudy.azureus2.plugins.ui.tables:
//			TableColumn, TableCell, TableCellRefreshListener

public class TableCellRefresher
{

	private static TableCellRefresher instance = null;
	private AEThread2 refresher;
	private Map mapCellsToColumn;
	private long iterationNumber;
	private boolean inProgress;
	private AERunnable runnable;

	private TableCellRefresher()
	{
		mapCellsToColumn = new HashMap();
		inProgress = false;
		runnable = new AERunnable() {

			final TableCellRefresher this$0;

			public void runSupport()
			{
				Map cellsCopy;
				synchronized (mapCellsToColumn)
				{
					cellsCopy = new HashMap(mapCellsToColumn);
					mapCellsToColumn.clear();
				}
				Iterator i$ = cellsCopy.keySet().iterator();
				do
				{
					if (!i$.hasNext())
						break;
					TableCell cell = (TableCell)i$.next();
					TableColumn column = (TableColumn)cellsCopy.get(cell);
					try
					{
						if (column instanceof TableCellRefreshListener)
							((TableCellRefreshListener)column).refresh(cell);
					}
					catch (Throwable t)
					{
						t.printStackTrace();
					}
				} while (true);
				inProgress = false;
				break MISSING_BLOCK_LABEL_148;
				Exception exception1;
				exception1;
				inProgress = false;
				throw exception1;
			}

			
			{
				this$0 = TableCellRefresher.this;
				super();
			}
		};
		refresher = new AEThread2("Cell Refresher", true) {

			final TableCellRefresher this$0;

			public void run()
			{
				try
				{
					iterationNumber = 0L;
					do
					{
						if (mapCellsToColumn.size() > 0 && !inProgress)
						{
							inProgress = true;
							Utils.execSWTThread(runnable);
						}
						Thread.sleep(200L);
						iterationNumber++;
					} while (true);
				}
				catch (Exception e)
				{
					e.printStackTrace();
				}
			}

			
			{
				this$0 = TableCellRefresher.this;
				super(x0, x1);
			}
		};
		refresher.start();
	}

	private void _addColumnCell(TableColumn column, TableCell cell)
	{
label0:
		{
			synchronized (mapCellsToColumn)
			{
				if (!mapCellsToColumn.containsKey(cell))
					break label0;
			}
			return;
		}
		mapCellsToColumn.put(cell, column);
		map;
		JVM INSTR monitorexit ;
		  goto _L1
		exception;
		throw exception;
_L1:
	}

	private int _getRefreshIndex(int refreshEvery100ms, int nbIndices)
	{
		if (refreshEvery100ms <= 0)
			return 1;
		if (nbIndices <= 0)
			return 1;
		else
			return (int)((iterationNumber / (long)refreshEvery100ms) % (long)nbIndices);
	}

	private static synchronized TableCellRefresher getInstance()
	{
		if (instance == null)
			instance = new TableCellRefresher();
		return instance;
	}

	public static void addCell(TableColumn column, TableCell cell)
	{
		getInstance()._addColumnCell(column, cell);
	}

	public static int getRefreshIndex(int refreshEvery100ms, int nbIndices)
	{
		return getInstance()._getRefreshIndex(refreshEvery100ms, nbIndices);
	}







}

⌨️ 快捷键说明

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