diff --git a/model-command/src/main/java/lcsb/mapviewer/commands/ClearColorModelCommand.java b/model-command/src/main/java/lcsb/mapviewer/commands/ClearColorModelCommand.java new file mode 100644 index 0000000000000000000000000000000000000000..a6ebee799eeba8375b4a17d52c85db414220d044 --- /dev/null +++ b/model-command/src/main/java/lcsb/mapviewer/commands/ClearColorModelCommand.java @@ -0,0 +1,37 @@ +package lcsb.mapviewer.commands; + +import java.awt.Color; +import java.util.ArrayList; + +import lcsb.mapviewer.model.map.model.Model; + +public class ClearColorModelCommand extends ModelCommand { + + ColorModelCommand colorModelCommand; + + /** + * Default constructor. + * + * @param model + * original model + */ + public ClearColorModelCommand(Model model) { + super(model); + colorModelCommand = new ColorModelCommand(model, new ArrayList<>(), new ColorExtractor(Color.WHITE, Color.WHITE)); + } + + @Override + protected void undoImplementation() throws CommandExecutionException { + colorModelCommand.undo(); + } + + @Override + protected void redoImplementation() throws CommandExecutionException { + colorModelCommand.redo(); + } + + @Override + protected void executeImplementation() throws CommandExecutionException { + colorModelCommand.execute(); + } +} diff --git a/model-command/src/main/java/lcsb/mapviewer/commands/ColorExtractor.java b/model-command/src/main/java/lcsb/mapviewer/commands/ColorExtractor.java new file mode 100644 index 0000000000000000000000000000000000000000..96d2f90c3c7b70989af580e9c55f241c17192084 --- /dev/null +++ b/model-command/src/main/java/lcsb/mapviewer/commands/ColorExtractor.java @@ -0,0 +1,50 @@ +package lcsb.mapviewer.commands; + +import java.awt.Color; + +import lcsb.mapviewer.model.map.layout.ColorSchema; + +public class ColorExtractor { + + private Color minColor; + private Color maxColor; + + public ColorExtractor(Color minColor, Color maxColor) { + this.minColor = minColor; + this.maxColor = maxColor; + } + + /** + * Extracts color from {@link ColorSchema} object. + * + * @return color from {@link ColorSchema} object + */ + public Color getNormalizedColor(ColorSchema colorSchema) { + if (colorSchema.getColor() != null) { + return colorSchema.getColor(); + } else { + return getColorForValue(colorSchema.getValue()); + } + } + + /** + * Returns color from red - green scale for the given normalized double value + * (from range -1,1). + * + * @param value + * double value that should be converted into color + * @return color for the double value + */ + protected Color getColorForValue(Double value) { + if (value > 0) { + double ratio = (1 - value); + return new Color((int) (maxColor.getRed() * ratio), (int) (maxColor.getGreen() * ratio), (int) (maxColor.getBlue() * ratio)); + } + if (value < 0) { + double ratio = 1 + value; + return new Color((int) (minColor.getRed() * ratio), (int) (minColor.getGreen() * ratio), (int) (minColor.getBlue() * ratio)); + } + return Color.WHITE; + } + +} diff --git a/model-command/src/main/java/lcsb/mapviewer/commands/ColorModelCommand.java b/model-command/src/main/java/lcsb/mapviewer/commands/ColorModelCommand.java index 87d848c59c4a5217069f0c173a27d0c58afc8398..a7fdd4c95ff3c01686529337f38c3907c025549a 100644 --- a/model-command/src/main/java/lcsb/mapviewer/commands/ColorModelCommand.java +++ b/model-command/src/main/java/lcsb/mapviewer/commands/ColorModelCommand.java @@ -47,6 +47,8 @@ public class ColorModelCommand extends ModelCommand { */ private Collection<ColorSchema> schemas; + private ColorExtractor colorExtractor; + /** * Default constructor. * @@ -55,9 +57,10 @@ public class ColorModelCommand extends ModelCommand { * @param schemas * set of color schemas used in this command to color model. */ - public ColorModelCommand(Model model, Collection<ColorSchema> schemas) { + public ColorModelCommand(Model model, Collection<ColorSchema> schemas, ColorExtractor colorExtractor) { super(model); this.schemas = schemas; + this.colorExtractor = colorExtractor; } /** @@ -75,7 +78,7 @@ public class ColorModelCommand extends ModelCommand { throw new InvalidColorSchemaException("At least two rows try to set color to reaction: " + reaction.getIdReaction()); } - Color color = schema.getNormalizedColor(); + Color color = colorExtractor.getNormalizedColor(schema); for (AbstractNode node : reaction.getNodes()) { node.getLine().setColor(color); if (schema.getLineWidth() != null) { @@ -148,7 +151,7 @@ public class ColorModelCommand extends ModelCommand { throw new InvalidColorSchemaException("At least two rows try to set color to element: " + alias.getName()); } - alias.setColor(schema.getNormalizedColor()); + alias.setColor(colorExtractor.getNormalizedColor(schema)); } } @@ -263,7 +266,7 @@ public class ColorModelCommand extends ModelCommand { for (ColorSchema schema : schemas) { for (Element alias : model2.getElements()) { if (match(alias, schema)) { - if (result.get(alias) != null && !result.get(alias).getNormalizedColor().equals(Color.WHITE)) { + if (result.get(alias) != null && !colorExtractor.getNormalizedColor(result.get(alias)).equals(Color.WHITE)) { throw new InvalidColorSchemaException("Alias " + alias.getElementId() + " is colored by more than one rule."); } result.put(alias, schema); @@ -271,7 +274,7 @@ public class ColorModelCommand extends ModelCommand { } for (Reaction reaction : model2.getReactions()) { if (match(reaction, schema)) { - if (result.get(reaction) != null && !result.get(reaction).getNormalizedColor().equals(Color.WHITE)) { + if (result.get(reaction) != null && !colorExtractor.getNormalizedColor(result.get(reaction)).equals(Color.WHITE)) { throw new InvalidColorSchemaException("Reaction " + reaction.getIdReaction() + " is colored by more than one rule."); } result.put(reaction, schema); diff --git a/model/src/main/java/lcsb/mapviewer/model/map/layout/ColorSchema.java b/model/src/main/java/lcsb/mapviewer/model/map/layout/ColorSchema.java index 89840fce6753e72466ead3a93a1239b68894c15a..acd8c609582e43fae25722382962326aba125626 100644 --- a/model/src/main/java/lcsb/mapviewer/model/map/layout/ColorSchema.java +++ b/model/src/main/java/lcsb/mapviewer/model/map/layout/ColorSchema.java @@ -483,39 +483,6 @@ public abstract class ColorSchema implements Serializable { this.types.add(clazz); } - /** - * Extracts color from {@link ColorSchema} object. - * - * @return color from {@link ColorSchema} object - */ - public Color getNormalizedColor() { - if (getColor() != null) { - return getColor(); - } else { - return getColorForValue(getValue()); - } - } - - /** - * Returns color from red - green scale for the given normalized double value - * (from range -1,1). - * - * @param value - * double value that should be converted into color - * @return color for the double value - */ - protected Color getColorForValue(Double value) { - if (value > 0) { - int val = (int) ((1 - value) * MAX_SINGLE_COLOR_VALUE_IN_RGB_FORMAT); - return new Color(val, MAX_SINGLE_COLOR_VALUE_IN_RGB_FORMAT, val); - } - if (value < 0) { - int val = (int) ((1 + value) * MAX_SINGLE_COLOR_VALUE_IN_RGB_FORMAT); - return new Color(MAX_SINGLE_COLOR_VALUE_IN_RGB_FORMAT, val, val); - } - return Color.WHITE; - } - /** * @return the description * @see #description diff --git a/model/src/main/java/lcsb/mapviewer/model/user/ConfigurationElementEditType.java b/model/src/main/java/lcsb/mapviewer/model/user/ConfigurationElementEditType.java new file mode 100644 index 0000000000000000000000000000000000000000..2b6256c70aa80e106c834518710bf14809d4b957 --- /dev/null +++ b/model/src/main/java/lcsb/mapviewer/model/user/ConfigurationElementEditType.java @@ -0,0 +1,45 @@ +package lcsb.mapviewer.model.user; + +/** + * Defines how the {@link ConfigurationElementType} should be edited (what kind + * of values we are storing). + * + * @author Piotr Gawron + * + */ +public enum ConfigurationElementEditType { + /** + * Double value. + */ + DOUBLE, + + /** + * Integer value. + */ + INTEGER, + + /** + * String value. + */ + STRING, + + /** + * Color value (for color picker). + */ + COLOR, + + /** + * Url value. + */ + URL, + + /** + * Email value. + */ + EMAIL, + + /** + * Password value. + */ + PASSWORD, +} diff --git a/model/src/main/java/lcsb/mapviewer/model/user/ConfigurationElementType.java b/model/src/main/java/lcsb/mapviewer/model/user/ConfigurationElementType.java index d77ddc26da96f9b903854fec6f14f24633f114e7..c362722b3e7ffa56f7bca66707bbac90e61943ed 100644 --- a/model/src/main/java/lcsb/mapviewer/model/user/ConfigurationElementType.java +++ b/model/src/main/java/lcsb/mapviewer/model/user/ConfigurationElementType.java @@ -1,162 +1,181 @@ -package lcsb.mapviewer.model.user; - -/** - * This enum defines all possible configuration parameter that are configurable - * by the user. - * - * @author Piotr Gawron - * - */ -public enum ConfigurationElementType { - - /** - * Email address used for sending email from the system. - */ - EMAIL_ADDRESS("E-mail address", "your.account@domain.com"), // - - /** - * Login for the email account. - */ - EMAIL_LOGIN("E-mail server login", "your@login"), // - - /** - * Password for the email account. - */ - EMAIL_PASSWORD("E-mail server password", "email.secret.password"), // - - /** - * Addres of the imap server. - */ - EMAIL_IMAP_SERVER("IMAP server", "your.imap.domain.com"), // - - /** - * Address of the smtp server. - */ - EMAIL_SMTP_SERVER("SMTP server", "your.smtp.domain.com"), // - - /** - * Port used for smtp connection (sending emails). - */ - EMAIL_SMTP_PORT("SMTP port", "25"), // - - /** - * Default map that should be presented if no map is selected by user side. - */ - DEFAULT_MAP("Default Project Id", "empty"), // - - /** - * Logo presented in the system. - */ - LOGO_IMG("Logo icon", "udl.png"), // - - /** - * Address connected to the logo. - */ - LOGO_LINK("Logo link (after click)", "http://wwwen.uni.lu/"), // - - /** - * Maximum distance (in pixels) that is allowed during finding closest element - * on the map. - */ - SEARCH_DISTANCE("Max distance for clicking on element (px)", "10"), - - /** - * Email used for requesting an account (in client side). - */ - REQUEST_ACCOUNT_EMAIL("Email used for requesting an account", "your.email@domain.com"), - - /** - * Max number of results in search box. - */ - SEARCH_RESULT_NUMBER("Max number of results in search box. ", "100"), - - /** - * Google Analytics tracking ID used for statistics. This tracking ID should - * look like "UA-000000-01". More information about tracking ID can be found - * <a href="https://support.google.com/analytics/answer/1032385?hl=en"> here - * </a>. - */ - GOOGLE_ANALYTICS_IDENTIFIER("Google Analytics tracking ID used for statistics", ""), - - /** - * Description of the logo presented in the system. - */ - LOGO_TEXT("Logo description", "University of Luxembourg"), - - /** - * Domain allowed to connect via x-frame technology. - */ - X_FRAME_DOMAIN("Domain allowed to connect via x-frame technology", ""), - - /** - * Relative directory (in webapps folder) where big files will be stored. - */ - BIG_FILE_STORAGE_DIR("Path to store big files", "minerva-big/"), - - /** - * File where legend 1/4 is stored. - */ - LENGEND_FILE_1("Legend 1 image file", "resources/images/legend_a.png"), - - /** - * File where legend 2/4 is stored. - */ - LENGEND_FILE_2("Legend 2 image file", "resources/images/legend_b.png"), - - /** - * File where legend 3/4 is stored. - */ - LENGEND_FILE_3("Legend 3 image file", "resources/images/legend_c.png"), - - /** - * File where legend 4/4 is stored. - */ - LENGEND_FILE_4("Legend 4 image file", "resources/images/legend_d.png"), - - /** - * File where legend 4/4 is stored. - */ - USER_MANUAL_FILE("User manual file", "resources/other/user_guide.pdf"); - - - /** - * Default value of the configuration parameter (it will be used only when - * value doesn't exist in the DAO). - */ - private String defaultValue = ""; - - /** - * Common name used for visualization (query user). - */ - private String commonName = ""; - - /** - * Default constructor. - * - * @param commonName - * common name used for this parameter - * @param defaultVal - * default value assigned to this parameter - */ - ConfigurationElementType(String commonName, String defaultVal) { - this.defaultValue = defaultVal; - this.commonName = commonName; - } - - /** - * @return the defaultValue - * @see #defaultValue - */ - public String getDefaultValue() { - return defaultValue; - } - - /** - * @return the commonName - * @see #commonName - */ - public String getCommonName() { - return commonName; - } - -} +package lcsb.mapviewer.model.user; + +/** + * This enum defines all possible configuration parameter that are configurable + * by the user. + * + * @author Piotr Gawron + * + */ +public enum ConfigurationElementType { + + /** + * Email address used for sending email from the system. + */ + EMAIL_ADDRESS("E-mail address", "your.account@domain.com", ConfigurationElementEditType.EMAIL), // + + /** + * Login for the email account. + */ + EMAIL_LOGIN("E-mail server login", "your@login", ConfigurationElementEditType.STRING), // + + /** + * Password for the email account. + */ + EMAIL_PASSWORD("E-mail server password", "email.secret.password", ConfigurationElementEditType.PASSWORD), // + + /** + * Addres of the imap server. + */ + EMAIL_IMAP_SERVER("IMAP server", "your.imap.domain.com", ConfigurationElementEditType.STRING), // + + /** + * Address of the smtp server. + */ + EMAIL_SMTP_SERVER("SMTP server", "your.smtp.domain.com", ConfigurationElementEditType.STRING), // + + /** + * Port used for smtp connection (sending emails). + */ + EMAIL_SMTP_PORT("SMTP port", "25", ConfigurationElementEditType.INTEGER), // + + /** + * Default map that should be presented if no map is selected by user side. + */ + DEFAULT_MAP("Default Project Id", "empty", ConfigurationElementEditType.STRING), // + + /** + * Logo presented in the system. + */ + LOGO_IMG("Logo icon", "udl.png", ConfigurationElementEditType.URL), // + + /** + * Address connected to the logo. + */ + LOGO_LINK("Logo link (after click)", "http://wwwen.uni.lu/", ConfigurationElementEditType.URL), // + + /** + * Maximum distance (in pixels) that is allowed during finding closest element + * on the map. + */ + SEARCH_DISTANCE("Max distance for clicking on element (px)", "10", ConfigurationElementEditType.DOUBLE), + + /** + * Email used for requesting an account (in client side). + */ + REQUEST_ACCOUNT_EMAIL("Email used for requesting an account", "your.email@domain.com", ConfigurationElementEditType.EMAIL), + + /** + * Max number of results in search box. + */ + SEARCH_RESULT_NUMBER("Max number of results in search box. ", "100", ConfigurationElementEditType.INTEGER), + + /** + * Google Analytics tracking ID used for statistics. This tracking ID should + * look like "UA-000000-01". More information about tracking ID can be found + * <a href="https://support.google.com/analytics/answer/1032385?hl=en"> here + * </a>. + */ + GOOGLE_ANALYTICS_IDENTIFIER("Google Analytics tracking ID used for statistics", "", ConfigurationElementEditType.STRING), + + /** + * Description of the logo presented in the system. + */ + LOGO_TEXT("Logo description", "University of Luxembourg", ConfigurationElementEditType.STRING), + + /** + * Domain allowed to connect via x-frame technology. + */ + X_FRAME_DOMAIN("Domain allowed to connect via x-frame technology", "", ConfigurationElementEditType.URL), + + /** + * Relative directory (in webapps folder) where big files will be stored. + */ + BIG_FILE_STORAGE_DIR("Path to store big files", "minerva-big/", ConfigurationElementEditType.STRING), + + /** + * File where legend 1/4 is stored. + */ + LENGEND_FILE_1("Legend 1 image file", "resources/images/legend_a.png", ConfigurationElementEditType.URL), + + /** + * File where legend 2/4 is stored. + */ + LENGEND_FILE_2("Legend 2 image file", "resources/images/legend_b.png", ConfigurationElementEditType.URL), + + /** + * File where legend 3/4 is stored. + */ + LENGEND_FILE_3("Legend 3 image file", "resources/images/legend_c.png", ConfigurationElementEditType.URL), + + /** + * File where legend 4/4 is stored. + */ + LENGEND_FILE_4("Legend 4 image file", "resources/images/legend_d.png", ConfigurationElementEditType.URL), + + /** + * File where legend 4/4 is stored. + */ + USER_MANUAL_FILE("User manual file", "resources/other/user_guide.pdf", ConfigurationElementEditType.URL), + + MIN_COLOR_VAL("Overlay color for negative values", "FF0000", ConfigurationElementEditType.COLOR), + + MAX_COLOR_VAL("Overlay color for postive values", "0000FF", ConfigurationElementEditType.COLOR); + + /** + * Default value of the configuration parameter (it will be used only when + * value doesn't exist in the DAO). + */ + private String defaultValue = ""; + + /** + * Common name used for visualization (query user). + */ + private String commonName = ""; + + /** + * How we want to edit specific param. + */ + private ConfigurationElementEditType editType = null; + + /** + * Default constructor. + * + * @param commonName + * common name used for this parameter + * @param editType + * type defining how we want to edit this configuration param + * @param defaultVal + * default value assigned to this parameter + */ + ConfigurationElementType(String commonName, String defaultVal, ConfigurationElementEditType editType) { + this.defaultValue = defaultVal; + this.commonName = commonName; + this.editType = editType; + } + + /** + * @return the defaultValue + * @see #defaultValue + */ + public String getDefaultValue() { + return defaultValue; + } + + /** + * @return the commonName + * @see #commonName + */ + public String getCommonName() { + return commonName; + } + + /** + * @return the editType + * @see #editType + */ + public ConfigurationElementEditType getEditType() { + return editType; + } + +} diff --git a/model/src/test/java/lcsb/mapviewer/model/map/layout/ColorSchemaTest.java b/model/src/test/java/lcsb/mapviewer/model/map/layout/ColorSchemaTest.java index 181cce38fadefea6779a548ccf367130209b1207..7d37060cce154cd6bc62b87efbf1f92af1c4bc07 100644 --- a/model/src/test/java/lcsb/mapviewer/model/map/layout/ColorSchemaTest.java +++ b/model/src/test/java/lcsb/mapviewer/model/map/layout/ColorSchemaTest.java @@ -113,35 +113,6 @@ public class ColorSchemaTest { } } - @Test - public void testGetColorForValue() throws Exception { - try { - ColorSchema cs = new GenericColorSchema(); - assertEquals(Color.GREEN, cs.getColorForValue(1.0)); - assertEquals(Color.RED, cs.getColorForValue(-1.0)); - assertEquals(Color.WHITE, cs.getColorForValue(0.0)); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - - @Test - public void testGetNormalizedColor() throws Exception { - try { - ColorSchema cs = new GenericColorSchema(); - cs.setColor(Color.BLUE); - assertEquals(Color.BLUE, cs.getNormalizedColor()); - - cs = new GenericColorSchema(); - cs.setValue(1.0); - assertEquals(Color.GREEN, cs.getNormalizedColor()); - } catch (Exception e) { - e.printStackTrace(); - throw e; - } - } - @Test public void testToString() throws Exception { try { diff --git a/service/src/main/java/lcsb/mapviewer/services/impl/ProjectService.java b/service/src/main/java/lcsb/mapviewer/services/impl/ProjectService.java index d011bcb4568127dbafedbae38010cb727c10897b..e397a1208dd6bd89aab2b5b98325cfe03e7162dd 100644 --- a/service/src/main/java/lcsb/mapviewer/services/impl/ProjectService.java +++ b/service/src/main/java/lcsb/mapviewer/services/impl/ProjectService.java @@ -36,6 +36,7 @@ import lcsb.mapviewer.annotation.services.TaxonomyBackend; import lcsb.mapviewer.annotation.services.TaxonomySearchException; import lcsb.mapviewer.annotation.services.annotators.AnnotatorException; import lcsb.mapviewer.annotation.services.annotators.ElementAnnotator; +import lcsb.mapviewer.commands.ClearColorModelCommand; import lcsb.mapviewer.commands.ColorModelCommand; import lcsb.mapviewer.commands.CommandExecutionException; import lcsb.mapviewer.commands.CopyCommand; @@ -603,7 +604,7 @@ public class ProjectService implements IProjectService { } if (layout.getTitle().equals(BuildInLayout.CLEAN.getTitle())) { output = new CopyCommand(model).execute(); - new ColorModelCommand(output, new ArrayList<>()).execute(); + new ClearColorModelCommand(output).execute(); } final double imgCounter = counter; diff --git a/service/src/main/java/lcsb/mapviewer/services/search/layout/FullLayoutAliasViewFactory.java b/service/src/main/java/lcsb/mapviewer/services/search/layout/FullLayoutAliasViewFactory.java index d58e285eff71e012da61010728b7134e70350deb..e42bc74452ab802039cdd8f87ac09afeb0eff40f 100644 --- a/service/src/main/java/lcsb/mapviewer/services/search/layout/FullLayoutAliasViewFactory.java +++ b/service/src/main/java/lcsb/mapviewer/services/search/layout/FullLayoutAliasViewFactory.java @@ -29,7 +29,7 @@ public class FullLayoutAliasViewFactory extends ElementViewFactory<Pair<Element, ColorSchema schema = pair.getRight(); FullLayoutAliasView result = new FullLayoutAliasView(pair.getLeft()); - result.setColor(schema.getNormalizedColor()); + result.setColor(schema.getColor()); result.setValue(schema.getValue()); result.setDescription(schema.getDescription()); if (schema instanceof GeneVariationColorSchema) { diff --git a/service/src/main/java/lcsb/mapviewer/services/search/layout/LightLayoutAliasViewFactory.java b/service/src/main/java/lcsb/mapviewer/services/search/layout/LightLayoutAliasViewFactory.java index 4d0c874fd4ccdb43ba5b1fce35c77faa03fa3dba..0f37f3a0afe17a79edab2d9858bb2aed061e0d71 100644 --- a/service/src/main/java/lcsb/mapviewer/services/search/layout/LightLayoutAliasViewFactory.java +++ b/service/src/main/java/lcsb/mapviewer/services/search/layout/LightLayoutAliasViewFactory.java @@ -25,7 +25,7 @@ public class LightLayoutAliasViewFactory extends ElementViewFactory<Pair<Element @Override public LightLayoutAliasView create(Pair<Element, ColorSchema> pair) { LightLayoutAliasView result = new LightLayoutAliasView(pair.getLeft()); - result.setColor(pair.getRight().getNormalizedColor()); + result.setColor(pair.getRight().getColor()); result.setValue(pair.getRight().getValue()); return result; } diff --git a/web/src/main/java/lcsb/mapviewer/bean/ConfigurationBean.java b/web/src/main/java/lcsb/mapviewer/bean/ConfigurationBean.java index 188034072a1b3516267093ddd444fe835e5a7cc8..73cfaa9548eb8c570077a00f6727f74dd2183873 100644 --- a/web/src/main/java/lcsb/mapviewer/bean/ConfigurationBean.java +++ b/web/src/main/java/lcsb/mapviewer/bean/ConfigurationBean.java @@ -83,7 +83,7 @@ public class ConfigurationBean extends AbstractManagedBean implements Serializab /** * List of values for all possible configurable parameters. */ - private List<ConfigurationView> values = new ArrayList<ConfigurationView>(); + private List<ConfigurationView> values = new ArrayList<>(); /** * Release version of the framework. diff --git a/web/src/main/java/lcsb/mapviewer/bean/ExportBean.java b/web/src/main/java/lcsb/mapviewer/bean/ExportBean.java index 9650be2c4d8e7bbfba278a4ebc4fb3a2343798dd..77545c81132c6f1792c873d3413488f8f6d70e3e 100644 --- a/web/src/main/java/lcsb/mapviewer/bean/ExportBean.java +++ b/web/src/main/java/lcsb/mapviewer/bean/ExportBean.java @@ -34,6 +34,7 @@ import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import lcsb.mapviewer.bean.MapBean.ClientMapData; +import lcsb.mapviewer.commands.ClearColorModelCommand; import lcsb.mapviewer.commands.ColorModelCommand; import lcsb.mapviewer.commands.CopyCommand; import lcsb.mapviewer.commands.SubModelCommand; @@ -1147,7 +1148,7 @@ public class ExportBean extends AbstractManagedBean { // this might not return true if we change CLEAN.title in future... // if it's clean then remove coloring - new ColorModelCommand(colorModel, new HashSet<>()).execute(); + new ClearColorModelCommand(colorModel).execute(); } for (Element alias : colorModel.getElements()) { alias.setVisibilityLevel(0); diff --git a/web/src/main/webapp/admin/configuration.xhtml b/web/src/main/webapp/admin/configuration.xhtml index 9202732b32a8ff4f7c5f3eb1402644802258eb47..7c63080fcaff4eed72e339864048b1951a29717f 100644 --- a/web/src/main/webapp/admin/configuration.xhtml +++ b/web/src/main/webapp/admin/configuration.xhtml @@ -56,6 +56,7 @@ global parameters of the MINERVA instance. More information can be found in the <p:column sortBy="value" headerText="Value"> <p:inputText value="#{configuration.value}" /> + <p:colorPicker value="#{configuration.value}" rendered="#{configuration.type.editType == 'COLOR'}"/> </p:column> </p:dataTable>