Class ChordRenderingInfo
java.lang.Object
org.jjazz.chordleadsheet.api.item.ChordRenderingInfo
- All Implemented Interfaces:
Serializable
Music rendering info associated to a chord.
This is an immutable class.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumChange the way music is rendered for a chord symbol.static classThis enables XStream instance configuration even for private classes or classes from non-public packages of Netbeans modules. -
Constructor Summary
ConstructorsConstructorDescriptionCreate an object with default values.ChordRenderingInfo(EnumSet<ChordRenderingInfo.Feature> features) Create an object with specified Features and default values.ChordRenderingInfo(EnumSet<ChordRenderingInfo.Feature> features, StandardScaleInstance scale) Create a new object with the specified parameters.ChordRenderingInfo(ChordRenderingInfo cri, EnumSet<ChordRenderingInfo.Feature> features) Create an object with specified scale and default values. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the accent feature if it's used.Get a copy of the rendering features.The standard scale instance that should be used for this chord.getTransposed(int t) Return a new object transposed by the specified semitones (StandardScaleInstance startNote is impacted).booleanTest if this object features contains the specified features.inthashCode()booleanTest if this object features contains one of the specified features.toString()A string representation for UI.
-
Constructor Details
-
ChordRenderingInfo
public ChordRenderingInfo()Create an object with default values. -
ChordRenderingInfo
Create an object with specified Features and default values.- Parameters:
features- If null use the default value.
-
ChordRenderingInfo
Create an object with specified scale and default values.- Parameters:
scale- If null use the default value.
-
ChordRenderingInfo
public ChordRenderingInfo(EnumSet<ChordRenderingInfo.Feature> features, StandardScaleInstance scale) Create a new object with the specified parameters.- Parameters:
features- If null use the default value.scale- Can be null if no scale defined.- Throws:
IllegalArgumentException- If the features object is not consistent, e.g. SHOT and HOLD can't both be used.
-
ChordRenderingInfo
-
ChordRenderingInfo
-
-
Method Details
-
getFeatures
Get a copy of the rendering features.Default value is an empty EnumSet.
- Returns:
-
getAccentFeature
Get the accent feature if it's used.- Returns:
- Can be null.
-
hasAllFeatures
Test if this object features contains the specified features.Convenience method because of EnumSet...
- Parameters:
f1-fx-- Returns:
-
hasOneFeature
Test if this object features contains one of the specified features.Convenience method because of EnumSet...
- Parameters:
f1-fx-- Returns:
-
getTransposed
Return a new object transposed by the specified semitones (StandardScaleInstance startNote is impacted).Default value is 0.
- Parameters:
t- Transposition in semitones.- Returns:
-
getScaleInstance
The standard scale instance that should be used for this chord.Default value is null.
- Returns:
- Can be null
-
hashCode
-
equals
-
toString
-
toUserString
A string representation for UI.Ex: "[Accent, Crash] - Phrygian(C)", or "Phrygian(C)".
Display only meaningful info, eg. do not show Hold/Shot/Extended/Crash/NoCrash if no accent.
- Returns:
- Can be an empty string
-