diff --git a/.gitignore b/.gitignore index 78010540..bfef843e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,9 @@ +.DS_Store /classes /package /nbproject/private/ /build/ -/dist/ \ No newline at end of file +/dist/ +*.jar +*.zip +src/corba/com/bbn/openmap/corba diff --git a/build.xml b/build.xml index c6dd5352..87bcdad7 100644 --- a/build.xml +++ b/build.xml @@ -18,7 +18,7 @@ **/*.gif, **/*.png, **/IntersectionTest.java" /> <property name="mac.app" value="OpenMap.app" /> <property name="jar.excludes" value="${general.excludes}, **/*.java" /> - <property name="openmap_version" value="5.1.15" /> + <property name="openmap_version" value="5.1.15b" /> <property name="openmap.ext" value="${openmap.home}/src/ext" /> <property name="openmap.src" value="${openmap.home}/src/openmap" /> <property name="svg.src" value="${openmap.home}/src/svg" /> @@ -221,5 +221,14 @@ <zip destfile="${openmap.zip}" basedir="${openmap_mac_package.dir}" includes="**" /> </target> + <target name="libzip" description="Create a OpenMap library package zip file." depends="clean,package"> + <copy todir="${openmap_package.dir}/OpenMap"> + <fileset dir="${openmap_mac_package.dir}/openmap-${openmap_version}"> + <exclude name="${install_excludes}" /> + </fileset> + </copy> + <zip destfile="${openmap_package.dir}/OpenMap_v${openmap_version}.zip" basedir="${openmap_package.dir}" includes="OpenMap/**" /> + <delete dir="${openmap_package.dir}/OpenMap" /> + </target> </project> diff --git a/src/openmap/com/bbn/openmap/MapBean.java b/src/openmap/com/bbn/openmap/MapBean.java index c7c494bb..8e5e87f3 100644 --- a/src/openmap/com/bbn/openmap/MapBean.java +++ b/src/openmap/com/bbn/openmap/MapBean.java @@ -151,7 +151,7 @@ public class MapBean extends JComponent /** * OpenMap version. */ - public static final String version = "5.1.15"; + public static final String version = "5.1.15b"; /** * Suppress the copyright message on initialization. diff --git a/src/openmap/com/bbn/openmap/layer/location/LocationLayer.java b/src/openmap/com/bbn/openmap/layer/location/LocationLayer.java index 72995f21..63fc2a51 100644 --- a/src/openmap/com/bbn/openmap/layer/location/LocationLayer.java +++ b/src/openmap/com/bbn/openmap/layer/location/LocationLayer.java @@ -581,14 +581,30 @@ public Properties getProperties(Properties props) { props.put(prefix + AllowPartialsProperty, new Boolean(declutterMatrix.isAllowPartials()).toString()); } - StringBuffer handlerList = new StringBuffer(); + StringBuilder handlerList = new StringBuilder(); // Need to hand this off to the location handlers, and build a // list of marker names to use in the LocationLayer property // list. if (dataHandlers != null) { + String handler; + int len; for (LocationHandler dataHandler : dataHandlers) { dataHandler.getProperties(props); + handler = dataHandler.getPropertyPrefix(); + if (handler != null) { + handler = handler.trim(); + len = handler.length(); + if (handler.charAt(len - 1) == '.') { + len--; + } + if (len > 0) { + if (handlerList.length() != 0) { + handlerList.append(' '); + } + handlerList.append(handler, 0, len); + } + } } } diff --git a/src/openmap/com/bbn/openmap/omGraphics/OMScalingRaster.java b/src/openmap/com/bbn/openmap/omGraphics/OMScalingRaster.java index aa5c478a..8c6564fb 100644 --- a/src/openmap/com/bbn/openmap/omGraphics/OMScalingRaster.java +++ b/src/openmap/com/bbn/openmap/omGraphics/OMScalingRaster.java @@ -563,44 +563,71 @@ public void render(Graphics graphics) { * @param loc the pixel location of the image. */ protected void renderImage(Graphics g, Image image, Point loc) { + if (image == null) { + if (DEBUG) { + logger.fine("ignoring null bitmap image"); + } + return; + } + if (!(g instanceof Graphics2D)) { + if (DEBUG) { + logger.fine("ignoring graphics (" + g.getClass() + ")"); + } + return; + } + final Rectangle visibleImageArea = getClippedRectangle(); + if (visibleImageArea == null) { + if (DEBUG) { + logger.fine("ignoring null visible image area"); + } + return; + } + try { + drawImage((Graphics2D) g, visibleImageArea, image, loc); + } catch (Exception ex) { + logger.warning(ex.toString()); + logger.info(getClass().getName() + "[x=" + x + ",y=" + y + ",width=" + width + + ",height=" + height + "]" + "[vx=" + visibleImageArea.x + ",vy=" + + visibleImageArea.y + ",vwidth=" + visibleImageArea.width + ",vheight=" + + visibleImageArea.height + "]"); + } + } - Rectangle visibleImageArea = getClippedRectangle(); - - if (image != null) { - - if (visibleImageArea != null) { - - if (DEBUG) { - logger.fine("drawing " + visibleImageArea + " image at " + loc.x + ", " - + loc.y); - } + /** + * Draw the image. + * + * @param g + * @param g the Graphics object to render the image into. Assumes this is a + * derivative of the Graphics passed into the OMGraphic, and can be + * modified without worrying about passing settings on to other + * OMGraphics. + * @param image the image to render. + * @param loc the pixel location of the image. + * @throws Exception if error. + */ + protected void drawImage(final Graphics2D g, final Rectangle visibleImageArea, + final Image image, final Point loc) + throws Exception { + if (DEBUG) { + logger.fine("drawing " + visibleImageArea + " image at " + loc.x + ", " + loc.y); + } + if (image instanceof BufferedImage) { + g.drawImage(((BufferedImage) image).getSubimage(visibleImageArea.x, visibleImageArea.y, visibleImageArea.width, visibleImageArea.height), scalingXFormOp, loc.x, loc.y); + } else { - if (g instanceof Graphics2D) { - if (image instanceof BufferedImage) { - ((Graphics2D) g).drawImage(((BufferedImage) image).getSubimage(visibleImageArea.x, visibleImageArea.y, visibleImageArea.width, visibleImageArea.height), scalingXFormOp, loc.x, loc.y); - } else { - - int sx1 = visibleImageArea.x; - int sy1 = visibleImageArea.y; - int sx2 = sx1 + visibleImageArea.width; - int sy2 = sy1 + visibleImageArea.height; - - int dx1 = loc.x; - int dy1 = loc.y; - Point2D d2 = scalingXFormOp.getPoint2D(new Point2D.Double(dx1 - + visibleImageArea.width, dy1 - + visibleImageArea.height), new Point2D.Double()); - int dx2 = (int) d2.getX(); - int dy2 = (int) d2.getY(); - - ((Graphics2D) g).drawImage(image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, this); - } - } // else what? Never seen this test fail with Java2D + int sx1 = visibleImageArea.x; + int sy1 = visibleImageArea.y; + int sx2 = sx1 + visibleImageArea.width; + int sy2 = sy1 + visibleImageArea.height; - } + int dx1 = loc.x; + int dy1 = loc.y; + Point2D d2 = scalingXFormOp.getPoint2D(new Point2D.Double(dx1 + + visibleImageArea.width, dy1 + visibleImageArea.height), new Point2D.Double()); + int dx2 = (int) d2.getX(); + int dy2 = (int) d2.getY(); - } else if (DEBUG) { - logger.fine("ignoring null bitmap image"); + g.drawImage(image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, this); } } diff --git a/src/openmap/com/bbn/openmap/util/PropUtils.java b/src/openmap/com/bbn/openmap/util/PropUtils.java index 772de377..63657bb9 100644 --- a/src/openmap/com/bbn/openmap/util/PropUtils.java +++ b/src/openmap/com/bbn/openmap/util/PropUtils.java @@ -582,7 +582,7 @@ public static long longFromProperties(Properties p, String propName, long defaul */ public static Color parseColorFromProperties(Properties p, String propName, String dfault) throws NumberFormatException { - return ColorFactory.parseColorFromProperties(p, propName, dfault, false); + return ColorFactory.parseColorFromProperties(p, propName, dfault, true); } /** @@ -657,7 +657,7 @@ public static Color parseColor(String colorString, boolean forceAlpha) * @see ColorFactory#parseColor(String, boolean) */ public static Color parseColor(String colorString) throws NumberFormatException { - return ColorFactory.parseColor(colorString, false); + return ColorFactory.parseColor(colorString, true); } /**