Commit b75e59b1 authored by Nico Mack's avatar Nico Mack

Added labelAngle property to CoxcombSlice corona

parent 8632ff63
......@@ -8,6 +8,7 @@ FACE_IS_TOUCHABLE_NODE=faceIsTouchable
ITEMS_VARIABLE_NODE=itemsVariable
HTML_TEMPLATE_NODE=htmlTemplate
LABEL_NODE=label
LABEL_ANGLE_NODE=labelAngle
LOWER_BOUND_RADIUS_NODE=lowerBoundRadius
LOWER_BOUND_VARIABLE_NODE=lowerBoundVariable
LOWER_STOP_ANGLE_NODE=lowerStopAngle
......
......@@ -171,6 +171,23 @@
<url>https://artefacts.list.lu/libs-release-local</url>
</repository>
</repositories>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.9</version>
<reportSets>
<reportSet>
<reports>
<report>dependencies</report>
<report>license</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
<scm>
<url>scm:git:https://git.list.lu/nui/TULIP-CPS.git</url>
......
......@@ -41,6 +41,7 @@ public class CpsNamespace extends NLS {
public static String ITEMS_VARIABLE_NODE;
public static String LABEL_NODE;
public static String LABEL_ANGLE_NODE;
public static String LOWER_BOUND_RADIUS_NODE;
public static String LOWER_BOUND_VARIABLE_NODE;
......
......@@ -68,6 +68,7 @@ public class CoxcombSlice extends ValueCorona implements InformationProvider<Obj
protected double upperBoundRadius;
protected double startAngle;
protected double arcSpan;
protected double labelAngle;
protected ColorPair fillColour;
protected ColorPair strokeColour;
......@@ -117,6 +118,7 @@ public class CoxcombSlice extends ValueCorona implements InformationProvider<Obj
this.upperBoundRadius = Math.max(builder.lowerBoundRadius, builder.upperBoundRadius);
this.startAngle = builder.startAngle;
this.arcSpan = builder.arcSpan;
this.labelAngle = builder.labelAngle;
this.fillColour = builder.fillColour;
this.strokeColour = builder.strokeColour;
......@@ -151,6 +153,7 @@ public class CoxcombSlice extends ValueCorona implements InformationProvider<Obj
this.upperBoundRadius = original.upperBoundRadius;
this.startAngle = original.startAngle;
this.arcSpan = original.arcSpan;
this.labelAngle = original.labelAngle;
this.fillColour = original.fillColour;
this.strokeColour = original.strokeColour;
......@@ -223,7 +226,8 @@ public class CoxcombSlice extends ValueCorona implements InformationProvider<Obj
labelPath = new Arc2D.Double(bounds, start, length, Arc2D.OPEN);
} else {
angle = AngleUtils.moduloThreeSixty(angle - arcSpan / 2);
double radialAngle = (Double.isNaN(this.labelAngle)) ? arcSpan / 2 : labelAngle;
angle = AngleUtils.moduloThreeSixty(angle - radialAngle);
double lineHeight = metrics.getAscent() / 2;
Shape centreLine = new Line2D.Double(innerRadius + insetBorder, lineHeight, upperBoundRadius, lineHeight);
......
......@@ -50,6 +50,7 @@ public abstract class BaseCoxcombSliceBuilder<B extends BaseCoxcombSliceBuilder<
public double upperBoundRadius;
public double startAngle;
public double arcSpan;
public double labelAngle;
public ColorPair fillColour;
public ColorPair strokeColour;
......@@ -125,6 +126,7 @@ public abstract class BaseCoxcombSliceBuilder<B extends BaseCoxcombSliceBuilder<
/** Optional fields */
label = BootstrappingUtils.getContentAsString(rootElement, CpsNamespace.LABEL_NODE, BootstrappingUtils.OPTIONAL, Externalization.EMPTY_STRING, context);
labelAngle = BootstrappingUtils.getContentAsDouble(rootElement, CpsNamespace.LABEL_ANGLE_NODE, BootstrappingUtils.OPTIONAL, Double.NaN, context);
radialLayout = BootstrappingUtils.getContentAsBoolean(rootElement, Externalization.RADIAL_LAYOUT_NODE, BootstrappingUtils.OPTIONAL, Boolean.FALSE, context);
cappedDisplay = BootstrappingUtils.getContentAsBoolean(rootElement, CpsNamespace.CAPPED_DISPLAY_NODE, BootstrappingUtils.OPTIONAL, Boolean.FALSE, context);
......
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