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

« back to all changes in this revision

Viewing changes to TuxGuitar/src/org/herac/tuxguitar/song/models/TGMarker.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.song.models;
 
2
 
 
3
import org.herac.tuxguitar.song.factory.TGFactory;
 
4
 
 
5
public abstract class TGMarker {
 
6
        private static final TGColor DEFAULT_COLOR = TGColor.RED;
 
7
        private static final String DEFAULT_TITLE = "Untitled";
 
8
        
 
9
        private int measure;
 
10
        private String title;
 
11
        private TGColor color;
 
12
        
 
13
        public TGMarker(TGFactory factory) {
 
14
                this.measure = 0;
 
15
                this.title = DEFAULT_TITLE;
 
16
                this.color = DEFAULT_COLOR.clone(factory);
 
17
        }
 
18
        
 
19
        public int getMeasure() {
 
20
                return this.measure;
 
21
        }
 
22
        
 
23
        public void setMeasure(int measure) {
 
24
                this.measure = measure;
 
25
        }
 
26
        
 
27
        public String getTitle() {
 
28
                return this.title;
 
29
        }
 
30
        
 
31
        public void setTitle(String title) {
 
32
                this.title = title;
 
33
        }
 
34
        
 
35
        public TGColor getColor() {
 
36
                return this.color;
 
37
        }
 
38
        
 
39
        public void setColor(TGColor color) {
 
40
                this.color = color;
 
41
        }
 
42
        
 
43
        public TGMarker clone(TGFactory factory){
 
44
                TGMarker marker = factory.newMarker();
 
45
                marker.setMeasure(getMeasure());
 
46
                marker.setTitle(getTitle());
 
47
                getColor().copy(marker.getColor());
 
48
                return marker;
 
49
        }
 
50
        
 
51
}