Commit 6a2d3b84 authored by Nico Mack's avatar Nico Mack

Created dedicated Leader Corona.

parent edb136d8
ABOVE_ELEMENT=above ABOVE_ELEMENT=above
BACKGROUND_NODE=background
BELOW_ELEMENT=below BELOW_ELEMENT=below
BLINK_ON_OUT_OF_RANGE_NODE=blinkOnOutOfRange BLINK_ON_OUT_OF_RANGE_NODE=blinkOnOutOfRange
CAPPED_DISPLAY_NODE=cappedDisplay CAPPED_DISPLAY_NODE=cappedDisplay
COLOUR_SCALE_NODE=colourScale COLOUR_SCALE_NODE=colourScale
DECIMALS_ATTRIBUTE=decimals DECIMALS_ATTRIBUTE=decimals
FACE_IS_TOUCHABLE_NODE=faceIsTouchable FACE_IS_TOUCHABLE_NODE=faceIsTouchable
FOREGROUND_NODE=foreground
ITEMS_VARIABLE_NODE=itemsVariable ITEMS_VARIABLE_NODE=itemsVariable
HTML_TEMPLATE_NODE=htmlTemplate HTML_TEMPLATE_NODE=htmlTemplate
LABEL_NODE=label LABEL_NODE=label
LABEL_ANGLE_NODE=labelAngle LABEL_ANGLE_NODE=labelAngle
LABEL_TRANSLATION_NODE=labelTranslation LABEL_TRANSLATION_NODE=labelTranslation
LANDING_LINE_LENGTH_NODE=landingLineLength
LEADER_COLOUR_NODE=leaderColour
LEADER_LINE_LENGTH_NODE=leaderLineLength
LEADER_STROKE_WIDTH_NODE=leaderStrokeWidth
LOWER_BOUND_RADIUS_NODE=lowerBoundRadius LOWER_BOUND_RADIUS_NODE=lowerBoundRadius
LOWER_BOUND_VARIABLE_NODE=lowerBoundVariable LOWER_BOUND_VARIABLE_NODE=lowerBoundVariable
LOWER_STOP_ANGLE_NODE=lowerStopAngle LOWER_STOP_ANGLE_NODE=lowerStopAngle
...@@ -25,6 +31,7 @@ POSITIONS_NODE=positions ...@@ -25,6 +31,7 @@ POSITIONS_NODE=positions
RANGE_SEPARATOR_ATTRIBUTE=rangeSeparator RANGE_SEPARATOR_ATTRIBUTE=rangeSeparator
REFERENCE_NODE=reference REFERENCE_NODE=reference
RELATIVE_NODE=relative RELATIVE_NODE=relative
ROTATION_NODE=rotation
SCALES_NODE=scales SCALES_NODE=scales
SELECTED_ITEMS_VARIABLE_NODE=selectedItemsVariable SELECTED_ITEMS_VARIABLE_NODE=selectedItemsVariable
SELECTED_RADIUS_NODE=selectedRadius SELECTED_RADIUS_NODE=selectedRadius
...@@ -32,6 +39,7 @@ STEP_SIZE_NODE=stepSize ...@@ -32,6 +39,7 @@ STEP_SIZE_NODE=stepSize
STRETCH_TO_FIT_NODE=stretchToFit STRETCH_TO_FIT_NODE=stretchToFit
TRACK_ROTATION_CONTINUOUSLY_NODE=trackRotationContinuously TRACK_ROTATION_CONTINUOUSLY_NODE=trackRotationContinuously
TRACK_TRANSLATION_CONTINUOUSLY_NODE=trackTranslationContinuously TRACK_TRANSLATION_CONTINUOUSLY_NODE=trackTranslationContinuously
TRANSLATION_NODE=translation
UPPER_BOUND_RADIUS_NODE=upperBoundRadius UPPER_BOUND_RADIUS_NODE=upperBoundRadius
UPPER_BOUND_VARIABLE_NODE=upperBoundVariable UPPER_BOUND_VARIABLE_NODE=upperBoundVariable
UPPER_STOP_ANGLE_NODE=upperStopAngle UPPER_STOP_ANGLE_NODE=upperStopAngle
......
...@@ -27,12 +27,14 @@ public class CpsNamespace extends NLS { ...@@ -27,12 +27,14 @@ public class CpsNamespace extends NLS {
private static final String BUNDLE_NAME = "CpsNamespace"; //$NON-NLS-1$ private static final String BUNDLE_NAME = "CpsNamespace"; //$NON-NLS-1$
public static String ABOVE_ELEMENT; public static String ABOVE_ELEMENT;
public static String BACKGROUND_NODE;
public static String BELOW_ELEMENT; public static String BELOW_ELEMENT;
public static String BLINK_ON_OUT_OF_RANGE_NODE; public static String BLINK_ON_OUT_OF_RANGE_NODE;
public static String CAPPED_DISPLAY_NODE; public static String CAPPED_DISPLAY_NODE;
public static String COLOUR_SCALE_NODE; public static String COLOUR_SCALE_NODE;
public static String FACE_IS_TOUCHABLE_NODE; public static String FACE_IS_TOUCHABLE_NODE;
public static String FOREGROUND_NODE;
public static String DECIMALS_ATTRIBUTE; public static String DECIMALS_ATTRIBUTE;
...@@ -44,6 +46,12 @@ public class CpsNamespace extends NLS { ...@@ -44,6 +46,12 @@ public class CpsNamespace extends NLS {
public static String LABEL_ANGLE_NODE; public static String LABEL_ANGLE_NODE;
public static String LABEL_TRANSLATION_NODE; public static String LABEL_TRANSLATION_NODE;
public static String LANDING_LINE_LENGTH_NODE;
public static String LEADER_COLOUR_NODE;
public static String LEADER_LINE_LENGTH_NODE;
public static String LEADER_STROKE_WIDTH_NODE;
public static String LOWER_BOUND_RADIUS_NODE; public static String LOWER_BOUND_RADIUS_NODE;
public static String LOWER_BOUND_VARIABLE_NODE; public static String LOWER_BOUND_VARIABLE_NODE;
public static String LOWER_STOP_ANGLE_NODE; public static String LOWER_STOP_ANGLE_NODE;
...@@ -61,6 +69,7 @@ public class CpsNamespace extends NLS { ...@@ -61,6 +69,7 @@ public class CpsNamespace extends NLS {
public static String RANGE_SEPARATOR_ATTRIBUTE; public static String RANGE_SEPARATOR_ATTRIBUTE;
public static String REFERENCE_NODE; public static String REFERENCE_NODE;
public static String RELATIVE_NODE; public static String RELATIVE_NODE;
public static String ROTATION_NODE;
public static String SCALES_NODE; public static String SCALES_NODE;
...@@ -72,6 +81,7 @@ public class CpsNamespace extends NLS { ...@@ -72,6 +81,7 @@ public class CpsNamespace extends NLS {
public static String TRACK_ROTATION_CONTINUOUSLY_NODE; public static String TRACK_ROTATION_CONTINUOUSLY_NODE;
public static String TRACK_TRANSLATION_CONTINUOUSLY_NODE; public static String TRACK_TRANSLATION_CONTINUOUSLY_NODE;
public static String TRANSLATION_NODE;
public static String UPPER_BOUND_RADIUS_NODE; public static String UPPER_BOUND_RADIUS_NODE;
public static String UPPER_BOUND_VARIABLE_NODE; public static String UPPER_BOUND_VARIABLE_NODE;
......
...@@ -3,7 +3,6 @@ package lu.list.itis.dkd.tui.widget.corona; ...@@ -3,7 +3,6 @@ package lu.list.itis.dkd.tui.widget.corona;
import lu.list.itis.dkd.tui.cps.variable.NumericalVariable; import lu.list.itis.dkd.tui.cps.variable.NumericalVariable;
import lu.list.itis.dkd.tui.utility.AngleUtils; import lu.list.itis.dkd.tui.utility.AngleUtils;
import lu.list.itis.dkd.tui.utility.ColorPair; import lu.list.itis.dkd.tui.utility.ColorPair;
import lu.list.itis.dkd.tui.utility.Leader;
import lu.list.itis.dkd.tui.utility.Point; import lu.list.itis.dkd.tui.utility.Point;
import lu.list.itis.dkd.tui.utility.VariableFormat; import lu.list.itis.dkd.tui.utility.VariableFormat;
import lu.list.itis.dkd.tui.widget.corona.builder.BaseArcGraphBuilder; import lu.list.itis.dkd.tui.widget.corona.builder.BaseArcGraphBuilder;
...@@ -38,7 +37,6 @@ import java.awt.geom.Rectangle2D; ...@@ -38,7 +37,6 @@ import java.awt.geom.Rectangle2D;
// *************************************************************************** // ***************************************************************************
public class ArcGraph extends ValueCorona { public class ArcGraph extends ValueCorona {
// protected String title;
protected double innerRadius; protected double innerRadius;
protected double outerRadius; protected double outerRadius;
protected int startAngle; protected int startAngle;
...@@ -52,7 +50,6 @@ public class ArcGraph extends ValueCorona { ...@@ -52,7 +50,6 @@ public class ArcGraph extends ValueCorona {
protected ColorPair strokeColour; protected ColorPair strokeColour;
protected ColorPair labelColour; protected ColorPair labelColour;
protected ColorPair textColour; protected ColorPair textColour;
protected ColorPair leaderColour;
protected ColorPair faceColour; protected ColorPair faceColour;
protected ColorPair bezelColour; protected ColorPair bezelColour;
...@@ -62,9 +59,6 @@ public class ArcGraph extends ValueCorona { ...@@ -62,9 +59,6 @@ public class ArcGraph extends ValueCorona {
protected Stroke borderStroke; protected Stroke borderStroke;
protected int strokeWidth; protected int strokeWidth;
protected int leaderLineLength;
protected int landingLineLength;
protected VariableFormat variableFormat; protected VariableFormat variableFormat;
protected int rampingTime; protected int rampingTime;
...@@ -75,7 +69,6 @@ public class ArcGraph extends ValueCorona { ...@@ -75,7 +69,6 @@ public class ArcGraph extends ValueCorona {
private Area face; private Area face;
private String label; private String label;
private LineMetrics labelMetrics; private LineMetrics labelMetrics;
private Leader leader;
protected Timeline blinkingTimeline; protected Timeline blinkingTimeline;
protected Timeline balisticTimeline; protected Timeline balisticTimeline;
...@@ -109,15 +102,12 @@ public class ArcGraph extends ValueCorona { ...@@ -109,15 +102,12 @@ public class ArcGraph extends ValueCorona {
this.strokeColour = builder.strokeColour; this.strokeColour = builder.strokeColour;
this.labelColour = builder.labelColour; this.labelColour = builder.labelColour;
this.textColour = builder.textColour; this.textColour = builder.textColour;
this.leaderColour = builder.leaderColour;
this.faceColour = builder.faceColour; this.faceColour = builder.faceColour;
this.bezelColour = builder.bezelColour; this.bezelColour = builder.bezelColour;
this.labelShape = builder.labelShape; this.labelShape = builder.labelShape;
this.labelFormat = builder.labelFormat; this.labelFormat = builder.labelFormat;
this.textFont = builder.textFont; this.textFont = builder.textFont;
this.strokeWidth = builder.strokeWidth; this.strokeWidth = builder.strokeWidth;
this.leaderLineLength = builder.leaderLineLength;
this.landingLineLength = builder.landingLineLength;
this.rampingTime = builder.rampingTime; this.rampingTime = builder.rampingTime;
this.buildFromProperties(); this.buildFromProperties();
...@@ -148,15 +138,12 @@ public class ArcGraph extends ValueCorona { ...@@ -148,15 +138,12 @@ public class ArcGraph extends ValueCorona {
this.strokeColour = original.strokeColour; this.strokeColour = original.strokeColour;
this.labelColour = original.labelColour; this.labelColour = original.labelColour;
this.textColour = original.textColour; this.textColour = original.textColour;
this.leaderColour = original.leaderColour;
this.faceColour = original.faceColour; this.faceColour = original.faceColour;
this.bezelColour = original.bezelColour; this.bezelColour = original.bezelColour;
this.labelShape = original.labelShape; this.labelShape = original.labelShape;
this.labelFormat = original.labelFormat; this.labelFormat = original.labelFormat;
this.textFont = original.textFont; this.textFont = original.textFont;
this.strokeWidth = original.strokeWidth; this.strokeWidth = original.strokeWidth;
this.leaderLineLength = original.leaderLineLength;
this.landingLineLength = original.landingLineLength;
this.rampingTime = original.rampingTime; this.rampingTime = original.rampingTime;
this.buildFromProperties(); this.buildFromProperties();
...@@ -210,12 +197,6 @@ public class ArcGraph extends ValueCorona { ...@@ -210,12 +197,6 @@ public class ArcGraph extends ValueCorona {
borderStroke = (strokeWidth > 0) ? new BasicStroke(strokeWidth) : null; borderStroke = (strokeWidth > 0) ? new BasicStroke(strokeWidth) : null;
if (leaderLineLength > 0) {
leader = new Leader(innerRadius, leaderLineLength, landingLineLength);
leader.setLabelShape(labelShape);
leader.setFont(textFont);
}
this.setInformation((relative) ? this.reference : this.variable.getValue()); this.setInformation((relative) ? this.reference : this.variable.getValue());
} }
...@@ -286,8 +267,6 @@ public class ArcGraph extends ValueCorona { ...@@ -286,8 +267,6 @@ public class ArcGraph extends ValueCorona {
faceColour.setSwitched(selectIt); faceColour.setSwitched(selectIt);
if (bezelColour != null) if (bezelColour != null)
bezelColour.setSwitched(selectIt); bezelColour.setSwitched(selectIt);
if (leaderColour != null)
leaderColour.setSwitched(selectIt);
} }
} }
...@@ -318,12 +297,6 @@ public class ArcGraph extends ValueCorona { ...@@ -318,12 +297,6 @@ public class ArcGraph extends ValueCorona {
extend = arcSpan * normalizedValue; extend = arcSpan * normalizedValue;
} }
if (leader != null) {
float leaderAngle = (float) -Math.toRadians(start + extend);
leader.updateLeader(leaderAngle);
}
if (blinkOnOutOfRange && reachedEndOfScale()) { if (blinkOnOutOfRange && reachedEndOfScale()) {
this.startBlinking(); this.startBlinking();
} else { } else {
...@@ -384,36 +357,22 @@ public class ArcGraph extends ValueCorona { ...@@ -384,36 +357,22 @@ public class ArcGraph extends ValueCorona {
// Depending on whether we specified a leader or not, we're either // Depending on whether we specified a leader or not, we're either
// painting the leader or the stationary graph label, but never both. // painting the leader or the stationary graph label, but never both.
if ((leaderColour != null) && (this.leader != null)) { if ((labelShape != null) || (label.length() > 0)) {
// Paint the leader... Point labelOffset = this.getOffsetFromCenter();
translation.translate(labelOffset.x, labelOffset.y);
this.leader.setStrokeColour(leaderColour.getColor()); localCanvas.setTransform(translation);
if (labelColour != null) }
this.leader.setFillColour(labelColour.getColor());
if (textColour != null)
this.leader.setLabelColour(textColour.getColor());
this.leader.paint(localCanvas);
} else {
// Paint the stationary graph label
if ((labelShape != null) || (label.length() > 0)) {
Point labelOffset = this.getOffsetFromCenter();
translation.translate(labelOffset.x, labelOffset.y);
localCanvas.setTransform(translation);
}
if (labelShape != null) {
localCanvas.setPaint(labelColour.getColor());
localCanvas.fill(labelShape);
}
if (textColour != null) { if (labelShape != null) {
localCanvas.setPaint(textColour.getColor()); localCanvas.setPaint(labelColour.getColor());
localCanvas.setFont(textFont); localCanvas.fill(labelShape);
localCanvas.drawString(label, 5, (labelMetrics.getAscent() / 2));
}
} }
if (textColour != null) {
localCanvas.setPaint(textColour.getColor());
localCanvas.setFont(textFont);
localCanvas.drawString(label, 5, (labelMetrics.getAscent() / 2));
}
localCanvas.dispose(); localCanvas.dispose();
} }
...@@ -438,15 +397,8 @@ public class ArcGraph extends ValueCorona { ...@@ -438,15 +397,8 @@ public class ArcGraph extends ValueCorona {
} }
if (textFont != null) { if (textFont != null) {
// StringBuilder labelBuilder = new StringBuilder(this.title).append(" "); //$NON-NLS-1$
// labelBuilder.append(this.variable.toString(this.cappedDisplay, true));
this.label = this.variableFormat.format(this.variable); this.label = this.variableFormat.format(this.variable);
this.labelMetrics = textFont.getLineMetrics(this.label, new FontRenderContext(null, true, true)); this.labelMetrics = textFont.getLineMetrics(this.label, new FontRenderContext(null, true, true));
if (leader != null) {
leader.setLabel(label);
}
} }
} }
} }
......
...@@ -2,7 +2,6 @@ package lu.list.itis.dkd.tui.widget.corona; ...@@ -2,7 +2,6 @@ package lu.list.itis.dkd.tui.widget.corona;
import lu.list.itis.dkd.tui.utility.AngleUtils; import lu.list.itis.dkd.tui.utility.AngleUtils;
import lu.list.itis.dkd.tui.utility.ColorPair; import lu.list.itis.dkd.tui.utility.ColorPair;
import lu.list.itis.dkd.tui.utility.Leader;
import lu.list.itis.dkd.tui.utility.ValueRange; import lu.list.itis.dkd.tui.utility.ValueRange;
import lu.list.itis.dkd.tui.utility.VariableFormat; import lu.list.itis.dkd.tui.utility.VariableFormat;
import lu.list.itis.dkd.tui.widget.corona.builder.ArcRangeGraphBuilder; import lu.list.itis.dkd.tui.widget.corona.builder.ArcRangeGraphBuilder;
...@@ -35,7 +34,6 @@ import java.awt.geom.Rectangle2D; ...@@ -35,7 +34,6 @@ import java.awt.geom.Rectangle2D;
// *************************************************************************** // ***************************************************************************
public class ArcRangeGraph extends ValueRangeCorona { public class ArcRangeGraph extends ValueRangeCorona {
private String title;
private double innerRadius; private double innerRadius;
private double outerRadius; private double outerRadius;
private double startAngle; private double startAngle;
...@@ -49,7 +47,6 @@ public class ArcRangeGraph extends ValueRangeCorona { ...@@ -49,7 +47,6 @@ public class ArcRangeGraph extends ValueRangeCorona {
private ColorPair strokeColour; private ColorPair strokeColour;
private ColorPair labelColour; private ColorPair labelColour;
private ColorPair textColour; private ColorPair textColour;
private ColorPair leaderColour;
private ColorPair faceColour; private ColorPair faceColour;
private ColorPair bezelColour; private ColorPair bezelColour;
...@@ -59,21 +56,13 @@ public class ArcRangeGraph extends ValueRangeCorona { ...@@ -59,21 +56,13 @@ public class ArcRangeGraph extends ValueRangeCorona {
private int strokeWidth; private int strokeWidth;
private String labelFormat; private String labelFormat;
private int leaderLineLength;
private int landingLineLength;
private Area outerArea; private Area outerArea;
private Area innerArea; private Area innerArea;
private Area positiveArc; private Area positiveArc;
private Area negativeArc; private Area negativeArc;
private Area face; private Area face;
private Leader lowerLeader;
private Leader upperLeader;
private VariableFormat variableFormat; private VariableFormat variableFormat;
private String lowerValueLabel;
private String upperValueLabel;
protected Timeline blinkingTimeline; protected Timeline blinkingTimeline;
protected Timeline balisticTimeline; protected Timeline balisticTimeline;
...@@ -81,8 +70,6 @@ public class ArcRangeGraph extends ValueRangeCorona { ...@@ -81,8 +70,6 @@ public class ArcRangeGraph extends ValueRangeCorona {
private double shownUpperValue; private double shownUpperValue;
private double referenceAngle; private double referenceAngle;
private double lowerAngle;
private double upperAngle;
// *************************************************************************** // ***************************************************************************
...@@ -97,9 +84,6 @@ public class ArcRangeGraph extends ValueRangeCorona { ...@@ -97,9 +84,6 @@ public class ArcRangeGraph extends ValueRangeCorona {
public ArcRangeGraph(ArcRangeGraphBuilder<?> builder) { public ArcRangeGraph(ArcRangeGraphBuilder<?> builder) {
super(builder); super(builder);
this.title = builder.title;
this.startAngle = builder.startAngle; this.startAngle = builder.startAngle;
this.arcSpan = builder.arcSpan; this.arcSpan = builder.arcSpan;
this.relative = builder.relative; this.relative = builder.relative;
...@@ -113,14 +97,11 @@ public class ArcRangeGraph extends ValueRangeCorona { ...@@ -113,14 +97,11 @@ public class ArcRangeGraph extends ValueRangeCorona {
this.strokeColour = builder.strokeColour; this.strokeColour = builder.strokeColour;
this.labelColour = builder.labelColour; this.labelColour = builder.labelColour;
this.textColour = builder.textColour; this.textColour = builder.textColour;
this.leaderColour = builder.leaderColour;
this.faceColour = builder.faceColour; this.faceColour = builder.faceColour;
this.bezelColour = builder.bezelColour; this.bezelColour = builder.bezelColour;
this.labelShape = builder.labelShape; this.labelShape = builder.labelShape;
this.textFont = builder.textFont; this.textFont = builder.textFont;
this.strokeWidth = builder.strokeWidth; this.strokeWidth = builder.strokeWidth;
this.landingLineLength = builder.landingLineLength;
this.leaderLineLength = builder.leaderLineLength;
this.labelFormat = builder.labelFormat; this.labelFormat = builder.labelFormat;
this.buildFromProperties(); this.buildFromProperties();
...@@ -151,14 +132,11 @@ public class ArcRangeGraph extends ValueRangeCorona { ...@@ -151,14 +132,11 @@ public class ArcRangeGraph extends ValueRangeCorona {
this.strokeColour = original.strokeColour; this.strokeColour = original.strokeColour;
this.labelColour = original.labelColour; this.labelColour = original.labelColour;
this.textColour = original.textColour; this.textColour = original.textColour;
this.leaderColour = original.leaderColour;
this.faceColour = original.faceColour; this.faceColour = original.faceColour;
this.bezelColour = original.bezelColour; this.bezelColour = original.bezelColour;
this.labelShape = original.labelShape; this.labelShape = original.labelShape;
this.textFont = original.textFont; this.textFont = original.textFont;
this.strokeWidth = original.strokeWidth; this.strokeWidth = original.strokeWidth;
this.landingLineLength = original.landingLineLength;
this.leaderLineLength = original.leaderLineLength;
this.labelFormat = original.labelFormat; this.labelFormat = original.labelFormat;
this.buildFromProperties(); this.buildFromProperties();
...@@ -213,14 +191,6 @@ public class ArcRangeGraph extends ValueRangeCorona { ...@@ -213,14 +191,6 @@ public class ArcRangeGraph extends ValueRangeCorona {
range = (relative) ? new ValueRange<>(this.reference, this.reference) range = (relative) ? new ValueRange<>(this.reference, this.reference)
: new ValueRange<>(this.lowerBoundVariable.getValue(), this.upperBoundVariable.getValue()); : new ValueRange<>(this.lowerBoundVariable.getValue(), this.upperBoundVariable.getValue());
lowerLeader = new Leader(innerRadius, leaderLineLength, landingLineLength);
lowerLeader.setLabelShape(labelShape);
lowerLeader.setFont(textFont);
upperLeader = new Leader(innerRadius, leaderLineLength, landingLineLength);
upperLeader.setLabelShape(labelShape);
upperLeader.setFont(textFont);
this.setInformation(range); this.setInformation(range);
} }
...@@ -246,19 +216,6 @@ public class ArcRangeGraph extends ValueRangeCorona { ...@@ -246,19 +216,6 @@ public class ArcRangeGraph extends ValueRangeCorona {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
private void updateLeader() {
float lowerLeaderAngle = (float) -Math.toRadians(lowerAngle);
float upperLeaderAngle = (float) -Math.toRadians(upperAngle);
this.lowerLeader.updateLeader(lowerLeaderAngle);
this.lowerLeader.setLabel(lowerValueLabel);
this.upperLeader.updateLeader(upperLeaderAngle);
this.upperLeader.setLabel(upperValueLabel);
}
// ---------------------------------------------------------------------------
private synchronized void updateArcFromValues() { private synchronized void updateArcFromValues() {
if ((lowerBoundVariable == null) || (upperBoundVariable == null)) { if ((lowerBoundVariable == null) || (upperBoundVariable == null)) {
...@@ -273,8 +230,8 @@ public class ArcRangeGraph extends ValueRangeCorona { ...@@ -273,8 +230,8 @@ public class ArcRangeGraph extends ValueRangeCorona {
double diameter = 2 * outerRadius; double diameter = 2 * outerRadius;
this.lowerAngle = startAngle + (arcSpan * normalizedLowerValue); // this.lowerAngle = startAngle + (arcSpan * normalizedLowerValue);
this.upperAngle = startAngle + (arcSpan * normalizedUpperValue); // this.upperAngle = startAngle + (arcSpan * normalizedUpperValue);
if (relative) { if (relative) {
double normalizedReference = (reference - this.lowerBoundVariable.getMinValue()) / valueRange; double normalizedReference = (reference - this.lowerBoundVariable.getMinValue()) / valueRange;
...@@ -321,8 +278,6 @@ public class ArcRangeGraph extends ValueRangeCorona { ...@@ -321,8 +278,6 @@ public class ArcRangeGraph extends ValueRangeCorona {
outerArea.subtract(innerArea); outerArea.subtract(innerArea);
} }
this.updateLeader();
if (blinkOnOutOfRange && ((shownUpperValue == this.upperBoundVariable.getMaxValue()) || (relative && (shownLowerValue == this.lowerBoundVariable.getMinValue())))) if (blinkOnOutOfRange && ((shownUpperValue == this.upperBoundVariable.getMaxValue()) || (relative && (shownLowerValue == this.lowerBoundVariable.getMinValue()))))
this.startBlinking(); this.startBlinking();
else else
...@@ -350,8 +305,6 @@ public class ArcRangeGraph extends ValueRangeCorona { ...@@ -350,8 +305,6 @@ public class ArcRangeGraph extends ValueRangeCorona {
labelColour.setSwitched(selectIt); labelColour.setSwitched(selectIt);
if (textColour != null) if (textColour != null)
textColour.setSwitched(selectIt); textColour.setSwitched(selectIt);
if (leaderColour != null)
leaderColour.setSwitched(selectIt);
if (faceColour != null) if (faceColour != null)
faceColour.setSwitched(selectIt); faceColour.setSwitched(selectIt);
if (bezelColour != null) if (bezelColour != null)
...@@ -425,25 +378,6 @@ public class ArcRangeGraph extends ValueRangeCorona { ...@@ -425,25 +378,6 @@ public class ArcRangeGraph extends ValueRangeCorona {
if (this.opacity < 1.0f) if (this.opacity < 1.0f)
localCanvas.setComposite(AlphaComposite.SrcOver.derive(1.0f)); localCanvas.setComposite(AlphaComposite.SrcOver.derive(1.0f));
if (leaderColour != null) {
if (this.lowerLeader != null) {
this.lowerLeader.setStrokeColour(leaderColour.getColor());
if (labelColour != null)
this.lowerLeader.setFillColour(labelColour.getColor());
if (textColour != null)
this.lowerLeader.setLabelColour(textColour.getColor());
this.lowerLeader.paint(localCanvas);
}
if (this.upperLeader != null) {
this.upperLeader.setStrokeColour(leaderColour.getColor());
if (labelColour != null)
this.upperLeader.setFillColour(labelColour.getColor());
if (textColour != null)
this.upperLeader.setLabelColour(textColour.getColor());
this.upperLeader.paint(localCanvas);
}
}
localCanvas.dispose(); localCanvas.dispose();
} }
...@@ -459,9 +393,6 @@ public class ArcRangeGraph extends ValueRangeCorona { ...@@ -459,9 +393,6 @@ public class ArcRangeGraph extends ValueRangeCorona {
double lowerBound = this.lowerBoundVariable.getValue(); double lowerBound = this.lowerBoundVariable.getValue();
double upperBound = this.upperBoundVariable.getValue(); double upperBound = this.upperBoundVariable.getValue();
this.lowerValueLabel = this.variableFormat.format(this.lowerBoundVariable);
this.upperValueLabel = this.variableFormat.format(this.upperBoundVariable);
if ((lowerBound == shownLowerValue) && (upperBound == shownUpperValue)) { if ((lowerBound == shownLowerValue) && (upperBound == shownUpperValue)) {
return; return;
} }
......
This diff is collapsed.
...@@ -110,15 +110,15 @@ public class BaseArcGraphBuilder<B extends BaseArcGraphBuilder<B>> extends Value ...@@ -110,15 +110,15 @@ public class BaseArcGraphBuilder<B extends BaseArcGraphBuilder<B>> extends Value
/** Optional fields */ /** Optional fields */
strokeWidth = BootstrappingUtils.getContentAsInteger(rootElement, Externalization.STROKE_WIDTH_NODE, BootstrappingUtils.OPTIONAL, 1, context); strokeWidth = BootstrappingUtils.getContentAsInteger(rootElement, Externalization.STROKE_WIDTH_NODE, BootstrappingUtils.OPTIONAL, 1, context);
leaderLineLength = BootstrappingUtils.getContentAsInteger(rootElement, Externalization.LEADER_LINE_LENGTH_NODE, BootstrappingUtils.OPTIONAL, 0, context); leaderLineLength = BootstrappingUtils.getContentAsInteger(rootElement, CpsNamespace.LEADER_LINE_LENGTH_NODE, BootstrappingUtils.OPTIONAL, 0, context);
landingLineLength = BootstrappingUtils.getContentAsInteger(rootElement, Externalization.LANDING_LINE_LENGTH_NODE, BootstrappingUtils.OPTIONAL, 0, context); landingLineLength = BootstrappingUtils.getContentAsInteger(rootElement, CpsNamespace.LANDING_LINE_LENGTH_NODE, BootstrappingUtils.OPTIONAL, 0, context);
rampingTime = BootstrappingUtils.getContentAsInteger(rootElement, Externalization.RAMPING_TIME_NODE, BootstrappingUtils.OPTIONAL, 500, context); rampingTime = BootstrappingUtils.getContentAsInteger(rootElement, Externalization.RAMPING_TIME_NODE, BootstrappingUtils.OPTIONAL, 500, context);
fillColour = buildColorPair(rootElement.getChild(Externalization.FILL_COLOUR_ELEMENT), BootstrappingUtils.MANDATORY, context); fillColour = buildColorPair(rootElement.getChild(Externalization.FILL_COLOUR_ELEMENT), BootstrappingUtils.MANDATORY, context);
textColour = buildColorPair(rootElement.getChild(Externalization.TEXT_COLOUR_ELEMENT), BootstrappingUtils.OPTIONAL, context); textColour = buildColorPair(rootElement.getChild(Externalization.TEXT_COLOUR_ELEMENT), BootstrappingUtils.OPTIONAL, context);
strokeColour = buildColorPair(rootElement.getChild(Externalization.STROKE_COLOUR_ELEMENT), BootstrappingUtils.MANDATORY, context); strokeColour = buildColorPair(rootElement.getChild(Externalization.STROKE_COLOUR_ELEMENT), BootstrappingUtils.MANDATORY, context);
labelColour = buildColorPair(rootElement.getChild(Externalization.LABEL_COLOUR_ELEMENT), BootstrappingUtils.MANDATORY, context); labelColour = buildColorPair(rootElement.getChild(Externalization.LABEL_COLOUR_ELEMENT), BootstrappingUtils.MANDATORY, context);
leaderColour = buildColorPair(rootElement.getChild(Externalization.LEADER_COLOUR_NODE), BootstrappingUtils.OPTIONAL, context); leaderColour = buildColorPair(rootElement.getChild(CpsNamespace.LEADER_COLOUR_NODE), BootstrappingUtils.OPTIONAL, context);
faceColour = buildColorPair(rootElement.getChild(Externalization.FACE_COLOUR_ELEMENT), BootstrappingUtils.OPTIONAL, context); faceColour = buildColorPair(rootElement.getChild(Externalization.FACE_COLOUR_ELEMENT), BootstrappingUtils.OPTIONAL, context);
bezelColour = buildColorPair(rootElement.getChild(Externalization.BEZEL_COLOUR_ELEMENT), BootstrappingUtils.OPTIONAL, context); bezelColour = buildColorPair(rootElement.getChild(Externalization.BEZEL_COLOUR_ELEMENT), BootstrappingUtils.OPTIONAL, context);
......
...@@ -45,12 +45,9 @@ public abstract class BaseArcRangeGraphBuilder<B extends BaseArcRangeGraphBuilde ...@@ -45,12 +45,9 @@ public abstract class BaseArcRangeGraphBuilder<B extends BaseArcRangeGraphBuilde
public ColorPair strokeColour; public ColorPair strokeColour;
public ColorPair labelColour; public ColorPair labelColour;
public ColorPair textColour; public ColorPair textColour;
public ColorPair leaderColour;
public ColorPair faceColour; public ColorPair faceColour;
public ColorPair bezelColour; public ColorPair bezelColour;
public int strokeWidth; public int strokeWidth;
public int landingLineLength;
public int leaderLineLength;
public Shape labelShape; public Shape labelShape;
public Font textFont; public Font textFont;
public String labelFormat; public String labelFormat;
...@@ -69,20 +66,26 @@ public abstract class BaseArcRangeGraphBuilder<B extends BaseArcRangeGraphBuilde ...