Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2012, 2015 THALES GLOBAL SERVICES and others.
* Copyright (c) 2012, 2026 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -70,7 +70,7 @@ public class BracketBendpointEditPolicy extends BendpointEditPolicy {
public static final String ROTATE_COMMAND_LABEL = Messages.BracketBendpointEditPolicy_rotateBracketCommandLabel;

/** The background feedback color as in GMF. */
private static final Color GRAY = new Color(null, 200, 200, 200);
private static final Color GRAY = new Color(200, 200, 200);

/** The feeback figure. */
private IFigure feedbackFigure;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2022 THALES GLOBAL SERVICES and others.
* Copyright (c) 2007, 2026 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -168,7 +168,7 @@ public void clearCache() {
public static final String DROP_ELEMENTS_CMD_NAME = Messages.SiriusContainerDropPolicy_dropElementsCommandLabel;

/** The background feedback color as in GMF. */
private static final Color GRAY = new Color(null, 200, 200, 200);
private static final Color GRAY = new Color(200, 200, 200);

/**
* the original target figure
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2023 THALES GLOBAL SERVICES and others.
* Copyright (c) 2007, 2026 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -280,7 +280,7 @@ public synchronized void configureBackground(IFigure fig) {
if (WHITE.equals(rgb)) {
backgroundColor = null;
} else {
backgroundColor = new Color(viewer.getControl().getDisplay(), rgb.getRed(), rgb.getGreen(), rgb.getBlue());
backgroundColor = new Color(rgb.getRed(), rgb.getGreen(), rgb.getBlue());
}
fig.setBackgroundColor(backgroundColor);
fig.setOpaque(backgroundColor != null);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// CHECKSTYLE:OFF copied from org.eclipse.nebula.widgets.gallery.DefaultGalleryItemRenderer
/*******************************************************************************
* Copyright (c) 2006-2007 Nicolas Richeton.
* Copyright (c) 2006-2026 Nicolas Richeton and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -287,7 +287,7 @@ private void createColors() {
// Create new colors
for (int i = dropShadowsSize - 1; i >= 0; i--) {
int value = 255 - i * step;
Color c = new Color(Display.getDefault(), value, value, value);
Color c = new Color(value, value, value);
dropShadowsColors.add(c);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// CHECKSTYLE:OFF copied from org.eclipse.nebula.widgets.gallery.ListItemRenderer
/*******************************************************************************
* Copyright (c) 2006-2007 Nicolas Richeton.
* Copyright (c) 2006-2026 Nicolas Richeton and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -273,7 +273,7 @@ private void createColors() {
// Create new colors
for (int i = dropShadowsSize - 1; i >= 0; i--) {
int value = 255 - i * step;
Color c = new Color(Display.getDefault(), value, value, value);
Color c = new Color(value, value, value);
dropShadowsColors.add(c);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2010, 2020 THALES GLOBAL SERVICES and others.
* Copyright (c) 2010, 2026 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -185,7 +185,7 @@ private Color geBorderColor() {
if (viewNode.getStyle() instanceof BorderedStyle) {
RGBValues borderColor = ((BorderedStyle) viewNode.getStyle()).getBorderColor();
if (borderColor != null) {
return new Color(null, borderColor.getRed(), borderColor.getGreen(), borderColor.getBlue());
return new Color(borderColor.getRed(), borderColor.getGreen(), borderColor.getBlue());
}
}
} catch (IllegalStateException e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2009, 2017 THALES GLOBAL SERVICES.
* Copyright (c) 2009, 2026 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand All @@ -17,7 +17,6 @@
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.sirius.ui.business.api.template.RepresentationTemplateEditManager;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;

/**
* Label provider highlighting generated model elements with a specific color.
Expand All @@ -27,7 +26,7 @@
*/
public class GeneratedElementsLabelProvider extends DecoratingStyledCellLabelProvider {

private final Color generated = new Color(Display.getDefault(), 136, 138, 133);
private final Color generated = new Color(136, 138, 133);

/**
* Create the provider.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2003, 2021 IBM Corporation and others.
* Copyright (c) 2003, 2026 IBM Corporation and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -63,14 +63,14 @@ public class SiriusSnapFeedbackPolicy extends GraphicalEditPolicy {
* This is the original color used by GEF in
* {@link org.eclipse.gef.editpolicies.SnapFeedbackPolicy}.
*/
public static final Color VERTICAL_HORIZONTAL_ORIGINAL_GUIDE_COLOR = new Color(null, 255, 175, 175);
public static final Color VERTICAL_HORIZONTAL_ORIGINAL_GUIDE_COLOR = new Color(255, 175, 175);

/**
* Color for guides corresponding to Vertical guide or Horizontal guide.
* Replace the red color of
* {@link org.eclipse.gef.editpolicies.SnapFeedbackPolicy}.
*/
public static final Color VERTICAL_HORIZONTAL_GUIDE_COLOR = new Color(null, 255, 175, 175);
public static final Color VERTICAL_HORIZONTAL_GUIDE_COLOR = new Color(255, 175, 175);

/**
* Color for guides of North, South, East or West side for snap to geometry.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2003, 2021 IBM Corporation and others.
* Copyright (c) 2003, 2026 IBM Corporation and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -60,14 +60,14 @@ public class SiriusSnapFeedbackPolicy extends GraphicalEditPolicy {
* This is the original color used by GEF in
* {@link org.eclipse.gef.editpolicies.SnapFeedbackPolicy}.
*/
public static final Color VERTICAL_HORIZONTAL_ORIGINAL_GUIDE_COLOR = new Color(null, 255, 175, 175);
public static final Color VERTICAL_HORIZONTAL_ORIGINAL_GUIDE_COLOR = new Color(255, 175, 175);

/**
* Color for guides corresponding to Vertical guide or Horizontal guide.
* Replace the red color of
* {@link org.eclipse.gef.editpolicies.SnapFeedbackPolicy}.
*/
public static final Color VERTICAL_HORIZONTAL_GUIDE_COLOR = new Color(null, 255, 175, 175);
public static final Color VERTICAL_HORIZONTAL_GUIDE_COLOR = new Color(255, 175, 175);

/**
* Color for guides of North, South, East or West side for snap to geometry.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2009, 2025 THALES GLOBAL SERVICES and others.
* Copyright (c) 2009, 2026 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -142,7 +142,7 @@ public enum ResourceURIType {
private static final String DOT = ".";

/** Default grid spacing. */
public static final int DEFAULT_GRID_SPACING = 20;
private static final int DEFAULT_GRID_SPACING = 20;

/** The local session. */
protected Session session;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018, 2023 Obeo.
* Copyright (c) 2018, 2026 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -56,16 +56,16 @@ public class EntitiesDiagramBackgroundTests extends SiriusDiagramTestCase implem
private DDiagramEditPart dDiagramEditPart;

/** White color */
private final Color WHITE_COLOR = new Color(null, 255, 255, 255);
private final Color WHITE_COLOR = new Color(255, 255, 255);

/** Green color */
private final Color GREEN_COLOR = new Color(null, 0, 255, 0);
private final Color GREEN_COLOR = new Color(0, 255, 0);

/** Red color */
private final Color RED_COLOR = new Color(null, 255, 0, 0);
private final Color RED_COLOR = new Color(255, 0, 0);

/** Intense blue color */
private final Color INTENSE_BLUE_COLOR = new Color(null, 0, 255, 255);
private final Color INTENSE_BLUE_COLOR = new Color(0, 255, 255);

@Override
protected void setUp() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2010, 2024 THALES GLOBAL SERVICES.
* Copyright (c) 2010, 2026 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -212,8 +212,8 @@ public void testBorderedNodeCopyPasteLayout() {
// layout.
checkFirstContainerABorderedNodes(diagramEditor1, expectedAList, expectedAList_GMF);
// Check the color before copy layout
Color yellow = new Color(null, 225, 225, 135);
Color lightBlue = new Color(null, 194, 239, 255);
Color yellow = new Color(225, 225, 135);
Color lightBlue = new Color(194, 239, 255);
try {
checkBorderNodeColor("r", diagramEditor1, yellow, "Yellow", 1);
checkBorderNodeColor("r", diagramEditor2, lightBlue, "Light Blue", 1);
Expand Down Expand Up @@ -885,7 +885,7 @@ public void testBorderNodeCopyPasteStyleOnDiagramWithExtension() {
checkBorderNode("a", diagramEditor4, A1_SECOND_DIAG_LOCATION, A1_SECOND_DIAG_GMF_LOCATION, 1);

// Check border node color
Color yellow = new Color(null, 252, 233, 79);
Color yellow = new Color(252, 233, 79);
try {
checkBorderNodeColor("a", diagramEditor4, yellow, "Yellow", 1);
} finally {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016, 2024 THALES GLOBAL SERVICES.
* Copyright (c) 2016, 2026 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -1294,7 +1294,7 @@ private void checkGraySquareStyle(SWTBotSiriusDiagramEditor editorToCheck, Strin
AbstractDiagramNodeEditPart part = (AbstractDiagramNodeEditPart) editPart.part();
Object shape = part.getStyleEditPart().getFigure().getChildren().get(0);
assertTrue("The shape of figure for " + label + " must be a square.", shape instanceof SquareFigure);
Color gray = new Color(null, 136, 136, 136);
Color gray = new Color(136, 136, 136);
try {
assertEquals("The color of figure for " + label + " must be gray.", gray, ((Shape) shape).getBackgroundColor());
} finally {
Expand All @@ -1317,8 +1317,8 @@ private void checkOrangeDiamondStyle(SWTBotSiriusDiagramEditor editorToCheck, St
AbstractDiagramNodeEditPart part = (AbstractDiagramNodeEditPart) editPart.part();
Object shape = part.getStyleEditPart().getFigure().getChildren().get(0);
assertTrue("The shape of figure for " + label + " must be a diamond.", shape instanceof LozengeFigure);
Color orange = new Color(null, 252, 175, 62);
Color blue = new Color(null, 152, 168, 191);
Color orange = new Color(252, 175, 62);
Color blue = new Color(152, 168, 191);
try {
assertEquals("The color of figure for " + label + " must be orange.", orange, ((Shape) shape).getBackgroundColor());
assertEquals("The color of the label for " + label + " must be blue.", blue, ((IFigure) ((Shape) shape).getChildren().get(0)).getForegroundColor());
Expand All @@ -1343,7 +1343,7 @@ private void checkYellowEllipseStyle(SWTBotSiriusDiagramEditor editorToCheck, St
AbstractDiagramNodeEditPart part = (AbstractDiagramNodeEditPart) editPart.part();
Object shape = part.getStyleEditPart().getFigure().getChildren().get(0);
assertTrue("The shape of figure for " + label + " must be an ellipse.", shape instanceof ODesignEllipseFigure);
Color yellow = new Color(null, 252, 233, 79);
Color yellow = new Color(252, 233, 79);
try {
assertEquals("The color of figure for " + label + " must be yellow.", yellow, ((Shape) shape).getBackgroundColor());
} finally {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2010, 2024 THALES GLOBAL SERVICES.
* Copyright (c) 2010, 2026 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -64,7 +64,7 @@ protected String getRepresentationDescriptionName() {
* launching Paste Layout action.
*/
public void testCopyPasteLayout() {
Color red = new Color(null, 227, 164, 156);
Color red = new Color(227, 164, 156);
try {
final EditPart srcLabelEditPart = editor.getEditPart("DropPort", AbstractDiagramNameEditPart.class).part();
assertTrue("The model of the DropPort editPart in source diagram should be a Node", srcLabelEditPart.getModel() instanceof Node);
Expand Down Expand Up @@ -102,7 +102,7 @@ public void testCopyPasteLayout() {
* launching Paste Style action.
*/
public void testCopyPasteStyle() {
Color red = new Color(null, 227, 164, 156);
Color red = new Color(227, 164, 156);
try {
final EditPart srcLabelEditPart = editor.getEditPart("DropPort", AbstractDiagramNameEditPart.class).part();
checkBorderNodeLabelColor(srcLabelEditPart, red, "Red");
Expand Down Expand Up @@ -141,7 +141,7 @@ public void testCopyPasteStyle() {
* launching Paste Format action.
*/
public void testCopyPasteFormat() {
Color red = new Color(null, 227, 164, 156);
Color red = new Color(227, 164, 156);
try {
final EditPart srcLabelEditPart = editor.getEditPart("DropPort", AbstractDiagramNameEditPart.class).part();
assertTrue("The model of the DropPort editPart in source diagram should be a Node", srcLabelEditPart.getModel() instanceof Node);
Expand Down