Commit 91bdf8d9 authored by Nico Mack's avatar Nico Mack

Added displayName attribute

parent 062402bc
......@@ -51,6 +51,7 @@ import java.util.List;
public class ColourScale<T extends Comparable<T>> {
private String name;
private String displayName;
private List<ColourMapping<T>> mappings;
private Color titleColour;
private Color labelColour;
......@@ -125,6 +126,7 @@ public class ColourScale<T extends Comparable<T>> {
private void buildFromBootstrap(@Nullable Element rootElement) throws BuildException {
name = BootstrappingUtils.getAttributeAsString(rootElement, Externalization.NAME_NODE, BootstrappingUtils.MANDATORY, null);
displayName = BootstrappingUtils.getAttributeAsString(rootElement, Externalization.DISPLAY_NAME_NODE, BootstrappingUtils.OPTIONAL, name);
unit = BootstrappingUtils.getAttributeAsString(rootElement, Externalization.UNIT_NODE, BootstrappingUtils.OPTIONAL, Externalization.EMPTY_STRING);
rangeSeparator = BootstrappingUtils.getAttributeAsString(rootElement, CpsNamespace.RANGE_SEPARATOR_ATTRIBUTE, BootstrappingUtils.OPTIONAL, DEFAULT_RANGE_SEPARATOR);
int decimals = BootstrappingUtils.getAttributeAsInteger(rootElement, CpsNamespace.DECIMALS_ATTRIBUTE, BootstrappingUtils.OPTIONAL, -1);
......@@ -308,7 +310,7 @@ public class ColourScale<T extends Comparable<T>> {
// ---------------------------------------------------------------------------
public String getTitle() {
StringBuilder titleBuilder = new StringBuilder(this.name);
StringBuilder titleBuilder = new StringBuilder(this.displayName);
if (Strings.isNotBlank(this.unit)) {
titleBuilder.append(" [").append(this.unit).append("]"); //$NON-NLS-1$ //$NON-NLS-2$
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment