示例#1
0
 protected Node convert(Document doc, TimeSignature signature) {
   Element timeEl = doc.createElement(TIME_TAG);
   Element beatsEl = doc.createElement(BEATS_TAG);
   Element beatTypeEl = doc.createElement(BEAT_TYPE_TAG);
   beatsEl.appendChild(doc.createTextNode(Integer.toString(signature.getNumerator())));
   beatTypeEl.appendChild(doc.createTextNode(Integer.toString(signature.getDenominator())));
   timeEl.appendChild(beatsEl);
   timeEl.appendChild(beatTypeEl);
   return timeEl;
 }
示例#2
0
 public JTimeSignature(TimeSignature ts, Point2D base, ScoreMetrics c) {
   super(c);
   m_ts = ts;
   if (!ts.isSumOfNumerators()) {
     m_numChars = getMusicalFont().getTimeSignatureDigits(ts.getNumerator());
   } else {
     String s_numChars = "";
     int[] sumOfNums = ts.getSumOfNumerators();
     for (int i = 0; i < sumOfNums.length; i++) {
       if (s_numChars.length() > 0) s_numChars += getMusicalFont().getDecoration(Decoration.PLUS);
       s_numChars += String.valueOf(getMusicalFont().getTimeSignatureDigits(sumOfNums[i]));
     }
     m_numChars = s_numChars.toCharArray();
   }
   m_denomChars = getMusicalFont().getTimeSignatureDigits(ts.getDenominator());
   setBase(base);
 }