Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

virtuoso.asaph.util.render
Class LineLayout  view LineLayout download LineLayout.java

java.lang.Object
  extended byvirtuoso.asaph.util.render.LineLayout
Direct Known Subclasses:
Graphics2DLineLayout, PlainTextLineLayout

public abstract class LineLayout
extends java.lang.Object

Object that computes and stores horizontal positions of line members.


Field Summary
private  java.util.List chordFragments_
           
private  float chordLeft_
           
private  float chordSpacingConstraint_
           
private  float curChordPos_
           
private  float curLinePos_
           
private  java.lang.StringBuffer curTextRun_
           
private  float fillerWidth_
           
private static float LARGE_VALUE
           
private  float lineLeft_
           
private static float SMALL_VALUE
           
private  java.util.List textFragments_
           
 
Constructor Summary
protected LineLayout()
          Constructor
 
Method Summary
private  void addChordFragment(float pos, virtuoso.asaph.model.types.Chord chord, virtuoso.asaph.model.types.Interval transpose)
           
private  void addFiller()
           
private  void addNormalFragment()
           
protected  void build(virtuoso.asaph.model.SongLine line, virtuoso.asaph.model.ChordSystem chordSystem, virtuoso.asaph.model.types.Interval transpose, int blockIndent)
          Build the layout
protected  java.lang.String generateChordString(virtuoso.asaph.model.types.Chord chord)
          Subclasses may override this to stringize a chord differently
protected  java.lang.String generateFillerString(float width)
          Subclasses may override this to generate filler text
abstract  float getChordBaseline()
          Get the chord baseline position
protected abstract  float getChordDelayOffset()
          Subclasses must implement this to provide the offset for delayed chords
 int getChordFragmentCount()
          Get the number of chord render fragments
 java.util.List getChordFragments()
          Get the List of chord fragments.
 float getChordsLineLeft()
          Get the left side of the chords
 float getChordsLineRight()
          Get the right side of the chords
protected abstract  float getChordWidth(java.lang.String str)
          Subclasses must implement this to provide the size of a chord string
protected abstract  float getCommentWidth(java.lang.String str)
          Subclasses must implement this to provide the size of a comment string
abstract  float getLineBottom()
          Get the position of the bottom of the line
protected abstract  float getLineIndentWidth()
          Subclasses must implement this to provide the size of a line indent
abstract  float getLineTop()
          Get the position of the top of the line
 float getLineWidth()
          Get the right side of the line
protected abstract  float getMinChordSpacing()
          Subclasses must implement this to provide the minimum chord spacing
 ChordFragment getNthChordFragment(int n)
          Get the indexed chord fragment
 TextFragment getNthTextFragment(int n)
          Get the indexed text fragment
abstract  float getTextBaseline()
          Get the text baseline position
 int getTextFragmentCount()
          Get the number of text render fragments
 java.util.List getTextFragments()
          Get the List of text fragments.
 float getTextLineLeft()
          Get the left side of the text
 float getTextLineRight()
          Get the right side of the text
protected abstract  float getTextWidth(java.lang.String str)
          Subclasses must implement this to provide the size of a text string
 boolean hasChords()
          Does this line have chords?
 boolean hasText()
          Does this line have text?
protected  java.lang.String modifyCommentString(java.lang.String comment)
          Subclasses may override this to munge a comment string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SMALL_VALUE

private static float SMALL_VALUE

LARGE_VALUE

private static float LARGE_VALUE

chordFragments_

private java.util.List chordFragments_

textFragments_

private java.util.List textFragments_

curLinePos_

private float curLinePos_

curChordPos_

private float curChordPos_

chordSpacingConstraint_

private float chordSpacingConstraint_

lineLeft_

private float lineLeft_

chordLeft_

private float chordLeft_

fillerWidth_

private float fillerWidth_

curTextRun_

private java.lang.StringBuffer curTextRun_
Constructor Detail

LineLayout

protected LineLayout()
Constructor

Method Detail

build

protected final void build(virtuoso.asaph.model.SongLine line,
                           virtuoso.asaph.model.ChordSystem chordSystem,
                           virtuoso.asaph.model.types.Interval transpose,
                           int blockIndent)
Build the layout


addChordFragment

private void addChordFragment(float pos,
                              virtuoso.asaph.model.types.Chord chord,
                              virtuoso.asaph.model.types.Interval transpose)

addNormalFragment

private void addNormalFragment()

addFiller

private void addFiller()

getLineTop

public abstract float getLineTop()
Get the position of the top of the line


getChordBaseline

public abstract float getChordBaseline()
Get the chord baseline position


getTextBaseline

public abstract float getTextBaseline()
Get the text baseline position


getLineBottom

public abstract float getLineBottom()
Get the position of the bottom of the line


getChordFragmentCount

public final int getChordFragmentCount()
Get the number of chord render fragments


getNthChordFragment

public final ChordFragment getNthChordFragment(int n)
Get the indexed chord fragment


getChordFragments

public final java.util.List getChordFragments()
Get the List of chord fragments.


getTextFragmentCount

public final int getTextFragmentCount()
Get the number of text render fragments


getNthTextFragment

public final TextFragment getNthTextFragment(int n)
Get the indexed text fragment


getTextFragments

public final java.util.List getTextFragments()
Get the List of text fragments.


hasChords

public final boolean hasChords()
Does this line have chords?


hasText

public final boolean hasText()
Does this line have text?


getChordsLineRight

public final float getChordsLineRight()
Get the right side of the chords


getTextLineRight

public final float getTextLineRight()
Get the right side of the text


getChordsLineLeft

public final float getChordsLineLeft()
Get the left side of the chords


getTextLineLeft

public final float getTextLineLeft()
Get the left side of the text


getLineWidth

public final float getLineWidth()
Get the right side of the line


getChordDelayOffset

protected abstract float getChordDelayOffset()
Subclasses must implement this to provide the offset for delayed chords


getMinChordSpacing

protected abstract float getMinChordSpacing()
Subclasses must implement this to provide the minimum chord spacing


getLineIndentWidth

protected abstract float getLineIndentWidth()
Subclasses must implement this to provide the size of a line indent


getTextWidth

protected abstract float getTextWidth(java.lang.String str)
Subclasses must implement this to provide the size of a text string


getCommentWidth

protected abstract float getCommentWidth(java.lang.String str)
Subclasses must implement this to provide the size of a comment string


getChordWidth

protected abstract float getChordWidth(java.lang.String str)
Subclasses must implement this to provide the size of a chord string


generateChordString

protected java.lang.String generateChordString(virtuoso.asaph.model.types.Chord chord)
Subclasses may override this to stringize a chord differently


modifyCommentString

protected java.lang.String modifyCommentString(java.lang.String comment)
Subclasses may override this to munge a comment string


generateFillerString

protected java.lang.String generateFillerString(float width)
Subclasses may override this to generate filler text