org.eclipse.draw2d.ColorConstants Java Examples

The following examples show how to use org.eclipse.draw2d.ColorConstants. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CustomSequenceFlowEditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @generated
 */
private RotatableDecoration createTargetDecoration() {
    final PolygonDecoration df = new PolygonDecoration();
    df.setFill(true);
    df.setBackgroundColor(ColorConstants.black);
    final PointList pl = new PointList();
    pl.addPoint(getMapMode().DPtoLP(0)
            , getMapMode().DPtoLP(0)
            );
    pl.addPoint(getMapMode().DPtoLP(-1)
            , getMapMode().DPtoLP(1)
            );
    pl.addPoint(getMapMode().DPtoLP(-1)
            , getMapMode().DPtoLP(-1)
            );
    pl.addPoint(getMapMode().DPtoLP(0)
            , getMapMode().DPtoLP(0)
            );
    df.setTemplate(pl);
    df.setScale(getMapMode().DPtoLP(7)
            , getMapMode().DPtoLP(3)
            );
    return df;
}
 
Example #2
Source File: GroupColumnEditPart.java    From ermasterr with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void setSelected(final int value) {
    final GroupColumnFigure figure = (GroupColumnFigure) getFigure();

    if (value != 0 && getParent() != null && getParent().getParent() != null) {
        final List selectedEditParts = getViewer().getSelectedEditParts();

        if (selectedEditParts != null && selectedEditParts.size() == 1) {
            figure.setBackgroundColor(ColorConstants.titleBackground);
            figure.setForegroundColor(ColorConstants.titleForeground);
            selected = true;

            super.setSelected(value);
        }

    } else {
        figure.setBackgroundColor(null);
        figure.setForegroundColor(null);
        selected = false;

        super.setSelected(value);
    }

}
 
Example #3
Source File: IntermediateErrorCatchEvent2EditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
public EditPolicy getPrimaryDragEditPolicy() {
	return new BorderItemSelectionEditPolicy() {
		@Override
		protected void showPrimarySelection() {
			super.showPrimarySelection();
			hideSelection();
			IFigure layer = getLayer(LayerConstants.HANDLE_LAYER);
			layer.setBackgroundColor(ColorConstants.black);
			layer.setVisible(true);
			for (Object f : layer.getChildren()) {
				((IFigure) f).setBackgroundColor(ColorConstants.black);
				((IFigure) f).setVisible(true);
			}
		}

		@Override
		protected IFigure createDragSourceFeedbackFigure() {
			IFigure r = FiguresHelper.getSelectedFigure(resolveSemanticElement().eClass(), -1, -1, null, null);
			addFeedback(r);
			return r;
		}
	};
}
 
Example #4
Source File: NormalColumnEditPart.java    From ermaster-b with Apache License 2.0 6 votes vote down vote up
private void setGroupColumnFigureColor(TableViewEditPart parentEditPart,
		ColumnGroup columnGroup, boolean selected) {
	for (NormalColumn column : columnGroup.getColumns()) {
		for (Object editPart : parentEditPart.getChildren()) {
			NormalColumnEditPart childEditPart = (NormalColumnEditPart) editPart;
			if (childEditPart.getModel() == column) {
				NormalColumnFigure columnFigure = (NormalColumnFigure) childEditPart
						.getFigure();
				if (selected) {
					columnFigure
							.setBackgroundColor(ColorConstants.titleBackground);
					columnFigure
							.setForegroundColor(ColorConstants.titleForeground);

				} else {
					columnFigure.setBackgroundColor(null);
					columnFigure.setForegroundColor(null);
				}

				childEditPart.selected = selected;
				break;
			}
		}
	}
}
 
Example #5
Source File: NormalColumnEditPart.java    From ermasterr with Apache License 2.0 6 votes vote down vote up
private void setGroupColumnFigureColor(final TableViewEditPart parentEditPart, final ColumnGroup columnGroup, final boolean selected) {
    for (final NormalColumn column : columnGroup.getColumns()) {
        for (final Object editPart : parentEditPart.getChildren()) {
            final NormalColumnEditPart childEditPart = (NormalColumnEditPart) editPart;
            if (childEditPart.getModel() == column) {
                final NormalColumnFigure columnFigure = (NormalColumnFigure) childEditPart.getFigure();
                if (selected) {
                    columnFigure.setBackgroundColor(ColorConstants.titleBackground);
                    columnFigure.setForegroundColor(ColorConstants.titleForeground);

                } else {
                    columnFigure.setBackgroundColor(null);
                    columnFigure.setForegroundColor(null);
                }

                childEditPart.selected = selected;
                break;
            }
        }
    }
}
 
Example #6
Source File: ScaledSliderFigure.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
@Override
protected void paintClientArea(Graphics graphics) {
	super.paintClientArea(graphics);
	if(hasFocus() && drawFocus){
		graphics.setForegroundColor(ColorConstants.black);
		graphics.setBackgroundColor(ColorConstants.white);

		Rectangle area = getClientArea();					
		graphics.drawFocus(area.x, area.y, area.width-1, area.height-1);
	}
	if(!isEnabled()) {
		graphics.setAlpha(DISABLED_ALPHA);
		graphics.setBackgroundColor(GRAY_COLOR);
		graphics.fillRectangle(bounds);
	}
}
 
Example #7
Source File: FunnyStyleSupport.java    From erflute with Apache License 2.0 6 votes vote down vote up
@Override
public void addIndex(IndexFigure indexFigure, String name, boolean isFirst) {
    final ImageFigure image = new ImageFigure();
    image.setBorder(new MarginBorder(new Insets(0, 0, 0, 19)));
    image.setImage(Activator.getImage(ImageKey.BLANK_WHITE));
    image.setOpaque(true);
    indexFigure.add(image);

    final StringBuilder text = new StringBuilder();
    text.append(name);
    final Label label = createColumnLabel();
    label.setBorder(new MarginBorder(new Insets(1, 0, 0, 4)));
    label.setForegroundColor(ColorConstants.black);
    label.setText(text.toString());

    indexFigure.add(label);
}
 
Example #8
Source File: EventFigure.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
public EventFigure(ITimelineEvent event) {

		final ToolbarLayout layout = new ToolbarLayout(false);
		layout.setMinorAlignment(OrderedLayout.ALIGN_CENTER);
		layout.setStretchMinorAxis(true);
		setLayoutManager(layout);
		setLayoutManager(new CenterLayout());

		setLineWidth(2);

		fLabel = new Label(event.getTitle());
		fLabel.setForegroundColor(ColorConstants.black);
		add(fLabel);

		if (event.getMessage() != null)
			setToolTip(new EventTooltip(event.getMessage()));
	}
 
Example #9
Source File: TimeAxisFigure.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
private void paintMarkers(Graphics graphics) {

		final Rectangle bounds = getBounds();
		graphics.setForegroundColor(ColorConstants.darkGray);
		graphics.setLineStyle(SWT.LINE_SOLID);

		final Insets insets = RootFigure.getFigure(this, TracksFigure.class).getInsets();
		final ITimelineStyleProvider styleProvider = RootFigure.getRootFigure(this).getStyleProvider();

		final Map<Double, Integer> markerPositions = getDetailFigure().getMarkerPositions();
		for (final Entry<Double, Integer> entry : markerPositions.entrySet()) {
			final String label = styleProvider.getTimeLabel(entry.getKey(), TimeUnit.NANOSECONDS);
			final int textWidth = FigureUtilities.getTextWidth(label, graphics.getFont());

			graphics.drawLine(entry.getValue() + bounds.x() + insets.left, bounds.y, entry.getValue() + bounds.x() + insets.left, bounds.y + 5);
			graphics.drawText(label, (entry.getValue() + bounds.x() + insets.left) - (textWidth / 2), bounds.y + 5);
		}
	}
 
Example #10
Source File: FunnyStyleSupport.java    From ermasterr with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void createColumnArea(final IFigure columns) {
    initColumnArea(columns);

    columns.setBorder(new MarginBorder(0, 0, 0, 0));
    columns.setBackgroundColor(ColorConstants.white);
    columns.setOpaque(true);

    final Figure centerFigure = new Figure();
    centerFigure.setLayoutManager(new BorderLayout());
    centerFigure.setBorder(new MarginBorder(new Insets(0, 2, 0, 2)));

    centerFigure.add(columns, BorderLayout.CENTER);
    getTableFigure().add(centerFigure, BorderLayout.CENTER);
}
 
Example #11
Source File: TimelineComposite.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
public TimelineComposite(Composite parent, int style) {
	super(parent, style);

	fResourceManager = new LocalResourceManager(JFaceResources.getResources(), this);

	final FillLayout layout = new FillLayout();
	layout.marginHeight = 10;
	layout.marginWidth = 10;
	setLayout(layout);

	setBackground(ColorConstants.black);

	final Canvas canvas = new Canvas(this, SWT.DOUBLE_BUFFERED);
	canvas.setBackground(ColorConstants.black);
	final LightweightSystem lightWeightSystem = new LightweightSystem(canvas);

	fRootFigure = new RootFigure(fResourceManager);
	fRootFigure.setFont(parent.getFont());
	lightWeightSystem.setContents(fRootFigure);

	// draw2d does not directly support mouseWheelEvents, so register on canvas
	canvas.addMouseWheelListener(new TimelineScaler(this));
}
 
Example #12
Source File: ProcessFigure.java    From olca-app with Mozilla Public License 2.0 6 votes vote down vote up
private void paintTable(Graphics graphics) {
	graphics.setForegroundColor(LINE_COLOR);
	int margin = 5;
	int width = getSize().width;
	int height = getSize().height;
	int x = getLocation().x;
	int y = getLocation().y;
	graphics.drawLine(new Point(x + margin, y + MINIMUM_HEIGHT
			+ TEXT_HEIGHT + MARGIN_HEIGHT), new Point(x + width - margin,
					y
							+ MINIMUM_HEIGHT + TEXT_HEIGHT + MARGIN_HEIGHT));
	if (height - margin > MINIMUM_HEIGHT + margin)
		graphics.drawLine(new Point(x + width / 2, y + MINIMUM_HEIGHT + margin), new Point(x + width / 2, y
				+ height - margin));
	graphics.setForegroundColor(TEXT_COLOR);
	graphics.drawText(M.Inputs, new Point(x + width / 6, y + MINIMUM_HEIGHT + MARGIN_HEIGHT));
	graphics.drawText(M.Outputs, new Point(x + 2 * width / 3, y + MINIMUM_HEIGHT + MARGIN_HEIGHT));
	graphics.setForegroundColor(ColorConstants.black);
}
 
Example #13
Source File: BoundarySignalEventEditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
public EditPolicy getPrimaryDragEditPolicy() {
	return new BorderItemSelectionEditPolicy() {
		@Override
		protected void showPrimarySelection() {
			super.showPrimarySelection();
			hideSelection();
			IFigure layer = getLayer(LayerConstants.HANDLE_LAYER);
			layer.setBackgroundColor(ColorConstants.black);
			layer.setVisible(true);
			for (Object f : layer.getChildren()) {
				((IFigure) f).setBackgroundColor(ColorConstants.black);
				((IFigure) f).setVisible(true);
			}
		}

		@Override
		protected IFigure createDragSourceFeedbackFigure() {
			IFigure r = FiguresHelper.getSelectedFigure(resolveSemanticElement().eClass(), -1, -1, null, null);
			addFeedback(r);
			return r;
		}
	};
}
 
Example #14
Source File: FunnyStyleSupport.java    From ermaster-b with Apache License 2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void createColumnArea(IFigure columns) {
	this.initColumnArea(columns);

	columns.setBorder(new MarginBorder(new Insets(1, 0, 1, 0)));
	columns.setBackgroundColor(ColorConstants.white);
	columns.setOpaque(true);

	Figure centerFigure = new Figure();
	centerFigure.setLayoutManager(new BorderLayout());
	centerFigure.setBorder(new MarginBorder(new Insets(0, 2, 0, 2)));

	centerFigure.add(columns, BorderLayout.CENTER);
	this.getTableFigure().add(centerFigure, BorderLayout.CENTER);
}
 
Example #15
Source File: CustomTextAnnotation2EditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
public void paintGradient(Graphics graphics) {                     
 Rectangle rect = getClientArea();
 if (rect == null)
	 return;

 graphics.pushState();
 Color from = ColorConstants.white;
 Color to = getBackgroundColor();

 graphics.setForegroundColor(from);
 graphics.setBackgroundColor(to);

 graphics.fillGradient(rect, false);

 graphics.popState();
 //now drawing the outline shape
 super.outlineShape(graphics);
}
 
Example #16
Source File: GroupColumnEditPart.java    From erflute with Apache License 2.0 6 votes vote down vote up
@Override
public void refreshTableColumns() {
    final ERDiagram diagram = getDiagram();
    final GroupColumnFigure columnFigure = (GroupColumnFigure) getFigure();
    final TableViewEditPart parent = (TableViewEditPart) getParent();
    parent.getContentPane().add(figure);
    final int notationLevel = diagram.getDiagramContents().getSettings().getNotationLevel();
    final ERColumn column = (ERColumn) getModel();
    if (notationLevel != DiagramSettings.NOTATION_LEVLE_TITLE) {
        final TableFigure tableFigure = (TableFigure) parent.getFigure();
        final boolean isAdded = false;
        final boolean isUpdated = false;
        if ((notationLevel == DiagramSettings.NOTATION_LEVLE_KEY)) {
            columnFigure.clearLabel();
            return;
        }
        addGroupColumnFigure(diagram, tableFigure, columnFigure, column, isAdded, isUpdated, false);
        if (selected) {
            columnFigure.setBackgroundColor(ColorConstants.titleBackground);
            columnFigure.setForegroundColor(ColorConstants.titleForeground);
        }
    } else {
        columnFigure.clearLabel();
        return;
    }
}
 
Example #17
Source File: NonInterruptingBoundaryTimerEvent2EditPart.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
public EditPolicy getPrimaryDragEditPolicy() {
	return new BorderItemSelectionEditPolicy() {
		@Override
		protected void showPrimarySelection() {
			super.showPrimarySelection();
			hideSelection();
			IFigure layer = getLayer(LayerConstants.HANDLE_LAYER);
			layer.setBackgroundColor(ColorConstants.black);
			layer.setVisible(true);
			for (Object f : layer.getChildren()) {
				((IFigure) f).setBackgroundColor(ColorConstants.black);
				((IFigure) f).setVisible(true);
			}
		}

		@Override
		protected IFigure createDragSourceFeedbackFigure() {
			IFigure r = FiguresHelper.getSelectedFigure(resolveSemanticElement().eClass(), -1, -1, null, null);
			addFeedback(r);
			return r;
		}
	};
}
 
Example #18
Source File: NoteFigure.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
private void decideColor(final int[] color) {
    if (color != null) {
        final int sum = color[0] + color[1] + color[2];

        if (sum > 255) {
            foregroundColor = ColorConstants.black;
        } else {
            foregroundColor = ColorConstants.white;
        }
    }
}
 
Example #19
Source File: DiagramPartitioningEditor.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
protected Composite createParentSash(Composite parent) {
	GridDataFactory.fillDefaults().grab(true, true).applyTo(parent);
	SashForm sash = new SashForm(parent, SWT.HORIZONTAL);
	sash.setBackground(ColorConstants.white);
	sash.setSashWidth(SASH_WIDTH);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(sash);
	GridLayoutFactory.fillDefaults().applyTo(sash);
	return sash;
}
 
Example #20
Source File: FunnyStyleSupport.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
@Override
	public void addColumnGroup(GroupColumnFigure columnFigure, int viewMode,
			String name, boolean isAdded, boolean isUpdated, boolean isRemoved) {

		columnFigure.setBorder(new MarginBorder(new Insets(1, 0, 1, 0)));

		ImageFigure image = new ImageFigure();
		image.setBorder(new MarginBorder(new Insets(0, 4, 0, 7)));
		image.setImage(Activator.getImage(ImageKey.GROUP));
		columnFigure.add(image);

//		Label filler = new Label();
//		filler.setBorder(new MarginBorder(new Insets(0, 0, 0, 16)));
//		filler.setBorder(new MarginBorder(new Insets(0, 0, 0, 6)));
//		columnFigure.add(filler);

//		filler = new Label();
//		filler.setBorder(new MarginBorder(new Insets(0, 0, 0, 16)));
//		columnFigure.add(filler);

		StringBuilder text = new StringBuilder();
		text.append(name);
		text.append(" (GROUP)");

		this.setColumnFigureColor(columnFigure, false, false, isAdded,
				isUpdated, isRemoved);

		Label label = this.createColumnLabel();

		label.setForegroundColor(ColorConstants.black);
		label.setLabelAlignment(PositionConstants.RIGHT);
		label.setBorder(new MarginBorder(new Insets(1, 3, 0, 4)));

		label.setText(text.toString());

		columnFigure.add(label);
	}
 
Example #21
Source File: TableViewGraphicalNodeEditPolicy.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
@Override
public void showTargetFeedback(final Request request) {
    final ERDiagram diagram = (ERDiagram) getHost().getRoot().getContents().getModel();

    if (diagram.isTooltip()) {
        final ZoomManager zoomManager = ((ScalableFreeformRootEditPart) getHost().getRoot()).getZoomManager();
        final double zoom = zoomManager.getZoom();

        final TableView tableView = (TableView) getHost().getModel();
        final Rectangle tableBounds = getHostFigure().getBounds();

        final String name = TableViewEditPart.getTableViewName(tableView, diagram);

        final Label label = new Label();
        label.setText(name);
        label.setBorder(new SimpleRaisedBorder());
        label.setBackgroundColor(ColorConstants.orange);
        label.setOpaque(true);

        final Dimension dim = FigureUtilities.getTextExtents(name, Display.getCurrent().getSystemFont());

        label.setBounds(new Rectangle((int) (zoom * (tableBounds.x + 33)), (int) (zoom * (tableBounds.y + 5)), (int) (dim.width * 1.5), 20));

        addFeedback(label);
    }
    super.showTargetFeedback(request);
}
 
Example #22
Source File: ModelPropertiesFigure.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
private void decideColor(int[] color) {
	if (color != null) {
		int sum = color[0] + color[1] + color[2];

		if (sum > 255) {
			this.foregroundColor = ColorConstants.black;
		} else {
			this.foregroundColor = ColorConstants.white;
		}
	}
}
 
Example #23
Source File: CustomPaletteEditPartFactory.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected EditPart createToolbarEditPart(EditPart parentEditPart,
		Object model) {
	PaletteEditPart ep = (PaletteEditPart) super.createToolbarEditPart(parentEditPart, model);
	ep.getFigure().setBackgroundColor(FigureUtilities.lighter(ColorConstants.lightGray));
	ep.getFigure().setOpaque(true);
	return ep;
}
 
Example #24
Source File: EntryEditPart.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected NodeFigure createMainFigure() {
	final NodeFigure figure = new EllipseAnchorDefaultSizeNodeFigure(MapModeUtils.DEFAULT_SMALL_NODE_DIMENSION);
	figure.setLayoutManager(new StackLayout());
	figure.add(createPrimaryShape());
	figure.setBackgroundColor(ColorConstants.black);
	figure.setForegroundColor(ColorConstants.white);
	return figure;
}
 
Example #25
Source File: JConnection.java    From JDeodorant with MIT License 5 votes vote down vote up
public PolylineConnection setReadStyle(){
	PolygonDecoration decoration = new PolygonDecoration();
	decoration.setTemplate(PolygonDecoration.TRIANGLE_TIP);
	decoration.setBackgroundColor(ColorConstants.black);
	this.setTargetDecoration(decoration);

	this.setForegroundColor(ColorConstants.darkBlue);

	return this;
}
 
Example #26
Source File: StatechartDefinitionSection.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
protected void createNameLabel(Composite labelComposite) {
	nameLabel = new Text(labelComposite, SWT.SINGLE | SWT.NORMAL);
	GridDataFactory.fillDefaults().indent(5, 1).grab(true, false).align(SWT.FILL, SWT.CENTER).applyTo(nameLabel);
	Optional<String> name = getStatechartName();
	if (name.isPresent()) {
		nameLabel.setText(name.get());
	}
	nameLabel.setEditable(isStatechart());
	nameLabel.setBackground(ColorConstants.white);
	nameModificationListener = new ModifyListener() {
		@Override
		public void modifyText(ModifyEvent e) {
			Optional<Statechart> sct = getStatechart();
			if (sct.isPresent()) {
				if (Objects.equals(sct.get().getName(), nameLabel.getText())) {
					return;
				}
				getSash().setRedraw(false);
				TransactionalEditingDomain domain = getTransactionalEditingDomain();
				SetCommand command = new SetCommand(domain, sct.get(),
						BasePackage.Literals.NAMED_ELEMENT__NAME, nameLabel.getText());
				domain.getCommandStack().execute(command);
				refresh(nameLabel.getParent());
				getSash().setRedraw(true);
			}
		}
	};
	nameLabel.addModifyListener(nameModificationListener);
}
 
Example #27
Source File: EntryEditPart.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public Object getPreferredValue(EStructuralFeature feature) {
	if (feature == NotationPackage.eINSTANCE.getLineStyle_LineColor()) {
		return FigureUtilities.RGBToInteger(ColorConstants.white.getRGB());
	} else if (feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
		return FigureUtilities.RGBToInteger(ColorConstants.black.getRGB());
	}
	return super.getPreferredValue(feature);
}
 
Example #28
Source File: DynamicAddRemoveLineComposite.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param parent
 * @param style
 */
public DynamicAddRemoveLineComposite(Composite parent, int style) {
	super(parent, style);
	if(getWidgetFactory() != null) {
		this.setBackground(ColorConstants.white);
	}
	this.setLayout(new GridLayout(2, false));

	imageplus = Pics.getImage(PicsConstants.plusBlack);
	imagemoins = Pics.getImage(PicsConstants.remove);

	minusGD = GridDataFactory.swtDefaults().align(SWT.CENTER, SWT.CENTER).create();
	// circle button
	regionForAdd = new Region();
	regionForAdd.add(createCircle(13, 13, 10));

	addButton = createAddButton(this);
	addButton.setLayoutData(GridDataFactory.swtDefaults().span(2, 1).create()) ;
	addButton.addSelectionListener(new SelectionAdapter() {
		/*
		 * (non-Javadoc)
		 * 
		 * @see
		 * org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse
		 * .swt.events.SelectionEvent)
		 */
		@Override
		public void widgetSelected(SelectionEvent e) {
			addLine(null);
		}
	});
}
 
Example #29
Source File: AbstractDialog.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
protected void createErrorComposite(final Composite parent) {
    errorMessageText = new CLabel(parent, SWT.NONE);
    errorMessageText.setLeftMargin(0);
    errorMessageText.setText("");

    final GridData gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.heightHint = 30 * getErrorLine();
    gridData.horizontalSpan = numColumns;

    errorMessageText.setLayoutData(gridData);
    errorMessageText.setForeground(ColorConstants.red);
}
 
Example #30
Source File: TableFigure.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
private void decideColor(final int[] color) {
    if (color != null) {
        final int sum = color[0] + color[1] + color[2];

        if (sum > 255) {
            foregroundColor = ColorConstants.black;
        } else {
            foregroundColor = ColorConstants.white;
        }
    }
}