📄 scaledgraphic.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: ScaledGraphic.java
package org.gudy.azureus2.ui.swt.components.graphics;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.Canvas;
import org.gudy.azureus2.core3.util.Debug;
import org.gudy.azureus2.ui.swt.mainwindow.Colors;
// Referenced classes of package org.gudy.azureus2.ui.swt.components.graphics:
// BackGroundGraphic, Scale, ValueFormater
public class ScaledGraphic extends BackGroundGraphic
{
protected Scale scale;
protected ValueFormater formater;
protected Image bufferScale;
private int lastMax;
private int update_divider_width;
public ScaledGraphic(Scale scale, ValueFormater formater)
{
update_divider_width = 0;
this.scale = scale;
this.formater = formater;
}
public void setUpdateDividerWidth(int width)
{
update_divider_width = width;
}
protected void drawScale(boolean sizeChanged)
{
Rectangle bounds;
GC gcBuffer;
if (drawCanvas == null || drawCanvas.isDisposed() || !drawCanvas.isVisible())
return;
drawBackGround(sizeChanged);
if (bufferBackground == null || bufferBackground.isDisposed())
return;
boolean scaleChanged = lastMax != scale.getMax();
if (!sizeChanged && !scaleChanged && bufferScale != null)
break MISSING_BLOCK_LABEL_386;
bounds = drawCanvas.getClientArea();
if (bounds.height < 30 || bounds.width < 100)
return;
if (bufferScale != null && !bufferScale.isDisposed())
bufferScale.dispose();
bufferScale = new Image(drawCanvas.getDisplay(), bounds);
gcBuffer = new GC(bufferScale);
gcBuffer.drawImage(bufferBackground, 0, 0);
gcBuffer.setForeground(Colors.black);
scale.setNbPixels(bounds.height - 16);
int levels[] = scale.getScaleValues();
for (int i = 0; i < levels.length; i++)
{
int height = bounds.height - scale.getScaledValue(levels[i]) - 2;
gcBuffer.drawLine(1, height, bounds.width - 70, height);
gcBuffer.drawText(formater.format(levels[i]), bounds.width - 65, height - 12, true);
}
if (update_divider_width > 0)
{
for (int i = bounds.width - 70; i > 0; i -= update_divider_width)
{
gcBuffer.setForeground(Colors.grey);
gcBuffer.drawLine(i, 0, i, bounds.height);
}
}
gcBuffer.dispose();
break MISSING_BLOCK_LABEL_386;
Exception e;
e;
Debug.out(e);
gcBuffer.dispose();
break MISSING_BLOCK_LABEL_386;
Exception exception;
exception;
gcBuffer.dispose();
throw exception;
}
public void dispose()
{
super.dispose();
if (bufferScale != null && !bufferScale.isDisposed())
bufferScale.dispose();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -