Search in sources :

Example 1 with NonNull

use of com.xenoage.utils.annotations.NonNull in project Zong by Xenoage.

the class FormattedTextReader method readStyle.

@NonNull
public FormattedTextStyle readStyle(MxlFormattedText mxlText) {
    MxlPrintStyle mxlPrintStyle = mxlText.getPrintStyle();
    FontInfo font = new FontInfoReader(mxlPrintStyle.getFont(), FontInfo.defaultValue).read();
    Color color = readColor(mxlPrintStyle);
    return new FormattedTextStyle(font, color, Superscript.Normal);
}
Also used : Color(com.xenoage.utils.color.Color) FormattedTextStyle(com.xenoage.zong.core.text.FormattedTextStyle) MxlPrintStyle(com.xenoage.zong.musicxml.types.attributes.MxlPrintStyle) FontInfo(com.xenoage.utils.font.FontInfo) NonNull(com.xenoage.utils.annotations.NonNull)

Example 2 with NonNull

use of com.xenoage.utils.annotations.NonNull in project Zong by Xenoage.

the class MxlStem method read.

@NonNull
public static MxlStem read(XmlReader reader) {
    MxlPosition yPosition = MxlPosition.read(reader);
    MxlColor color = MxlColor.read(reader);
    MxlStemValue stem = MxlStemValue.read(reader);
    return new MxlStem(stem, yPosition, color);
}
Also used : MxlStemValue(com.xenoage.zong.musicxml.types.enums.MxlStemValue) MxlColor(com.xenoage.zong.musicxml.types.attributes.MxlColor) MxlPosition(com.xenoage.zong.musicxml.types.attributes.MxlPosition) NonNull(com.xenoage.utils.annotations.NonNull)

Example 3 with NonNull

use of com.xenoage.utils.annotations.NonNull in project Zong by Xenoage.

the class MxlAccidentalMark method read.

@NonNull
public static MxlAccidentalMark read(XmlReader reader) {
    MxlPrintStyle printStyle = MxlPrintStyle.read(reader);
    MxlPlacement placement = MxlPlacement.read(reader);
    MxlAccidentalText accidentalText = MxlAccidentalText.read(reader);
    return new MxlAccidentalMark(accidentalText, printStyle, placement);
}
Also used : MxlAccidentalText(com.xenoage.zong.musicxml.types.enums.MxlAccidentalText) MxlPlacement(com.xenoage.zong.musicxml.types.enums.MxlPlacement) MxlPrintStyle(com.xenoage.zong.musicxml.types.attributes.MxlPrintStyle) NonNull(com.xenoage.utils.annotations.NonNull)

Example 4 with NonNull

use of com.xenoage.utils.annotations.NonNull in project Zong by Xenoage.

the class MxlFormattedText method read.

@NonNull
public static MxlFormattedText read(XmlReader reader) {
    MxlLeftCenterRight justify = MxlLeftCenterRight.read(reader, "justify");
    MxlLeftCenterRight hAlign = MxlLeftCenterRight.read(reader, "halign");
    MxlVAlign vAlign = MxlVAlign.read(reader);
    MxlPrintStyle printStyle = MxlPrintStyle.read(reader);
    String value = reader.getTextNotNull();
    return new MxlFormattedText(value, justify, hAlign, vAlign, printStyle);
}
Also used : MxlLeftCenterRight(com.xenoage.zong.musicxml.types.enums.MxlLeftCenterRight) MxlVAlign(com.xenoage.zong.musicxml.types.enums.MxlVAlign) MxlPrintStyle(com.xenoage.zong.musicxml.types.attributes.MxlPrintStyle) NonNull(com.xenoage.utils.annotations.NonNull)

Example 5 with NonNull

use of com.xenoage.utils.annotations.NonNull in project Zong by Xenoage.

the class MxlForward method read.

@NonNull
public static MxlForward read(XmlReader reader) {
    Integer duration = null;
    MxlEditorialVoice editorialVoice = new MxlEditorialVoice();
    while (reader.openNextChildElement()) {
        String n = reader.getElementName();
        if (n.equals("duration"))
            duration = Parser.parseInt(reader.getText());
        else
            editorialVoice.readElement(reader);
        reader.closeElement();
    }
    if (duration == null)
        throw reader.dataException("duration unknown");
    if (false == editorialVoice.isUsed())
        editorialVoice = null;
    return new MxlForward(duration, editorialVoice);
}
Also used : MxlEditorialVoice(com.xenoage.zong.musicxml.types.groups.MxlEditorialVoice) NonNull(com.xenoage.utils.annotations.NonNull)

Aggregations

NonNull (com.xenoage.utils.annotations.NonNull)20 MxlColor (com.xenoage.zong.musicxml.types.attributes.MxlColor)4 MxlPrintStyle (com.xenoage.zong.musicxml.types.attributes.MxlPrintStyle)4 MxlPosition (com.xenoage.zong.musicxml.types.attributes.MxlPosition)2 MxlEditorialVoice (com.xenoage.zong.musicxml.types.groups.MxlEditorialVoice)2 Color (com.xenoage.utils.color.Color)1 FontInfo (com.xenoage.utils.font.FontInfo)1 Size2f (com.xenoage.utils.math.geom.Size2f)1 XmlReader (com.xenoage.utils.xml.XmlReader)1 ScoreFormat (com.xenoage.zong.core.format.ScoreFormat)1 FormattedTextStyle (com.xenoage.zong.core.text.FormattedTextStyle)1 MxlCreditContent (com.xenoage.zong.musicxml.types.choice.MxlCreditContent)1 MxlAccidentalText (com.xenoage.zong.musicxml.types.enums.MxlAccidentalText)1 MxlBarStyle (com.xenoage.zong.musicxml.types.enums.MxlBarStyle)1 MxlBeamValue (com.xenoage.zong.musicxml.types.enums.MxlBeamValue)1 MxlGroupBarlineValue (com.xenoage.zong.musicxml.types.enums.MxlGroupBarlineValue)1 MxlGroupSymbolValue (com.xenoage.zong.musicxml.types.enums.MxlGroupSymbolValue)1 MxlLeftCenterRight (com.xenoage.zong.musicxml.types.enums.MxlLeftCenterRight)1 MxlMarginType (com.xenoage.zong.musicxml.types.enums.MxlMarginType)1 MxlNoteTypeValue (com.xenoage.zong.musicxml.types.enums.MxlNoteTypeValue)1