use of org.pentaho.di.core.gui.PrimitiveGCInterface.ELineStyle in project pentaho-kettle by pentaho.
the class TransPainter method drawLine.
private void drawLine(StepMeta fs, StepMeta ts, TransHopMeta hi, boolean is_candidate) {
int[] line = getLine(fs, ts);
EColor col;
ELineStyle linestyle = ELineStyle.SOLID;
int activeLinewidth = linewidth;
EImage arrow;
if (is_candidate) {
col = EColor.BLUE;
arrow = EImage.ARROW_CANDIDATE;
} else {
if (hi.isEnabled()) {
if (fs.isSendingErrorRowsToStep(ts)) {
col = EColor.RED;
linestyle = ELineStyle.DASH;
activeLinewidth = linewidth + 1;
arrow = EImage.ARROW_ERROR;
} else {
col = EColor.HOP_DEFAULT;
arrow = EImage.ARROW_DEFAULT;
}
} else {
col = EColor.GRAY;
arrow = EImage.ARROW_DISABLED;
}
}
if (hi.split) {
activeLinewidth = linewidth + 2;
}
// Check to see if the source step is an info step for the target step.
//
StepIOMetaInterface ioMeta = ts.getStepMetaInterface().getStepIOMeta();
List<StreamInterface> infoStreams = ioMeta.getInfoStreams();
if (!infoStreams.isEmpty()) {
//
for (StreamInterface stream : infoStreams) {
if (fs.getName().equalsIgnoreCase(stream.getStepname())) {
//
if (fs.getCopies() > 1) {
// This is not a desirable situation, it will always end in error.
// As such, it's better not to give feedback on it.
// We do this by drawing an error icon over the hop...
//
col = EColor.RED;
arrow = EImage.ARROW_ERROR;
}
}
}
}
gc.setForeground(col);
gc.setLineStyle(linestyle);
gc.setLineWidth(activeLinewidth);
drawArrow(arrow, line, hi, fs, ts);
if (hi.split) {
gc.setLineWidth(linewidth);
}
gc.setForeground(EColor.BLACK);
gc.setBackground(EColor.BACKGROUND);
gc.setLineStyle(ELineStyle.SOLID);
}
Aggregations