Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
essentially Mike's modifications from
https://github.com/openjump-gis/cadplan-extension/tree/main/jump-chart
plus
- moved everything into one clean package com.cadplan.jump_chart
- some I18N finetuning
- some icon cosmetics
- version is placed in language files via maven
- added distro-zip and checksumming
  • Loading branch information
edeso committed Sep 6, 2021
0 parents commit ad9433b
Show file tree
Hide file tree
Showing 29 changed files with 4,132 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/target/
.settings/*
.project
.classpath
30 changes: 30 additions & 0 deletions distro-zip.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
<id>distro zip</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<!-- place extension jar in folder root to be parsed by OJ -->
<outputDirectory>/</outputDirectory>
<useTransitiveFiltering>false</useTransitiveFiltering>
<includes>
<include>${artifact}</include>
</includes>
</dependencySet>
<dependencySet>
<!-- place deps in a extension lib/ subfolder, as jgrapht is a shared dependency -->
<outputDirectory>/lib</outputDirectory>
<unpack>false</unpack>
<scope>runtime</scope>
<useTransitiveFiltering>true</useTransitiveFiltering>
<useProjectArtifact>false</useProjectArtifact>
<excludes>
<exclude>org.openjump:OpenJUMP</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>
Binary file added doc/JumpChartUserGuide.pdf
Binary file not shown.
122 changes: 122 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>com.cadplan</groupId>
<artifactId>jump-chart-extension</artifactId>
<version>2.1.0</version>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- workaround, we need to use em here, so they are avail later during filtering -->
<project.build.version.details>[${git.branch}/${git.commit.id.abbrev}/${git.build.time}]</project.build.version.details>
</properties>

<repositories>
<repository>
<id>ojrepo</id>
<name>OpenJUMP Snapshot Repository</name>
<url>https://ojrepo.soldin.de/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.openjump</groupId>
<artifactId>OpenJUMP</artifactId>
<version>2.0-main-SNAPSHOT</version>
</dependency>
</dependencies>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>com/cadplan/jump_chart/language/</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>distro zip</id>
<phase>package</phase>
<configuration>
<descriptors>
<descriptor>distro-zip.xml</descriptor>
</descriptors>
<attach>false</attach>
</configuration>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.9.10</version>
<?m2e execute onConfiguration,onIncremental?>
<executions>
<!-- retrieve git revision information from local repo -->
<execution>
<id>fetch git properties of current branch</id>
<goals>
<goal>revision</goal>
</goals>
<phase>validate</phase>
</execution>
</executions>
<configuration>
<verbose>true</verbose>
<includeOnlyProperties>
<includeOnlyProperty>^git.branch$</includeOnlyProperty>
<includeOnlyProperty>^git.build.(time|version|(number(|.unique)))$</includeOnlyProperty>
<includeOnlyProperty>^git.commit.(id.(abbrev|full)|message.short)$</includeOnlyProperty>
<includeOnlyProperty>^git.dirty$</includeOnlyProperty>
</includeOnlyProperties>
</configuration>
</plugin>
<plugin>
<groupId>net.nicoulaj.maven.plugins</groupId>
<artifactId>checksum-maven-plugin</artifactId>
<version>1.10</version>
<executions>
<execution>
<goals>
<goal>files</goal>
</goals>
<phase>package</phase>
<configuration>
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<includes>
<include>${project.build.finalName}.zip</include>
</includes>
</fileSet>
</fileSets>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
223 changes: 223 additions & 0 deletions src/main/java/com/cadplan/jump_chart/designer/GridBagDesigner.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
/*
* The Unified Mapping Platform (JUMP) is an extensible, interactive GUI
* for visualizing and manipulating spatial features with geometry and attributes.
*
* Copyright (C) 2006 Cadplan
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
package com.cadplan.jump_chart.designer;
//===================================================
// GridBagDesigner
//===================================================




import java.awt.*;
import javax.swing.*;

/**
* @author Geoffrey G. Roy
* @version 1.0
*/


public class GridBagDesigner
{




private GridBagLayout layout;
private GridBagConstraints constraints;
private Container container;



/**
* Constructor for GridBagDesgner
*
* @param container
*/
public GridBagDesigner(Container container)
{
layout = new GridBagLayout();
constraints = new GridBagConstraints();
container.setLayout(layout);
this.container = container;
setDefaults();
}



/**
* Adds a component using currrent settings
*
* @param component
*/

public void addComponent(Component component)
{
layout.setConstraints(component, constraints);
container.add(component);
setDefaults();
}
public void addComponentRetain(Component component)
{
layout.setConstraints(component, constraints);
container.add(component);
}

/**
* Adds a JComponent using current settings and fixes
* size to xSize * ySize
*
* @param component
* @param xSize
* @param ySize
*/
public void addComponent(JComponent component, int xSize, int ySize)
{
Dimension size = new Dimension(xSize, ySize);
component.setMinimumSize(size);
component.setMaximumSize(size);
component.setPreferredSize(size);
layout.setConstraints(component, constraints);
container.add(component);
setDefaults();
}

public void addComponentRetain(JComponent component, int xSize, int ySize)
{
Dimension size = new Dimension(xSize, ySize);
component.setMinimumSize(size);
component.setMaximumSize(size);
component.setPreferredSize(size);
layout.setConstraints(component, constraints);
container.add(component);
}

public void resetLayout()
{
setDefaults();
}


/**
* Sets gid position
* Default is (0,0);
*
* @param gridx
* @param gridy
*/
public void setPosition(int gridx, int gridy)
{
constraints.gridx = gridx;
constraints.gridy = gridy;
}


/**
* Sets grid span
* Defaults are (1,1)
*
* @param gridwidth
* @param gridheight
*/
public void setSpan(int gridwidth, int gridheight)
{
constraints.gridwidth = gridwidth;
constraints.gridheight = gridheight;
}


/**
* Sets cell weights
* Defaults are (0.0,0.0)
*
* @param weightx
* @param weighty
*/
public void setWeight(double weightx, double weighty)
{
constraints.weightx = weightx;
constraints.weighty = weighty;
}


/**
* Sets cell fill type as one of:
* GridBagConstraints.{NONE, VERTICAL, HORIZONTAL, BOTH}
* Default is NONE
*
* @param fill
*/
public void setFill(int fill)
{
constraints.fill = fill;
}


/**
* Sets cell anchor type as one of:
* GridBagConstraints.{NORTH, NORTHEAST, EAST, SOUTHEAST, SOUTH, SOUTHWEST, WEST, NORTHWEST, CENTER}
* Default is CENTER
*
* @param anchor
*/
public void setAnchor(int anchor)
{
constraints.anchor = anchor;
}



/**
* Sets cell insets
* Defaults are (0,0,0,0)
*
* @param top
* @param left
* @param bottom
* @param right
*/
public void setInsets(int top, int left, int bottom, int right)
{
constraints.insets = new Insets(top, left, bottom, right);
}


/**
* Sets cell defaults
*
*/
private void setDefaults()
{
constraints.gridx = 0;
constraints.gridy = 0;
constraints.gridwidth = 1;
constraints.gridheight = 1;
constraints.fill = GridBagConstraints.NONE;
constraints.anchor = GridBagConstraints.CENTER;
constraints.weightx = 0.0;
constraints.weighty = 0.0;
constraints.insets = new Insets(0,0,0,0);

}


}
Loading

0 comments on commit ad9433b

Please sign in to comment.