Skip to content

Commit 94d4526

Browse files
committed
Servlet build updates.
MapTileServlet updates for MapTileSets Moved DrawingAttribute GUI out of EditableOMGraphic GUI Fixed ToolPanel property problem. OverlayMapPanel cursor fix. mapTile package fixes. Took Mnemonic out of menus.
1 parent 4613f5e commit 94d4526

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+9458
-9356
lines changed

.classpath

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<classpath>
33
<classpathentry excluding="**/.DS_Store|**/.cvsignore|build.xml" kind="src" path="src/openmap"/>
44
<classpathentry kind="src" path="src/vpfservlet/WEB-INF/src"/>
5-
<classpathentry kind="src" output="openmap/classes/mapTileServlet" path="src/maptileservlet/WEB-INF/src"/>
5+
<classpathentry kind="src" path="src/maptileservlet/WEB-INF/src"/>
66
<classpathentry excluding="**/.DS_Store|**/.cvsignore|build.xml" kind="src" path="src/ext"/>
77
<classpathentry excluding="**/.DS_Store|**/.cvsignore|build.xml" kind="src" output="classes/corba" path="src/corba"/>
88
<classpathentry excluding="**/.DS_Store|**/.cvsignore|build.xml" kind="src" output="classes/j3d" path="src/j3d"/>

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/classes

build.xml

+8-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<property name="mac.app" value="OpenMap.app" />
2020
<property name="jar.excludes" value="${general.excludes}, **/*.java" />
2121
<property name="openmap_version" value="5.0.1b" />
22-
<property name="openmap.ext" value="${openmap.home}/ext" />
22+
<property name="openmap.ext" value="${openmap.home}/src/ext" />
2323
<property name="openmap.src" value="${openmap.home}/src/openmap" />
2424
<property name="svg.src" value="${openmap.home}/src/svg" />
2525
<property name="j3d.src" value="${openmap.home}/src/j3d" />
@@ -31,13 +31,17 @@
3131
<property name="macJavaStub" value="/System/Library/Frameworks/JavaVM.framework/Resources/MacOS/JavaApplicationStub" />
3232

3333
<!-- Whatever you put in value will be passed to compiler.-->
34-
<!-- <property name="compiler.args" value="-Xlint:deprecation,unchecked"/>-->
35-
<property name="compiler.args" value="-nowarn"/>
34+
<!-- <property name="compiler.args" value="-Xlint:deprecation,unchecked"/>-->
35+
<property name="compiler.args" value="-nowarn" />
3636

3737
<available file="${macJavaStub}" property="do.copyMacJavaStub" />
3838

39+
<!-- ################################
40+
You can add path to external jars here, comma separated in the includes list. This covers
41+
the jars in the external libraries available from svn
42+
######################### -->
3943
<path id="ext_tools_classpath">
40-
<fileset dir="." includes="ext/**/*.jar" />
44+
<fileset dir="." includes="ext/**/*.jar" />
4145
</path>
4246

4347
</target>

lib/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/omcorba.jar
2+
/omj3d.jar
3+
/omsvg.jar
4+
/openmap.jar
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/CSpecialist
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/CRpfFrameProvider
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/corbaImageServer

src/maptileservlet/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/dist

src/maptileservlet/WEB-INF/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/classes
2+
/lib

src/maptileservlet/WEB-INF/classes/tileset1.properties

-4
This file was deleted.

src/maptileservlet/WEB-INF/classes/tileset2.properties

-3
This file was deleted.

src/maptileservlet/WEB-INF/src/com/bbn/openmap/maptileservlet/MapTileServlet.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.bbn.openmap.util.ComponentFactory;
2424
import com.bbn.openmap.util.PropUtils;
2525
import com.bbn.openmap.util.http.HttpConnection;
26+
import java.io.InputStream;
2627

2728
/**
2829
* MapTileServlet is a servlet class that fields requests for map tiles.
@@ -63,7 +64,8 @@ public void init(ServletConfig config)
6364

6465
Properties descProps = new Properties();
6566
logger.info("going to read props");
66-
descProps.load(descURL.openStream());
67+
InputStream descURLStream = descURL.openStream();
68+
descProps.load(descURLStream);
6769

6870
logger.info("loaded " + desc + " " + descProps.toString());
6971

@@ -74,6 +76,8 @@ public void init(ServletConfig config)
7476
mapTileSets.put(mts.getName(), mts);
7577
logger.info("Adding " + mtsName + " dataset");
7678
}
79+
80+
descURLStream.close();
7781
}
7882
} catch (MalformedURLException murle) {
7983
logger.warning("MalformedURLException reading " + desc);

src/maptileservlet/WEB-INF/src/com/bbn/openmap/maptileservlet/MapTileSet.java

-17
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,12 @@
1010
* with the terms of the license agreement you entered into with CSC.
1111
*
1212
*/
13-
1413
package com.bbn.openmap.maptileservlet;
1514

16-
import java.awt.geom.Point2D;
17-
import java.awt.image.BufferedImage;
1815
import java.io.IOException;
19-
import java.util.Properties;
20-
import java.util.logging.Logger;
2116

2217
import com.bbn.openmap.PropertyConsumer;
23-
import com.bbn.openmap.dataAccess.mapTile.EmptyTileHandler;
24-
import com.bbn.openmap.dataAccess.mapTile.MapTileCoordinateTransform;
25-
import com.bbn.openmap.dataAccess.mapTile.MapTileMaker;
26-
import com.bbn.openmap.dataAccess.mapTile.OSMMapTileCoordinateTransform;
27-
import com.bbn.openmap.dataAccess.mapTile.SimpleEmptyTileHandler;
28-
import com.bbn.openmap.dataAccess.mapTile.StandardMapTileFactory;
29-
import com.bbn.openmap.image.PNGImageIOFormatter;
30-
import com.bbn.openmap.io.BinaryBufferedFile;
3118
import com.bbn.openmap.io.FormatException;
32-
import com.bbn.openmap.proj.Mercator;
33-
import com.bbn.openmap.proj.coords.LatLonPoint;
34-
import com.bbn.openmap.util.ComponentFactory;
35-
import com.bbn.openmap.util.PropUtils;
3619

3720
/**
3821
* The MapTileSet contains all the information for handling a specific set of

src/maptileservlet/build.xml

+21-12
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<property name="ommaptile.class_dir" value="./WEB-INF/src" />
88
<property name="ommaptile.lib_dir" value="./WEB-INF/lib" />
99
<property name="ommaptile.classes" value="./WEB-INF/classes" />
10-
10+
<property name="ommaptile.dist" value="./dist" />
1111
<!-- YOU HAVE TO CHANGE THIS TO MATCH YOUR TOMCAT INSTALLATION -->
1212
<!--<property name="tomcat.home" value="/usr/local/java/jakarta-tomcat-4.0.1"/>-->
1313
<property name="tomcat.home" value="/usr/local/apache-tomcat-7.0.8" />
@@ -36,14 +36,21 @@
3636

3737
<target name="todo" depends="classes, jar" description="Compiles all of the OpenMap classes and builds jar files in lib directory." />
3838

39-
<target name="classes" depends="ommaptile" description="Compiles Ommaptile Servlet classes." />
40-
41-
<target name="all" depends="jar" description="Compiles Ommaptile Servlet classes and creates the war (web archive) file." />
39+
<target name="classes" depends="ommaptile" description="Compiles ommaptile Servlet classes." />
4240

43-
<target name="jar" depends="classes" description="Builds jar files, placing them in the lib directory.">
44-
45-
<jar jarfile="${ommaptile.home}/ommaptile.war" basedir="${ommaptile.home}" includes="**, **/*.jsp, **/*.html,**/*.properties" excludes="**/*.war, **/build.xml, **/src/**" />
41+
<target name="all" depends="war" description="Compiles Ommaptile Servlet classes and creates the war (web archive) file." />
4642

43+
<target name="war" depends="jar">
44+
<war destfile="${ommaptile.home}/ommaptile.war" webxml="WEB-INF/web.xml">
45+
<lib dir="${ommaptile.lib_dir}"/>
46+
<fileset dir="${ommaptile.home}" includes="*.properties"/>
47+
</war>
48+
</target>
49+
50+
<target name="jar" depends="classes">
51+
<jar jarfile="${ommaptile.lib_dir}/ommaptile.jar">
52+
<fileset dir="${ommaptile.classes}"/>
53+
</jar>
4754
</target>
4855

4956
<!-- ############################
@@ -59,9 +66,7 @@
5966
<copy todir="${ommaptile.lib_dir}">
6067
<fileset dir="${openmap.home}/ext/sqlitejdbc" includes="*.jar" />
6168
</copy>
62-
<copy todir="${ommaptile.classes}">
63-
<fileset dir="." includes="*.properties" />
64-
</copy>
69+
6570
<javac srcdir="${ommaptile.home}" destdir="${ommaptile.classes}" classpath="${tomcat.jar};${ommaptile.jar}" excludes="${javac.excludes}, ${dependency.excludes}" />
6671
</target>
6772

@@ -75,9 +80,13 @@
7580
<!-- ############################
7681
Cleanup targets
7782
############################ -->
78-
<target name="clean" depends="clean_classes, clean_jars" description="Delete jar files and all class files" />
83+
<target name="clean" depends="clean_classes, clean_jars" description="Delete jar files and all class files">
84+
<delete dir="${ommaptile.dist}"/>
85+
</target>
7986

80-
<target name="distclean" depends="clean_classes" description="Delete class files, but not the jar files." />
87+
<target name="distclean" depends="clean_classes" description="Delete class files, but not the jar files." >
88+
<delete dir="${ommaptile.lib_dir}" />
89+
</target>
8190

8291
<target name="clean_all" depends="clean, clean_docs" description="Delete jar files, class files, and generated documentation." />
8392

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
name=st_osm
1+
# Note that this tileset is referenced in the web.xml file. That's what gets this file read.
2+
# The ant jar target will package this properties file properly for deployment in the war. You can add
3+
# more properties files for different tile sets.
4+
5+
# The name is the scoping name in the path after the servlet argument:
6+
# http://localhost:8080/ommaptile/tileset1/z/x/y.png gets you tiles.
7+
name=tileset1
8+
# The rootDir is where the tile set is on your local system.
29
#rootDir=<path to root directory of tile data>
3-
#rootDir=/Volumes/data/tiles
10+
rootDir=/Volumes/data/tiles
411
#rootDir=/f:/data/tiles
512

6-
# Uses the default Tile Set class
13+
# This example uses the default MapTileSet class, which just looks on disk for files. No class property needed.
714

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
# Note that this tileset is referenced in the web.xml file. That's what gets this file read.
2+
# The ant jar target will package this properties file properly for deployment in the war. You can add
3+
# more properties files for different tile sets.
4+
5+
name=tileset2
6+
17
#The rootDir for a TileMill file, using the sql jar file in the classpath, too.
2-
rootDir=jdbc:sqlite:/data/tiles/control-room.mbtiles
8+
rootDir=jdbc:sqlite:/Volumes/data/tiles/control-room.mbtiles
39
# Windows version:
410
#rootDir=jdbc:sqlite:/f:/data/tiles/control-room.mbtiles
5-
name=control-room
11+
12+
# Identifies to the servlet that this tile set needs a different MapTileSet class
613
class=com.bbn.openmap.maptileservlet.TileMillMapTileSet

src/openmap/com/bbn/openmap/Layer.java

+27-28
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// $Revision: 1.34 $
1818
// $Date: 2008/09/28 19:06:07 $
1919
// $Author: dietrick $
20-
//
20+
//
2121
// **********************************************************************
2222

2323
package com.bbn.openmap;
@@ -703,9 +703,9 @@ public Component getGUI() {
703703
* @param aInfoDisplayListener the listener to add
704704
*/
705705
public void addInfoDisplayListener(InfoDisplayListener aInfoDisplayListener) {
706-
synchronized (IDListeners) {
706+
// synchronized (IDListeners) { //2012.06.15 TAW
707707
IDListeners.add(aInfoDisplayListener);
708-
}
708+
//}
709709
}
710710

711711
/**
@@ -714,10 +714,9 @@ public void addInfoDisplayListener(InfoDisplayListener aInfoDisplayListener) {
714714
* @param aInfoDisplayListener the listener to remove
715715
*/
716716
public void removeInfoDisplayListener(InfoDisplayListener aInfoDisplayListener) {
717-
718-
synchronized (IDListeners) {
717+
// synchronized (IDListeners) { //2012.06.15 TAW
719718
IDListeners.remove(aInfoDisplayListener);
720-
}
719+
// }
721720
}
722721

723722
/**
@@ -727,11 +726,11 @@ public void removeInfoDisplayListener(InfoDisplayListener aInfoDisplayListener)
727726
* @param evt the InfoDisplay event carrying the string.
728727
*/
729728
public void fireRequestInfoLine(InfoDisplayEvent evt) {
730-
synchronized (IDListeners) {
729+
//synchronized (IDListeners) { // //2012.06.15 TAW
731730
for (InfoDisplayListener listener : IDListeners) {
732731
listener.requestInfoLine(evt);
733732
}
734-
}
733+
//}
735734
}
736735

737736
/**
@@ -765,11 +764,11 @@ public void fireRequestInfoLine(String infoLine, int loc) {
765764
* Browser.
766765
*/
767766
public void fireRequestBrowserContent(InfoDisplayEvent evt) {
768-
synchronized (IDListeners) {
767+
// synchronized (IDListeners) { //2012.06.15 TAW
769768
for (InfoDisplayListener listener : IDListeners) {
770769
listener.requestBrowserContent(evt);
771770
}
772-
}
771+
// }
773772
}
774773

775774
/**
@@ -791,11 +790,11 @@ public void fireRequestBrowserContent(String browserContent) {
791790
* Browser.
792791
*/
793792
public void fireRequestURL(InfoDisplayEvent evt) {
794-
synchronized (IDListeners) {
793+
// synchronized (IDListeners) { //2012.06.15 TAW
795794
for (InfoDisplayListener listener : IDListeners) {
796795
listener.requestURL(evt);
797796
}
798-
}
797+
// }
799798
}
800799

801800
/**
@@ -816,11 +815,11 @@ public void fireRequestURL(String url) {
816815
* @param cursor the cursor to use.
817816
*/
818817
public void fireRequestCursor(java.awt.Cursor cursor) {
819-
synchronized (IDListeners) {
818+
// synchronized (IDListeners) { //2012.06.15 TAW
820819
for (InfoDisplayListener listener : IDListeners) {
821820
listener.requestCursor(cursor);
822821
}
823-
}
822+
// }
824823
}
825824

826825
/**
@@ -831,11 +830,11 @@ public void fireRequestCursor(java.awt.Cursor cursor) {
831830
* dialog window.
832831
*/
833832
public void fireRequestMessage(InfoDisplayEvent evt) {
834-
synchronized (IDListeners) {
833+
// synchronized (IDListeners) { //2012.06.15 TAW
835834
for (InfoDisplayListener listener : IDListeners) {
836835
listener.requestMessage(evt);
837836
}
838-
}
837+
// }
839838
}
840839

841840
/**
@@ -870,15 +869,15 @@ public void fireHideToolTip() {
870869
* InfoDisplayEvent is null, then a requestHideToolTip will be fired.
871870
*/
872871
public void fireRequestToolTip(InfoDisplayEvent event) {
873-
synchronized (IDListeners) {
872+
// synchronized (IDListeners) { //2012.06.15 TAW
874873
for (InfoDisplayListener listener : IDListeners) {
875874
if (event != null) {
876875
listener.requestShowToolTip(event);
877876
} else {
878877
listener.requestHideToolTip();
879878
}
880879
}
881-
}
880+
//}
882881
}
883882

884883
// /////////////////////////////////////////////////
@@ -890,9 +889,9 @@ public void fireRequestToolTip(InfoDisplayEvent event) {
890889
* @param aLayerStatusListener LayerStatusListener
891890
*/
892891
public void addLayerStatusListener(LayerStatusListener aLayerStatusListener) {
893-
synchronized (lsListeners) {
892+
//synchronized (lsListeners) { //2012.06.15 TAW
894893
lsListeners.add(aLayerStatusListener);
895-
}
894+
//}
896895
}
897896

898897
/**
@@ -901,9 +900,9 @@ public void addLayerStatusListener(LayerStatusListener aLayerStatusListener) {
901900
* @param aLayerStatusListener the listener to remove
902901
*/
903902
public void removeLayerStatusListener(LayerStatusListener aLayerStatusListener) {
904-
synchronized (lsListeners) {
903+
// synchronized (lsListeners) { //2012.06.15 TAW
905904
lsListeners.remove(aLayerStatusListener);
906-
}
905+
//}
907906
}
908907

909908
/**
@@ -912,12 +911,12 @@ public void removeLayerStatusListener(LayerStatusListener aLayerStatusListener)
912911
* @param evt LayerStatusEvent
913912
*/
914913
public void fireStatusUpdate(LayerStatusEvent evt) {
915-
synchronized (lsListeners) {
914+
// synchronized (lsListeners) { //2012.06.15 TAW
916915
// AWTAvailable conditional removed, not used, not useful.
917916
for (LayerStatusListener listener : lsListeners) {
918917
listener.updateLayerStatus(evt);
919918
}
920-
}
919+
// }
921920
}
922921

923922
/**
@@ -1317,12 +1316,12 @@ public void clearListeners() {
13171316
if (localHackList != null) {
13181317
localHackList.clear();
13191318
}
1320-
synchronized (IDListeners) {
1319+
// synchronized (IDListeners) { //2012.06.15 TAW
13211320
IDListeners.clear();
1322-
}
1323-
synchronized (lsListeners) {
1321+
//}
1322+
//synchronized (lsListeners) {
13241323
lsListeners.clear();
1325-
}
1324+
//}
13261325
BeanContext bc = getBeanContext();
13271326
if (bc != null) {
13281327
bc.removeBeanContextMembershipListener(this);

0 commit comments

Comments
 (0)