~ubuntu-branches/ubuntu/oneiric/tuxguitar/oneiric

« back to all changes in this revision

Viewing changes to TuxGuitar/src/org/herac/tuxguitar/gui/editors/tab/painters/TGTripletFeelPainter.java

  • Committer: Bazaar Package Importer
  • Author(s): Philippe Coval
  • Date: 2008-06-19 00:30:30 UTC
  • mto: (5.1.2 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20080619003030-h719szrhsngou7c6
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.herac.tuxguitar.gui.editors.tab.painters;
 
2
 
 
3
import org.herac.tuxguitar.gui.editors.TGPainter;
 
4
 
 
5
public class TGTripletFeelPainter {
 
6
        
 
7
        public static void paintTripletFeel8(TGPainter painter, int x, int y,float scale) {
 
8
                float topSpacing = (1.0f * scale);
 
9
                float horizontalSpacing = (1.5f * scale);
 
10
                float verticalSpacing = (2.5f * scale);
 
11
                float ovalWidth = (1.33f * scale);
 
12
                
 
13
                painter.initPath(TGPainter.PATH_FILL);
 
14
                TGNotePainter.paintNote(painter,x, y + (topSpacing + verticalSpacing) , scale );
 
15
                painter.closePath();
 
16
                
 
17
                painter.initPath();
 
18
                painter.moveTo( x + Math.round(ovalWidth) ,y + Math.round(topSpacing + verticalSpacing + (0.33f * scale)) );
 
19
                painter.lineTo( x + Math.round(ovalWidth) ,y + topSpacing);
 
20
                painter.closePath();
 
21
                
 
22
                painter.initPath(TGPainter.PATH_FILL);
 
23
                TGNotePainter.paintNote(painter,x + horizontalSpacing,y + (topSpacing + verticalSpacing)  , scale );
 
24
                painter.closePath();
 
25
                
 
26
                painter.initPath();
 
27
                painter.moveTo(x + Math.round(ovalWidth + horizontalSpacing) ,y +Math.round(topSpacing + verticalSpacing + (0.33f * scale)) );
 
28
                painter.lineTo(x + Math.round(ovalWidth + horizontalSpacing) ,y +topSpacing);
 
29
                painter.closePath();
 
30
                
 
31
                painter.initPath(TGPainter.PATH_FILL);
 
32
                TGNotePainter.paintFooter(painter,x + Math.round(ovalWidth + horizontalSpacing),y + (topSpacing + (scale * 2.3f)), -1 , scale);
 
33
                painter.closePath();
 
34
                
 
35
                painter.initPath();
 
36
                painter.moveTo( x, y + (1 * scale) );
 
37
                painter.cubicTo( x, y + (1 * scale), x + ( ( (ovalWidth * 2f) + horizontalSpacing) / 2f),y + (-1 * scale) ,x + ( (ovalWidth * 2f) + horizontalSpacing),y + (1 * scale));
 
38
                painter.closePath();
 
39
        }
 
40
        
 
41
        public static void paintTripletFeelNone8(TGPainter painter, int x, int y,float scale) {
 
42
                float horizontalSpacing = (1.5f * scale);
 
43
                float verticalSpacing = (2.5f * scale);
 
44
                float ovalWidth = (1.33f * scale);
 
45
                
 
46
                painter.initPath(TGPainter.PATH_FILL);
 
47
                TGNotePainter.paintNote(painter,x, y + verticalSpacing , scale );
 
48
                painter.closePath();
 
49
                
 
50
                painter.initPath();
 
51
                painter.moveTo( x + Math.round(ovalWidth) ,y + Math.round(verticalSpacing + (0.33f * scale)) );
 
52
                painter.lineTo( x + Math.round(ovalWidth) ,y);
 
53
                painter.lineTo( x + Math.round(ovalWidth + horizontalSpacing) ,y);
 
54
                painter.lineTo( x + Math.round(ovalWidth + horizontalSpacing) ,y + Math.round(verticalSpacing + (0.33f * scale)) );
 
55
                painter.closePath();
 
56
                
 
57
                painter.initPath(TGPainter.PATH_FILL);
 
58
                TGNotePainter.paintNote(painter,x + horizontalSpacing,y + verticalSpacing , scale );
 
59
                painter.closePath();
 
60
        }
 
61
        
 
62
        public static int paintTripletFeel16(TGPainter painter, int x, int y,float scale) {
 
63
                float topSpacing = (1.0f * scale);
 
64
                float horizontalSpacing = (1.5f * scale);
 
65
                float verticalSpacing = (2.5f * scale);
 
66
                float ovalWidth = (1.33f * scale);
 
67
                
 
68
                painter.initPath(TGPainter.PATH_FILL);
 
69
                TGNotePainter.paintNote(painter,x,y + (topSpacing + verticalSpacing) , scale );
 
70
                painter.closePath();
 
71
                
 
72
                painter.initPath();
 
73
                painter.moveTo(x + Math.round(ovalWidth) ,y + Math.round(topSpacing + verticalSpacing + (0.33f * scale)) );
 
74
                painter.lineTo(x + Math.round(ovalWidth) ,y + topSpacing);
 
75
                painter.lineTo(x + Math.round(ovalWidth + horizontalSpacing) ,y + topSpacing);
 
76
                painter.lineTo(x + Math.round(ovalWidth + horizontalSpacing) ,y + Math.round(topSpacing + verticalSpacing + (0.33f * scale)) );
 
77
                painter.moveTo(x + Math.round(ovalWidth + horizontalSpacing - (0.55f * scale) ) ,y + Math.round(topSpacing + (0.5f * scale)));
 
78
                painter.lineTo(x + Math.round(ovalWidth + horizontalSpacing) ,y + Math.round(topSpacing + (0.5f * scale)));
 
79
                painter.closePath();
 
80
                
 
81
                painter.initPath(TGPainter.PATH_FILL);
 
82
                TGNotePainter.paintNote(painter,x + horizontalSpacing,y + (topSpacing + verticalSpacing) , scale );
 
83
                painter.closePath();
 
84
                
 
85
                painter.initPath();
 
86
                painter.moveTo( x,y + (1 * scale) );
 
87
                painter.cubicTo( x,y + (1 * scale),x + ( ( (ovalWidth * 2f) + horizontalSpacing) / 2f),y + (-1*scale) ,x + ( (ovalWidth * 2f) + horizontalSpacing),y + (1 * scale));
 
88
                painter.closePath();
 
89
                
 
90
                return Math.round( (ovalWidth * 2f) + horizontalSpacing );
 
91
        }
 
92
        
 
93
        public static int paintTripletFeelNone16(TGPainter painter, int x, int y,float scale) {
 
94
                float horizontalSpacing = (1.5f * scale);
 
95
                float verticalSpacing = (2.5f * scale);
 
96
                float ovalWidth = (1.33f * scale);
 
97
                
 
98
                painter.initPath(TGPainter.PATH_FILL);
 
99
                TGNotePainter.paintNote(painter,x,y + verticalSpacing , scale );
 
100
                painter.closePath();
 
101
                
 
102
                painter.initPath();
 
103
                painter.moveTo(x + Math.round(ovalWidth) ,y + Math.round(verticalSpacing + (0.33f * scale)) );
 
104
                painter.lineTo(x + Math.round(ovalWidth) ,y);
 
105
                painter.lineTo(x + Math.round(ovalWidth + horizontalSpacing) ,y);
 
106
                painter.lineTo(x + Math.round(ovalWidth + horizontalSpacing) ,y + Math.round(verticalSpacing + (0.33f * scale)) );
 
107
                painter.moveTo(x + Math.round(ovalWidth) ,y + Math.round(0.5f * scale));
 
108
                painter.lineTo(x + Math.round(ovalWidth + horizontalSpacing) ,y + Math.round(0.5f * scale));
 
109
                painter.closePath();
 
110
                
 
111
                painter.initPath(TGPainter.PATH_FILL);
 
112
                TGNotePainter.paintNote(painter,x + horizontalSpacing,y + verticalSpacing , scale );
 
113
                painter.closePath();
 
114
                
 
115
                return Math.round( ovalWidth + horizontalSpacing );
 
116
        }
 
117
}