import org.simantics.trend.configuration.TrendItem.DrawMode;
import org.simantics.trend.configuration.TrendItem.Renderer;
import org.simantics.trend.util.KvikDeviationBuilder;
+import org.slf4j.LoggerFactory;
/**
* Data node for a TrendItem
public class ItemNode extends G2DNode implements TrendLayout {
private static final long serialVersionUID = -4741446944761752871L;
-
+ private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(ItemNode.class);
+
public static final AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .61f);
public TrendItem item;
line.lineTo(maxX, ny);
line.moveTo(x, y);
} else {
- line.lineTo(x, y);
+ if (x != currentX || y != currentY) {
+ line.lineTo(x, y);
+ }
}
}
s.accessor.get(i, s.sampleBinding, vb.getSample());
if(!validSample(vb)) {
- System.err.println("-invalid value band: " + i + "/" + count + ":" + vb);
+ LOGGER.warn("-invalid value band: " + i + "/" + count + ":" + vb);
continue;
}
// Non-continuation point
}
}
- lineTo(x2, y2);
+ // gitlab #35: t2 > t1 ensure that the value band is
+ // rendered as a horizontal line until the the time when
+ // the band's value went out of dead-band.
+ if (flat || t2 > t1)
+ lineTo(x2, y2);
// if(showBand) {
// lineTo(x2, y2);
}
// Binary signal
- if (item.renderer == Renderer.Binary) {
+ else if (item.renderer == Renderer.Binary) {
byte value = 0;
if (vb.getValueBinding() instanceof BooleanBinding) {
value = ((Boolean) vb.getValue(Bindings.BOOLEAN)) ? (byte)0 : (byte)1;