本文整理汇总了Java中org.herac.tuxguitar.song.models.TGDuration.WHOLE属性的典型用法代码示例。如果您正苦于以下问题:Java TGDuration.WHOLE属性的具体用法?Java TGDuration.WHOLE怎么用?Java TGDuration.WHOLE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.herac.tuxguitar.song.models.TGDuration
的用法示例。
在下文中一共展示了TGDuration.WHOLE属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMinSpacing
/**
* Calcula el Espacio minimo que quedara entre nota y nota
*/
protected float getMinSpacing(TGDuration duration){
float scale = getScale();
switch(duration.getValue()){
case TGDuration.WHOLE:
return (50.0f * scale);
case TGDuration.HALF:
return (30.0f * scale);
case TGDuration.QUARTER:
return (25.0f * scale);
case TGDuration.EIGHTH:
return (20.0f * scale);
default:
return (18.0f * scale);
}
}
示例2: getVoiceWidth
/**
* Calcula el Espacio que ocupara el pulso
*/
public float getVoiceWidth(TGVoiceImpl voice){
float scale = getScale();
TGDuration duration = voice.getDuration();
if(duration != null){
switch(duration.getValue()){
case TGDuration.WHOLE:
return (30.0f * scale);
case TGDuration.HALF:
return (25.0f * scale);
case TGDuration.QUARTER:
return (21.0f * scale);
case TGDuration.EIGHTH:
return (20.0f * scale);
case TGDuration.SIXTEENTH:
return (19.0f * scale);
case TGDuration.THIRTY_SECOND:
return (18.0f * scale);
default:
return this.getMinBeatWidth();
}
}
return (20.0f * scale);
}
示例3: parseDuration
private byte parseDuration(TGDuration duration) {
byte value = 0;
switch (duration.getValue()) {
case TGDuration.WHOLE:
value = -2;
break;
case TGDuration.HALF:
value = -1;
break;
case TGDuration.QUARTER:
value = 0;
break;
case TGDuration.EIGHTH:
value = 1;
break;
case TGDuration.SIXTEENTH:
value = 2;
break;
case TGDuration.THIRTY_SECOND:
value = 3;
break;
case TGDuration.SIXTY_FOURTH:
value = 4;
break;
}
return value;
}
示例4: processAction
protected void processAction(TGActionContext context) {
TGDuration duration = ((TGDuration) context.getAttribute(TGDocumentContextAttributes.ATTRIBUTE_DURATION));
if( duration.getValue() > TGDuration.WHOLE ){
duration.setValue(duration.getValue() / 2);
duration.setDotted(false);
duration.setDoubleDotted(false);
TGActionManager tgActionManager = TGActionManager.getInstance(getContext());
tgActionManager.execute(TGSetDurationAction.NAME, context);
}
}
示例5: paintSilence
public void paintSilence(TGLayout layout,TGPainter painter, float fromX, float fromY) {
int style = layout.getStyle();
float x = 0;
float lineSpacing = 0;
float y = 0;
float scale = 0;
if((style & TGLayout.DISPLAY_SCORE) != 0 ){
x = fromX + getPosX() + getBeatImpl().getSpacing(layout);
y = fromY + getPaintPosition(TGTrackSpacing.POSITION_SCORE_MIDDLE_LINES) + this.silenceY;
lineSpacing = layout.getScoreLineSpacing();
scale = (lineSpacing / 9.0f);
}else{
x = fromX + getPosX() + getBeatImpl().getSpacing(layout) - 1;
y = fromY + getPaintPosition(TGTrackSpacing.POSITION_TABLATURE) + this.silenceY;
lineSpacing = layout.getStringSpacing();
scale = (lineSpacing / 10.0f);
}
setStyle(layout, painter,(layout.isPlayModeEnabled() && isPlaying(layout)));
painter.initPath(TGPainter.PATH_FILL);
int duration = getDuration().getValue();
if(duration == TGDuration.WHOLE){
TGSilencePainter.paintWhole(painter, x, y , scale);
}
else if(duration == TGDuration.HALF){
TGSilencePainter.paintHalf(painter, x, y , scale);
}
else if(duration == TGDuration.QUARTER){
TGSilencePainter.paintQuarter(painter, x, y, scale);
}
else if(duration == TGDuration.EIGHTH){
TGSilencePainter.paintEighth(painter, x, y, scale);
}
else if(duration == TGDuration.SIXTEENTH){
TGSilencePainter.paintSixteenth(painter, x, y, scale);
}
else if(duration == TGDuration.THIRTY_SECOND){
TGSilencePainter.paintThirtySecond(painter, x, y, scale);
}
else if(duration == TGDuration.SIXTY_FOURTH){
TGSilencePainter.paintSixtyFourth(painter, x, y, scale);
}
painter.closePath();
if(getDuration().isDotted() || getDuration().isDoubleDotted()){
layout.setDotStyle(painter);
painter.initPath();
painter.moveTo(x + 10,y +1);
painter.addOval(x + 10,y +1,1,1);
if(getDuration().isDoubleDotted()){
painter.moveTo(x + 13,y +1);
painter.addOval(x + 13,y +1,1,1);
}
painter.closePath();
}
if(!getDuration().getDivision().isEqual(TGDivisionType.NORMAL)){
layout.setDivisionTypeStyle(painter);
if((style & TGLayout.DISPLAY_SCORE) != 0 ){
painter.drawString(Integer.toString(getDuration().getDivision().getEnters()), x,(fromY + getPaintPosition(TGTrackSpacing.POSITION_DIVISION_TYPE)));
}else{
painter.drawString(Integer.toString(getDuration().getDivision().getEnters()),x,(fromY + getPaintPosition(TGTrackSpacing.POSITION_DIVISION_TYPE)));
}
}
}