Commit 1e2b36bf authored by Nico Mack's avatar Nico Mack

Added insetBorder property to CoxcombSlice

parent 70b8a2f6
......@@ -78,6 +78,7 @@ public class CoxcombSlice extends ValueCorona implements InformationProvider<Obj
protected Font textFont;
protected Stroke borderStroke;
protected int strokeWidth;
protected int insetBorder;
protected int rampingTime;
protected Timeline blinkingTimeline;
......@@ -125,6 +126,7 @@ public class CoxcombSlice extends ValueCorona implements InformationProvider<Obj
this.textFont = builder.textFont;
this.strokeWidth = builder.strokeWidth;
this.insetBorder = builder.insetBorder;
this.faceIsTouchable = builder.faceIsTouchable;
......@@ -156,6 +158,7 @@ public class CoxcombSlice extends ValueCorona implements InformationProvider<Obj
this.textFont = original.textFont;
this.strokeWidth = original.strokeWidth;
this.insetBorder = original.insetBorder;
this.faceIsTouchable = original.faceIsTouchable;
......@@ -223,7 +226,7 @@ public class CoxcombSlice extends ValueCorona implements InformationProvider<Obj
angle = AngleUtils.moduloThreeSixty(angle - arcSpan / 2);
double lineHeight = metrics.getAscent() / 2;
Shape centreLine = new Line2D.Double(innerRadius, lineHeight, upperBoundRadius, lineHeight);
Shape centreLine = new Line2D.Double(innerRadius + insetBorder, lineHeight, upperBoundRadius, lineHeight);
AffineTransform rotate = AffineTransform.getRotateInstance(Math.toRadians(angle));
labelPath = rotate.createTransformedShape(centreLine);
}
......
......@@ -59,6 +59,7 @@ public abstract class BaseCoxcombSliceBuilder<B extends BaseCoxcombSliceBuilder<
public Font textFont;
public int strokeWidth;
public int insetBorder;
public boolean cappedDisplay;
public int rampingTime;
......@@ -131,6 +132,7 @@ public abstract class BaseCoxcombSliceBuilder<B extends BaseCoxcombSliceBuilder<
faceIsTouchable = BootstrappingUtils.getContentAsBoolean(rootElement, CpsNamespace.FACE_IS_TOUCHABLE_NODE, BootstrappingUtils.OPTIONAL, Boolean.FALSE, context);
strokeWidth = BootstrappingUtils.getContentAsInteger(rootElement, Externalization.STROKE_WIDTH_NODE, BootstrappingUtils.OPTIONAL, 1, context);
insetBorder = BootstrappingUtils.getContentAsInteger(rootElement, Externalization.INSET_BORDER_NODE, BootstrappingUtils.OPTIONAL, 0, context);
rampingTime = BootstrappingUtils.getContentAsInteger(rootElement, Externalization.RAMPING_TIME_NODE, BootstrappingUtils.OPTIONAL, 500, context);
textColour = buildColorPair(rootElement.getChild(Externalization.TEXT_COLOUR_ELEMENT), BootstrappingUtils.OPTIONAL, 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