use of org.pentaho.di.core.gui.PrimitiveGCInterface.EColor 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);
}
use of org.pentaho.di.core.gui.PrimitiveGCInterface.EColor in project pentaho-kettle by pentaho.
the class StarModelPainter method drawCircleName.
private void drawCircleName(Point center, LogicalTable logicalTable) {
String name = ConceptUtil.getName(logicalTable, locale);
if (!Utils.isEmpty(name)) {
Point nameSize = gc.textExtent(name);
int margin = 20;
nameSize.x += margin;
nameSize.y += margin;
EColor bg = EColor.BACKGROUND;
TableType tableType = (TableType) logicalTable.getProperty(DefaultPropertyID.TABLE_TYPE.getId());
if (tableType != null && TableType.FACT == tableType) {
bg = EColor.LIGHTGRAY;
}
gc.setBackground(bg);
gc.fillRoundRectangle(center.x - nameSize.x / 2, center.y - nameSize.y / 2, nameSize.x, nameSize.y, 20, 20);
gc.drawRoundRectangle(center.x - nameSize.x / 2, center.y - nameSize.y / 2, nameSize.x, nameSize.y, 20, 20);
gc.drawText(name, center.x - nameSize.x / 2 + margin / 2, center.y - nameSize.y / 2 + margin / 2, true);
gc.setBackground(EColor.BACKGROUND);
}
}
use of org.pentaho.di.core.gui.PrimitiveGCInterface.EColor in project pentaho-kettle by pentaho.
the class JobPainter method drawLine.
/**
* Calculates line coordinates from center to center.
*/
protected void drawLine(JobHopMeta jobHop, boolean is_candidate) {
int[] line = getLine(jobHop.getFromEntry(), jobHop.getToEntry());
gc.setLineWidth(linewidth);
EColor col;
if (jobHop.getFromEntry().isLaunchingInParallel()) {
gc.setLineStyle(ELineStyle.PARALLEL);
} else {
gc.setLineStyle(ELineStyle.SOLID);
}
EImage arrow;
if (is_candidate) {
col = EColor.BLUE;
arrow = EImage.ARROW_CANDIDATE;
} else if (jobHop.isEnabled()) {
if (jobHop.isUnconditional()) {
col = EColor.HOP_DEFAULT;
arrow = EImage.ARROW_DEFAULT;
} else {
if (jobHop.getEvaluation()) {
col = EColor.HOP_OK;
arrow = EImage.ARROW_OK;
} else {
col = EColor.RED;
arrow = EImage.ARROW_ERROR;
gc.setLineStyle(ELineStyle.DASH);
}
}
} else {
col = EColor.GRAY;
arrow = EImage.ARROW_DISABLED;
}
gc.setForeground(col);
if (jobHop.isSplit()) {
gc.setLineWidth(linewidth + 2);
}
drawArrow(arrow, line, jobHop);
if (jobHop.isSplit()) {
gc.setLineWidth(linewidth);
}
gc.setForeground(EColor.BLACK);
gc.setBackground(EColor.BACKGROUND);
gc.setLineStyle(ELineStyle.SOLID);
}
Aggregations