-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRoundProgress.java
More file actions
executable file
·48 lines (40 loc) · 1.49 KB
/
RoundProgress.java
File metadata and controls
executable file
·48 lines (40 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* Projet : Trustopics
* Version : 0.2.1
* Fichier : RoundProgress.java
*/
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import javax.swing.JComponent;
public class RoundProgress extends JComponent {
private final int glb_roundProgressFileSize = 500;
private int glb_roundProgressValue=0;
private int glb_roundProgressStep;
public RoundProgress() {}
public void MyUpdate() {
glb_roundProgressValue++;
update(getGraphics());
}
public void Init() {
glb_roundProgressValue = 0;
update(getGraphics());
}
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if (glb_roundProgressValue <= 0) {
g2.setPaint(new GradientPaint(getWidth(),1,Defines.UIcolForeGDrawing,0,0,Defines.UIcolBackGDrawing,true));
g2.fillRect(0,0,getWidth(),getHeight());
g2.setPaint(Defines.UIcolForeGDrawing);
g2.fillRect(0,getHeight()/2,getHeight()/2,getHeight()/2);
g2.setPaint(new GradientPaint(getWidth(),1,Defines.UIcolForeGDrawing,0,0,Defines.UIcolForeGText,true));
g2.fillArc(0,0,getHeight(),getHeight(),90,180);
}
glb_roundProgressStep = glb_roundProgressValue/(glb_roundProgressFileSize/getWidth());
g2.setPaint(new GradientPaint(getWidth(),1,Defines.UIcolForeGDrawing,0,0,Defines.UIcolForeGText,true));
g2.fillArc(glb_roundProgressStep,0,getHeight(),getHeight(),270,180);
}
}