diff --git a/CHANGELOG.md b/CHANGELOG.md index bcbefce2..342d367b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,31 @@ +Contrast-Finder 0.5.1, 2017-06-14 +--------------------------------- + +Features: +none + +Security: +- [#65 - Upgraded spring-security to v4.2.3](https://github.com/Asqatasun/Contrast-Finder/issues/65) + +Bugs: +- [#61 - Added missing color names (*Grey + RebeccaPurple)](https://github.com/Asqatasun/Contrast-Finder/issues/61) +- [#63 - Allowed "rgb(255,255,255" value for "rgb(255,255,255)" in the form](https://github.com/Asqatasun/Contrast-Finder/issues/63) +- Fixed some codacy "error prone" + "code style" + +Refactoring: +- [#66 - Modified project directories](https://github.com/Asqatasun/Contrast-Finder/issues/66) +- [#64 - Moved contrast-finder.log|.conf files into webapp directory](https://github.com/Asqatasun/Contrast-Finder/issues/64) + +Configuration: +none + +Documentation: +none + +Upgrade-o-meter: just replace the .war file and restart Tomcat + + Contrast-Finder 0.5.0, 2017-06-09 --------------------------------- diff --git a/README.md b/README.md index 3b17e2ec..4d01ce6f 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Build Status](https://travis-ci.org/Asqatasun/Contrast-Finder.svg)](https://travis-ci.org/Asqatasun/Contrast-Finder) [![Release](https://img.shields.io/github/release/asqatasun/Contrast-Finder.svg)](https://github.com/Asqatasun/Contrast-Finder/releases/latest) [![Dependency Status](https://www.versioneye.com/user/projects/58fb3e17c2ef423822580804/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/58fb3e17c2ef423822580804?child=summary#tab-dependencies) +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c3374c9913d24a9c91e91552f1796672)](https://www.codacy.com/app/Asqatasun/Contrast-Finder) # Contrast-Finder diff --git a/contrast-finder-resources/pom.xml b/contrast-finder-resources/pom.xml deleted file mode 100644 index b0f087a0..00000000 --- a/contrast-finder-resources/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - 4.0.0 - - org.asqatasun - contrast-finder - 0.5.0 - - contrast-finder-resources - 0.5.0 - contrast-finder-resources - https://contrast-finder.org - - Asqatasun.org - http://asqatasun.org - - - - GNU Affero General Public License v3.0 - https://www.gnu.org/licenses/agpl-3.0.txt - manual - - - - UTF-8 - - - - junit - junit - 4.12 - test - - - diff --git a/contrast-finder-resources/src/main/resources/contrast-finder.log b/contrast-finder-resources/src/main/resources/contrast-finder.log deleted file mode 100644 index e69de29b..00000000 diff --git a/contrast-finder-webapp/nb-configuration.xml b/contrast-finder-webapp/nb-configuration.xml deleted file mode 100644 index d3aa9882..00000000 --- a/contrast-finder-webapp/nb-configuration.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - 1.6-web - HTML5 - - diff --git a/contrast-finder-webapp/src/main/webapp/WEB-INF/template/footer.jspf~ b/contrast-finder-webapp/src/main/webapp/WEB-INF/template/footer.jspf~ deleted file mode 100644 index 7b549f08..00000000 --- a/contrast-finder-webapp/src/main/webapp/WEB-INF/template/footer.jspf~ +++ /dev/null @@ -1,74 +0,0 @@ -<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> -<%@page pageEncoding="UTF-8"%> - - - - - - - - - - - - - -======= - (function() { - var u = (("https:" == document.location.protocol) ? "https" : "http") + "://stats.open-s.com/"; - _paq.push(["setTrackerUrl", u + "piwik.php"]); - _paq.push(["setSiteId", "${piwikSiteId}"]); - var d = document, g = d.createElement("script"), s = d.getElementsByTagName("script")[0]; - g.type = "text/javascript"; - g.defer = true; - g.async = true; - g.src = u + "piwik.js"; - s.parentNode.insertBefore(g, s); - })(); - - - ->>>>>>> release-0.3 diff --git a/docker/RELEASE/Dockerfile b/docker/RELEASE/Dockerfile index 53de58d6..c8c6d195 100644 --- a/docker/RELEASE/Dockerfile +++ b/docker/RELEASE/Dockerfile @@ -1,7 +1,7 @@ FROM asqatasun/contrast-finder:pre-requisites_from-Ubuntu LABEL org.label-schema.schema-version = "1.0.0-rc.1" \ org.label-schema.name = "Contrast-Finder - WebApp" \ - org.label-schema.version = "0.5.0" \ + org.label-schema.version = "0.5.1" \ org.label-schema.url = "https://contrast-finder.org" \ org.label-schema.vcs-url = "https://github.com/Asqatasun/Contrast-Finder" \ org.label-schema.docker.cmd = "docker run -p 8087:8080 -d asqatasun/contrast-finder" \ @@ -13,9 +13,9 @@ LABEL org.label-schema.schema-version = "1.0.0-rc.1" # # --- Building this docker image # docker build -t asqatasun/contrast-finder . -# docker build -t asqatasun/contrast-finder --build-arg CONTRAST_FINDER_RELEASE=0.5.0 . -# docker build -t asqatasun/contrast-finder --build-arg SRC_URL_PREFIX=https://github.com/Asqatasun/Contrast-Finder/releases/download/v0.5.0/ . -# docker build -t asqatasun/contrast-finder --build-arg SRC_URL=https://github.com/Asqatasun/Contrast-Finder/releases/download/v0.5.0/contrast-finder_0.5.0.i386.tar.gz . +# docker build -t asqatasun/contrast-finder --build-arg CONTRAST_FINDER_RELEASE=0.5.1 . +# docker build -t asqatasun/contrast-finder --build-arg SRC_URL_PREFIX=https://github.com/Asqatasun/Contrast-Finder/releases/download/v0.5.1/ . +# docker build -t asqatasun/contrast-finder --build-arg SRC_URL=https://github.com/Asqatasun/Contrast-Finder/releases/download/v0.5.1/contrast-finder_0.5.1.i386.tar.gz . # # --- Launch a container # docker run -p 127.0.0.1:8087:8080 --name contrast.finder -d asqatasun/contrast-finder @@ -36,7 +36,7 @@ LABEL org.label-schema.schema-version = "1.0.0-rc.1" ################################################################### # build variables -ARG CONTRAST_FINDER_RELEASE="0.5.0" +ARG CONTRAST_FINDER_RELEASE="0.5.1" ARG SRC_URL_PREFIX="https://github.com/Asqatasun/Contrast-Finder/releases/download/v${CONTRAST_FINDER_RELEASE}" ARG SRC_URL="${SRC_URL_PREFIX}/contrast-finder_${CONTRAST_FINDER_RELEASE}.i386.tar.gz" diff --git a/docker/RELEASE/README.md b/docker/RELEASE/README.md index 801e3f32..90c1455d 100644 --- a/docker/RELEASE/README.md +++ b/docker/RELEASE/README.md @@ -7,13 +7,10 @@ Tool to provide color combination for a good (accessible, WCAG-compliant) contra Supported tags and respective `Dockerfile` links : * [pre-requisites_from-Ubuntu](https://github.com/Asqatasun/Contrast-Finder/blob/master/docker/pre-requisites/pre-requisites_from-Ubuntu/Dockerfile) -* [v0.5.0, latest](https://github.com/Asqatasun/Contrast-Finder/blob/master/docker/RELEASE/Dockerfile) +* [v0.5.1, latest](https://github.com/Asqatasun/Contrast-Finder/blob/master/docker/RELEASE/Dockerfile) +* [v0.5.0](https://github.com/Asqatasun/Contrast-Finder/blob/v0.5.0/docker/RELEASE/Dockerfile) * [v0.4.7](https://github.com/Asqatasun/Contrast-Finder/blob/v0.4.7/docker/RELEASE/Dockerfile) * [v0.4.6](https://github.com/Asqatasun/Contrast-Finder/blob/v0.4.6/docker/RELEASE/Dockerfile) -* [v0.4.5](https://github.com/Asqatasun/Contrast-Finder/blob/v0.4.5/docker/RELEASE/Dockerfile) -* [v0.4.4](https://github.com/Asqatasun/Contrast-Finder/blob/v0.4.4/docker/RELEASE/Dockerfile) -* [v0.4.3](https://github.com/Asqatasun/Contrast-Finder/blob/v0.4.3/docker/RELEASE/Dockerfile) -* [v0.4.2](https://github.com/Asqatasun/Contrast-Finder/blob/v0.4.2/docker/RELEASE/Dockerfile) ## How to use this image `docker pull asqatasun/contrast-finder` diff --git a/docker/SNAPSHOT-local_from-Tomcat/Dockerfile b/docker/SNAPSHOT-local_from-Tomcat/Dockerfile index b9c7061a..ab4cc098 100644 --- a/docker/SNAPSHOT-local_from-Tomcat/Dockerfile +++ b/docker/SNAPSHOT-local_from-Tomcat/Dockerfile @@ -25,7 +25,7 @@ FROM tomcat:7.0-jre7 ################################################################### # environment variables -ENV CONTRAST_FINDER_RELEASE="0.5.0" +ENV CONTRAST_FINDER_RELEASE="0.5.1" ENV TOMCAT_WEBAPP_DIR="/usr/local/tomcat/webapps" # Prepare Contrast-Finder diff --git a/docker/SNAPSHOT-local_from-Ubuntu/Dockerfile b/docker/SNAPSHOT-local_from-Ubuntu/Dockerfile index 1bec9745..af980252 100644 --- a/docker/SNAPSHOT-local_from-Ubuntu/Dockerfile +++ b/docker/SNAPSHOT-local_from-Ubuntu/Dockerfile @@ -19,7 +19,7 @@ FROM asqatasun/contrast-finder:pre-requisites_from-Ubuntu ################################################################### # environment variables -ENV CONTRAST_FINDER_RELEASE="0.5.0" +ENV CONTRAST_FINDER_RELEASE="0.5.1" # Add contrast-finder .war ADD contrast-finder_${CONTRAST_FINDER_RELEASE}.i386.tar.gz /root diff --git a/docker/SNAPSHOT-local_from-Ubuntu/test_conf-default-algo/Dockerfile b/docker/SNAPSHOT-local_from-Ubuntu/test_conf-default-algo/Dockerfile index 6dcd3569..cb074ce5 100644 --- a/docker/SNAPSHOT-local_from-Ubuntu/test_conf-default-algo/Dockerfile +++ b/docker/SNAPSHOT-local_from-Ubuntu/test_conf-default-algo/Dockerfile @@ -19,7 +19,7 @@ FROM asqatasun/contrast-finder:pre-requisites_from-Ubuntu ################################################################### # environment variables -ENV CONTRAST_FINDER_RELEASE="0.5.0" +ENV CONTRAST_FINDER_RELEASE="0.5.1" ENV CONF_DEFAULT_ALGO="Rgb" # ENV CONF_DEFAULT_ALGO="Rgb" # ENV CONF_DEFAULT_ALGO="HSV" diff --git a/docker/SNAPSHOT-local_from-Ubuntu/test_conf-env_debug/Dockerfile b/docker/SNAPSHOT-local_from-Ubuntu/test_conf-env_debug/Dockerfile index f2a60f18..f5084967 100644 --- a/docker/SNAPSHOT-local_from-Ubuntu/test_conf-env_debug/Dockerfile +++ b/docker/SNAPSHOT-local_from-Ubuntu/test_conf-env_debug/Dockerfile @@ -19,7 +19,7 @@ FROM asqatasun/contrast-finder:pre-requisites_from-Ubuntu ################################################################### # environment variables -ENV CONTRAST_FINDER_RELEASE="0.5.0" +ENV CONTRAST_FINDER_RELEASE="0.5.1" ENV CONF_ENV="debug" # Add contrast-finder .war diff --git a/docker/SNAPSHOT-local_from-Ubuntu/test_conf-piwik/Dockerfile b/docker/SNAPSHOT-local_from-Ubuntu/test_conf-piwik/Dockerfile index 4299326c..ee72b046 100644 --- a/docker/SNAPSHOT-local_from-Ubuntu/test_conf-piwik/Dockerfile +++ b/docker/SNAPSHOT-local_from-Ubuntu/test_conf-piwik/Dockerfile @@ -19,7 +19,7 @@ FROM asqatasun/contrast-finder:pre-requisites_from-Ubuntu ################################################################### # environment variables -ENV CONTRAST_FINDER_RELEASE="0.5.0" +ENV CONTRAST_FINDER_RELEASE="0.5.1" ENV PIWIK_KEY="9" ENV PIWIK_URL="http://localhost/piwik/" diff --git a/docker/compile_and_build_docker_image.sh b/docker/compile_and_build_docker_image.sh index 9fdc17d3..bddc9e59 100755 --- a/docker/compile_and_build_docker_image.sh +++ b/docker/compile_and_build_docker_image.sh @@ -124,7 +124,7 @@ fail() { ############################################# -TGZ_BASENAME="contrast-finder-webapp/target/contrast-finder" +TGZ_BASENAME="webapp/target/contrast-finder" TGZ_EXT=".tar.gz" ADD_IP='' URL="http://localhost:${CONTAINER_EXPOSED_PORT}/contrast-finder/" diff --git a/docker/pre-requisites/pre-requisites_from-Ubuntu/Dockerfile b/docker/pre-requisites/pre-requisites_from-Ubuntu/Dockerfile index 5520bc8f..f4e2f320 100644 --- a/docker/pre-requisites/pre-requisites_from-Ubuntu/Dockerfile +++ b/docker/pre-requisites/pre-requisites_from-Ubuntu/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:14.04 LABEL org.label-schema.schema-version = "1.0.0-rc.1" \ org.label-schema.name = "Contrast-Finder - WebApp pre-requisites" \ - org.label-schema.version = "0.5.0" \ + org.label-schema.version = "0.5.1" \ org.label-schema.url = "https://contrast-finder.org" \ org.label-schema.vcs-url = "https://github.com/Asqatasun/Contrast-Finder" # ----> documentation http://label-schema.org/ diff --git a/contrast-finder-api/pom.xml b/engine/api/pom.xml similarity index 90% rename from contrast-finder-api/pom.xml rename to engine/api/pom.xml index c73cc587..5cd58261 100644 --- a/contrast-finder-api/pom.xml +++ b/engine/api/pom.xml @@ -3,14 +3,14 @@ 4.0.0 org.asqatasun - contrast-finder - 0.5.0 + engine + 0.5.1 contrast-finder-api - 0.5.0 + 0.5.1 + api jar - contrast-finder-api https://contrast-finder.org Asqatasun.org diff --git a/contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/AbstractColorFinder.java b/engine/api/src/main/java/org/asqatasun/contrastfinder/AbstractColorFinder.java similarity index 88% rename from contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/AbstractColorFinder.java rename to engine/api/src/main/java/org/asqatasun/contrastfinder/AbstractColorFinder.java index a988302f..10b4871a 100644 --- a/contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/AbstractColorFinder.java +++ b/engine/api/src/main/java/org/asqatasun/contrastfinder/AbstractColorFinder.java @@ -17,15 +17,15 @@ * * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder; +package org.asqatasun.contrastfinder; import java.awt.Color; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.asqatasun.contrastFinder.result.ColorCombinaison; -import org.asqatasun.contrastFinder.result.ColorResult; -import org.asqatasun.contrastFinder.result.factory.ColorCombinaisonFactory; -import org.asqatasun.contrastFinder.result.factory.ColorResultFactory; +import org.asqatasun.contrastfinder.result.ColorCombinaison; +import org.asqatasun.contrastfinder.result.ColorResult; +import org.asqatasun.contrastfinder.result.factory.ColorCombinaisonFactory; +import org.asqatasun.contrastfinder.result.factory.ColorResultFactory; import org.asqatasun.utils.contrastchecker.ContrastChecker; /** @@ -40,31 +40,26 @@ public abstract class AbstractColorFinder implements ColorFinder { private static final float MAX_COEFFICIENT_LEVEL = 2.5f; protected static final float UNITARY_STEP_HUE = (MIN_HUE / MAX_HUE); private ColorResultFactory colorResultFactory; + private ColorCombinaisonFactory colorCombinaisonFactory; + private Color colorToKeep; /* the color to keep, will not be modified during test */ + private Float coefficientLevel; /* the coefficient level to apply*/ + private ColorResult colorResult; /* the colorResult that handles the results of the test*/ public ColorResultFactory getColorResultFactory() { return colorResultFactory; - } - - - private ColorCombinaisonFactory colorCombinaisonFactory; + } public ColorCombinaisonFactory getColorCombinaisonFactory() { return colorCombinaisonFactory; } - /* the color to keep, will not be modified during test */ - private Color colorToKeep; public Color getColorToKeep() { return colorToKeep; } - /* the coefficient level to apply*/ - private Float coefficientLevel; public Float getCoefficientLevel() { return coefficientLevel; } - /* the colorResult that handles the results of the test*/ - private ColorResult colorResult; @Override public ColorResult getColorResult() { diff --git a/contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/ColorFinder.java b/engine/api/src/main/java/org/asqatasun/contrastfinder/ColorFinder.java similarity index 93% rename from contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/ColorFinder.java rename to engine/api/src/main/java/org/asqatasun/contrastfinder/ColorFinder.java index de355ca6..ee84c993 100644 --- a/contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/ColorFinder.java +++ b/engine/api/src/main/java/org/asqatasun/contrastfinder/ColorFinder.java @@ -17,10 +17,10 @@ * * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder; +package org.asqatasun.contrastfinder; import java.awt.Color; -import org.asqatasun.contrastFinder.result.ColorResult; +import org.asqatasun.contrastfinder.result.ColorResult; /** * diff --git a/contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/factory/ColorFinderFactory.java b/engine/api/src/main/java/org/asqatasun/contrastfinder/factory/ColorFinderFactory.java similarity index 92% rename from contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/factory/ColorFinderFactory.java rename to engine/api/src/main/java/org/asqatasun/contrastfinder/factory/ColorFinderFactory.java index d7ce8315..77a8736d 100644 --- a/contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/factory/ColorFinderFactory.java +++ b/engine/api/src/main/java/org/asqatasun/contrastfinder/factory/ColorFinderFactory.java @@ -18,8 +18,8 @@ * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.factory; -import org.asqatasun.contrastFinder.ColorFinder; +package org.asqatasun.contrastfinder.factory; +import org.asqatasun.contrastfinder.ColorFinder; /** * diff --git a/contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/result/ColorCombinaison.java b/engine/api/src/main/java/org/asqatasun/contrastfinder/result/ColorCombinaison.java similarity index 98% rename from contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/result/ColorCombinaison.java rename to engine/api/src/main/java/org/asqatasun/contrastfinder/result/ColorCombinaison.java index 531d46b6..d66c3173 100644 --- a/contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/result/ColorCombinaison.java +++ b/engine/api/src/main/java/org/asqatasun/contrastfinder/result/ColorCombinaison.java @@ -18,7 +18,7 @@ * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.result; +package org.asqatasun.contrastfinder.result; import java.awt.Color; diff --git a/contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/result/ColorResult.java b/engine/api/src/main/java/org/asqatasun/contrastfinder/result/ColorResult.java similarity index 97% rename from contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/result/ColorResult.java rename to engine/api/src/main/java/org/asqatasun/contrastfinder/result/ColorResult.java index 3eceab5f..f88fa605 100644 --- a/contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/result/ColorResult.java +++ b/engine/api/src/main/java/org/asqatasun/contrastfinder/result/ColorResult.java @@ -18,7 +18,7 @@ * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.result; +package org.asqatasun.contrastfinder.result; import java.awt.Color; import java.util.Collection; diff --git a/contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/result/factory/ColorCombinaisonFactory.java b/engine/api/src/main/java/org/asqatasun/contrastfinder/result/factory/ColorCombinaisonFactory.java similarity index 90% rename from contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/result/factory/ColorCombinaisonFactory.java rename to engine/api/src/main/java/org/asqatasun/contrastfinder/result/factory/ColorCombinaisonFactory.java index dc8ba8bb..fdccff35 100644 --- a/contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/result/factory/ColorCombinaisonFactory.java +++ b/engine/api/src/main/java/org/asqatasun/contrastfinder/result/factory/ColorCombinaisonFactory.java @@ -17,10 +17,10 @@ * * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.result.factory; +package org.asqatasun.contrastfinder.result.factory; import java.awt.Color; -import org.asqatasun.contrastFinder.result.ColorCombinaison; +import org.asqatasun.contrastfinder.result.ColorCombinaison; /** * diff --git a/contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/result/factory/ColorResultFactory.java b/engine/api/src/main/java/org/asqatasun/contrastfinder/result/factory/ColorResultFactory.java similarity index 89% rename from contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/result/factory/ColorResultFactory.java rename to engine/api/src/main/java/org/asqatasun/contrastfinder/result/factory/ColorResultFactory.java index 80d558fe..febc76d7 100644 --- a/contrast-finder-api/src/main/java/org/asqatasun/contrastFinder/result/factory/ColorResultFactory.java +++ b/engine/api/src/main/java/org/asqatasun/contrastfinder/result/factory/ColorResultFactory.java @@ -18,9 +18,9 @@ * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.result.factory; +package org.asqatasun.contrastfinder.result.factory; -import org.asqatasun.contrastFinder.result.ColorResult; +import org.asqatasun.contrastfinder.result.ColorResult; /** * diff --git a/contrast-finder-api/src/test/java/org/asqatasun/contrast/finder/api/AppTest.java b/engine/api/src/test/java/org/asqatasun/contrast/finder/api/AppTest.java similarity index 100% rename from contrast-finder-api/src/test/java/org/asqatasun/contrast/finder/api/AppTest.java rename to engine/api/src/test/java/org/asqatasun/contrast/finder/api/AppTest.java diff --git a/contrast-finder-api/src/test/java/org/asqatasun/contrastFinder/AbstractColorFinderImplTest.java b/engine/api/src/test/java/org/asqatasun/contrastfinder/AbstractColorFinderImplTest.java similarity index 97% rename from contrast-finder-api/src/test/java/org/asqatasun/contrastFinder/AbstractColorFinderImplTest.java rename to engine/api/src/test/java/org/asqatasun/contrastfinder/AbstractColorFinderImplTest.java index bbf49a16..386f2598 100644 --- a/contrast-finder-api/src/test/java/org/asqatasun/contrastFinder/AbstractColorFinderImplTest.java +++ b/engine/api/src/test/java/org/asqatasun/contrastfinder/AbstractColorFinderImplTest.java @@ -2,7 +2,7 @@ * To change this template, choose Tools | Templates * and open the template in the editor. */ -package org.asqatasun.contrastFinder; +package org.asqatasun.contrastfinder; import java.awt.Color; import junit.framework.TestCase; @@ -94,7 +94,7 @@ public void testFindColorsWithInvalidContrastWithForegroundTested() { */ public class AbstractColorFinderImplImpl extends AbstractColorFinder { - boolean isFindColorsCalled = false; + private boolean isFindColorsCalled = false; public AbstractColorFinderImplImpl() { super(null, null); diff --git a/contrast-finder-hsv/pom.xml b/engine/hsv/pom.xml similarity index 94% rename from contrast-finder-hsv/pom.xml rename to engine/hsv/pom.xml index 9b7e04aa..c4c1dae7 100644 --- a/contrast-finder-hsv/pom.xml +++ b/engine/hsv/pom.xml @@ -3,14 +3,14 @@ 4.0.0 org.asqatasun - contrast-finder - 0.5.0 + engine + 0.5.1 contrast-finder-hsv - 0.5.0 + 0.5.1 + hsv jar - contrast-finder-hsv https://contrast-finder.org Asqatasun.org diff --git a/contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/factory/ColorFinderHsvFactory.java b/engine/hsv/src/main/java/org/asqatasun/contrastfinder/factory/ColorFinderHsvFactory.java similarity index 85% rename from contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/factory/ColorFinderHsvFactory.java rename to engine/hsv/src/main/java/org/asqatasun/contrastfinder/factory/ColorFinderHsvFactory.java index 237f1e11..4de3dd04 100644 --- a/contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/factory/ColorFinderHsvFactory.java +++ b/engine/hsv/src/main/java/org/asqatasun/contrastfinder/factory/ColorFinderHsvFactory.java @@ -18,12 +18,12 @@ * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.factory; +package org.asqatasun.contrastfinder.factory; import org.apache.commons.lang3.StringUtils; -import org.asqatasun.contrastFinder.hsv.ColorFinderHsv; -import org.asqatasun.contrastFinder.hsv.ColorFinderRgb; -import org.asqatasun.contrastFinder.ColorFinder; +import org.asqatasun.contrastfinder.hsv.ColorFinderHsv; +import org.asqatasun.contrastfinder.hsv.ColorFinderRgb; +import org.asqatasun.contrastfinder.ColorFinder; /** * diff --git a/contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/factory/ColorFinderHsvPsychoFactory.java b/engine/hsv/src/main/java/org/asqatasun/contrastfinder/factory/ColorFinderHsvPsychoFactory.java similarity index 94% rename from contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/factory/ColorFinderHsvPsychoFactory.java rename to engine/hsv/src/main/java/org/asqatasun/contrastfinder/factory/ColorFinderHsvPsychoFactory.java index 3a9aade8..907473d0 100644 --- a/contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/factory/ColorFinderHsvPsychoFactory.java +++ b/engine/hsv/src/main/java/org/asqatasun/contrastfinder/factory/ColorFinderHsvPsychoFactory.java @@ -18,11 +18,11 @@ * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.factory; +package org.asqatasun.contrastfinder.factory; import org.apache.commons.lang3.StringUtils; -import org.asqatasun.contrastFinder.hsv.ColorFinderHsvPsycho; -import org.asqatasun.contrastFinder.ColorFinder; +import org.asqatasun.contrastfinder.hsv.ColorFinderHsvPsycho; +import org.asqatasun.contrastfinder.ColorFinder; /** * diff --git a/contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/factory/ColorFinderRgbFactory.java b/engine/hsv/src/main/java/org/asqatasun/contrastfinder/factory/ColorFinderRgbFactory.java similarity index 92% rename from contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/factory/ColorFinderRgbFactory.java rename to engine/hsv/src/main/java/org/asqatasun/contrastfinder/factory/ColorFinderRgbFactory.java index bb141e89..a66699a5 100644 --- a/contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/factory/ColorFinderRgbFactory.java +++ b/engine/hsv/src/main/java/org/asqatasun/contrastfinder/factory/ColorFinderRgbFactory.java @@ -18,13 +18,13 @@ * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.factory; +package org.asqatasun.contrastfinder.factory; -import org.asqatasun.contrastFinder.hsv.Boundary; +import org.asqatasun.contrastfinder.hsv.Boundary; import java.util.Map; import org.apache.commons.lang3.StringUtils; -import org.asqatasun.contrastFinder.hsv.ColorFinderRgb; -import org.asqatasun.contrastFinder.ColorFinder; +import org.asqatasun.contrastfinder.hsv.ColorFinderRgb; +import org.asqatasun.contrastfinder.ColorFinder; /** * diff --git a/contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/hsv/Boundary.java b/engine/hsv/src/main/java/org/asqatasun/contrastfinder/hsv/Boundary.java similarity index 97% rename from contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/hsv/Boundary.java rename to engine/hsv/src/main/java/org/asqatasun/contrastfinder/hsv/Boundary.java index 80a488db..988f3e36 100644 --- a/contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/hsv/Boundary.java +++ b/engine/hsv/src/main/java/org/asqatasun/contrastfinder/hsv/Boundary.java @@ -17,7 +17,7 @@ * * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.hsv; +package org.asqatasun.contrastfinder.hsv; /** * @@ -26,6 +26,7 @@ public class Boundary { private Float minValue; + private Float maxValue; public Float getMinValue() { return minValue; @@ -34,7 +35,7 @@ public Float getMinValue() { public Float getMaxValue() { return maxValue; } - private Float maxValue; + /** * diff --git a/contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/hsv/ColorFinderHsv.java b/engine/hsv/src/main/java/org/asqatasun/contrastfinder/hsv/ColorFinderHsv.java similarity index 97% rename from contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/hsv/ColorFinderHsv.java rename to engine/hsv/src/main/java/org/asqatasun/contrastfinder/hsv/ColorFinderHsv.java index dad5af84..22b27a67 100644 --- a/contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/hsv/ColorFinderHsv.java +++ b/engine/hsv/src/main/java/org/asqatasun/contrastfinder/hsv/ColorFinderHsv.java @@ -17,16 +17,16 @@ * * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.hsv; +package org.asqatasun.contrastfinder.hsv; import java.awt.Color; import java.util.Collection; import java.util.HashSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.asqatasun.contrastFinder.AbstractColorFinder; -import org.asqatasun.contrastFinder.result.factory.ColorCombinaisonFactoryImpl; -import org.asqatasun.contrastFinder.result.factory.ColorResultFactoryImpl; +import org.asqatasun.contrastfinder.AbstractColorFinder; +import org.asqatasun.contrastfinder.result.factory.ColorCombinaisonFactoryImpl; +import org.asqatasun.contrastfinder.result.factory.ColorResultFactoryImpl; import org.asqatasun.utils.colorconvertor.ColorConverter; import org.asqatasun.utils.contrastchecker.ContrastChecker; diff --git a/contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/hsv/ColorFinderHsvPsycho.java b/engine/hsv/src/main/java/org/asqatasun/contrastfinder/hsv/ColorFinderHsvPsycho.java similarity index 97% rename from contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/hsv/ColorFinderHsvPsycho.java rename to engine/hsv/src/main/java/org/asqatasun/contrastfinder/hsv/ColorFinderHsvPsycho.java index 42044940..f2340849 100644 --- a/contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/hsv/ColorFinderHsvPsycho.java +++ b/engine/hsv/src/main/java/org/asqatasun/contrastfinder/hsv/ColorFinderHsvPsycho.java @@ -17,15 +17,15 @@ * * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.hsv; +package org.asqatasun.contrastfinder.hsv; import java.awt.Color; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.asqatasun.contrastFinder.AbstractColorFinder; -import org.asqatasun.contrastFinder.result.ColorCombinaison; -import org.asqatasun.contrastFinder.result.factory.ColorCombinaisonFactoryImpl; -import org.asqatasun.contrastFinder.result.factory.ColorResultFactoryImpl; +import org.asqatasun.contrastfinder.AbstractColorFinder; +import org.asqatasun.contrastfinder.result.ColorCombinaison; +import org.asqatasun.contrastfinder.result.factory.ColorCombinaisonFactoryImpl; +import org.asqatasun.contrastfinder.result.factory.ColorResultFactoryImpl; import org.asqatasun.utils.colorconvertor.ColorConverter; /** diff --git a/contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/hsv/ColorFinderRgb.java b/engine/hsv/src/main/java/org/asqatasun/contrastfinder/hsv/ColorFinderRgb.java similarity index 96% rename from contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/hsv/ColorFinderRgb.java rename to engine/hsv/src/main/java/org/asqatasun/contrastfinder/hsv/ColorFinderRgb.java index eefd508b..1bcab91a 100644 --- a/contrast-finder-hsv/src/main/java/org/asqatasun/contrastFinder/hsv/ColorFinderRgb.java +++ b/engine/hsv/src/main/java/org/asqatasun/contrastfinder/hsv/ColorFinderRgb.java @@ -17,16 +17,16 @@ * * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.hsv; +package org.asqatasun.contrastfinder.hsv; import java.awt.Color; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.asqatasun.contrastFinder.AbstractColorFinder; -import org.asqatasun.contrastFinder.result.ColorCombinaison; -import org.asqatasun.contrastFinder.result.factory.ColorCombinaisonFactoryImpl; -import org.asqatasun.contrastFinder.result.factory.ColorResultFactoryImpl; +import org.asqatasun.contrastfinder.AbstractColorFinder; +import org.asqatasun.contrastfinder.result.ColorCombinaison; +import org.asqatasun.contrastfinder.result.factory.ColorCombinaisonFactoryImpl; +import org.asqatasun.contrastfinder.result.factory.ColorResultFactoryImpl; import org.asqatasun.utils.colorconvertor.ColorConverter; /** diff --git a/contrast-finder-hsv/src/test/java/org/asqatasun/contrastFinder/hsv/ColorFinderHsvPsychoTest.java b/engine/hsv/src/test/java/org/asqatasun/contrastfinder/hsv/ColorFinderHsvPsychoTest.java similarity index 97% rename from contrast-finder-hsv/src/test/java/org/asqatasun/contrastFinder/hsv/ColorFinderHsvPsychoTest.java rename to engine/hsv/src/test/java/org/asqatasun/contrastfinder/hsv/ColorFinderHsvPsychoTest.java index b57f7939..60bf45a5 100644 --- a/contrast-finder-hsv/src/test/java/org/asqatasun/contrastFinder/hsv/ColorFinderHsvPsychoTest.java +++ b/engine/hsv/src/test/java/org/asqatasun/contrastfinder/hsv/ColorFinderHsvPsychoTest.java @@ -2,7 +2,7 @@ * To change this template, choose Tools | Templates * and open the template in the editor. */ -package org.asqatasun.contrastFinder.hsv; +package org.asqatasun.contrastfinder.hsv; import java.awt.Color; import java.util.ArrayList; @@ -11,7 +11,7 @@ import junit.framework.TestCase; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.asqatasun.contrastFinder.result.ColorCombinaison; +import org.asqatasun.contrastfinder.result.ColorCombinaison; import org.asqatasun.utils.colorconvertor.ColorConverter; /** diff --git a/contrast-finder-hsv/src/test/java/org/asqatasun/contrastFinder/hsv/ColorFinderHsvTest.java b/engine/hsv/src/test/java/org/asqatasun/contrastfinder/hsv/ColorFinderHsvTest.java similarity index 99% rename from contrast-finder-hsv/src/test/java/org/asqatasun/contrastFinder/hsv/ColorFinderHsvTest.java rename to engine/hsv/src/test/java/org/asqatasun/contrastfinder/hsv/ColorFinderHsvTest.java index 666413ba..8e39ffd6 100644 --- a/contrast-finder-hsv/src/test/java/org/asqatasun/contrastFinder/hsv/ColorFinderHsvTest.java +++ b/engine/hsv/src/test/java/org/asqatasun/contrastfinder/hsv/ColorFinderHsvTest.java @@ -17,7 +17,7 @@ * * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.hsv; +package org.asqatasun.contrastfinder.hsv; import java.awt.Color; import java.util.ArrayList; @@ -26,7 +26,7 @@ import junit.framework.TestCase; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.asqatasun.contrastFinder.result.ColorCombinaison; +import org.asqatasun.contrastfinder.result.ColorCombinaison; /** * diff --git a/contrast-finder-hsv/src/test/java/org/asqatasun/contrastFinder/hsv/ColorFinderRgbTest.java b/engine/hsv/src/test/java/org/asqatasun/contrastfinder/hsv/ColorFinderRgbTest.java similarity index 94% rename from contrast-finder-hsv/src/test/java/org/asqatasun/contrastFinder/hsv/ColorFinderRgbTest.java rename to engine/hsv/src/test/java/org/asqatasun/contrastfinder/hsv/ColorFinderRgbTest.java index e5f6dc35..47e40e8f 100644 --- a/contrast-finder-hsv/src/test/java/org/asqatasun/contrastFinder/hsv/ColorFinderRgbTest.java +++ b/engine/hsv/src/test/java/org/asqatasun/contrastfinder/hsv/ColorFinderRgbTest.java @@ -2,7 +2,7 @@ * To change this template, choose Tools | Templates * and open the template in the editor. */ -package org.asqatasun.contrastFinder.hsv; +package org.asqatasun.contrastfinder.hsv; import java.awt.Color; import java.util.ArrayList; @@ -10,7 +10,7 @@ import junit.framework.TestCase; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.asqatasun.contrastFinder.result.ColorCombinaison; +import org.asqatasun.contrastfinder.result.ColorCombinaison; /** * diff --git a/contrast-finder-hsv/src/test/resources/logback.xml b/engine/hsv/src/test/resources/logback.xml similarity index 100% rename from contrast-finder-hsv/src/test/resources/logback.xml rename to engine/hsv/src/test/resources/logback.xml diff --git a/contrast-finder-impl/pom.xml b/engine/impl/pom.xml similarity index 88% rename from contrast-finder-impl/pom.xml rename to engine/impl/pom.xml index 9ed6ec08..336f699e 100644 --- a/contrast-finder-impl/pom.xml +++ b/engine/impl/pom.xml @@ -3,14 +3,15 @@ 4.0.0 org.asqatasun - contrast-finder - 0.5.0 + engine + 0.5.1 contrast-finder-impl - 0.5.0 + 0.5.1 + impl jar - contrast-finder-impl + https://contrast-finder.org Asqatasun.org diff --git a/contrast-finder-impl/src/main/java/org/asqatasun/contrastFinder/factory/ColorFinderFactoryImpl.java b/engine/impl/src/main/java/org/asqatasun/contrastfinder/factory/ColorFinderFactoryImpl.java similarity index 94% rename from contrast-finder-impl/src/main/java/org/asqatasun/contrastFinder/factory/ColorFinderFactoryImpl.java rename to engine/impl/src/main/java/org/asqatasun/contrastfinder/factory/ColorFinderFactoryImpl.java index 806f62e6..e23f2f3c 100644 --- a/contrast-finder-impl/src/main/java/org/asqatasun/contrastFinder/factory/ColorFinderFactoryImpl.java +++ b/engine/impl/src/main/java/org/asqatasun/contrastfinder/factory/ColorFinderFactoryImpl.java @@ -18,11 +18,11 @@ * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.factory; +package org.asqatasun.contrastfinder.factory; import java.util.HashMap; import java.util.Map; -import org.asqatasun.contrastFinder.ColorFinder; +import org.asqatasun.contrastfinder.ColorFinder; /** * diff --git a/contrast-finder-impl/src/main/java/org/asqatasun/contrastFinder/result/ColorCombinaisonImpl.java b/engine/impl/src/main/java/org/asqatasun/contrastfinder/result/ColorCombinaisonImpl.java similarity index 99% rename from contrast-finder-impl/src/main/java/org/asqatasun/contrastFinder/result/ColorCombinaisonImpl.java rename to engine/impl/src/main/java/org/asqatasun/contrastfinder/result/ColorCombinaisonImpl.java index acfd4882..abec506d 100644 --- a/contrast-finder-impl/src/main/java/org/asqatasun/contrastFinder/result/ColorCombinaisonImpl.java +++ b/engine/impl/src/main/java/org/asqatasun/contrastfinder/result/ColorCombinaisonImpl.java @@ -17,7 +17,7 @@ * * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.result; +package org.asqatasun.contrastfinder.result; import java.awt.Color; import org.asqatasun.utils.colorconvertor.ColorConverter; diff --git a/contrast-finder-impl/src/main/java/org/asqatasun/contrastFinder/result/ColorResultImpl.java b/engine/impl/src/main/java/org/asqatasun/contrastfinder/result/ColorResultImpl.java similarity index 96% rename from contrast-finder-impl/src/main/java/org/asqatasun/contrastFinder/result/ColorResultImpl.java rename to engine/impl/src/main/java/org/asqatasun/contrastfinder/result/ColorResultImpl.java index bc23becd..4d61fda3 100644 --- a/contrast-finder-impl/src/main/java/org/asqatasun/contrastFinder/result/ColorResultImpl.java +++ b/engine/impl/src/main/java/org/asqatasun/contrastfinder/result/ColorResultImpl.java @@ -17,13 +17,13 @@ * * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.result; +package org.asqatasun.contrastfinder.result; import java.awt.Color; import java.util.Collection; import java.util.LinkedHashSet; import java.util.Set; -import org.asqatasun.contrastFinder.result.factory.ColorCombinaisonFactory; +import org.asqatasun.contrastfinder.result.factory.ColorCombinaisonFactory; import org.asqatasun.utils.distancecalculator.DistanceCalculator; /** diff --git a/contrast-finder-impl/src/main/java/org/asqatasun/contrastFinder/result/factory/ColorCombinaisonFactoryImpl.java b/engine/impl/src/main/java/org/asqatasun/contrastfinder/result/factory/ColorCombinaisonFactoryImpl.java similarity index 86% rename from contrast-finder-impl/src/main/java/org/asqatasun/contrastFinder/result/factory/ColorCombinaisonFactoryImpl.java rename to engine/impl/src/main/java/org/asqatasun/contrastfinder/result/factory/ColorCombinaisonFactoryImpl.java index 5ad69a8c..5e90fbea 100644 --- a/contrast-finder-impl/src/main/java/org/asqatasun/contrastFinder/result/factory/ColorCombinaisonFactoryImpl.java +++ b/engine/impl/src/main/java/org/asqatasun/contrastfinder/result/factory/ColorCombinaisonFactoryImpl.java @@ -18,11 +18,11 @@ * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.result.factory; +package org.asqatasun.contrastfinder.result.factory; import java.awt.Color; -import org.asqatasun.contrastFinder.result.ColorCombinaison; -import org.asqatasun.contrastFinder.result.ColorCombinaisonImpl; +import org.asqatasun.contrastfinder.result.ColorCombinaison; +import org.asqatasun.contrastfinder.result.ColorCombinaisonImpl; /** * diff --git a/contrast-finder-impl/src/main/java/org/asqatasun/contrastFinder/result/factory/ColorResultFactoryImpl.java b/engine/impl/src/main/java/org/asqatasun/contrastfinder/result/factory/ColorResultFactoryImpl.java similarity index 86% rename from contrast-finder-impl/src/main/java/org/asqatasun/contrastFinder/result/factory/ColorResultFactoryImpl.java rename to engine/impl/src/main/java/org/asqatasun/contrastfinder/result/factory/ColorResultFactoryImpl.java index 8212ff15..bb735a90 100644 --- a/contrast-finder-impl/src/main/java/org/asqatasun/contrastFinder/result/factory/ColorResultFactoryImpl.java +++ b/engine/impl/src/main/java/org/asqatasun/contrastfinder/result/factory/ColorResultFactoryImpl.java @@ -18,10 +18,10 @@ * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.result.factory; +package org.asqatasun.contrastfinder.result.factory; -import org.asqatasun.contrastFinder.result.ColorResult; -import org.asqatasun.contrastFinder.result.ColorResultImpl; +import org.asqatasun.contrastfinder.result.ColorResult; +import org.asqatasun.contrastfinder.result.ColorResultImpl; /** * diff --git a/contrast-finder-impl/src/test/java/org/asqatasun/color/result/impl/AppTest.java b/engine/impl/src/test/java/org/asqatasun/color/result/impl/AppTest.java similarity index 100% rename from contrast-finder-impl/src/test/java/org/asqatasun/color/result/impl/AppTest.java rename to engine/impl/src/test/java/org/asqatasun/color/result/impl/AppTest.java diff --git a/engine/pom.xml b/engine/pom.xml new file mode 100644 index 00000000..9f069b78 --- /dev/null +++ b/engine/pom.xml @@ -0,0 +1,34 @@ + + + 4.0.0 + + org.asqatasun + contrast-finder + 0.5.1 + + engine + 0.5.1 + pom + + contrast-finder-engine + https://contrast-finder.org + + Asqatasun.org + http://asqatasun.org + + + + GNU Affero General Public License v3.0 + https://www.gnu.org/licenses/agpl-3.0.txt + manual + + + + + + api + utils + hsv + impl + + diff --git a/contrast-finder-utils/pom.xml b/engine/utils/pom.xml similarity index 91% rename from contrast-finder-utils/pom.xml rename to engine/utils/pom.xml index 3848b6fb..80f35861 100644 --- a/contrast-finder-utils/pom.xml +++ b/engine/utils/pom.xml @@ -3,14 +3,14 @@ 4.0.0 org.asqatasun - contrast-finder - 0.5.0 + engine + 0.5.1 contrast-finder-utils - 0.5.0 + 0.5.1 + utils jar - contrast-finder-utils https://contrast-finder.org Asqatasun.org diff --git a/contrast-finder-utils/src/main/java/org/asqatasun/utils/colorconvertor/ColorConverter.java b/engine/utils/src/main/java/org/asqatasun/utils/colorconvertor/ColorConverter.java similarity index 87% rename from contrast-finder-utils/src/main/java/org/asqatasun/utils/colorconvertor/ColorConverter.java rename to engine/utils/src/main/java/org/asqatasun/utils/colorconvertor/ColorConverter.java index 9b59f215..603a5e7a 100644 --- a/contrast-finder-utils/src/main/java/org/asqatasun/utils/colorconvertor/ColorConverter.java +++ b/engine/utils/src/main/java/org/asqatasun/utils/colorconvertor/ColorConverter.java @@ -40,10 +40,14 @@ public final class ColorConverter { private static final int MAX_ANGLE = 360; private static final int RGB_MIN = 0; private static final int RGB_MAX = 255; + private static final int CONSTANT_SL_COMPONENTS_HUNDRED = 100; + private static final int CONSTANT_S_COMPONENTS_TWO_HUNDRED = 200; + private static final int CONSTANT_SL_COMPONENTS_TWO = 2; + private static final int CONSTANT_S_COMPONENTS_FIFTY = 50; private static final String HEXADECIMAL_DICTIONNARY = "[0-9A-Fa-f]+"; // FFF, FFFFFF private static final String HEXADECIMAL_DICTIONNARY_V2 = "^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"; // #FFF, #FFFFFF, FFF, FFFFFF (but not FF or FFFF) - private static final String SHORT_RGB_DICTIONNARY = "^[0-9]{1,3},[0-9]{1,3},[0-9]{1,3}$"; // ex: 255,255,255 - private static final String RGB_DICTIONNARY = "^rgb\\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3}\\)$"; // ex: rgb(255,255,255) + private static final String SHORT_RGB_DICTIONNARY = "^[0-9]{1,3},[0-9]{1,3},[0-9]{1,3}$"; // ex: "255,255,255" + private static final String RGB_DICTIONNARY = "^rgb\\([0-9]{1,3},[0-9]{1,3},[0-9]{1,3}\\)?$"; // ex: "rgb(255,255,255)" and "rgb(255,255,255" /** * Private constructor, utility class @@ -61,7 +65,9 @@ private ColorConverter() { */ public static Color offsetHsbColor(Color color, float offsetHue, float offsetSaturation, float offsetBrightness) { float[] hsbValues = new float[MAX_COMPONENT]; - Float hue, saturation, brightness; + Float brightness; + Float saturation; + Float hue; Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsbValues); @@ -125,26 +131,30 @@ public static Color offsetRgbColor(Color bgColor, int offsetRed, int offsetGreen */ public static String formatColorStr(String colorStr) { String str = colorStr.replaceAll("\\s", ""); // replace ' ', \t, \n, ... - if (str.toLowerCase().matches(RGB_DICTIONNARY)){ // ex: rgb(255,255,255) - colorStr = str.toLowerCase(); + if (str.toLowerCase().matches(RGB_DICTIONNARY)){ // ex: "rgb(255,255,255)" and "rgb(255,255,255" + str = str.toLowerCase(); + if(!str.endsWith(")")){ + str = str + ")"; + } } - else if(str.matches(SHORT_RGB_DICTIONNARY)){ // ex: 255,255,255 - colorStr = "rgb(" + str + ")"; + else if(str.matches(SHORT_RGB_DICTIONNARY)){ // ex: "255,255,255" + str = "rgb(" + str + ")"; } else if(str.matches(HEXADECIMAL_DICTIONNARY_V2)) { if (str.charAt(0) != '#') { str = "#" + str; } - colorStr = str.toUpperCase(); + str = str.toUpperCase(); } else { ColorNameLookup c = new ColorNameLookup(); - String name = c.getColorNameFromStr(str); - if(name != ""){ - colorStr = name; + String name = c.getColorNameFromStr(str); + String empty = ""; + if(!name.equals(empty)){ + str = name; } } - return colorStr; + return str; } @@ -169,9 +179,9 @@ public static Color colorFromStr(String colorStr) { * @return Color object or NULL */ public static Color colorFromColorName(String colorStr) { - colorStr = colorStr.replaceAll("\\s", ""); // replace ' ', \t, \n, ... + String str = colorStr.replaceAll("\\s", ""); // replace ' ', \t, \n, ... ColorNameLookup c = new ColorNameLookup(); - return c.getColorFromName(colorStr); + return c.getColorFromName(str); } @@ -181,11 +191,11 @@ public static Color colorFromColorName(String colorStr) { */ public static Color colorFromRgbStr(String colorStr) { Color color = null; - colorStr = colorStr.toLowerCase().replaceAll("\\s", ""); // replace ' ', \t, \n, ... - if (colorStr.matches(RGB_DICTIONNARY) | colorStr.matches(SHORT_RGB_DICTIONNARY)){ // ex: rgb(255,255,255) or 255,255,255 - colorStr = colorStr.replaceAll("rgb\\(",""); - colorStr = colorStr.replaceAll("\\)",""); - String[] strList = colorStr.split(","); + String str = colorStr.toLowerCase().replaceAll("\\s", ""); // replace ' ', \t, \n, ... + if (str.matches(RGB_DICTIONNARY) | str.matches(SHORT_RGB_DICTIONNARY)){ // ex: rgb(255,255,255) or 255,255,255 + str = str.replaceAll("rgb\\(",""); + str = str.replaceAll("\\)",""); + String[] strList = str.split(","); int r = Integer.parseInt(strList[0]); int g = Integer.parseInt(strList[1]); int b = Integer.parseInt(strList[2]); @@ -264,11 +274,6 @@ public static String rgb2Hex(Color color) { return (String.format("#%02x%02x%02x", color.getRed(), color.getGreen(), color.getBlue())).toUpperCase(); } - - private static final int CONSTANT_SL_COMPONENTS_HUNDRED = 100; - private static final int CONSTANT_S_COMPONENTS_TWO_HUNDRED = 200; - private static final int CONSTANT_SL_COMPONENTS_TWO = 2; - private static final int CONSTANT_S_COMPONENTS_FIFTY = 50; /** * @param color diff --git a/contrast-finder-utils/src/main/java/org/asqatasun/utils/colornamelookup/ColorNameLookup.java b/engine/utils/src/main/java/org/asqatasun/utils/colornamelookup/ColorNameLookup.java similarity index 94% rename from contrast-finder-utils/src/main/java/org/asqatasun/utils/colornamelookup/ColorNameLookup.java rename to engine/utils/src/main/java/org/asqatasun/utils/colornamelookup/ColorNameLookup.java index 03c4faf6..9287a5c2 100644 --- a/contrast-finder-utils/src/main/java/org/asqatasun/utils/colornamelookup/ColorNameLookup.java +++ b/engine/utils/src/main/java/org/asqatasun/utils/colornamelookup/ColorNameLookup.java @@ -34,10 +34,10 @@ public ColorNameLookup() { * @return empty or color name width correct case (ex: Silver, DarkMagenta, Silver, ...) */ public String getColorNameFromStr(String colorStr) { - colorStr = colorStr.trim(); + String str = colorStr.trim(); for (ColorName c : colorList) { String name = c.getName(); // .toLowerCase() - if ( name.equalsIgnoreCase(colorStr)) { + if ( name.equalsIgnoreCase(str)) { return name; } } @@ -49,19 +49,19 @@ public String getColorNameFromStr(String colorStr) { * @return Color object or NULL */ public Color getColorFromName(String colorStr) { - colorStr = colorStr.trim(); + String str = colorStr.trim(); for (ColorName c : colorList) { String name = c.getName(); - if ( name.equalsIgnoreCase(colorStr)) { + if ( name.equalsIgnoreCase(str)) { return new Color(c.getRed(), c.getGreen(), c.getBlue()); } } return null; } + /** * Initialize the color list - * @@@TODO missing some alias (ex: grey = gray, ...) = 10 alis missing * https://developer.mozilla.org/fr/docs/Web/CSS/Type_color * https://www.w3schools.com/colors/colors_names.asp * http://htmlcolorcodes.com/fr/noms-de-couleur/ @@ -93,6 +93,7 @@ private ArrayList initColorList() { colors.add( new ColorName("DarkCyan",0x00,0x8B,0x8B)); colors.add( new ColorName("DarkGoldenRod",0xB8,0x86,0x0B)); colors.add( new ColorName("DarkGray",0xA9,0xA9,0xA9)); + colors.add( new ColorName("DarkGrey",0xA9,0xA9,0xA9)); colors.add( new ColorName("DarkGreen",0x00,0x64,0x00)); colors.add( new ColorName("DarkKhaki",0xBD,0xB7,0x6B)); colors.add( new ColorName("DarkMagenta",0x8B,0x00,0x8B)); @@ -104,11 +105,13 @@ private ArrayList initColorList() { colors.add( new ColorName("DarkSeaGreen",0x8F,0xBC,0x8F)); colors.add( new ColorName("DarkSlateBlue",0x48,0x3D,0x8B)); colors.add( new ColorName("DarkSlateGray",0x2F,0x4F,0x4F)); + colors.add( new ColorName("DarkSlateGrey",0x2F,0x4F,0x4F)); colors.add( new ColorName("DarkTurquoise",0x00,0xCE,0xD1)); colors.add( new ColorName("DarkViolet",0x94,0x00,0xD3)); colors.add( new ColorName("DeepPink",0xFF,0x14,0x93)); colors.add( new ColorName("DeepSkyBlue",0x00,0xBF,0xFF)); colors.add( new ColorName("DimGray",0x69,0x69,0x69)); + colors.add( new ColorName("DimGrey",0x69,0x69,0x69)); colors.add( new ColorName("DodgerBlue",0x1E,0x90,0xFF)); colors.add( new ColorName("FireBrick",0xB2,0x22,0x22)); colors.add( new ColorName("FloralWhite",0xFF,0xFA,0xF0)); @@ -119,6 +122,7 @@ private ArrayList initColorList() { colors.add( new ColorName("Gold",0xFF,0xD7,0x00)); colors.add( new ColorName("GoldenRod",0xDA,0xA5,0x20)); colors.add( new ColorName("Gray",0x80,0x80,0x80)); + colors.add( new ColorName("Grey",0x80,0x80,0x80)); colors.add( new ColorName("Green",0x00,0x80,0x00)); colors.add( new ColorName("GreenYellow",0xAD,0xFF,0x2F)); colors.add( new ColorName("HoneyDew",0xF0,0xFF,0xF0)); @@ -136,12 +140,14 @@ private ArrayList initColorList() { colors.add( new ColorName("LightCyan",0xE0,0xFF,0xFF)); colors.add( new ColorName("LightGoldenRodYellow",0xFA,0xFA,0xD2)); colors.add( new ColorName("LightGray",0xD3,0xD3,0xD3)); + colors.add( new ColorName("LightGrey",0xD3,0xD3,0xD3)); colors.add( new ColorName("LightGreen",0x90,0xEE,0x90)); colors.add( new ColorName("LightPink",0xFF,0xB6,0xC1)); colors.add( new ColorName("LightSalmon",0xFF,0xA0,0x7A)); colors.add( new ColorName("LightSeaGreen",0x20,0xB2,0xAA)); colors.add( new ColorName("LightSkyBlue",0x87,0xCE,0xFA)); colors.add( new ColorName("LightSlateGray",0x77,0x88,0x99)); + colors.add( new ColorName("LightSlateGrey",0x77,0x88,0x99)); colors.add( new ColorName("LightSteelBlue",0xB0,0xC4,0xDE)); colors.add( new ColorName("LightYellow",0xFF,0xFF,0xE0)); colors.add( new ColorName("Lime",0x00,0xFF,0x00)); @@ -194,6 +200,7 @@ private ArrayList initColorList() { colors.add( new ColorName("SkyBlue",0x87,0xCE,0xEB)); colors.add( new ColorName("SlateBlue",0x6A,0x5A,0xCD)); colors.add( new ColorName("SlateGray",0x70,0x80,0x90)); + colors.add( new ColorName("SlateGrey",0x70,0x80,0x90)); colors.add( new ColorName("Snow",0xFF,0xFA,0xFA)); colors.add( new ColorName("SpringGreen",0x00,0xFF,0x7F)); colors.add( new ColorName("SteelBlue",0x46,0x82,0xB4)); @@ -208,6 +215,7 @@ private ArrayList initColorList() { colors.add( new ColorName("WhiteSmoke",0xF5,0xF5,0xF5)); colors.add( new ColorName("Yellow",0xFF,0xFF,0x00)); colors.add( new ColorName("YellowGreen",0x9A,0xCD,0x32)); + colors.add( new ColorName("RebeccaPurple",0x66,0x33,0x99)); // CCS 4 #663399 return colors; } diff --git a/contrast-finder-utils/src/main/java/org/asqatasun/utils/contrastchecker/ContrastChecker.java b/engine/utils/src/main/java/org/asqatasun/utils/contrastchecker/ContrastChecker.java similarity index 100% rename from contrast-finder-utils/src/main/java/org/asqatasun/utils/contrastchecker/ContrastChecker.java rename to engine/utils/src/main/java/org/asqatasun/utils/contrastchecker/ContrastChecker.java diff --git a/contrast-finder-utils/src/main/java/org/asqatasun/utils/distancecalculator/DistanceCalculator.java b/engine/utils/src/main/java/org/asqatasun/utils/distancecalculator/DistanceCalculator.java similarity index 100% rename from contrast-finder-utils/src/main/java/org/asqatasun/utils/distancecalculator/DistanceCalculator.java rename to engine/utils/src/main/java/org/asqatasun/utils/distancecalculator/DistanceCalculator.java diff --git a/contrast-finder-utils/src/test/java/org/asqatasun/utils/colorconvertor/ColorConverterTest.java b/engine/utils/src/test/java/org/asqatasun/utils/colorconvertor/ColorConverterTest.java similarity index 94% rename from contrast-finder-utils/src/test/java/org/asqatasun/utils/colorconvertor/ColorConverterTest.java rename to engine/utils/src/test/java/org/asqatasun/utils/colorconvertor/ColorConverterTest.java index e64de066..9da65e68 100644 --- a/contrast-finder-utils/src/test/java/org/asqatasun/utils/colorconvertor/ColorConverterTest.java +++ b/engine/utils/src/test/java/org/asqatasun/utils/colorconvertor/ColorConverterTest.java @@ -142,9 +142,22 @@ public void testGetHue() { // formatColor() ///////////////////////////////////////////////////////////////////// + public void testFormatColorRgbLastParenthesisIsMissing() { + String expResult = "rgb(255,255,255)"; + String colorStr = "rgb(255,255,255"; // # must be added + System.out.println("formatColorRgblastParenthesisIsMissing ["+ colorStr +"]"); + String result = ColorConverter.formatColorStr(colorStr); + assertEquals(expResult, result); + + colorStr = " rgb( 255, 255, 255 "; // # must be added + System.out.println("formatColorRgblastParenthesisIsMissing ["+ colorStr +"]"); + result = ColorConverter.formatColorStr(colorStr); + assertEquals(expResult, result); + } + public void testFormatColorRgbToLowerCase() { System.out.println("formatColorRgbToLowerCase [RGB(255,255,255)]"); - String colorStr = "RGB(255,255,255)"; // # must be added + String colorStr = "RGB(255,255,255)"; String expResult = "rgb(255,255,255)"; String result = ColorConverter.formatColorStr(colorStr); assertEquals(expResult, result); @@ -152,7 +165,7 @@ public void testFormatColorRgbToLowerCase() { public void testFormatColorRgb() { System.out.println("formatColorRgb [ rgb( 255, 255, 255 ) ]"); - String colorStr = " rgb( 255, 255, 255 ) "; // # must be added + String colorStr = " rgb( 255, 255, 255 ) "; String expResult = "rgb(255,255,255)"; String result = ColorConverter.formatColorStr(colorStr); assertEquals(expResult, result); @@ -162,7 +175,7 @@ public void testFormatColorRgb() { public void testFormatColorRgbShortWidthSpace() { System.out.println("formatColorRgbShortWidthSpace [ 255, 255, 255 ]"); - String colorStr = " 255, 255, 255 "; // # must be added + String colorStr = " 255, 255, 255 "; String expResult = "rgb(255,255,255)"; String result = ColorConverter.formatColorStr(colorStr); assertEquals(expResult, result); @@ -170,7 +183,7 @@ public void testFormatColorRgbShortWidthSpace() { public void testFormatColorRgbShort() { System.out.println("formatColorRgbShort [255,255,255]"); - String colorStr = "255,255,255"; // # must be added + String colorStr = "255,255,255"; String expResult = "rgb(255,255,255)"; String result = ColorConverter.formatColorStr(colorStr); assertEquals(expResult, result); diff --git a/contrast-finder-utils/src/test/java/org/asqatasun/utils/colornamelookup/ColorNameLookupTest.java b/engine/utils/src/test/java/org/asqatasun/utils/colornamelookup/ColorNameLookupTest.java similarity index 100% rename from contrast-finder-utils/src/test/java/org/asqatasun/utils/colornamelookup/ColorNameLookupTest.java rename to engine/utils/src/test/java/org/asqatasun/utils/colornamelookup/ColorNameLookupTest.java diff --git a/contrast-finder-utils/src/test/java/org/asqatasun/utils/contrastchecker/ContrastCheckerTest.java b/engine/utils/src/test/java/org/asqatasun/utils/contrastchecker/ContrastCheckerTest.java similarity index 100% rename from contrast-finder-utils/src/test/java/org/asqatasun/utils/contrastchecker/ContrastCheckerTest.java rename to engine/utils/src/test/java/org/asqatasun/utils/contrastchecker/ContrastCheckerTest.java diff --git a/pom.xml b/pom.xml index e4689251..f01ec941 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.asqatasun contrast-finder pom - 0.5.0 + 0.5.1 Contrast-Finder https://contrast-finder.org @@ -28,12 +28,8 @@ the minimum version of Maven for maven plugins ............ mvn versions:display-plugin-updates --> - contrast-finder-api - contrast-finder-utils - contrast-finder-hsv - contrast-finder-impl - contrast-finder-webapp - contrast-finder-resources + engine + webapp UTF-8 diff --git a/contrast-finder-webapp/pom.xml b/webapp/pom.xml similarity index 97% rename from contrast-finder-webapp/pom.xml rename to webapp/pom.xml index d3946d1e..e3aa0b34 100644 --- a/contrast-finder-webapp/pom.xml +++ b/webapp/pom.xml @@ -4,10 +4,10 @@ org.asqatasun contrast-finder - 0.5.0 + 0.5.1 - contrast-finder-webapp - 0.5.0 + webapp + 0.5.1 war contrast-finder-webapp @@ -28,7 +28,7 @@ ${project.build.directory}/endorsed UTF-8 4.3.9.RELEASE - 4.2.2.RELEASE + 4.2.3.RELEASE @@ -231,6 +231,7 @@ + contrast-finder-webapp-${project.version} diff --git a/contrast-finder-webapp/src/main/java/org/asqatasun/contrastFinder/webapp/controller/IndexController.java b/webapp/src/main/java/org/asqatasun/contrastfinder/webapp/controller/IndexController.java similarity index 94% rename from contrast-finder-webapp/src/main/java/org/asqatasun/contrastFinder/webapp/controller/IndexController.java rename to webapp/src/main/java/org/asqatasun/contrastfinder/webapp/controller/IndexController.java index 50c6b9fe..35f51b02 100644 --- a/contrast-finder-webapp/src/main/java/org/asqatasun/contrastFinder/webapp/controller/IndexController.java +++ b/webapp/src/main/java/org/asqatasun/contrastfinder/webapp/controller/IndexController.java @@ -17,14 +17,14 @@ * * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.webapp.controller; +package org.asqatasun.contrastfinder.webapp.controller; -import org.asqatasun.contrastFinder.webapp.model.ColorModel; -import org.asqatasun.contrastFinder.webapp.validator.ColorModelValidator; -import org.asqatasun.contrastFinder.ColorFinder; -import org.asqatasun.contrastFinder.factory.ColorFinderFactory; -import org.asqatasun.contrastFinder.result.ColorResult; +import org.asqatasun.contrastfinder.webapp.model.ColorModel; +import org.asqatasun.contrastfinder.webapp.validator.ColorModelValidator; +import org.asqatasun.contrastfinder.ColorFinder; +import org.asqatasun.contrastfinder.factory.ColorFinderFactory; +import org.asqatasun.contrastfinder.result.ColorResult; import org.asqatasun.utils.colorconvertor.ColorConverter; import org.asqatasun.utils.contrastchecker.ContrastChecker; import org.springframework.beans.factory.annotation.Autowired; @@ -127,10 +127,10 @@ protected void initBinder(WebDataBinder binder) { public String initAccueil(final Model model, @CookieValue(value = "algo", defaultValue = "") String algoCookie) { ColorModel colorModel = new ColorModel(); - if (algoCookie.equals("HSV") || algoCookie.equals("Rgb")) { + if ("HSV".equals(algoCookie) || "Rgb".equals(algoCookie)) { colorModel.setAlgo(algoCookie); } - else if (defaultAlgorithm.equals("HSV") || defaultAlgorithm.equals("Rgb")) { + else if ("HSV".equals(defaultAlgorithm) || "Rgb".equals(defaultAlgorithm)) { colorModel.setAlgo(defaultAlgorithm); } // Default algo in ColorModel class is "HSV" model.addAttribute("defaultAlgorithm", defaultAlgorithm); @@ -219,9 +219,9 @@ public String getPageResultFromGet( final Model model, * @return The other algorithm */ private String getOppositeAlgo(String algo) { - if (algo.equals("HSV")) { + if ("HSV".equals(algo)) { return "Rgb"; - } else if (algo.equals("Rgb")) { + } else if ("Rgb".equals(algo)) { return "HSV"; } return algo; diff --git a/contrast-finder-webapp/src/main/java/org/asqatasun/contrastFinder/webapp/model/ColorModel.java b/webapp/src/main/java/org/asqatasun/contrastfinder/webapp/model/ColorModel.java similarity index 98% rename from contrast-finder-webapp/src/main/java/org/asqatasun/contrastFinder/webapp/model/ColorModel.java rename to webapp/src/main/java/org/asqatasun/contrastfinder/webapp/model/ColorModel.java index eee7daa5..7687bbbb 100644 --- a/contrast-finder-webapp/src/main/java/org/asqatasun/contrastFinder/webapp/model/ColorModel.java +++ b/webapp/src/main/java/org/asqatasun/contrastfinder/webapp/model/ColorModel.java @@ -17,7 +17,7 @@ * * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.webapp.model; +package org.asqatasun.contrastfinder.webapp.model; import org.apache.commons.lang3.StringUtils; import org.asqatasun.utils.colorconvertor.ColorConverter; diff --git a/contrast-finder-webapp/src/main/java/org/asqatasun/contrastFinder/webapp/validator/ColorModelValidator.java b/webapp/src/main/java/org/asqatasun/contrastfinder/webapp/validator/ColorModelValidator.java similarity index 95% rename from contrast-finder-webapp/src/main/java/org/asqatasun/contrastFinder/webapp/validator/ColorModelValidator.java rename to webapp/src/main/java/org/asqatasun/contrastfinder/webapp/validator/ColorModelValidator.java index b7349de5..c92a7ce5 100644 --- a/contrast-finder-webapp/src/main/java/org/asqatasun/contrastFinder/webapp/validator/ColorModelValidator.java +++ b/webapp/src/main/java/org/asqatasun/contrastfinder/webapp/validator/ColorModelValidator.java @@ -17,11 +17,11 @@ * * Contact us by mail: asqatasun AT asqatasun DOT org */ -package org.asqatasun.contrastFinder.webapp.validator; +package org.asqatasun.contrastfinder.webapp.validator; import java.awt.Color; import org.apache.commons.lang3.StringUtils; -import org.asqatasun.contrastFinder.webapp.model.ColorModel; +import org.asqatasun.contrastfinder.webapp.model.ColorModel; import org.asqatasun.utils.colorconvertor.ColorConverter; import org.springframework.validation.Errors; import org.springframework.validation.Validator; @@ -93,7 +93,7 @@ private void validateColor(String colorKey, String colorValue, Errors errors) { } private void validateAlgo(String algo, Errors errors) { - if (!(algo.equals("HSV") || algo.equals("Rgb"))) { + if (!("HSV".equals(algo) || "Rgb".equals(algo))) { errors.rejectValue("algo", "NOT_A_VALID_ALGO", "La valeur de l'algorithm est invalide"); } } diff --git a/webapp/src/main/resources/conf/README.md b/webapp/src/main/resources/conf/README.md new file mode 100644 index 00000000..4abb5292 --- /dev/null +++ b/webapp/src/main/resources/conf/README.md @@ -0,0 +1,3 @@ + + /etc/contrast-finder/contrast-finder.conf + /var/log/contrast-finder/contrast-finder.log diff --git a/contrast-finder-resources/src/main/resources/contrast-finder.conf.dist b/webapp/src/main/resources/conf/contrast-finder.conf.dist similarity index 100% rename from contrast-finder-resources/src/main/resources/contrast-finder.conf.dist rename to webapp/src/main/resources/conf/contrast-finder.conf.dist diff --git a/contrast-finder-webapp/src/main/resources/descriptor.xml b/webapp/src/main/resources/descriptor.xml similarity index 92% rename from contrast-finder-webapp/src/main/resources/descriptor.xml rename to webapp/src/main/resources/descriptor.xml index 644b292d..906051b6 100644 --- a/contrast-finder-webapp/src/main/resources/descriptor.xml +++ b/webapp/src/main/resources/descriptor.xml @@ -19,7 +19,7 @@ - ${basedir}/../contrast-finder-resources/src/main/resources + ${basedir}/src/main/resources/conf contrast-finder.conf.dist @@ -28,7 +28,7 @@ - ${basedir}/../contrast-finder-resources/src/main/resources + ${basedir}/src/main/resources/conf contrast-finder.log diff --git a/contrast-finder-webapp/src/main/resources/i18n/contrast-finder.properties b/webapp/src/main/resources/i18n/contrast-finder.properties similarity index 100% rename from contrast-finder-webapp/src/main/resources/i18n/contrast-finder.properties rename to webapp/src/main/resources/i18n/contrast-finder.properties diff --git a/contrast-finder-webapp/src/main/resources/i18n/contrast-finder_en.properties b/webapp/src/main/resources/i18n/contrast-finder_en.properties similarity index 100% rename from contrast-finder-webapp/src/main/resources/i18n/contrast-finder_en.properties rename to webapp/src/main/resources/i18n/contrast-finder_en.properties diff --git a/contrast-finder-webapp/src/main/resources/i18n/contrast-finder_fr.properties b/webapp/src/main/resources/i18n/contrast-finder_fr.properties similarity index 100% rename from contrast-finder-webapp/src/main/resources/i18n/contrast-finder_fr.properties rename to webapp/src/main/resources/i18n/contrast-finder_fr.properties diff --git a/contrast-finder-webapp/src/main/resources/logback.xml b/webapp/src/main/resources/logback.xml similarity index 96% rename from contrast-finder-webapp/src/main/resources/logback.xml rename to webapp/src/main/resources/logback.xml index 9002c0ab..71d4a28b 100644 --- a/contrast-finder-webapp/src/main/resources/logback.xml +++ b/webapp/src/main/resources/logback.xml @@ -29,7 +29,7 @@ - + diff --git a/contrast-finder-webapp/src/main/webapp/Css/10-bootstrap.min.css b/webapp/src/main/webapp/Css/10-bootstrap.min.css similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Css/10-bootstrap.min.css rename to webapp/src/main/webapp/Css/10-bootstrap.min.css diff --git a/contrast-finder-webapp/src/main/webapp/Css/20-bootstrap-theme.min.css b/webapp/src/main/webapp/Css/20-bootstrap-theme.min.css similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Css/20-bootstrap-theme.min.css rename to webapp/src/main/webapp/Css/20-bootstrap-theme.min.css diff --git a/contrast-finder-webapp/src/main/webapp/Css/30-contrast-finder.css b/webapp/src/main/webapp/Css/30-contrast-finder.css similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Css/30-contrast-finder.css rename to webapp/src/main/webapp/Css/30-contrast-finder.css diff --git a/contrast-finder-webapp/src/main/webapp/Css/40-accessible-table-sorter.css b/webapp/src/main/webapp/Css/40-accessible-table-sorter.css similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Css/40-accessible-table-sorter.css rename to webapp/src/main/webapp/Css/40-accessible-table-sorter.css diff --git a/contrast-finder-webapp/src/main/webapp/Images/asc.png b/webapp/src/main/webapp/Images/asc.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/asc.png rename to webapp/src/main/webapp/Images/asc.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/bg.png b/webapp/src/main/webapp/Images/bg.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/bg.png rename to webapp/src/main/webapp/Images/bg.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/contrast_finder_logo.png b/webapp/src/main/webapp/Images/contrast_finder_logo.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/contrast_finder_logo.png rename to webapp/src/main/webapp/Images/contrast_finder_logo.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/creative_common_logo.png b/webapp/src/main/webapp/Images/creative_common_logo.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/creative_common_logo.png rename to webapp/src/main/webapp/Images/creative_common_logo.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/desc.png b/webapp/src/main/webapp/Images/desc.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/desc.png rename to webapp/src/main/webapp/Images/desc.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/favicon.ico b/webapp/src/main/webapp/Images/favicon.ico similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/favicon.ico rename to webapp/src/main/webapp/Images/favicon.ico diff --git a/contrast-finder-webapp/src/main/webapp/Images/good.jpg b/webapp/src/main/webapp/Images/good.jpg similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/good.jpg rename to webapp/src/main/webapp/Images/good.jpg diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/android-chrome-144x144.png b/webapp/src/main/webapp/Images/logo/favicon/android-chrome-144x144.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/android-chrome-144x144.png rename to webapp/src/main/webapp/Images/logo/favicon/android-chrome-144x144.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/android-chrome-192x192.png b/webapp/src/main/webapp/Images/logo/favicon/android-chrome-192x192.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/android-chrome-192x192.png rename to webapp/src/main/webapp/Images/logo/favicon/android-chrome-192x192.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/android-chrome-256x256.png b/webapp/src/main/webapp/Images/logo/favicon/android-chrome-256x256.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/android-chrome-256x256.png rename to webapp/src/main/webapp/Images/logo/favicon/android-chrome-256x256.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/android-chrome-36x36.png b/webapp/src/main/webapp/Images/logo/favicon/android-chrome-36x36.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/android-chrome-36x36.png rename to webapp/src/main/webapp/Images/logo/favicon/android-chrome-36x36.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/android-chrome-384x384.png b/webapp/src/main/webapp/Images/logo/favicon/android-chrome-384x384.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/android-chrome-384x384.png rename to webapp/src/main/webapp/Images/logo/favicon/android-chrome-384x384.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/android-chrome-48x48.png b/webapp/src/main/webapp/Images/logo/favicon/android-chrome-48x48.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/android-chrome-48x48.png rename to webapp/src/main/webapp/Images/logo/favicon/android-chrome-48x48.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/android-chrome-512x512.png b/webapp/src/main/webapp/Images/logo/favicon/android-chrome-512x512.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/android-chrome-512x512.png rename to webapp/src/main/webapp/Images/logo/favicon/android-chrome-512x512.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/android-chrome-72x72.png b/webapp/src/main/webapp/Images/logo/favicon/android-chrome-72x72.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/android-chrome-72x72.png rename to webapp/src/main/webapp/Images/logo/favicon/android-chrome-72x72.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/android-chrome-96x96.png b/webapp/src/main/webapp/Images/logo/favicon/android-chrome-96x96.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/android-chrome-96x96.png rename to webapp/src/main/webapp/Images/logo/favicon/android-chrome-96x96.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-114x114-precomposed.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-114x114-precomposed.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-114x114-precomposed.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-114x114-precomposed.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-114x114.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-114x114.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-114x114.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-114x114.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-120x120-precomposed.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-120x120-precomposed.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-120x120-precomposed.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-120x120-precomposed.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-120x120.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-120x120.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-120x120.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-120x120.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-144x144-precomposed.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-144x144-precomposed.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-144x144-precomposed.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-144x144-precomposed.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-144x144.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-144x144.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-144x144.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-144x144.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-152x152-precomposed.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-152x152-precomposed.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-152x152-precomposed.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-152x152-precomposed.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-152x152.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-152x152.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-152x152.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-152x152.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-180x180-precomposed.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-180x180-precomposed.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-180x180-precomposed.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-180x180-precomposed.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-180x180.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-180x180.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-180x180.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-180x180.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-57x57-precomposed.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-57x57-precomposed.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-57x57-precomposed.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-57x57-precomposed.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-57x57.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-57x57.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-57x57.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-57x57.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-60x60-precomposed.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-60x60-precomposed.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-60x60-precomposed.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-60x60-precomposed.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-60x60.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-60x60.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-60x60.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-60x60.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-72x72-precomposed.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-72x72-precomposed.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-72x72-precomposed.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-72x72-precomposed.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-72x72.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-72x72.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-72x72.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-72x72.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-76x76-precomposed.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-76x76-precomposed.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-76x76-precomposed.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-76x76-precomposed.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-76x76.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-76x76.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-76x76.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-76x76.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-precomposed.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-precomposed.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-precomposed.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon-precomposed.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon.png b/webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon.png rename to webapp/src/main/webapp/Images/logo/favicon/apple-touch-icon.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/browserconfig.xml b/webapp/src/main/webapp/Images/logo/favicon/browserconfig.xml similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/browserconfig.xml rename to webapp/src/main/webapp/Images/logo/favicon/browserconfig.xml diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/favicon-16x16.png b/webapp/src/main/webapp/Images/logo/favicon/favicon-16x16.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/favicon-16x16.png rename to webapp/src/main/webapp/Images/logo/favicon/favicon-16x16.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/favicon-194x194.png b/webapp/src/main/webapp/Images/logo/favicon/favicon-194x194.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/favicon-194x194.png rename to webapp/src/main/webapp/Images/logo/favicon/favicon-194x194.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/favicon-32x32.png b/webapp/src/main/webapp/Images/logo/favicon/favicon-32x32.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/favicon-32x32.png rename to webapp/src/main/webapp/Images/logo/favicon/favicon-32x32.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/favicon.ico b/webapp/src/main/webapp/Images/logo/favicon/favicon.ico similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/favicon.ico rename to webapp/src/main/webapp/Images/logo/favicon/favicon.ico diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/manifest.json b/webapp/src/main/webapp/Images/logo/favicon/manifest.json similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/manifest.json rename to webapp/src/main/webapp/Images/logo/favicon/manifest.json diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/mstile-144x144.png b/webapp/src/main/webapp/Images/logo/favicon/mstile-144x144.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/mstile-144x144.png rename to webapp/src/main/webapp/Images/logo/favicon/mstile-144x144.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/mstile-150x150.png b/webapp/src/main/webapp/Images/logo/favicon/mstile-150x150.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/mstile-150x150.png rename to webapp/src/main/webapp/Images/logo/favicon/mstile-150x150.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/mstile-310x150.png b/webapp/src/main/webapp/Images/logo/favicon/mstile-310x150.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/mstile-310x150.png rename to webapp/src/main/webapp/Images/logo/favicon/mstile-310x150.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/mstile-310x310.png b/webapp/src/main/webapp/Images/logo/favicon/mstile-310x310.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/mstile-310x310.png rename to webapp/src/main/webapp/Images/logo/favicon/mstile-310x310.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/mstile-70x70.png b/webapp/src/main/webapp/Images/logo/favicon/mstile-70x70.png similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/mstile-70x70.png rename to webapp/src/main/webapp/Images/logo/favicon/mstile-70x70.png diff --git a/contrast-finder-webapp/src/main/webapp/Images/logo/favicon/safari-pinned-tab.svg b/webapp/src/main/webapp/Images/logo/favicon/safari-pinned-tab.svg similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Images/logo/favicon/safari-pinned-tab.svg rename to webapp/src/main/webapp/Images/logo/favicon/safari-pinned-tab.svg diff --git a/contrast-finder-webapp/src/main/webapp/Js/10-jquery.min.js b/webapp/src/main/webapp/Js/10-jquery.min.js similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Js/10-jquery.min.js rename to webapp/src/main/webapp/Js/10-jquery.min.js diff --git a/contrast-finder-webapp/src/main/webapp/Js/20-jquery.tablesorter.min.js b/webapp/src/main/webapp/Js/20-jquery.tablesorter.min.js similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Js/20-jquery.tablesorter.min.js rename to webapp/src/main/webapp/Js/20-jquery.tablesorter.min.js diff --git a/contrast-finder-webapp/src/main/webapp/Js/25-accessible.js b/webapp/src/main/webapp/Js/25-accessible.js similarity index 58% rename from contrast-finder-webapp/src/main/webapp/Js/25-accessible.js rename to webapp/src/main/webapp/Js/25-accessible.js index db4da0b7..547cc109 100644 --- a/contrast-finder-webapp/src/main/webapp/Js/25-accessible.js +++ b/webapp/src/main/webapp/Js/25-accessible.js @@ -3,44 +3,44 @@ $.tablesorter.addWidget({ - id: 'addA11y', + id: "addA11y", format: function(table) { // Now add the accessibility information - jQuery('tr', table).each( function(e) { + jQuery("tr", table).each( function(e) { // Do the header first because sorted and unsorted columns have this class - $('th.'+table.config.cssHeader, this).each( function(e) { - $('span.offscreen', this).each( function(e) { + $("th."+table.config.cssHeader, this).each( function(e) { + $("span.offscreen", this).each( function(e) { $(this).remove(); }); $("#contrast-solution caption").text(gTableCaptionText); // modify $(this).removeAttr("aria-sort"); // remove any existing aria-sort attribute on this header - $(this).append( $('').addClass('offscreen').text( 'Sortable, Not Sorted')); // add some offscreen text to the header + $(this).append( $("").addClass("offscreen").text( "Sortable, Not Sorted")); // add some offscreen text to the header }); // Now do the ascending and descending - $(this).find( 'th.'+table.config.cssAsc).each( function(e) { - $('span.offscreen', this).each( function(e) { + $(this).find( "th."+table.config.cssAsc).each( function(e) { + $("span.offscreen", this).each( function(e) { $(this).remove(); }); var headerText = $(this).text(); - $("#contrast-solution caption").text(gTableCaptionText + ': Sorted By ' + headerText + ' Descending '); + $("#contrast-solution caption").text(gTableCaptionText + ": Sorted By " + headerText + " Descending "); $(this).attr("aria-sort", "descending");//give it aria-sort attribute with value of descending - $(this).append( $('').addClass('offscreen').text( 'Sortable, Sorted Descending'));// add some offscreen text to the header + $(this).append( $("").addClass("offscreen").text( "Sortable, Sorted Descending"));// add some offscreen text to the header }); - $('th.'+table.config.cssDesc, this).each( function(e) { - $('span.offscreen', this).each( function(e) { + $("th."+table.config.cssDesc, this).each( function(e) { + $("span.offscreen", this).each( function(e) { $(this).remove(); }); var headerText = $(this).text(); - $("#contrast-solution caption").text(gTableCaptionText + ': Sorted By ' + headerText + ' Ascending '); + $("#contrast-solution caption").text(gTableCaptionText + ": Sorted By " + headerText + " Ascending "); $(this).attr("aria-sort", "ascending");//give it aria-sort attribute with value of ascending - $(this).append( $('').addClass('offscreen').text( 'Sortable, Sorted Ascending'));// add some offscreen text to the header + $(this).append( $("").addClass("offscreen").text( "Sortable, Sorted Ascending"));// add some offscreen text to the header }); }); } @@ -48,21 +48,25 @@ // make the good table $("#contrast-solution") - .tablesorter({widgets: ['addA11y']}) - .wrap('
') // wrap it in a DIV with a role of application + .tablesorter({widgets: ["addA11y"]}) + .wrap("
") // wrap it in a DIV with a role of application .attr("role", "grid") // add role of grid to the table itself .attr("aria-readonly", "true") // mark the grid as readonly (because none of the data is editable .attr("aria-labelledby", "theCaption") // label the table with caption - .bind( 'keypress keyup keydown', function(e) { + .bind( "keypress keyup keydown", function(e) { var keyCode; var special = (e.ctrlKey || e.shiftKey || e.metaKey || e.altKey); - if ( !e.keyCode && 'which' in e && e.which) keyCode = e.which; - else keyCode = e.keyCode; + if ( !e.keyCode && "which" in e && e.which){ + keyCode = e.which; + } + else { + keyCode = e.keyCode; + } // Whenever a header cell is active, pressing the spacebar or enter // will trigger the sort if ( keyCode == 13 || keyCode == 32) { - if ( $(e.target).hasClass( 'header')) { - $(e.target).trigger( 'click'); + if ( $(e.target).hasClass( "header")) { + $(e.target).trigger( "click"); } } }); // set the table to be labelled by its caption @@ -79,16 +83,16 @@ $("#contrast-solution tbody th").attr("role", "rowheader").attr("scope", "row"); // add tabindex so tabindex only appears on the sortable headers - // which is basicaly any TH *with* a class of 'header' (which gets put there by tablesorter) + // which is basicaly any TH *with* a class of "header" (which gets put there by tablesorter) $("#contrast-solution th.header").attr("tabindex", "0"); // assign role of gridcell on all data cells $("#contrast-solution tbody td").attr("role", "gridcell"); - $('#contrast-solution caption').attr({ - role: 'log', - 'aria-live': 'assertive', - 'aria-relevant': 'all', - 'aria-atomic': 'true' + $("#contrast-solution caption").attr({ + role: "log", + "aria-live": "assertive", + "aria-relevant": "all", + "aria-atomic": "true" }); }); diff --git a/contrast-finder-webapp/src/main/webapp/Js/30-bootstrap.min.js b/webapp/src/main/webapp/Js/30-bootstrap.min.js similarity index 100% rename from contrast-finder-webapp/src/main/webapp/Js/30-bootstrap.min.js rename to webapp/src/main/webapp/Js/30-bootstrap.min.js diff --git a/contrast-finder-webapp/src/main/webapp/Js/35-affix.js b/webapp/src/main/webapp/Js/35-affix.js similarity index 50% rename from contrast-finder-webapp/src/main/webapp/Js/35-affix.js rename to webapp/src/main/webapp/Js/35-affix.js index 4ee58194..a03abdf7 100644 --- a/contrast-finder-webapp/src/main/webapp/Js/35-affix.js +++ b/webapp/src/main/webapp/Js/35-affix.js @@ -1,10 +1,10 @@ -$('#old-contrast').affix( +$("#old-contrast").affix( { offset: { top: function() { - var header = $('#header').height() - var setUpForm = $('#set-up-form').height() - return (this.top = header + setUpForm + 135) + var header = $("#header").height(); + var setUpForm = $("#set-up-form").height(); + return (this.top = header + setUpForm + 135); } } - }) + }); diff --git a/contrast-finder-webapp/src/main/webapp/Js/36-sample.color.js b/webapp/src/main/webapp/Js/36-sample.color.js similarity index 71% rename from contrast-finder-webapp/src/main/webapp/Js/36-sample.color.js rename to webapp/src/main/webapp/Js/36-sample.color.js index 3e173536..cf260c10 100644 --- a/contrast-finder-webapp/src/main/webapp/Js/36-sample.color.js +++ b/webapp/src/main/webapp/Js/36-sample.color.js @@ -1,39 +1,42 @@ -$(document).ready(function() { - // changeColorSample("foreground"); - // changeColorSample("background"); - document.getElementById("foreground-input").onchange = function() { - changeColorSample("foreground"); - }; - document.getElementById("background-input").onchange = function() { - changeColorSample("background"); - }; -}); -function changeColorSample(colorPrefix) { - var input = document.getElementById(colorPrefix + "-input"); - var color = input.value.toLowerCase(); - var sample = document.getElementById(colorPrefix + "-sample"); - color = color.toString().replace(/\s/g,""); // replace ' ', \t, \n, ... - color = isValidateColor(color.toString()); - if (color !== "false") { - sample.style.backgroundColor = color; - sample.classList.add('color-sample'); - sample.classList.add('sample-bordered'); - document.getElementById(colorPrefix + "-sample-invalid").style.display = "none"; - input.classList.remove('error'); - } else { - sample.style.backgroundColor = "rgba(0,0,0,0)"; - sample.classList.remove('color-sample'); - sample.classList.remove('sample-bordered'); - document.getElementById(colorPrefix + "-sample-invalid").style.display = "inherit"; - input.classList.add('error'); - } +String.prototype.splice = function(idx, rem, s) { + return (this.slice(0, idx) + s + this.slice(idx + Math.abs(rem))); +}; + +// only run when the substr() function is broken +// Microsoft's JScript does not support negative values for the start index. +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr +if ("ab".substr(-1) !== "b") { + /** + * Get the substring of a string + * @param {integer} start where to start the substring + * @param {integer} length how many characters to return + * @return {string} + */ + String.prototype.substr = (function(substr) { + return function(start, length) { + // call the original method + return substr.call(this, + // did we get a negative start, calculate how much it is from the beginning of the string + // adjust the start parameter for negative value + start < 0 ? this.length + start : start, + length); + }; + }(String.prototype.substr)); +} + +function setValidColor(str) { + var result = str.splice(0, 0, "#"); + return result; } function isValidateColor(str) { str = str.trim(); - if(str.match(/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/) !== null){ + if(str.match(/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)?$/) !== null){ + if(str.substr(-1) !== ")"){ + str = str + ")"; + } return str; } else if (str.match(/^(\d{1,3}),(\d{1,3}),(\d{1,3})$/) !== null){ @@ -50,8 +53,8 @@ function isValidateColor(str) { } else { // source: https://gist.github.com/bobspace/2712980 - var CssColorNames = ["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenRod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","Darkorange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","GoldenRod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","Lavender","LavenderBlush","LawnGreen","LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenRodYellow","LightGray","LightGrey","LightGreen","LightPink","LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSlateGrey","LightSteelBlue","LightYellow","Lime","LimeGreen","Linen","Magenta","Maroon","MediumAquaMarine","MediumBlue","MediumOrchid","MediumPurple","MediumSeaGreen","MediumSlateBlue","MediumSpringGreen","MediumTurquoise","MediumVioletRed","MidnightBlue","MintCream","MistyRose","Moccasin","NavajoWhite","Navy","OldLace","Olive","OliveDrab","Orange","OrangeRed","Orchid","PaleGoldenRod","PaleGreen","PaleTurquoise","PaleVioletRed","PapayaWhip","PeachPuff","Peru","Pink","Plum","PowderBlue","Purple","Red","RosyBrown","RoyalBlue","SaddleBrown","Salmon","SandyBrown","SeaGreen","SeaShell","Sienna","Silver","SkyBlue","SlateBlue","SlateGray","SlateGrey","Snow","SpringGreen","SteelBlue","Tan","Teal","Thistle","Tomato","Turquoise","Violet","Wheat","White", - "WhiteSmoke","Yellow","YellowGreen"]; + var CssColorNames = ["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenRod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","DarkOrange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","GoldenRod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory","Khaki","Lavender","LavenderBlush","LawnGreen","LemonChiffon","LightBlue","LightCoral","LightCyan","LightGoldenRodYellow","LightGray","LightGrey","LightGreen","LightPink","LightSalmon","LightSeaGreen","LightSkyBlue","LightSlateGray","LightSlateGrey","LightSteelBlue","LightYellow","Lime","LimeGreen","Linen","Magenta","Maroon","MediumAquaMarine","MediumBlue","MediumOrchid","MediumPurple","MediumSeaGreen","MediumSlateBlue","MediumSpringGreen","MediumTurquoise","MediumVioletRed","MidnightBlue","MintCream","MistyRose","Moccasin","NavajoWhite","Navy","OldLace","Olive","OliveDrab","Orange","OrangeRed","Orchid","PaleGoldenRod","PaleGreen","PaleTurquoise","PaleVioletRed","PapayaWhip","PeachPuff","Peru","Pink","Plum","PowderBlue","Purple","Red","RosyBrown","RoyalBlue","SaddleBrown","Salmon","SandyBrown","SeaGreen","SeaShell","Sienna","Silver","SkyBlue","SlateBlue","SlateGray","SlateGrey","Snow","SpringGreen","SteelBlue","Tan","Teal","Thistle","Tomato","Turquoise","Violet","Wheat","White", + "WhiteSmoke","Yellow","YellowGreen","RebeccaPurple"]; var query = str.toLowerCase(); var colorName = ""; CssColorNames.some(function(element, i) { @@ -63,15 +66,39 @@ function isValidateColor(str) { if(colorName !== ""){ return colorName; } - return "false" + return "false"; } } -function setValidColor(str) { - var result = str.splice(0, 0, "#") - return result; +function changeColorSample(colorPrefix) { + var input = document.getElementById(colorPrefix + "-input"); + var color = input.value.toLowerCase(); + var sample = document.getElementById(colorPrefix + "-sample"); + color = color.toString().replace(/\s/g,""); // replace ' ', \t, \n, ... + color = isValidateColor(color.toString()); + if (color !== "false") { + sample.style.backgroundColor = color; + sample.classList.add("color-sample"); + sample.classList.add("sample-bordered"); + document.getElementById(colorPrefix + "-sample-invalid").style.display = "none"; + input.classList.remove("error"); + } else { + sample.style.backgroundColor = "rgba(0,0,0,0)"; + sample.classList.remove("color-sample"); + sample.classList.remove("sample-bordered"); + document.getElementById(colorPrefix + "-sample-invalid").style.display = "inherit"; + input.classList.add("error"); + } } -String.prototype.splice = function(idx, rem, s) { - return (this.slice(0, idx) + s + this.slice(idx + Math.abs(rem))); -}; \ No newline at end of file + +$(document).ready(function() { + // changeColorSample("foreground"); + // changeColorSample("background"); + document.getElementById("foreground-input").onchange = function() { + changeColorSample("foreground"); + }; + document.getElementById("background-input").onchange = function() { + changeColorSample("background"); + }; +}); \ No newline at end of file diff --git a/contrast-finder-webapp/src/main/webapp/META-INF/context.xml b/webapp/src/main/webapp/META-INF/context.xml similarity index 100% rename from contrast-finder-webapp/src/main/webapp/META-INF/context.xml rename to webapp/src/main/webapp/META-INF/context.xml diff --git a/contrast-finder-webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-controller.xml b/webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-controller.xml similarity index 89% rename from contrast-finder-webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-controller.xml rename to webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-controller.xml index 014644af..56d2a824 100644 --- a/contrast-finder-webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-controller.xml +++ b/webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-controller.xml @@ -5,7 +5,7 @@ http://www.springframework.org/schema/beans/spring-beans-4.3.xsd"> + class="org.asqatasun.contrastfinder.webapp.controller.IndexController"> diff --git a/contrast-finder-webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-i18n.xml b/webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-i18n.xml similarity index 100% rename from contrast-finder-webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-i18n.xml rename to webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-i18n.xml diff --git a/contrast-finder-webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-locale.xml b/webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-locale.xml similarity index 100% rename from contrast-finder-webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-locale.xml rename to webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-locale.xml diff --git a/contrast-finder-webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-model.xml b/webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-model.xml similarity index 82% rename from contrast-finder-webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-model.xml rename to webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-model.xml index 33260247..f573e317 100644 --- a/contrast-finder-webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-model.xml +++ b/webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-model.xml @@ -5,10 +5,10 @@ http://www.springframework.org/schema/beans/spring-beans-4.3.xsd"> + class="org.asqatasun.contrastfinder.factory.ColorFinderHsvFactory"/> + class="org.asqatasun.contrastfinder.factory.ColorFinderHsvPsychoFactory"> @@ -17,7 +17,7 @@ + class="org.asqatasun.contrastfinder.factory.ColorFinderRgbFactory"> @@ -31,7 +31,7 @@ + class="org.asqatasun.contrastfinder.factory.ColorFinderFactoryImpl"> @@ -43,19 +43,19 @@ + class="org.asqatasun.contrastfinder.hsv.Boundary"> + class="org.asqatasun.contrastfinder.hsv.Boundary"> + class="org.asqatasun.contrastfinder.hsv.Boundary"> diff --git a/contrast-finder-webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-resolver.xml b/webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-resolver.xml similarity index 100% rename from contrast-finder-webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-resolver.xml rename to webapp/src/main/webapp/WEB-INF/conf/mvc/cf-beans-resolver.xml diff --git a/contrast-finder-webapp/src/main/webapp/WEB-INF/contrast-finder-servlet.xml b/webapp/src/main/webapp/WEB-INF/contrast-finder-servlet.xml similarity index 100% rename from contrast-finder-webapp/src/main/webapp/WEB-INF/contrast-finder-servlet.xml rename to webapp/src/main/webapp/WEB-INF/contrast-finder-servlet.xml diff --git a/contrast-finder-webapp/src/main/webapp/WEB-INF/pages/form.jsp b/webapp/src/main/webapp/WEB-INF/pages/form.jsp similarity index 100% rename from contrast-finder-webapp/src/main/webapp/WEB-INF/pages/form.jsp rename to webapp/src/main/webapp/WEB-INF/pages/form.jsp diff --git a/contrast-finder-webapp/src/main/webapp/WEB-INF/spring/security.xml b/webapp/src/main/webapp/WEB-INF/spring/security.xml similarity index 100% rename from contrast-finder-webapp/src/main/webapp/WEB-INF/spring/security.xml rename to webapp/src/main/webapp/WEB-INF/spring/security.xml diff --git a/contrast-finder-webapp/src/main/webapp/WEB-INF/template/cf-message.jspf b/webapp/src/main/webapp/WEB-INF/template/cf-message.jspf similarity index 100% rename from contrast-finder-webapp/src/main/webapp/WEB-INF/template/cf-message.jspf rename to webapp/src/main/webapp/WEB-INF/template/cf-message.jspf diff --git a/contrast-finder-webapp/src/main/webapp/WEB-INF/template/footer.jspf b/webapp/src/main/webapp/WEB-INF/template/footer.jspf similarity index 100% rename from contrast-finder-webapp/src/main/webapp/WEB-INF/template/footer.jspf rename to webapp/src/main/webapp/WEB-INF/template/footer.jspf diff --git a/contrast-finder-webapp/src/main/webapp/WEB-INF/template/head.jspf b/webapp/src/main/webapp/WEB-INF/template/head.jspf similarity index 100% rename from contrast-finder-webapp/src/main/webapp/WEB-INF/template/head.jspf rename to webapp/src/main/webapp/WEB-INF/template/head.jspf diff --git a/contrast-finder-webapp/src/main/webapp/WEB-INF/template/header.jspf b/webapp/src/main/webapp/WEB-INF/template/header.jspf similarity index 100% rename from contrast-finder-webapp/src/main/webapp/WEB-INF/template/header.jspf rename to webapp/src/main/webapp/WEB-INF/template/header.jspf diff --git a/contrast-finder-webapp/src/main/webapp/WEB-INF/template/template_variables.jspf b/webapp/src/main/webapp/WEB-INF/template/template_variables.jspf similarity index 99% rename from contrast-finder-webapp/src/main/webapp/WEB-INF/template/template_variables.jspf rename to webapp/src/main/webapp/WEB-INF/template/template_variables.jspf index 70108aef..acfd9d7f 100644 --- a/contrast-finder-webapp/src/main/webapp/WEB-INF/template/template_variables.jspf +++ b/webapp/src/main/webapp/WEB-INF/template/template_variables.jspf @@ -2,7 +2,7 @@ <%@ page pageEncoding="UTF-8" %> <%-- APP version --%> - + <%-- APP Name --%> diff --git a/contrast-finder-webapp/src/main/webapp/WEB-INF/web.xml b/webapp/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from contrast-finder-webapp/src/main/webapp/WEB-INF/web.xml rename to webapp/src/main/webapp/WEB-INF/web.xml diff --git a/contrast-finder-webapp/src/main/webapp/default.jsp b/webapp/src/main/webapp/default.jsp similarity index 100% rename from contrast-finder-webapp/src/main/webapp/default.jsp rename to webapp/src/main/webapp/default.jsp