diff --git a/msi.gama.application/plugin.xml b/msi.gama.application/plugin.xml index 3811df9131..dc22ccf098 100644 --- a/msi.gama.application/plugin.xml +++ b/msi.gama.application/plugin.xml @@ -21,18 +21,10 @@ name="aboutImage" value="branding_icons/icon128.png"> - - - - @@ -118,21 +110,13 @@ value="branding_icons/icon128.png"> + name="appName" + value="Gama (runtime)"> - - - - diff --git a/msi.gama.application/splash.bmp b/msi.gama.application/splash.bmp index 25e6b70614..9594afe64c 100644 Binary files a/msi.gama.application/splash.bmp and b/msi.gama.application/splash.bmp differ diff --git a/msi.gama.core/src/msi/gama/kernel/experiment/TextStatement.java b/msi.gama.core/src/msi/gama/kernel/experiment/TextStatement.java index d0b3968d13..84edbd2101 100644 --- a/msi.gama.core/src/msi/gama/kernel/experiment/TextStatement.java +++ b/msi.gama.core/src/msi/gama/kernel/experiment/TextStatement.java @@ -53,11 +53,16 @@ type = IType.COLOR, optional = true, doc = @doc ("The color with wich the text will be displayed")), + @facet ( + name = IKeyword.BACKGROUND, + type = IType.COLOR, + optional = true, + doc = @doc ("The color of the background of the text")), @facet ( name = FONT, type = { IType.FONT, IType.STRING }, optional = true, - doc = @doc ("the font used to draw the text, if any. Applying this facet to geometries or images has no effect. You can construct here your font with the operator \"font\". ex : font:font(\"Helvetica\", 20 , #plain)")), + doc = @doc ("the font used to draw the text, which can be built with the operator \"font\". ex : font:font(\"Helvetica\", 20 , #bold)")), @facet ( name = IKeyword.CATEGORY, type = IType.LABEL, @@ -79,13 +84,14 @@ public TextStatement(final IDescription desc) { color = getFacet(IKeyword.COLOR); category = getFacet(IKeyword.CATEGORY); font = getFacet(IKeyword.FONT); + background = getFacet(IKeyword.BACKGROUND); } /** The message. */ final IExpression message; /** The color. */ - final IExpression color, category, font; + final IExpression color, category, font, background; @Override public Object privateExecuteIn(final IScope scope) throws GamaRuntimeException { @@ -107,6 +113,12 @@ public Color getColor(final IScope scope) { return rgb; } + public Color getBackground(final IScope scope) { + GamaColor rgb = null; + if (background != null) { rgb = Cast.asColor(scope, background.value(scope)); } + return rgb; + } + @Override public String getTitle() { return ""; } diff --git a/msi.gama.models/models/Visualization and User Interaction/GUI Design/Parameters and Commands.gaml b/msi.gama.models/models/Visualization and User Interaction/GUI Design/Parameters and Commands.gaml index 3dc512c0c1..83d2624593 100644 --- a/msi.gama.models/models/Visualization and User Interaction/GUI Design/Parameters and Commands.gaml +++ b/msi.gama.models/models/Visualization and User Interaction/GUI Design/Parameters and Commands.gaml @@ -54,8 +54,8 @@ experiment "Show Parameters" type: gui { // Texts can be inserted in the parameters pane to explain, for instance, how the model works // Category: Explanation ////////////////////////////////////////////// - text "This is a simple text using default values" category: "Explanation"; - text "This is a more elaborate text in a different color" color: #darkgreen category: "Explanation"; + text "This is a simple text using default values. It adapts automatically to the light/dark themes" category: "Explanation"; + text "This is a more elaborate text in a different color and a background" color: #white background: #violet category: "Explanation"; text "This is a text in a different font, in italic and a size of 12" category: "Explanation" color: #orange font: font("Helvetica",12,#italic); text "This bold red text \rspans over \r3 lines." category: "Explanation" color: #red font: font("Helvetica",12,#bold); diff --git a/ummisco.gama.product/gama.product b/ummisco.gama.product/gama.product index 9de5af455f..f8b737e3f2 100644 --- a/ummisco.gama.product/gama.product +++ b/ummisco.gama.product/gama.product @@ -66,9 +66,7 @@ + startupProgressRect="71,515,500,12" /> @@ -283,9 +281,9 @@ + - diff --git a/ummisco.gama.product/gama.runtime.product b/ummisco.gama.product/gama.runtime.product index cab17e51d6..db919671bf 100644 --- a/ummisco.gama.product/gama.runtime.product +++ b/ummisco.gama.product/gama.runtime.product @@ -6,11 +6,11 @@ - GAMA Platform - V1.8.2 - http://gama-platform.org - -(c) 2007-2008 IRD-UR GEODES (France) & IFI-MSI (Vietnam) -(c) 2009-2011 UMI 209 UMMISCO IRD/UPMC - MSI (Vietnam) -(c) 2012-2017 UMI 209 UMMISCO IRD/UPMC & Partners + GAMA Platform - V1.8.2 - http://gama-platform.org + +(c) 2007-2008 IRD-UR GEODES (France) & IFI-MSI (Vietnam) +(c) 2009-2011 UMI 209 UMMISCO IRD/UPMC - MSI (Vietnam) +(c) 2012-2017 UMI 209 UMMISCO IRD/UPMC & Partners (c) 2018-2021 UMI 209 UMMISCO IRD/SU & Partners @@ -19,9 +19,9 @@ - -showsplash --data @noDefault - --launcher.defaultAction + -showsplash +-data @noDefault + --launcher.defaultAction openFile --launcher.GTK_version 3 @@ -56,7 +56,7 @@ --add-exports=java.desktop/sun.java2d=ALL-UNNAMED -Dsun.java2d.uiScale.enabled=false - -XstartOnFirstThread + -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts @@ -65,9 +65,7 @@ + startupProgressRect="71,515,500,12" /> @@ -290,8 +288,8 @@ - + diff --git a/ummisco.gama.ui.shared/src/ummisco/gama/ui/parameters/TextDisplayer.java b/ummisco.gama.ui.shared/src/ummisco/gama/ui/parameters/TextDisplayer.java index 8c950a0ef5..d999b8a4d8 100644 --- a/ummisco.gama.ui.shared/src/ummisco/gama/ui/parameters/TextDisplayer.java +++ b/ummisco.gama.ui.shared/src/ummisco/gama/ui/parameters/TextDisplayer.java @@ -25,11 +25,10 @@ import msi.gama.runtime.exceptions.GamaRuntimeException; import msi.gama.util.GamaFont; import ummisco.gama.ui.resources.GamaColors; -import ummisco.gama.ui.resources.IGamaColors; import ummisco.gama.ui.utils.WorkbenchHelper; /** - * The Class CommandEditor. + * The Class TextDisplayer. */ public class TextDisplayer extends AbstractStatementEditor { @@ -83,16 +82,19 @@ Composite createValueComposite() { protected Control createCustomParameterControl(final Composite composite) throws GamaRuntimeException { java.awt.Color c = getStatement().getColor(getScope()); - Color color; - if (c == null) { - color = IGamaColors.NEUTRAL.color(); - } else { - color = GamaColors.toSwtColor(getStatement().getColor(getScope())); - } - text = new StyledText(composite, SWT.BORDER | SWT.WRAP); + java.awt.Color b = getStatement().getBackground(getScope()); + Color color = c == null ? null : GamaColors.toSwtColor(c); + Color back = b == null ? null : GamaColors.toSwtColor(b); + text = new StyledText(composite, SWT.BORDER | SWT.WRAP | SWT.READ_ONLY); text.setJustify(true); text.setMargins(4, 4, 4, 4); - GamaColors.setBackAndForeground(text, IGamaColors.WHITE.color(), color); + if (back != null) { + if (color != null) { + GamaColors.setBackAndForeground(text, back, color); + } else { + GamaColors.setBackground(text, back); + } + } else if (color != null) { GamaColors.setForeground(text, color); } text.setText(getStatement().getText(getScope())); GamaFont font = getStatement().getFont(getScope()); if (font != null) {