Skip to content

Commit

Permalink
distro package resource folder, iconify dialogs
Browse files Browse the repository at this point in the history
rename icon/language package for easier resource folder packaging
  • Loading branch information
edeso committed Jan 16, 2022
1 parent 75bc192 commit 49673f1
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 3 deletions.
11 changes: 11 additions & 0 deletions distro-zip.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,15 @@
</includes>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<!-- sextante/ files folder -->
<directory>${project.build.outputDirectory}</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>set_attributes/**</include>
</includes>
<filtered>false</filtered>
</fileSet>
</fileSets>
</assembly>
12 changes: 11 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<resource>
<directory>src/main/resources</directory>
<includes>
<include>set_attributes/language/</include>
<include>org/openjump/ext/setattributes/language/</include>
</includes>
<filtering>true</filtering>
</resource>
Expand Down Expand Up @@ -136,6 +136,16 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.1</version>
<configuration>
<excludes>
<exclude>set_attributes/</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// 0.7.0 [2015-06-13]
public class SetAttributesExtension extends Extension {

public static final I18N I18N = com.vividsolutions.jump.I18N.getInstance("set_attributes");
public static final I18N I18N = com.vividsolutions.jump.I18N.getInstance("org.openjump.ext.setattributes");

public String getName() {
return "Set Attribute Values Extension (Micha\u00EBl Michaud)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public String getName() {

public ImageIcon getIcon(){
return new ImageIcon(Objects.requireNonNull(this.getClass()
.getResource("/set_attributes/set_attributes.png")));
.getResource("set_attributes.png")));
}

public boolean execute(final PlugInContext context) throws Exception {
Expand All @@ -50,6 +50,8 @@ public boolean execute(final PlugInContext context) throws Exception {
Logger.error("Missing default set-attributes/ folder in extension dir.");
addFiles("~/.OpenJUMP/set_attributes", fileMap);
MultiInputDialog dialog = new MultiInputDialog(context.getWorkbenchFrame(), getName(), true);
ImageIcon small = GUIUtil.resize((ImageIcon) getIcon(), 12);
dialog.setIconImage(small.getImage());
for (Map.Entry<String,File> entry : fileMap.entrySet()) {
JDialog dia = dialogsMap.get(entry.getKey());
JCheckBox jcb = dialog.addCheckBox(entry.getKey(), dia!=null && dia.isValid() && dia.isVisible());
Expand All @@ -69,6 +71,7 @@ public boolean execute(final PlugInContext context) throws Exception {
JDialog jaDialog = toolbox.createDialog(
context.getWorkbenchContext(),
entry.getValue().getParentFile());
jaDialog.setIconImage(small.getImage());
jaDialog.pack();
jaDialog.setResizable(false);
jaDialog.setLocationRelativeTo(context.getWorkbenchFrame());
Expand Down

0 comments on commit 49673f1

Please sign in to comment.