Changeset 36315 in osm for applications/editors


Ignore:
Timestamp:
2024-08-21T19:57:34+02:00 (4 months ago)
Author:
taylor.smock
Message:

Use pom.xml for dependencies when ivy.xml is not available

This removes ivy.xml from javafx and converts rasterfilters to use maven for
dependency management instead of jars in source control. In addition
rasterfilters dependencies were upgraded to the latest versions.

javafx now requires Java 17 since OpenJFX 21 requires Java 17+.

opendata was upgraded to use jdom2 (see
https://github.com/JOSM/josm-plugins/security/dependabot/2)

Location:
applications/editors/josm/plugins
Files:
4 deleted
33 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/build-common.xml

    r36308 r36315  
    1111**
    1212-->
    13 <project name="plugin_common" basedir="." xmlns:jacoco="antlib:org.jacoco.ant" xmlns:if="ant:if" xmlns:unless="ant:unless" xmlns:ivy="antlib:org.apache.ivy.ant">
     13<project name="plugin_common" basedir="." xmlns:jacoco="antlib:org.jacoco.ant" xmlns:if="ant:if" xmlns:unless="ant:unless" xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:mvn="antlib:org.apache.maven.resolver.ant" >
    1414
    1515    <property name="josm"                   location="../../core/dist/josm-custom.jar"/>
     
    4343    <property name="ivy.jar.file"           location="${ivy.jar.dir}/ivy.jar"/>
    4444    <property name="ivy.version"            value="2.5.1"/>
     45    <property name="maven.artifact.resolver.version" value="1.5.1"/>
     46    <property name="maven.artifact.resolver.parent.dir" value="${user.home}/.m2/repository/org/apache/maven/resolver/maven-resolver-ant-tasks/${maven.artifact.resolver.version}/"/>
     47    <property name="maven.artifact.resolver.jar.file" value="${maven.artifact.resolver.parent.dir}/maven-resolver-ant-tasks-${maven.artifact.resolver.version}-uber.jar"/>
    4548    <property name="jacoco.inclbootstrapclasses"  value="false" />
    4649    <property name="jacoco.inclnolocationclasses" value="false" />
     
    111114    </target>
    112115    <target name="compile" depends="init, pre-compile, resolve-tools" unless="skip-compile">
     116        <condition property="plugin.classpath.actual.defined">
     117            <isreference refid="plugin.classpath.actual" type="path"/>
     118        </condition>
     119        <path id="plugin.classpath.actual" unless:set="plugin.classpath.actual.defined">
     120            <path refid="plugin.classpath"/>
     121        </path>
    113122        <echo message="compiling sources for ${plugin.jar} ..."/>
    114123        <path id="jdk.boot.classpath">
     
    134143            <compilerarg value="-Xplugin:ErrorProne -Xep:StringSplitter:OFF -Xep:ReferenceEquality:OFF -Xep:InsecureCryptoUsage:OFF -Xep:FutureReturnValueIgnored:OFF -Xep:JdkObsolete:OFF -Xep:EqualsHashCode:OFF -Xep:JavaUtilDate:OFF -Xep:DoNotCallSuggester:OFF -Xep:BanSerializableRead:OFF" />
    135144            <compilerarg line="-Xmaxwarns 1000"/>
    136             <classpath refid="plugin.classpath"/>
     145            <classpath refid="plugin.classpath.actual"/>
    137146        </javac>
    138147    </target>
     
    280289        <!-- to be overridden by plugins that need to perform additional tasks before generating javadoc -->
    281290    </target>
    282     <target name="javadoc" depends="pre-javadoc" unless="skip-javadoc">
     291    <target name="javadoc" depends="pre-javadoc,pre-compile" unless="skip-javadoc">
     292        <mkdir dir="${plugin.doc.dir}"/>
    283293        <javadoc destdir="${plugin.doc.dir}"
    284294                executable="${javadoc.executable}"
     
    289299                linksource="true"
    290300                author="false">
    291             <classpath refid="plugin.classpath"/>
     301            <classpath refid="plugin.classpath" unless:set="plugin.classpath.dependencies"/>
     302            <classpath refid="plugin.classpath.dependencies" if:set="plugin.classpath.dependencies"/>
    292303            <sourcepath>
    293304                <pathelement path="${plugin.src.dir}" />
     
    661672                                                                         "/>
    662673            <fileset dir="${basedir}/test" includes="**/*.java" erroronmissingdir="false"/>
     674            <formatter type="plain"/>
    663675            <formatter type="xml" toFile="checkstyle-josm-${ant.project.name}.xml"/>
    664676        </checkstyle>
     
    677689                jvmargs="-Xmx1024m"
    678690                >
    679             <auxClasspath refid="plugin.classpath" />
     691            <auxClasspath refid="plugin.classpath" unless:set="plugin.classpath.dependencies"/>
     692            <auxClasspath refid="plugin.classpath.dependencies" if:set="plugin.classpath.dependencies"/>
    680693            <sourcePath path="${basedir}/src" />
    681694            <class location="${plugin.build.dir}" />
     
    715728    ** Ivy tasks
    716729    -->
     730    <target name="is-ivy">
     731        <condition property="isIvy">
     732            <available file="ivy.xml"/>
     733        </condition>
     734    </target>
    717735    <target name="download-ivy">
    718736        <mkdir dir="${ivy.jar.dir}"/>
     
    743761        </delete>
    744762    </target>
    745     <target name="fetch_dependencies" depends="clean_ivy, init-ivy">
     763    <target name="fetch-dependencies-ivy" depends="clean_ivy, init-ivy, is-ivy" if="isIvy">
    746764        <echo>fetching dependencies with ivy</echo>
    747765        <available property="plugin.ivysettings.exists" file="ivy_settings.xml"/>
     
    751769        <ivy:retrieve pattern="${plugin.lib.dir}/[artifact]-[revision](-[classifier]).[ext]" conf="default" />
    752770    </target>
    753     <target name="ivy-checkdepsupdate" description="Display dependency updates on the console" depends="fetch_dependencies">
     771    <target name="ivy-checkdepsupdate" description="Display dependency updates on the console" depends="fetch-dependencies-ivy">
    754772        <ivy:checkdepsupdate/>
    755773    </target>
     774    <!--
     775    ** Maven tasks
     776    -->
     777    <target name="is-maven" depends="is-ivy">
     778        <condition property="isMaven">
     779            <and>
     780                <available file="pom.xml"/>
     781                <not>
     782                    <isset property="isIvy"/>
     783                </not>
     784            </and>
     785        </condition>
     786    </target>
     787    <target name="download-maven" depends="is-maven" if="isMaven">
     788        <mkdir dir="${maven.artifact.resolver.parent.dir}"/>
     789        <get src="https://josm.openstreetmap.de/nexus/content/repositories/public/org/apache/maven/resolver/maven-resolver-ant-tasks/${maven.artifact.resolver.version}/maven-resolver-ant-tasks-${maven.artifact.resolver.version}-uber.jar"
     790             dest="${maven.artifact.resolver.jar.file}"
     791             usetimestamp="true"/>
     792    </target>
     793    <target name="init-maven" depends="is-maven,download-maven" if="isMaven">
     794        <path id="maven.lib.path">
     795            <fileset dir="${maven.artifact.resolver.parent.dir}" includes="*.jar"/>
     796        </path>
     797        <taskdef uri="antlib:org.apache.maven.resolver.ant" resource="org/apache/maven/resolver/ant/antlib.xml" classpathref="maven.lib.path"/>
     798    </target>
     799    <target name="fetch-dependencies-maven" depends="is-maven,init-maven,clean_ivy" if="isMaven">
     800        <mvn:pom file="pom.xml"/>
     801        <mvn:pom file="pom.xml" id="pom"/>
     802        <!-- This stanza is necessary since the maven resolver doesn't read repo settings from the pom.xml file -->
     803        <!-- resolver.repositories makes it global -->
     804        <mvn:remoterepos id="resolver.repositories">
     805            <mvn:remoterepo id="JOSM" url="https://josm.openstreetmap.de/nexus/content/repositories/public/" />
     806        </mvn:remoterepos>
     807        <mkdir dir="${plugin.lib.dir}"/>
     808        <mvn:resolve>
     809            <!-- For some reason, compile time josm-unittest dependencies get included -->
     810            <mvn:dependencies pomRef="pom">
     811                <mvn:exclusion groupId="org.openstreetmap.josm" artifactId="josm-unittest"/>
     812                <mvn:exclusion groupId="org.junit.platform"/>
     813                <mvn:exclusion groupId="org.junit.vintage"/>
     814                <mvn:exclusion groupId="org.junit.jupiter"/>
     815            </mvn:dependencies>
     816            <mvn:files refid="lib.files" dir="${plugin.lib.dir}" layout="{artifactId}-{version}-{classifier}.{extension}" scopes="compile,!test"/>
     817        </mvn:resolve>
     818        <echo message="${toString:lib.files}"/>
     819        <mvn:resolve>
     820            <mvn:path refid="classpath.provided" scopes="provided"/>
     821        </mvn:resolve>
     822        <mvn:resolve>
     823            <mvn:path refid="testlib.classpath" classpath="test"/>
     824        </mvn:resolve>
     825        <mvn:resolve>
     826            <mvn:dependencies>
     827                <mvn:dependency groupId="org.jacoco" artifactId="org.jacoco.ant" version="${pom.properties.jacoco.version}" classifier="nodeps" type="jar" scope="test"/>
     828            </mvn:dependencies>
     829            <mvn:path refid="jacocotest.classpath" classpath="test"/>
     830        </mvn:resolve>
     831        <mvn:resolve>
     832            <mvn:dependencies>
     833                <mvn:dependency groupId="com.puppycrawl.tools" artifactId="checkstyle" version="${pom.properties.checkstyle.version}" scope="compile"/>
     834            </mvn:dependencies>
     835            <mvn:path refid="checkstyle.classpath" classpath="compile"/>
     836        </mvn:resolve>
     837        <mvn:resolve>
     838            <mvn:dependencies>
     839                <mvn:dependency groupId="com.github.spotbugs" artifactId="spotbugs" version="${pom.properties.spotbugs.version}" scope="compile"/>
     840                <mvn:dependency groupId="com.github.spotbugs" artifactId="spotbugs-ant" version="${pom.properties.spotbugs.version}" scope="compile"/>
     841            </mvn:dependencies>
     842            <mvn:path refid="spotbugs.classpath" classpath="compile"/>
     843        </mvn:resolve>
     844        <path id="plugin.classpath.actual">
     845            <path refid="plugin.classpath"/>
     846            <path refid="classpath.provided"/>
     847        </path>
     848    </target>
     849
     850    <target name="fetch_dependencies" depends="fetch-dependencies-ivy,fetch-dependencies-maven">
     851      <!-- We can depend upon ivy and/or maven right now. -->
     852    </target>
    756853</project>
  • applications/editors/josm/plugins/build.xml

    r36311 r36315  
    1313    <property name="java21_plugins" value="FIT/build.xml
    1414                                            MicrosoftStreetside/build.xml" />
    15     <property name="java17_plugins" value="imageio/build.xml
     15    <property name="java17_plugins" value="javafx/build.xml
     16                                            imageio/build.xml
    1617                                            Mapillary/build.xml
    1718                                            MapRoulette/build.xml
     
    1920                                            todo/build.xml"/>
    2021    <property name="ordered_plugins" value="jackson/build.xml
    21                                             javafx/build.xml
    2222                                            jaxb/build.xml
    2323                                            jna/build.xml
  • applications/editors/josm/plugins/javafx/build.xml

    r35805 r36315  
    1212    <property name="plugin.class" value="org.openstreetmap.josm.plugins.javafx.JavaFxPlugin"/>
    1313    <property name="plugin.description" value="Provides additional OpenJFX (JavaFX) features such as MP3 audio playback."/>
    14     <!--<property name="plugin.minimum.java.version" value="10"/>-->
     14    <property name="plugin.minimum.java.version" value="17"/>
    1515    <property name="plugin.provides" value="javafx"/>
    1616    <!--<property name="plugin.icon" value="..."/>-->
  • applications/editors/josm/plugins/javafx/pom.xml

    r36313 r36315  
    2121        <plugin.early>true</plugin.early>
    2222        <plugin.stage>5</plugin.stage>
     23        <plugin.minimum.java.version>17</plugin.minimum.java.version>
    2324        <javafx.version>21.0.2</javafx.version>
    2425    </properties>
  • applications/editors/josm/plugins/opendata/build.xml

    r36122 r36315  
    11<?xml version="1.0" encoding="utf-8"?>
    2 <project name="opendata" default="dist" basedir=".">
     2<project name="opendata" default="dist" basedir="." xmlns:mvn="antlib:org.apache.maven.resolver.ant">
    33    <property name="plugin.main.version" value="18723"/>
    44    <property name="plugin.author" value="Don-vip"/>
     
    2626    <property name="ejml" location="${plugin.dist.dir}/ejml.jar"/>
    2727    <property name="geotools" location="${plugin.dist.dir}/geotools.jar"/>
    28    
     28
    2929    <!--
    3030    **********************************************************
     
    4141    **********************************************************
    4242    -->
    43     <target name="compile_jopendoc" depends="init">
     43    <target name="compile_jopendoc" depends="init, fetch_dependencies">
    4444        <echo message="compiling JOpenDocument ... "/>
    4545        <javac srcdir="includes/org/jopendocument" debug="false" destdir="${plugin.build.dir}" includeAntRuntime="false" encoding="ISO-8859-1" release="${java.lang.version}">
    4646            <classpath>
    4747                <!-- JDOM is required in an older version than the one embedded in geotools jar -->
    48                 <pathelement location="lib/jdom-1.1.3.jar"/>
     48                <pathelement location="lib/jdom2-2.0.6.1.jar"/>
    4949                <pathelement location="${apache-commons}"/>
    5050            </classpath>
     
    7878    **********************************************************
    7979    -->
    80     <target name="pre-compile" depends="init, compile_poi, compile_jopendoc, compile_neptune, compile_j7zip"/>
     80    <target name="pre-compile" depends="init, fetch_dependencies, compile_poi, compile_jopendoc, compile_neptune, compile_j7zip"/>
    8181   
    8282    <target name="xjc_neptune" depends="init, -jaxb_linux, -jaxb_windows" unless="jaxb.notRequired">
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/ChildCreator.java

    r34152 r36315  
    2020import java.util.ListIterator;
    2121
    22 import org.jdom.Element;
    23 import org.jdom.Namespace;
     22import org.jdom2.Element;
     23import org.jdom2.Namespace;
    2424
    2525/**
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/ImmutableDocStyledNode.java

    r30568 r36315  
    1919import java.util.Set;
    2020
    21 import org.jdom.Document;
    22 import org.jdom.Element;
     21import org.jdom2.Document;
     22import org.jdom2.Element;
    2323
    2424public class ImmutableDocStyledNode<S extends StyleStyle, D extends ODDocument> extends StyledNode<S, D> {
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/ODMeta.java

    r30568 r36315  
    2424import java.util.Map;
    2525
    26 import org.jdom.Element;
    27 import org.jdom.Namespace;
     26import org.jdom2.Element;
     27import org.jdom2.Namespace;
    2828
    2929/**
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/ODNode.java

    r28000 r36315  
    1616package org.jopendocument.dom;
    1717
    18 import org.jdom.Element;
     18import org.jdom2.Element;
    1919
    2020/**
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/ODPackage.java

    r34151 r36315  
    2222import java.util.Set;
    2323
    24 import org.jdom.Document;
     24import org.jdom2.Document;
    2525import org.jopendocument.util.CopyUtils;
    2626import org.jopendocument.util.FileUtils;
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/ODUserDefinedMeta.java

    r28000 r36315  
    1919import java.util.List;
    2020
    21 import org.jdom.Attribute;
    22 import org.jdom.Element;
    23 import org.jdom.Namespace;
     21import org.jdom2.Attribute;
     22import org.jdom2.Element;
     23import org.jdom2.Namespace;
    2424
    2525// eg <meta:user-defined meta:name="countOfSomething">5.2</meta:user-defined>
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/ODXMLDocument.java

    r30568 r36315  
    2424import java.util.Map;
    2525
    26 import org.jdom.Document;
    27 import org.jdom.Element;
    28 import org.jdom.Namespace;
     26import org.jdom2.Document;
     27import org.jdom2.Element;
     28import org.jdom2.Namespace;
    2929
    3030/**
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/StyleDesc.java

    r30568 r36315  
    2020import java.util.List;
    2121
    22 import org.jdom.Element;
     22import org.jdom2.Element;
    2323import org.jopendocument.util.CollectionMap;
    2424
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/StyleStyle.java

    r30568 r36315  
    1919import java.util.Map;
    2020
    21 import org.jdom.Element;
    22 import org.jdom.Namespace;
     21import org.jdom2.Element;
     22import org.jdom2.Namespace;
    2323import org.jopendocument.dom.spreadsheet.CellStyle;
    2424import org.jopendocument.dom.spreadsheet.ColumnStyle;
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/StyledNode.java

    r28000 r36315  
    1616package org.jopendocument.dom;
    1717
    18 import org.jdom.Element;
     18import org.jdom2.Element;
    1919
    2020/**
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/XMLVersion.java

    r30568 r36315  
    1919import java.util.Map;
    2020
    21 import org.jdom.Element;
    22 import org.jdom.Namespace;
     21import org.jdom2.Element;
     22import org.jdom2.Namespace;
    2323
    2424/**
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/Cell.java

    r34151 r36315  
    2525import java.util.regex.Pattern;
    2626
    27 import org.jdom.Element;
    28 import org.jdom.Namespace;
    29 import org.jdom.Text;
     27import org.jdom2.Element;
     28import org.jdom2.Namespace;
     29import org.jdom2.Text;
    3030import org.jopendocument.dom.ODDocument;
    3131import org.jopendocument.dom.ODValueType;
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/CellStyle.java

    r28000 r36315  
    1818import java.util.Arrays;
    1919
    20 import org.jdom.Element;
     20import org.jdom2.Element;
    2121import org.jopendocument.dom.ODPackage;
    2222import org.jopendocument.dom.StyleDesc;
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/Column.java

    r28000 r36315  
    1616package org.jopendocument.dom.spreadsheet;
    1717
    18 import org.jdom.Element;
     18import org.jdom2.Element;
    1919import org.jopendocument.dom.ODDocument;
    2020
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/ColumnStyle.java

    r28000 r36315  
    1616package org.jopendocument.dom.spreadsheet;
    1717
    18 import org.jdom.Element;
     18import org.jdom2.Element;
    1919import org.jopendocument.dom.ODPackage;
    2020import org.jopendocument.dom.StyleDesc;
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/Row.java

    r30568 r36315  
    2222import java.util.List;
    2323
    24 import org.jdom.Element;
     24import org.jdom2.Element;
    2525import org.jopendocument.dom.ODDocument;
    2626
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/RowStyle.java

    r28000 r36315  
    1616package org.jopendocument.dom.spreadsheet;
    1717
    18 import org.jdom.Element;
     18import org.jdom2.Element;
    1919import org.jopendocument.dom.ODPackage;
    2020import org.jopendocument.dom.StyleDesc;
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/Sheet.java

    r28000 r36315  
    1616package org.jopendocument.dom.spreadsheet;
    1717
    18 import org.jdom.Element;
     18import org.jdom2.Element;
    1919
    2020/**
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/SpreadSheet.java

    r30568 r36315  
    2121import java.util.NoSuchElementException;
    2222
    23 import org.jdom.Document;
    24 import org.jdom.Element;
     23import org.jdom2.Document;
     24import org.jdom2.Element;
    2525import org.jopendocument.dom.ODDocument;
    2626import org.jopendocument.dom.ODPackage;
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/Table.java

    r30568 r36315  
    2020import java.util.ListIterator;
    2121
    22 import org.jdom.Attribute;
    23 import org.jdom.Element;
     22import org.jdom2.Attribute;
     23import org.jdom2.Element;
    2424import org.jopendocument.dom.ODDocument;
    2525import org.jopendocument.util.Tuple2;
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/TableCalcNode.java

    r28000 r36315  
    1616package org.jopendocument.dom.spreadsheet;
    1717
    18 import org.jdom.Element;
    19 import org.jdom.Namespace;
     18import org.jdom2.Element;
     19import org.jdom2.Namespace;
    2020import org.jopendocument.dom.ImmutableDocStyledNode;
    2121import org.jopendocument.dom.ODDocument;
  • applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/TableStyle.java

    r28000 r36315  
    1818import java.util.Arrays;
    1919
    20 import org.jdom.Element;
     20import org.jdom2.Element;
    2121import org.jopendocument.dom.ODPackage;
    2222import org.jopendocument.dom.StyleDesc;
  • applications/editors/josm/plugins/opendata/pom.xml

    r36282 r36315  
    7171            <scope>provided</scope>
    7272        </dependency>
    73         <!-- Needed to compile jopendocument, provided by geotools later -->
     73        <!-- Needed to compile jopendocument, not currently provided by geotools -->
    7474        <dependency>
    7575            <groupId>org.jdom</groupId>
    76             <artifactId>jdom</artifactId>
    77             <version>1.1.3</version>
    78             <scope>provided</scope>
     76            <artifactId>jdom2</artifactId>
     77            <version>2.0.6.1</version>
     78            <scope>compile</scope>
    7979        </dependency>
    8080    </dependencies>
  • applications/editors/josm/plugins/rasterfilters/build.xml

    r36122 r36315  
    1313        <property name="plugin.version" value="1.0.4"/>
    1414
    15     <property name="plugin.icon" value="images/josm_filters_48.png"/>
     15  <property name="plugin.icon" value="images/josm_filters_48.png"/>
    1616        <property name="plugin.author" value="Vadim Varnavsky" />
    1717        <property name="plugin.class" value="org.openstreetmap.josm.plugins.rasterfilters.RasterFiltersPlugin" />
    1818        <property name="plugin.description" value="The RasterFiltersPlugin allows to choose and apply some images'' filters to some layers" />
    1919
     20  <target name="pre-compile" depends="fetch_dependencies">
     21    <!-- include fetch_dependencies task -->
     22  </target>
     23
    2024</project>
  • applications/editors/josm/plugins/rasterfilters/pom.xml

    r36314 r36315  
    3535            <groupId>org.jsoup</groupId>
    3636            <artifactId>jsoup</artifactId>
    37             <version>1.15.3</version>
     37            <version>1.18.1</version>
    3838        </dependency>
    3939        <dependency>
    40             <!-- I think lib/picker.jar is an "old" version of org.drjekyll:colorpicker:1.2 -->
    41             <!-- Note: you will have to run mvn initialize to get this working. Sorry. -->
    4240            <groupId>org.drjekyll</groupId>
    4341            <artifactId>colorpicker</artifactId>
    44             <version>1.0</version>
     42            <version>2.0.1</version>
    4543        </dependency>
    4644    </dependencies>
    4745    <build>
    4846        <plugins>
    49             <plugin>
    50                 <groupId>org.apache.maven.plugins</groupId>
    51                 <artifactId>maven-install-plugin</artifactId>
    52                 <version>3.1.1</version>
    53                 <executions>
    54                     <execution>
    55                         <id>default-initialize</id>
    56                         <phase>initialize</phase>
    57                         <goals>
    58                             <goal>install-file</goal>
    59                         </goals>
    60                         <configuration>
    61                             <file>lib/picker.jar</file>
    62                             <groupId>org.drjekyll</groupId>
    63                             <artifactId>colorpicker</artifactId>
    64                             <version>1.0</version>
    65                             <packaging>jar</packaging>
    66                         </configuration>
    67                     </execution>
    68                     <execution>
    69                         <id>clean-initialize</id>
    70                         <phase>clean</phase>
    71                         <goals>
    72                             <goal>install-file</goal>
    73                         </goals>
    74                         <configuration>
    75                             <file>lib/picker.jar</file>
    76                             <groupId>org.drjekyll</groupId>
    77                             <artifactId>colorpicker</artifactId>
    78                             <version>1.0</version>
    79                             <packaging>jar</packaging>
    80                         </configuration>
    81                     </execution>
    82                 </executions>
    83             </plugin>
    8447            <plugin>
    8548                <groupId>org.apache.maven.plugins</groupId>
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/gui/FilterGuiListener.java

    r34550 r36315  
     1// SPDX-License-Identifier: WTFPL
    12package org.openstreetmap.josm.plugins.rasterfilters.gui;
    23
     
    2627import org.openstreetmap.josm.plugins.rasterfilters.values.SliderValue;
    2728
    28 import com.bric.swing.ColorPicker;
     29import com.bric.colorpicker.ColorPicker;
    2930
    3031/**
     
    3536 */
    3637public class FilterGuiListener implements ChangeListener, ItemListener,
    37         ActionListener, PropertyChangeListener, FilterStateOwner
    38 {
     38        ActionListener, PropertyChangeListener, FilterStateOwner {
    3939
    40     private StateChangeListener handler;
     40    private final StateChangeListener handler;
    4141    private FilterStateModel filterState;
    42     private Set<ComboBoxModel<String>> models = new HashSet<>();
     42    private final Set<ComboBoxModel<String>> models = new HashSet<>();
    4343    private UID filterId;
    4444
     45    /**
     46     * Create a new {@link FilterGuiListener} with the given handler
     47     * @param handler The handler to call when the state changes
     48     */
    4549    public FilterGuiListener(StateChangeListener handler) {
    4650        this.handler = handler;
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/gui/FilterPanel.java

    r36122 r36315  
     1// SPDX-License-Identifier: WTFPL
    12package org.openstreetmap.josm.plugins.rasterfilters.gui;
    23
     
    1314import java.util.Hashtable;
    1415
     16import com.bric.colorpicker.ColorPickerMode;
    1517import jakarta.json.JsonArray;
    1618import jakarta.json.JsonObject;
     
    2729import javax.swing.JPanel;
    2830import javax.swing.JSlider;
     31import javax.swing.SwingConstants;
    2932import javax.swing.border.Border;
    3033import javax.swing.border.EmptyBorder;
     
    3437import org.openstreetmap.josm.tools.Logging;
    3538
    36 import com.bric.swing.ColorPicker;
     39import com.bric.colorpicker.ColorPicker;
    3740
    3841/**
     
    4649
    4750    private static final long serialVersionUID = 1L;
     51    private static final String TITLE = "title";
     52    private static final String DEFAULT = "default";
     53    private static final String ARIAL = "Arial";
    4854    private UID filterId;
    4955    private int neededHeight;
    5056
     57    /**
     58     * Create a new {@link FilterPanel}
     59     */
    5160    public FilterPanel() {
    5261        super();
     
    7382                setNeededHeight(getNeededHeight() + 30);
    7483
    75                 JCheckBox checkBox = createCheckBox(json.getString("title"));
    76                 checkBox.setSelected(json.getBoolean("default"));
     84                JCheckBox checkBox = createCheckBox(json.getString(TITLE));
     85                checkBox.setSelected(json.getBoolean(DEFAULT));
    7786                checkBox.setName(json.getString("name"));
    7887
     
    93102    private JComponent createSelect(JsonObject json) {
    94103
    95         Font font = new Font("Arial", Font.PLAIN, 14);
     104        Font font = new Font(ARIAL, Font.PLAIN, 14);
    96105
    97106        JPanel selectPanel = new JPanel();
     
    102111        selectPanel.setMaximumSize(new Dimension(300, 40));
    103112
    104         JLabel selectTitle = new JLabel(json.getString("title"));
     113        JLabel selectTitle = new JLabel(json.getString(TITLE));
    105114
    106115        selectTitle.setFont(font);
     
    111120        DefaultComboBoxModel<String> model = new DefaultComboBoxModel<>();
    112121
    113         model.setSelectedItem(json.getString("default"));
     122        model.setSelectedItem(json.getString(DEFAULT));
    114123
    115124        for (int i = 0; i < valuesArray.size(); i++) {
     
    134143        ColorPicker picker = new ColorPicker(false, false);
    135144        picker.setPreferredSize(new Dimension(200, 180));
    136         picker.setMode(ColorPicker.HUE);
     145        picker.setMode(ColorPickerMode.HUE);
    137146        picker.setName(json.getString("name"));
    138147
    139         addControlTitle(json.getString("title"));
     148        addControlTitle(json.getString(TITLE));
    140149
    141150        this.add(picker);
     
    152161
    153162        JCheckBox checkBox = new JCheckBox(text);
    154         Font font = new Font("Arial", Font.PLAIN, 12);
     163        Font font = new Font(ARIAL, Font.PLAIN, 12);
    155164
    156165        checkBox.setFont(font);
     
    167176    private static JCheckBox createDisableBox(ItemListener listener) {
    168177        JCheckBox disable = new JCheckBox("Disable");
    169         Font font = new Font("Arial", Font.PLAIN, 12);
     178        Font font = new Font(ARIAL, Font.PLAIN, 12);
    170179
    171180        disable.addItemListener(listener);
     
    177186    private static JButton createRemoveButton(ActionListener listener) {
    178187        JButton removeButton = new JButton("Remove");
    179         Font font = new Font("Arial", Font.PLAIN, 12);
     188        Font font = new Font(ARIAL, Font.PLAIN, 12);
    180189
    181190        removeButton.setFont(font);
     
    207216
    208217    private void addControlTitle(String labelText) {
    209         Font labelFont = new Font("Arial", Font.PLAIN, 14);
     218        Font labelFont = new Font(ARIAL, Font.PLAIN, 14);
    210219
    211220        JPanel sliderLabelPanel = new JPanel();
     
    214223        sliderLabelPanel.setBackground(Color.white);
    215224
    216         JLabel sliderLabel = new JLabel(labelText, JLabel.LEFT);
     225        JLabel sliderLabel = new JLabel(labelText, SwingConstants.LEFT);
    217226        sliderLabel.setFont(labelFont);
    218227        sliderLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
     
    228237        Border sliderBorder = new EmptyBorder(5, 5, 5, 5);
    229238
    230         addControlTitle(json.getString("title"));
     239        addControlTitle(json.getString(TITLE));
    231240
    232241        Hashtable<Integer, JLabel> labelTable = new Hashtable<>();
     
    240249            int minValue = array.getInt(0);
    241250            int maxValue = array.getInt(1);
    242             int initValue = json.getInt("default");
     251            int initValue = json.getInt(DEFAULT);
    243252
    244253            Logging.debug("Slider is integer\n");
     
    246255                    + "maxValue: " + maxValue);
    247256            try {
    248                 slider = new JSlider(JSlider.HORIZONTAL, minValue, maxValue,
     257                slider = new JSlider(SwingConstants.HORIZONTAL, minValue, maxValue,
    249258                        initValue);
    250259                slider.setName(json.getString("name"));
     
    273282
    274283
    275             double initValue = json.getJsonNumber("default").doubleValue() * 100;
     284            double initValue = json.getJsonNumber(DEFAULT).doubleValue() * 100;
    276285            double delta = (maxValue - minValue) / 100d;
    277286
     
    287296
    288297            try {
    289                 slider = new JSlider(JSlider.HORIZONTAL, minValue, maxValue, (int) initValue);
     298                slider = new JSlider(SwingConstants.HORIZONTAL, minValue, maxValue, (int) initValue);
    290299                slider.setMinorTickSpacing(maxValue / 4);
    291300                slider.setName(json.getString("name"));
  • applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/model/FiltersManager.java

    r36122 r36315  
     1// SPDX-License-Identifier: WTFPL
    12package org.openstreetmap.josm.plugins.rasterfilters.model;
    23
     
    3233import org.openstreetmap.josm.tools.Logging;
    3334
    34 import com.bric.swing.ColorPicker;
     35import com.bric.colorpicker.ColorPicker;
    3536
    3637
     
    4243 */
    4344public class FiltersManager implements StateChangeListener, ImageProcessor, ActionListener, ItemListener {
    44 
    45     public Map<UID, Filter> filtersMap = new LinkedHashMap<>();
    46     public Set<Filter> disabledFilters = new HashSet<>();
    47     public FiltersDialog dialog;
    48 
     45    private static final String TITLE = "title";
     46
     47    private final Map<UID, Filter> filtersMap = new LinkedHashMap<>();
     48    private final Set<Filter> disabledFilters = new HashSet<>();
     49    private final FiltersDialog dialog;
     50
     51    /**
     52     * Create a new {@link FiltersManager} given a {@link FiltersDialog}
     53     * @param dialog The dialog to use
     54     */
    4955    public FiltersManager(FiltersDialog dialog) {
    5056        this.dialog = dialog;
     
    6167        String filterClassName = meta.getString("classname");
    6268
    63         String filterTitle = meta.getString("title");
     69        String filterTitle = meta.getString(TITLE);
    6470
    6571        fp.setName(filterTitle);
     
    96102        }
    97103
    98         fp.setBorder(BorderFactory.createTitledBorder(meta.getString("title")));
     104        fp.setBorder(BorderFactory.createTitledBorder(meta.getString(TITLE)));
    99105
    100106        JsonArray controls = meta.getJsonArray("controls");
     
    165171        for (JsonObject json : FiltersDownloader.filtersMeta) {
    166172
    167             if (json.getString("title").equals(title)) {
     173            if (json.getString(TITLE).equals(title)) {
    168174                return createFilterWithPanel(json);
    169175            }
Note: See TracChangeset for help on using the changeset viewer.