Changeset 36315 in osm for applications/editors
- Timestamp:
- 2024-08-21T19:57:34+02:00 (4 months ago)
- Location:
- applications/editors/josm/plugins
- Files:
-
- 4 deleted
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/build-common.xml
r36308 r36315 11 11 ** 12 12 --> 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" > 14 14 15 15 <property name="josm" location="../../core/dist/josm-custom.jar"/> … … 43 43 <property name="ivy.jar.file" location="${ivy.jar.dir}/ivy.jar"/> 44 44 <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"/> 45 48 <property name="jacoco.inclbootstrapclasses" value="false" /> 46 49 <property name="jacoco.inclnolocationclasses" value="false" /> … … 111 114 </target> 112 115 <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> 113 122 <echo message="compiling sources for ${plugin.jar} ..."/> 114 123 <path id="jdk.boot.classpath"> … … 134 143 <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" /> 135 144 <compilerarg line="-Xmaxwarns 1000"/> 136 <classpath refid="plugin.classpath "/>145 <classpath refid="plugin.classpath.actual"/> 137 146 </javac> 138 147 </target> … … 280 289 <!-- to be overridden by plugins that need to perform additional tasks before generating javadoc --> 281 290 </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}"/> 283 293 <javadoc destdir="${plugin.doc.dir}" 284 294 executable="${javadoc.executable}" … … 289 299 linksource="true" 290 300 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"/> 292 303 <sourcepath> 293 304 <pathelement path="${plugin.src.dir}" /> … … 661 672 "/> 662 673 <fileset dir="${basedir}/test" includes="**/*.java" erroronmissingdir="false"/> 674 <formatter type="plain"/> 663 675 <formatter type="xml" toFile="checkstyle-josm-${ant.project.name}.xml"/> 664 676 </checkstyle> … … 677 689 jvmargs="-Xmx1024m" 678 690 > 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"/> 680 693 <sourcePath path="${basedir}/src" /> 681 694 <class location="${plugin.build.dir}" /> … … 715 728 ** Ivy tasks 716 729 --> 730 <target name="is-ivy"> 731 <condition property="isIvy"> 732 <available file="ivy.xml"/> 733 </condition> 734 </target> 717 735 <target name="download-ivy"> 718 736 <mkdir dir="${ivy.jar.dir}"/> … … 743 761 </delete> 744 762 </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"> 746 764 <echo>fetching dependencies with ivy</echo> 747 765 <available property="plugin.ivysettings.exists" file="ivy_settings.xml"/> … … 751 769 <ivy:retrieve pattern="${plugin.lib.dir}/[artifact]-[revision](-[classifier]).[ext]" conf="default" /> 752 770 </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"> 754 772 <ivy:checkdepsupdate/> 755 773 </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> 756 853 </project> -
applications/editors/josm/plugins/build.xml
r36311 r36315 13 13 <property name="java21_plugins" value="FIT/build.xml 14 14 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 16 17 Mapillary/build.xml 17 18 MapRoulette/build.xml … … 19 20 todo/build.xml"/> 20 21 <property name="ordered_plugins" value="jackson/build.xml 21 javafx/build.xml22 22 jaxb/build.xml 23 23 jna/build.xml -
applications/editors/josm/plugins/javafx/build.xml
r35805 r36315 12 12 <property name="plugin.class" value="org.openstreetmap.josm.plugins.javafx.JavaFxPlugin"/> 13 13 <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"/> 15 15 <property name="plugin.provides" value="javafx"/> 16 16 <!--<property name="plugin.icon" value="..."/>--> -
applications/editors/josm/plugins/javafx/pom.xml
r36313 r36315 21 21 <plugin.early>true</plugin.early> 22 22 <plugin.stage>5</plugin.stage> 23 <plugin.minimum.java.version>17</plugin.minimum.java.version> 23 24 <javafx.version>21.0.2</javafx.version> 24 25 </properties> -
applications/editors/josm/plugins/opendata/build.xml
r36122 r36315 1 1 <?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"> 3 3 <property name="plugin.main.version" value="18723"/> 4 4 <property name="plugin.author" value="Don-vip"/> … … 26 26 <property name="ejml" location="${plugin.dist.dir}/ejml.jar"/> 27 27 <property name="geotools" location="${plugin.dist.dir}/geotools.jar"/> 28 28 29 29 <!-- 30 30 ********************************************************** … … 41 41 ********************************************************** 42 42 --> 43 <target name="compile_jopendoc" depends="init ">43 <target name="compile_jopendoc" depends="init, fetch_dependencies"> 44 44 <echo message="compiling JOpenDocument ... "/> 45 45 <javac srcdir="includes/org/jopendocument" debug="false" destdir="${plugin.build.dir}" includeAntRuntime="false" encoding="ISO-8859-1" release="${java.lang.version}"> 46 46 <classpath> 47 47 <!-- 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"/> 49 49 <pathelement location="${apache-commons}"/> 50 50 </classpath> … … 78 78 ********************************************************** 79 79 --> 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"/> 81 81 82 82 <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 20 20 import java.util.ListIterator; 21 21 22 import org.jdom .Element;23 import org.jdom .Namespace;22 import org.jdom2.Element; 23 import org.jdom2.Namespace; 24 24 25 25 /** -
applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/ImmutableDocStyledNode.java
r30568 r36315 19 19 import java.util.Set; 20 20 21 import org.jdom .Document;22 import org.jdom .Element;21 import org.jdom2.Document; 22 import org.jdom2.Element; 23 23 24 24 public 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 24 24 import java.util.Map; 25 25 26 import org.jdom .Element;27 import org.jdom .Namespace;26 import org.jdom2.Element; 27 import org.jdom2.Namespace; 28 28 29 29 /** -
applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/ODNode.java
r28000 r36315 16 16 package org.jopendocument.dom; 17 17 18 import org.jdom .Element;18 import org.jdom2.Element; 19 19 20 20 /** -
applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/ODPackage.java
r34151 r36315 22 22 import java.util.Set; 23 23 24 import org.jdom .Document;24 import org.jdom2.Document; 25 25 import org.jopendocument.util.CopyUtils; 26 26 import org.jopendocument.util.FileUtils; -
applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/ODUserDefinedMeta.java
r28000 r36315 19 19 import java.util.List; 20 20 21 import org.jdom .Attribute;22 import org.jdom .Element;23 import org.jdom .Namespace;21 import org.jdom2.Attribute; 22 import org.jdom2.Element; 23 import org.jdom2.Namespace; 24 24 25 25 // 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 24 24 import java.util.Map; 25 25 26 import org.jdom .Document;27 import org.jdom .Element;28 import org.jdom .Namespace;26 import org.jdom2.Document; 27 import org.jdom2.Element; 28 import org.jdom2.Namespace; 29 29 30 30 /** -
applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/StyleDesc.java
r30568 r36315 20 20 import java.util.List; 21 21 22 import org.jdom .Element;22 import org.jdom2.Element; 23 23 import org.jopendocument.util.CollectionMap; 24 24 -
applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/StyleStyle.java
r30568 r36315 19 19 import java.util.Map; 20 20 21 import org.jdom .Element;22 import org.jdom .Namespace;21 import org.jdom2.Element; 22 import org.jdom2.Namespace; 23 23 import org.jopendocument.dom.spreadsheet.CellStyle; 24 24 import org.jopendocument.dom.spreadsheet.ColumnStyle; -
applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/StyledNode.java
r28000 r36315 16 16 package org.jopendocument.dom; 17 17 18 import org.jdom .Element;18 import org.jdom2.Element; 19 19 20 20 /** -
applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/XMLVersion.java
r30568 r36315 19 19 import java.util.Map; 20 20 21 import org.jdom .Element;22 import org.jdom .Namespace;21 import org.jdom2.Element; 22 import org.jdom2.Namespace; 23 23 24 24 /** -
applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/Cell.java
r34151 r36315 25 25 import java.util.regex.Pattern; 26 26 27 import org.jdom .Element;28 import org.jdom .Namespace;29 import org.jdom .Text;27 import org.jdom2.Element; 28 import org.jdom2.Namespace; 29 import org.jdom2.Text; 30 30 import org.jopendocument.dom.ODDocument; 31 31 import org.jopendocument.dom.ODValueType; -
applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/CellStyle.java
r28000 r36315 18 18 import java.util.Arrays; 19 19 20 import org.jdom .Element;20 import org.jdom2.Element; 21 21 import org.jopendocument.dom.ODPackage; 22 22 import org.jopendocument.dom.StyleDesc; -
applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/Column.java
r28000 r36315 16 16 package org.jopendocument.dom.spreadsheet; 17 17 18 import org.jdom .Element;18 import org.jdom2.Element; 19 19 import org.jopendocument.dom.ODDocument; 20 20 -
applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/ColumnStyle.java
r28000 r36315 16 16 package org.jopendocument.dom.spreadsheet; 17 17 18 import org.jdom .Element;18 import org.jdom2.Element; 19 19 import org.jopendocument.dom.ODPackage; 20 20 import org.jopendocument.dom.StyleDesc; -
applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/Row.java
r30568 r36315 22 22 import java.util.List; 23 23 24 import org.jdom .Element;24 import org.jdom2.Element; 25 25 import org.jopendocument.dom.ODDocument; 26 26 -
applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/RowStyle.java
r28000 r36315 16 16 package org.jopendocument.dom.spreadsheet; 17 17 18 import org.jdom .Element;18 import org.jdom2.Element; 19 19 import org.jopendocument.dom.ODPackage; 20 20 import org.jopendocument.dom.StyleDesc; -
applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/Sheet.java
r28000 r36315 16 16 package org.jopendocument.dom.spreadsheet; 17 17 18 import org.jdom .Element;18 import org.jdom2.Element; 19 19 20 20 /** -
applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/SpreadSheet.java
r30568 r36315 21 21 import java.util.NoSuchElementException; 22 22 23 import org.jdom .Document;24 import org.jdom .Element;23 import org.jdom2.Document; 24 import org.jdom2.Element; 25 25 import org.jopendocument.dom.ODDocument; 26 26 import org.jopendocument.dom.ODPackage; -
applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/Table.java
r30568 r36315 20 20 import java.util.ListIterator; 21 21 22 import org.jdom .Attribute;23 import org.jdom .Element;22 import org.jdom2.Attribute; 23 import org.jdom2.Element; 24 24 import org.jopendocument.dom.ODDocument; 25 25 import org.jopendocument.util.Tuple2; -
applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/TableCalcNode.java
r28000 r36315 16 16 package org.jopendocument.dom.spreadsheet; 17 17 18 import org.jdom .Element;19 import org.jdom .Namespace;18 import org.jdom2.Element; 19 import org.jdom2.Namespace; 20 20 import org.jopendocument.dom.ImmutableDocStyledNode; 21 21 import org.jopendocument.dom.ODDocument; -
applications/editors/josm/plugins/opendata/includes/org/jopendocument/dom/spreadsheet/TableStyle.java
r28000 r36315 18 18 import java.util.Arrays; 19 19 20 import org.jdom .Element;20 import org.jdom2.Element; 21 21 import org.jopendocument.dom.ODPackage; 22 22 import org.jopendocument.dom.StyleDesc; -
applications/editors/josm/plugins/opendata/pom.xml
r36282 r36315 71 71 <scope>provided</scope> 72 72 </dependency> 73 <!-- Needed to compile jopendocument, provided by geotools later-->73 <!-- Needed to compile jopendocument, not currently provided by geotools --> 74 74 <dependency> 75 75 <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> 79 79 </dependency> 80 80 </dependencies> -
applications/editors/josm/plugins/rasterfilters/build.xml
r36122 r36315 13 13 <property name="plugin.version" value="1.0.4"/> 14 14 15 15 <property name="plugin.icon" value="images/josm_filters_48.png"/> 16 16 <property name="plugin.author" value="Vadim Varnavsky" /> 17 17 <property name="plugin.class" value="org.openstreetmap.josm.plugins.rasterfilters.RasterFiltersPlugin" /> 18 18 <property name="plugin.description" value="The RasterFiltersPlugin allows to choose and apply some images'' filters to some layers" /> 19 19 20 <target name="pre-compile" depends="fetch_dependencies"> 21 <!-- include fetch_dependencies task --> 22 </target> 23 20 24 </project> -
applications/editors/josm/plugins/rasterfilters/pom.xml
r36314 r36315 35 35 <groupId>org.jsoup</groupId> 36 36 <artifactId>jsoup</artifactId> 37 <version>1.1 5.3</version>37 <version>1.18.1</version> 38 38 </dependency> 39 39 <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. -->42 40 <groupId>org.drjekyll</groupId> 43 41 <artifactId>colorpicker</artifactId> 44 <version> 1.0</version>42 <version>2.0.1</version> 45 43 </dependency> 46 44 </dependencies> 47 45 <build> 48 46 <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>84 47 <plugin> 85 48 <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 1 2 package org.openstreetmap.josm.plugins.rasterfilters.gui; 2 3 … … 26 27 import org.openstreetmap.josm.plugins.rasterfilters.values.SliderValue; 27 28 28 import com.bric. swing.ColorPicker;29 import com.bric.colorpicker.ColorPicker; 29 30 30 31 /** … … 35 36 */ 36 37 public class FilterGuiListener implements ChangeListener, ItemListener, 37 ActionListener, PropertyChangeListener, FilterStateOwner 38 { 38 ActionListener, PropertyChangeListener, FilterStateOwner { 39 39 40 private StateChangeListener handler;40 private final StateChangeListener handler; 41 41 private FilterStateModel filterState; 42 private Set<ComboBoxModel<String>> models = new HashSet<>();42 private final Set<ComboBoxModel<String>> models = new HashSet<>(); 43 43 private UID filterId; 44 44 45 /** 46 * Create a new {@link FilterGuiListener} with the given handler 47 * @param handler The handler to call when the state changes 48 */ 45 49 public FilterGuiListener(StateChangeListener handler) { 46 50 this.handler = handler; -
applications/editors/josm/plugins/rasterfilters/src/org/openstreetmap/josm/plugins/rasterfilters/gui/FilterPanel.java
r36122 r36315 1 // SPDX-License-Identifier: WTFPL 1 2 package org.openstreetmap.josm.plugins.rasterfilters.gui; 2 3 … … 13 14 import java.util.Hashtable; 14 15 16 import com.bric.colorpicker.ColorPickerMode; 15 17 import jakarta.json.JsonArray; 16 18 import jakarta.json.JsonObject; … … 27 29 import javax.swing.JPanel; 28 30 import javax.swing.JSlider; 31 import javax.swing.SwingConstants; 29 32 import javax.swing.border.Border; 30 33 import javax.swing.border.EmptyBorder; … … 34 37 import org.openstreetmap.josm.tools.Logging; 35 38 36 import com.bric. swing.ColorPicker;39 import com.bric.colorpicker.ColorPicker; 37 40 38 41 /** … … 46 49 47 50 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"; 48 54 private UID filterId; 49 55 private int neededHeight; 50 56 57 /** 58 * Create a new {@link FilterPanel} 59 */ 51 60 public FilterPanel() { 52 61 super(); … … 73 82 setNeededHeight(getNeededHeight() + 30); 74 83 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)); 77 86 checkBox.setName(json.getString("name")); 78 87 … … 93 102 private JComponent createSelect(JsonObject json) { 94 103 95 Font font = new Font( "Arial", Font.PLAIN, 14);104 Font font = new Font(ARIAL, Font.PLAIN, 14); 96 105 97 106 JPanel selectPanel = new JPanel(); … … 102 111 selectPanel.setMaximumSize(new Dimension(300, 40)); 103 112 104 JLabel selectTitle = new JLabel(json.getString( "title"));113 JLabel selectTitle = new JLabel(json.getString(TITLE)); 105 114 106 115 selectTitle.setFont(font); … … 111 120 DefaultComboBoxModel<String> model = new DefaultComboBoxModel<>(); 112 121 113 model.setSelectedItem(json.getString( "default"));122 model.setSelectedItem(json.getString(DEFAULT)); 114 123 115 124 for (int i = 0; i < valuesArray.size(); i++) { … … 134 143 ColorPicker picker = new ColorPicker(false, false); 135 144 picker.setPreferredSize(new Dimension(200, 180)); 136 picker.setMode(ColorPicker .HUE);145 picker.setMode(ColorPickerMode.HUE); 137 146 picker.setName(json.getString("name")); 138 147 139 addControlTitle(json.getString( "title"));148 addControlTitle(json.getString(TITLE)); 140 149 141 150 this.add(picker); … … 152 161 153 162 JCheckBox checkBox = new JCheckBox(text); 154 Font font = new Font( "Arial", Font.PLAIN, 12);163 Font font = new Font(ARIAL, Font.PLAIN, 12); 155 164 156 165 checkBox.setFont(font); … … 167 176 private static JCheckBox createDisableBox(ItemListener listener) { 168 177 JCheckBox disable = new JCheckBox("Disable"); 169 Font font = new Font( "Arial", Font.PLAIN, 12);178 Font font = new Font(ARIAL, Font.PLAIN, 12); 170 179 171 180 disable.addItemListener(listener); … … 177 186 private static JButton createRemoveButton(ActionListener listener) { 178 187 JButton removeButton = new JButton("Remove"); 179 Font font = new Font( "Arial", Font.PLAIN, 12);188 Font font = new Font(ARIAL, Font.PLAIN, 12); 180 189 181 190 removeButton.setFont(font); … … 207 216 208 217 private void addControlTitle(String labelText) { 209 Font labelFont = new Font( "Arial", Font.PLAIN, 14);218 Font labelFont = new Font(ARIAL, Font.PLAIN, 14); 210 219 211 220 JPanel sliderLabelPanel = new JPanel(); … … 214 223 sliderLabelPanel.setBackground(Color.white); 215 224 216 JLabel sliderLabel = new JLabel(labelText, JLabel.LEFT);225 JLabel sliderLabel = new JLabel(labelText, SwingConstants.LEFT); 217 226 sliderLabel.setFont(labelFont); 218 227 sliderLabel.setAlignmentX(Component.LEFT_ALIGNMENT); … … 228 237 Border sliderBorder = new EmptyBorder(5, 5, 5, 5); 229 238 230 addControlTitle(json.getString( "title"));239 addControlTitle(json.getString(TITLE)); 231 240 232 241 Hashtable<Integer, JLabel> labelTable = new Hashtable<>(); … … 240 249 int minValue = array.getInt(0); 241 250 int maxValue = array.getInt(1); 242 int initValue = json.getInt( "default");251 int initValue = json.getInt(DEFAULT); 243 252 244 253 Logging.debug("Slider is integer\n"); … … 246 255 + "maxValue: " + maxValue); 247 256 try { 248 slider = new JSlider( JSlider.HORIZONTAL, minValue, maxValue,257 slider = new JSlider(SwingConstants.HORIZONTAL, minValue, maxValue, 249 258 initValue); 250 259 slider.setName(json.getString("name")); … … 273 282 274 283 275 double initValue = json.getJsonNumber( "default").doubleValue() * 100;284 double initValue = json.getJsonNumber(DEFAULT).doubleValue() * 100; 276 285 double delta = (maxValue - minValue) / 100d; 277 286 … … 287 296 288 297 try { 289 slider = new JSlider( JSlider.HORIZONTAL, minValue, maxValue, (int) initValue);298 slider = new JSlider(SwingConstants.HORIZONTAL, minValue, maxValue, (int) initValue); 290 299 slider.setMinorTickSpacing(maxValue / 4); 291 300 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 1 2 package org.openstreetmap.josm.plugins.rasterfilters.model; 2 3 … … 32 33 import org.openstreetmap.josm.tools.Logging; 33 34 34 import com.bric. swing.ColorPicker;35 import com.bric.colorpicker.ColorPicker; 35 36 36 37 … … 42 43 */ 43 44 public 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 */ 49 55 public FiltersManager(FiltersDialog dialog) { 50 56 this.dialog = dialog; … … 61 67 String filterClassName = meta.getString("classname"); 62 68 63 String filterTitle = meta.getString( "title");69 String filterTitle = meta.getString(TITLE); 64 70 65 71 fp.setName(filterTitle); … … 96 102 } 97 103 98 fp.setBorder(BorderFactory.createTitledBorder(meta.getString( "title")));104 fp.setBorder(BorderFactory.createTitledBorder(meta.getString(TITLE))); 99 105 100 106 JsonArray controls = meta.getJsonArray("controls"); … … 165 171 for (JsonObject json : FiltersDownloader.filtersMeta) { 166 172 167 if (json.getString( "title").equals(title)) {173 if (json.getString(TITLE).equals(title)) { 168 174 return createFilterWithPanel(json); 169 175 }
Note:
See TracChangeset
for help on using the changeset viewer.