예제 #1
0
 public double render(Graphics2D context) {
   super.render(context);
   /*char[] chars2 = {ScoreMetrics.STAFF_SIX_LINES};
   context.drawChars(chars2, 0, chars2.length,
   		(int)m_base.getX(), (int)(m_base.getY()));*/
   if (!m_clef.isNone()) {
     Color previousColor = context.getColor();
     setColor(context, ScoreElements.CLEF);
     char[] chars = {getMusicalFont().getClef(m_clef)};
     context.drawChars(
         chars,
         0,
         chars.length,
         (int) (getBase().getX() + getMetrics().getNoteWidth() / 4),
         (int) (getBase().getY() - getMetrics().getNoteHeight() * (m_clef.getLineNumber() - 1)));
     context.setColor(previousColor);
   }
   return getWidth();
 }
예제 #2
0
 public double getWidth() {
   if (m_clef.isNone()) return 0;
   return getMetrics().getBounds(getMusicalFont().getClef(m_clef)).getWidth()
       + getMetrics().getNoteWidth() / 2;
   // return 3*getMetrics().getNoteWidth();
 }