📄 ontopproblem.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: OnTopProblem.java
package org.gudy.azureus2.ui.swt.snippets;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.*;
import org.gudy.azureus2.core3.util.AERunnable;
import org.gudy.azureus2.core3.util.AEThread;
public class OnTopProblem
{
private static int sizes[] = {
100, 120, 140
};
Display display;
Shell mainShell;
Shell onTopShell;
Label labelIter;
int iter;
public OnTopProblem()
{
display = new Display();
mainShell = new Shell(display, 1264);
mainShell.setText("OnTopProblem");
mainShell.setLayout(new FillLayout());
Button btnClose = new Button(mainShell, 8);
btnClose.setText("Close");
btnClose.addListener(13, new Listener() {
final OnTopProblem this$0;
public void handleEvent(Event arg0)
{
mainShell.dispose();
}
{
this$0 = OnTopProblem.this;
super();
}
});
mainShell.setSize(300, 200);
mainShell.open();
onTopShell = new Shell(mainShell, 16384);
onTopShell.setSize(200, 30);
onTopShell.open();
onTopShell.setLayout(new FillLayout());
labelIter = new Label(onTopShell, 0);
org.eclipse.swt.widgets.Tray tray = display.getSystemTray();
TrayItem trayItem = new TrayItem(tray, 0);
trayItem.addListener(14, new Listener() {
final OnTopProblem this$0;
public void handleEvent(Event e)
{
mainShell.setVisible(true);
}
{
this$0 = OnTopProblem.this;
super();
}
});
mainShell.addListener(21, new Listener() {
final OnTopProblem this$0;
public void handleEvent(Event e)
{
e.doit = false;
mainShell.setVisible(false);
onTopShell.setVisible(true);
}
{
this$0 = OnTopProblem.this;
super();
}
});
Thread t = new AEThread("OnTopProblem") {
final OnTopProblem this$0;
public void runSupport()
{
while (updateDisplay())
try
{
Thread.sleep(100L);
}
catch (Exception ignore) { }
}
{
this$0 = OnTopProblem.this;
super(x0);
}
};
t.start();
waitForDispose();
display.dispose();
}
public void waitForDispose()
{
do
{
if (mainShell.isDisposed())
break;
if (!display.readAndDispatch())
display.sleep();
} while (true);
}
public boolean updateDisplay()
{
if (display != null && !display.isDisposed())
{
display.asyncExec(new AERunnable() {
final OnTopProblem this$0;
public void runSupport()
{
iter++;
labelIter.setText((new StringBuilder()).append("").append(iter).toString());
onTopShell.setSize(OnTopProblem.sizes[iter % OnTopProblem.sizes.length], 20);
}
{
this$0 = OnTopProblem.this;
super();
}
});
return true;
} else
{
return false;
}
}
public static void main(String args[])
{
new OnTopProblem();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -