📄 backgroundgraphic.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: BackGroundGraphic.java
package org.gudy.azureus2.ui.swt.components.graphics;
import com.aelitis.azureus.ui.swt.utils.ColorCache;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.Canvas;
import org.gudy.azureus2.core3.util.AEMonitor;
import org.gudy.azureus2.ui.swt.mainwindow.Colors;
// Referenced classes of package org.gudy.azureus2.ui.swt.components.graphics:
// Graphic
public class BackGroundGraphic
implements Graphic
{
protected Canvas drawCanvas;
protected Image bufferBackground;
protected Color lightGrey;
protected Color lightGrey2;
protected Color colorWhite;
protected AEMonitor this_mon;
public BackGroundGraphic()
{
this_mon = new AEMonitor("BackGroundGraphic");
}
public void initialize(Canvas canvas)
{
drawCanvas = canvas;
lightGrey = ColorCache.getColor(canvas.getDisplay(), 250, 250, 250);
lightGrey2 = ColorCache.getColor(canvas.getDisplay(), 233, 233, 233);
colorWhite = ColorCache.getColor(canvas.getDisplay(), 255, 255, 255);
}
public void refresh()
{
}
protected void drawBackGround(boolean sizeChanged)
{
if (drawCanvas == null || drawCanvas.isDisposed())
return;
if (sizeChanged || bufferBackground == null)
{
Rectangle bounds = drawCanvas.getClientArea();
if (bounds.height < 30 || bounds.width < 100)
return;
if (bufferBackground != null && !bufferBackground.isDisposed())
bufferBackground.dispose();
if (bounds.width > 10000 || bounds.height > 10000)
return;
bufferBackground = new Image(drawCanvas.getDisplay(), bounds);
Color colors[] = new Color[4];
colors[0] = colorWhite;
colors[1] = lightGrey;
colors[2] = lightGrey2;
colors[3] = lightGrey;
GC gcBuffer = new GC(bufferBackground);
for (int i = 0; i < bounds.height - 2; i++)
{
gcBuffer.setForeground(colors[i % 4]);
gcBuffer.drawLine(1, i + 1, bounds.width - 1, i + 1);
}
gcBuffer.setForeground(Colors.black);
gcBuffer.drawLine(bounds.width - 70, 0, bounds.width - 70, bounds.height - 1);
gcBuffer.drawRectangle(0, 0, bounds.width - 1, bounds.height - 1);
gcBuffer.dispose();
}
}
public void dispose()
{
if (bufferBackground != null && !bufferBackground.isDisposed())
bufferBackground.dispose();
}
public void setColors(Color color1, Color color2, Color color3)
{
colorWhite = color1;
lightGrey = color2;
lightGrey2 = color3;
drawCanvas.redraw();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -