📄 pieutils.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: PieUtils.java
package org.gudy.azureus2.ui.swt.components.graphics;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
import org.gudy.azureus2.ui.swt.mainwindow.Colors;
public class PieUtils
{
public PieUtils()
{
}
private static Image computePie(Display display, int width, int height, int percent)
{
Image image = new Image(display, width, height);
GC gcImage = new GC(image);
gcImage.setForeground(Colors.blue);
int angle = (percent * 360) / 100;
gcImage.setBackground(Colors.blues[7]);
gcImage.fillArc(0, 0, width, height, 90 - angle, angle);
gcImage.drawOval(0, 0, width - 1, height - 1);
gcImage.dispose();
return image;
}
public static void drawPie(GC gc, int x, int y, int width, int height, int percent)
{
org.eclipse.swt.graphics.Color background = gc.getBackground();
gc.setForeground(Colors.blue);
int angle = (percent * 360) / 100;
if (angle < 4)
angle = 0;
gc.setBackground(Colors.white);
gc.fillArc(x, y, width, height, 0, 360);
gc.setBackground(background);
gc.fillArc(x, y, width, height, 90, angle * -1);
gc.drawOval(x, y, width - 1, height - 1);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -