2
* Created on 29-nov-2005
4
* TODO To change the template for this generated file go to
5
* Window - Preferences - Java - Code Style - Code Templates
7
package org.herac.tuxguitar.gui.editors.tab;
9
import java.util.Iterator;
11
import org.herac.tuxguitar.gui.editors.tab.layout.ViewLayout;
12
import org.herac.tuxguitar.song.factory.TGFactory;
13
import org.herac.tuxguitar.song.models.TGTrack;
18
* TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates
20
public class TGTrackImpl extends TGTrack{
22
private int tabHeight;
23
private int scoreHeight;
25
public TGTrackImpl(TGFactory factory) {
29
public void update(ViewLayout layout){
30
this.calculateTabHeight(layout);
31
this.calculateScoreHeight(layout);
34
* Calcula el el ancho de la tablatura
36
public void calculateTabHeight(ViewLayout layout) {
37
this.tabHeight = ((layout.getStyle() & ViewLayout.DISPLAY_TABLATURE) != 0 ?((stringCount() - 1) * layout.getStringSpacing()):0);
41
* Calcula el el ancho de la partitura
43
public void calculateScoreHeight(ViewLayout layout) {
44
this.scoreHeight = ((layout.getStyle() & ViewLayout.DISPLAY_SCORE) != 0 ?(layout.getScoreLineSpacing() * 5):0);
47
public boolean hasCaret(ViewLayout layout){
48
return (this.equals(layout.getTablature().getCaret().getTrack()));
51
public int getTabHeight() {
52
return this.tabHeight;
55
public int getScoreHeight() {
56
return this.scoreHeight;
59
public void setTabHeight(int tabHeight) {
60
this.tabHeight = tabHeight;
64
Iterator measures = getMeasures();
65
while(measures.hasNext()){
66
TGMeasureImpl measure = (TGMeasureImpl)measures.next();
67
if(!measure.isDisposed()){
74
public void removeMeasure(int index){
75
TGMeasureImpl measure = (TGMeasureImpl)getMeasure(index);
76
if(!measure.isDisposed()){
79
super.removeMeasure(index);
b'\\ No newline at end of file'