mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 16:47:31 -05:00
Updates pull request from Roman Tsypuk to convert the build system from
ant to gradle. Removes linux and windows application launch scripts and produces an executable jar with all resources included.
This commit is contained in:
@@ -37,7 +37,7 @@ import java.beans.VetoableChangeSupport;
|
||||
*
|
||||
* <p>
|
||||
* A non-visual java bean is a Java class that conforms to the AbstractBean
|
||||
* patterns to allow visual manipulation of the bean's ua.in.smartjava.properties and event
|
||||
* patterns to allow visual manipulation of the bean's properties and event
|
||||
* handlers at design-time.
|
||||
* </p>
|
||||
*
|
||||
@@ -178,7 +178,7 @@ public abstract class AbstractBean {
|
||||
|
||||
/**
|
||||
* Add a PropertyChangeListener to the listener list.
|
||||
* The listener is registered for all ua.in.smartjava.properties.
|
||||
* The listener is registered for all properties.
|
||||
* The same listener object may be added more than once, and will be called
|
||||
* as many times as it is added.
|
||||
* If <code>listener</code> is null, no exception is thrown and no action
|
||||
@@ -193,9 +193,9 @@ public abstract class AbstractBean {
|
||||
/**
|
||||
* Remove a PropertyChangeListener from the listener list.
|
||||
* This removes a PropertyChangeListener that was registered
|
||||
* for all ua.in.smartjava.properties.
|
||||
* for all properties.
|
||||
* If <code>listener</code> was added more than once to the same event
|
||||
* ua.in.smartjava.source, it will be notified one less time after being removed.
|
||||
* source, it will be notified one less time after being removed.
|
||||
* If <code>listener</code> is null, or was never added, no exception is
|
||||
* thrown and no action is taken.
|
||||
*
|
||||
@@ -259,7 +259,7 @@ public abstract class AbstractBean {
|
||||
/**
|
||||
* Remove a PropertyChangeListener for a specific property.
|
||||
* If <code>listener</code> was added more than once to the same event
|
||||
* ua.in.smartjava.source for the specified property, it will be notified one less time
|
||||
* source for the specified property, it will be notified one less time
|
||||
* after being removed.
|
||||
* If <code>propertyName</code> is null, no exception is thrown and no
|
||||
* action is taken.
|
||||
@@ -340,8 +340,8 @@ public abstract class AbstractBean {
|
||||
|
||||
/**
|
||||
* Check if there are any listeners for a specific property, including
|
||||
* those registered on all ua.in.smartjava.properties. If <code>propertyName</code>
|
||||
* is null, only check for listeners registered on all ua.in.smartjava.properties.
|
||||
* those registered on all properties. If <code>propertyName</code>
|
||||
* is null, only check for listeners registered on all properties.
|
||||
*
|
||||
* @param propertyName the property name.
|
||||
* @return true if there are one or more listeners for the given property
|
||||
@@ -352,8 +352,8 @@ public abstract class AbstractBean {
|
||||
|
||||
/**
|
||||
* Check if there are any listeners for a specific property, including
|
||||
* those registered on all ua.in.smartjava.properties. If <code>propertyName</code>
|
||||
* is null, only check for listeners registered on all ua.in.smartjava.properties.
|
||||
* those registered on all properties. If <code>propertyName</code>
|
||||
* is null, only check for listeners registered on all properties.
|
||||
*
|
||||
* @param propertyName the property name.
|
||||
* @return true if there are one or more listeners for the given property
|
||||
@@ -364,7 +364,7 @@ public abstract class AbstractBean {
|
||||
|
||||
/**
|
||||
* Add a VetoableListener to the listener list.
|
||||
* The listener is registered for all ua.in.smartjava.properties.
|
||||
* The listener is registered for all properties.
|
||||
* The same listener object may be added more than once, and will be called
|
||||
* as many times as it is added.
|
||||
* If <code>listener</code> is null, no exception is thrown and no action
|
||||
@@ -380,9 +380,9 @@ public abstract class AbstractBean {
|
||||
/**
|
||||
* Remove a VetoableChangeListener from the listener list.
|
||||
* This removes a VetoableChangeListener that was registered
|
||||
* for all ua.in.smartjava.properties.
|
||||
* for all properties.
|
||||
* If <code>listener</code> was added more than once to the same event
|
||||
* ua.in.smartjava.source, it will be notified one less time after being removed.
|
||||
* source, it will be notified one less time after being removed.
|
||||
* If <code>listener</code> is null, or was never added, no exception is
|
||||
* thrown and no action is taken.
|
||||
*
|
||||
@@ -425,7 +425,7 @@ public abstract class AbstractBean {
|
||||
/**
|
||||
* Remove a VetoableChangeListener for a specific property.
|
||||
* If <code>listener</code> was added more than once to the same event
|
||||
* ua.in.smartjava.source for the specified property, it will be notified one less time
|
||||
* source for the specified property, it will be notified one less time
|
||||
* after being removed.
|
||||
* If <code>propertyName</code> is null, no exception is thrown and no
|
||||
* action is taken.
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="getZoomOutAction()" type="code"/>
|
||||
</Property>
|
||||
<Property name="ua.in.smartjava.icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/org/jdesktop/swingx/mapviewer/resources/plus.png"/>
|
||||
</Property>
|
||||
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
|
||||
@@ -92,7 +92,7 @@
|
||||
<Property name="action" type="javax.swing.Action" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="getZoomInAction()" type="code"/>
|
||||
</Property>
|
||||
<Property name="ua.in.smartjava.icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
|
||||
<Image iconType="3" name="/org/jdesktop/swingx/mapviewer/resources/minus.png"/>
|
||||
</Property>
|
||||
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
|
||||
|
||||
@@ -6,27 +6,6 @@
|
||||
|
||||
package org.jdesktop.swingx;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.Action;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JSlider;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import org.jdesktop.swingx.mapviewer.DefaultTileFactory;
|
||||
import org.jdesktop.swingx.mapviewer.DefaultWaypoint;
|
||||
import org.jdesktop.swingx.mapviewer.GeoPosition;
|
||||
@@ -39,10 +18,19 @@ import org.jdesktop.swingx.painter.AbstractPainter;
|
||||
import org.jdesktop.swingx.painter.CompoundPainter;
|
||||
import org.jdesktop.swingx.painter.Painter;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>The JXMapKit is a pair of JXMapViewers preconfigured to be easy to use
|
||||
* with common features built in. This includes zoom buttons, a zoom slider,
|
||||
* and a mini-ua.in.smartjava.map in the lower right corner showing an overview of the ua.in.smartjava.map.
|
||||
* and a mini-map in the lower right corner showing an overview of the map.
|
||||
* Each feature can be turned off using an appropriate
|
||||
* <CODE>is<I>X</I>visible</CODE> property. For example, to turn
|
||||
* off the minimap call
|
||||
@@ -112,7 +100,7 @@ public class JXMapKit extends JPanel
|
||||
rebuildMainMapOverlay();
|
||||
|
||||
/*
|
||||
* // adapter to move the minimap after the main ua.in.smartjava.map has moved MouseInputAdapter ma = new MouseInputAdapter() {
|
||||
* // adapter to move the minimap after the main map has moved MouseInputAdapter ma = new MouseInputAdapter() {
|
||||
* public void mouseReleased(MouseEvent e) { miniMap.setCenterPosition(mapCenterPosition); } };
|
||||
* mainMap.addMouseMotionListener(ma); mainMap.addMouseListener(ma);
|
||||
*/
|
||||
@@ -152,13 +140,13 @@ public class JXMapKit extends JPanel
|
||||
}
|
||||
});
|
||||
|
||||
// an overlay for the mini-ua.in.smartjava.map which shows a rectangle representing the main ua.in.smartjava.map
|
||||
// an overlay for the mini-map which shows a rectangle representing the main map
|
||||
miniMap.setOverlayPainter(new Painter<JXMapViewer>()
|
||||
{
|
||||
@Override
|
||||
public void paint(Graphics2D g, JXMapViewer map, int width, int height)
|
||||
{
|
||||
// get the viewport rect of the main ua.in.smartjava.map
|
||||
// get the viewport rect of the main map
|
||||
Rectangle mainMapBounds = mainMap.getViewportBounds();
|
||||
|
||||
// convert to Point2Ds
|
||||
@@ -170,7 +158,7 @@ public class JXMapKit extends JPanel
|
||||
GeoPosition upperLeft = mainMap.getTileFactory().pixelToGeo(upperLeft2D, mainMap.getZoom());
|
||||
GeoPosition lowerRight = mainMap.getTileFactory().pixelToGeo(lowerRight2D, mainMap.getZoom());
|
||||
|
||||
// convert to Point2Ds on the mini-ua.in.smartjava.map
|
||||
// convert to Point2Ds on the mini-map
|
||||
upperLeft2D = map.getTileFactory().geoToPixel(upperLeft, map.getZoom());
|
||||
lowerRight2D = map.getTileFactory().geoToPixel(lowerRight, map.getZoom());
|
||||
|
||||
@@ -178,7 +166,7 @@ public class JXMapKit extends JPanel
|
||||
Rectangle rect = map.getViewportBounds();
|
||||
// p("rect = " + rect);
|
||||
g.translate(-rect.x, -rect.y);
|
||||
// Point2D centerpos = ua.in.smartjava.map.getTileFactory().geoToPixel(mapCenterPosition, ua.in.smartjava.map.getZoom());
|
||||
// Point2D centerpos = map.getTileFactory().geoToPixel(mapCenterPosition, map.getZoom());
|
||||
// p("center pos = " + centerpos);
|
||||
g.setPaint(Color.RED);
|
||||
// g.drawRect((int)centerpos.getX()-30,(int)centerpos.getY()-30,60,60);
|
||||
@@ -210,7 +198,7 @@ public class JXMapKit extends JPanel
|
||||
private boolean zoomChanging = false;
|
||||
|
||||
/**
|
||||
* Set the current zoomlevel for the main ua.in.smartjava.map. The minimap will be updated accordingly
|
||||
* Set the current zoomlevel for the main map. The minimap will be updated accordingly
|
||||
* @param zoom the new zoom level
|
||||
*/
|
||||
public void setZoom(int zoom)
|
||||
@@ -230,7 +218,7 @@ public class JXMapKit extends JPanel
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an action which can be attached to buttons or menu items to make the ua.in.smartjava.map zoom out
|
||||
* Returns an action which can be attached to buttons or menu items to make the map zoom out
|
||||
* @return a preconfigured Zoom Out action
|
||||
*/
|
||||
public Action getZoomOutAction()
|
||||
@@ -253,7 +241,7 @@ public class JXMapKit extends JPanel
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an action which can be attached to buttons or menu items to make the ua.in.smartjava.map zoom in
|
||||
* Returns an action which can be attached to buttons or menu items to make the map zoom in
|
||||
* @return a preconfigured Zoom In action
|
||||
*/
|
||||
public Action getZoomInAction()
|
||||
@@ -417,8 +405,8 @@ public class JXMapKit extends JPanel
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
/**
|
||||
* Indicates if the mini-ua.in.smartjava.map is currently visible
|
||||
* @return the current value of the mini-ua.in.smartjava.map property
|
||||
* Indicates if the mini-map is currently visible
|
||||
* @return the current value of the mini-map property
|
||||
*/
|
||||
public boolean isMiniMapVisible()
|
||||
{
|
||||
@@ -426,7 +414,7 @@ public class JXMapKit extends JPanel
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets if the mini-ua.in.smartjava.map should be visible
|
||||
* Sets if the mini-map should be visible
|
||||
* @param miniMapVisible a new value for the miniMap property
|
||||
*/
|
||||
public void setMiniMapVisible(boolean miniMapVisible)
|
||||
@@ -534,7 +522,7 @@ public class JXMapKit extends JPanel
|
||||
|
||||
/**
|
||||
* Returns a reference to the main embedded JXMapViewer component
|
||||
* @return the main ua.in.smartjava.map
|
||||
* @return the main map
|
||||
*/
|
||||
public JXMapViewer getMainMap()
|
||||
{
|
||||
|
||||
@@ -9,24 +9,6 @@
|
||||
|
||||
package org.jdesktop.swingx;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Image;
|
||||
import java.awt.Insets;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.beans.DesignMode;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import org.jdesktop.swingx.mapviewer.GeoPosition;
|
||||
import org.jdesktop.swingx.mapviewer.Tile;
|
||||
import org.jdesktop.swingx.mapviewer.TileFactory;
|
||||
@@ -38,25 +20,35 @@ import org.jdesktop.swingx.painter.Painter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.beans.DesignMode;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* A tile oriented ua.in.smartjava.map component that can easily be used with tile sources
|
||||
* A tile oriented map component that can easily be used with tile sources
|
||||
* on the web like Google and Yahoo maps, satellite data such as NASA imagery,
|
||||
* and also with file based sources like pre-processed NASA images.
|
||||
* A known ua.in.smartjava.map provider can be used with the SLMapServerInfo,
|
||||
* A known map provider can be used with the SLMapServerInfo,
|
||||
* which will connect to a 2km resolution version of NASA's Blue Marble Next Generation
|
||||
* imagery. @see SLMapServerInfo for more information.
|
||||
*
|
||||
* Note, the JXMapViewer has three center point ua.in.smartjava.properties. The <B>addressLocation</B> property
|
||||
* represents an abstract center of the ua.in.smartjava.map. This would usually be something like the first item
|
||||
* Note, the JXMapViewer has three center point properties. The <B>addressLocation</B> property
|
||||
* represents an abstract center of the map. This would usually be something like the first item
|
||||
* in a search result. It is a {@link GeoPosition}. The <b>centerPosition</b> property represents
|
||||
* the current center point of the ua.in.smartjava.map. If the user pans the ua.in.smartjava.map then the centerPosition point will
|
||||
* change but the <B>addressLocation</B> will not. Calling <B>recenterToAddressLocation()</B> will move the ua.in.smartjava.map
|
||||
* the current center point of the map. If the user pans the map then the centerPosition point will
|
||||
* change but the <B>addressLocation</B> will not. Calling <B>recenterToAddressLocation()</B> will move the map
|
||||
* back to that center address. The <B>center</B> property represents the same point as the centerPosition
|
||||
* property, but as a Point2D in pixel space instead of a GeoPosition in lat/long space. Note that
|
||||
* the center property is a Point2D in the entire world bitmap, not in the portion of the ua.in.smartjava.map currently
|
||||
* visible. You can use the <B>getViewportBounds()</B> method to find the portion of the ua.in.smartjava.map currently visible
|
||||
* the center property is a Point2D in the entire world bitmap, not in the portion of the map currently
|
||||
* visible. You can use the <B>getViewportBounds()</B> method to find the portion of the map currently visible
|
||||
* and adjust your calculations accordingly. Changing the <B>center</B> property will change the <B>centerPosition</B>
|
||||
* property and vice versa. All three ua.in.smartjava.properties are bound.
|
||||
* property and vice versa. All three properties are bound.
|
||||
* @author Joshua.Marinacci@sun.com
|
||||
* @see org.jdesktop.swingx.mapviewer.bmng.SLMapServerInfo
|
||||
*/
|
||||
@@ -76,9 +68,9 @@ public class JXMapViewer extends JPanel implements DesignMode
|
||||
private int zoomLevel = 1;
|
||||
|
||||
/**
|
||||
* The position, in <I>ua.in.smartjava.map coordinates</I> of the center point. This is defined as the distance from the top and
|
||||
* left edges of the ua.in.smartjava.map in pixels. Dragging the ua.in.smartjava.map component will change the center position. Zooming in/out will
|
||||
* cause the center to be recalculated so as to remain in the center of the new "ua.in.smartjava.map".
|
||||
* The position, in <I>map coordinates</I> of the center point. This is defined as the distance from the top and
|
||||
* left edges of the map in pixels. Dragging the map component will change the center position. Zooming in/out will
|
||||
* cause the center to be recalculated so as to remain in the center of the new "map".
|
||||
*/
|
||||
private Point2D center = new Point2D.Double(0, 0);
|
||||
|
||||
@@ -89,20 +81,20 @@ public class JXMapViewer extends JPanel implements DesignMode
|
||||
private boolean drawTileBorders = false;
|
||||
|
||||
/**
|
||||
* Factory used by this component to grab the tiles necessary for painting the ua.in.smartjava.map.
|
||||
* Factory used by this component to grab the tiles necessary for painting the map.
|
||||
*/
|
||||
private TileFactory factory;
|
||||
|
||||
/**
|
||||
* The position in latitude/longitude of the "address" being mapped. This is a special coordinate that, when moved,
|
||||
* will cause the ua.in.smartjava.map to be moved as well. It is separate from "center" in that "center" tracks the current center
|
||||
* will cause the map to be moved as well. It is separate from "center" in that "center" tracks the current center
|
||||
* (in pixels) of the viewport whereas this will not change when panning or zooming. Whenever the addressLocation is
|
||||
* changed, however, the ua.in.smartjava.map will be repositioned.
|
||||
* changed, however, the map will be repositioned.
|
||||
*/
|
||||
private GeoPosition addressLocation;
|
||||
|
||||
/**
|
||||
* The overlay to delegate to for painting the "foreground" of the ua.in.smartjava.map component. This would include painting
|
||||
* The overlay to delegate to for painting the "foreground" of the map component. This would include painting
|
||||
* waypoints, day/night, etc. Also receives mouse events.
|
||||
*/
|
||||
private Painter<? super JXMapViewer> overlay;
|
||||
@@ -194,7 +186,7 @@ public class JXMapViewer extends JPanel implements DesignMode
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw the ua.in.smartjava.map tiles. This method is for implementation use only.
|
||||
* Draw the map tiles. This method is for implementation use only.
|
||||
* @param g Graphics
|
||||
* @param zoom zoom level to draw at
|
||||
* @param viewportBounds the bounds to draw within
|
||||
@@ -233,7 +225,7 @@ public class JXMapViewer extends JPanel implements DesignMode
|
||||
int ox = ((itpx * getTileFactory().getTileSize(zoom)) - viewportBounds.x);
|
||||
int oy = ((itpy * getTileFactory().getTileSize(zoom)) - viewportBounds.y);
|
||||
|
||||
// if the tile is off the ua.in.smartjava.map to the north/south, then just don't paint anything
|
||||
// if the tile is off the map to the north/south, then just don't paint anything
|
||||
if (isTileOnMap(itpx, itpy, mapSize))
|
||||
{
|
||||
if (isOpaque())
|
||||
@@ -303,9 +295,9 @@ public class JXMapViewer extends JPanel implements DesignMode
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ua.in.smartjava.map overlay. This is a Painter<JXMapViewer> which will paint on top of the ua.in.smartjava.map. It can be used to draw waypoints,
|
||||
* Sets the map overlay. This is a Painter<JXMapViewer> which will paint on top of the map. It can be used to draw waypoints,
|
||||
* lines, or static overlays like text messages.
|
||||
* @param overlay the ua.in.smartjava.map overlay to use
|
||||
* @param overlay the map overlay to use
|
||||
*/
|
||||
public void setOverlayPainter(Painter<? super JXMapViewer> overlay)
|
||||
{
|
||||
@@ -341,8 +333,8 @@ public class JXMapViewer extends JPanel implements DesignMode
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current ua.in.smartjava.map overlay
|
||||
* @return the current ua.in.smartjava.map overlay
|
||||
* Gets the current map overlay
|
||||
* @return the current map overlay
|
||||
*/
|
||||
public Painter<? super JXMapViewer> getOverlayPainter()
|
||||
{
|
||||
@@ -352,7 +344,7 @@ public class JXMapViewer extends JPanel implements DesignMode
|
||||
/**
|
||||
* Returns the bounds of the viewport in pixels. This can be used to transform points into the world bitmap
|
||||
* coordinate space.
|
||||
* @return the bounds in <em>pixels</em> of the "view" of this ua.in.smartjava.map
|
||||
* @return the bounds in <em>pixels</em> of the "view" of this map
|
||||
*/
|
||||
public Rectangle getViewportBounds()
|
||||
{
|
||||
@@ -413,9 +405,9 @@ public class JXMapViewer extends JPanel implements DesignMode
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current address location of the ua.in.smartjava.map. This property does not change when the user pans the ua.in.smartjava.map. This
|
||||
* Gets the current address location of the map. This property does not change when the user pans the map. This
|
||||
* property is bound.
|
||||
* @return the current ua.in.smartjava.map location (address)
|
||||
* @return the current map location (address)
|
||||
*/
|
||||
public GeoPosition getAddressLocation()
|
||||
{
|
||||
@@ -423,7 +415,7 @@ public class JXMapViewer extends JPanel implements DesignMode
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current address location of the ua.in.smartjava.map
|
||||
* Gets the current address location of the map
|
||||
* @param addressLocation the new address location
|
||||
*/
|
||||
public void setAddressLocation(GeoPosition addressLocation)
|
||||
@@ -437,7 +429,7 @@ public class JXMapViewer extends JPanel implements DesignMode
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-centers the ua.in.smartjava.map to have the current address location be at the center of the ua.in.smartjava.map, accounting for the ua.in.smartjava.map's
|
||||
* Re-centers the map to have the current address location be at the center of the map, accounting for the map's
|
||||
* width and height.
|
||||
*/
|
||||
public void recenterToAddressLocation()
|
||||
@@ -468,7 +460,7 @@ public class JXMapViewer extends JPanel implements DesignMode
|
||||
}
|
||||
|
||||
/**
|
||||
* A property indicating the center position of the ua.in.smartjava.map
|
||||
* A property indicating the center position of the map
|
||||
* @param geoPosition the new property value
|
||||
*/
|
||||
public void setCenterPosition(GeoPosition geoPosition)
|
||||
@@ -481,7 +473,7 @@ public class JXMapViewer extends JPanel implements DesignMode
|
||||
}
|
||||
|
||||
/**
|
||||
* A property indicating the center position of the ua.in.smartjava.map
|
||||
* A property indicating the center position of the map
|
||||
* @return the current center position
|
||||
*/
|
||||
public GeoPosition getCenterPosition()
|
||||
@@ -537,8 +529,8 @@ public class JXMapViewer extends JPanel implements DesignMode
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current pixel center of the ua.in.smartjava.map. This point is in the global bitmap coordinate system, not as lat/longs.
|
||||
* @return the current center of the ua.in.smartjava.map as a pixel value
|
||||
* Gets the current pixel center of the map. This point is in the global bitmap coordinate system, not as lat/longs.
|
||||
* @return the current center of the map as a pixel value
|
||||
*/
|
||||
public Point2D getCenter()
|
||||
{
|
||||
@@ -546,8 +538,8 @@ public class JXMapViewer extends JPanel implements DesignMode
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the new center of the ua.in.smartjava.map in pixel coordinates.
|
||||
* @param center the new center of the ua.in.smartjava.map in pixel coordinates
|
||||
* Sets the new center of the map in pixel coordinates.
|
||||
* @param center the new center of the map in pixel coordinates
|
||||
*/
|
||||
public void setCenter(Point2D center)
|
||||
{
|
||||
@@ -591,13 +583,13 @@ public class JXMapViewer extends JPanel implements DesignMode
|
||||
centerX = mapWidth - viewportWidth / 2;
|
||||
}
|
||||
|
||||
// if ua.in.smartjava.map is to small then just center it vert
|
||||
// if map is to small then just center it vert
|
||||
if (mapHeight < newVP.getHeight())
|
||||
{
|
||||
centerY = mapHeight / 2;// viewportHeight/2;// - mapHeight/2;
|
||||
}
|
||||
|
||||
// if ua.in.smartjava.map is too small then just center it horiz
|
||||
// if map is too small then just center it horiz
|
||||
if (!isHorizontalWrapped() && mapWidth < newVP.getWidth())
|
||||
{
|
||||
centerX = mapWidth / 2;
|
||||
@@ -641,7 +633,7 @@ public class JXMapViewer extends JPanel implements DesignMode
|
||||
|
||||
int zoom = getZoom();
|
||||
Rectangle2D rect = generateBoundingRect(positions, zoom);
|
||||
// Rectangle2D viewport = ua.in.smartjava.map.getViewportBounds();
|
||||
// Rectangle2D viewport = map.getViewportBounds();
|
||||
int count = 0;
|
||||
while (!getViewportBounds().contains(rect))
|
||||
{
|
||||
@@ -745,9 +737,9 @@ public class JXMapViewer extends JPanel implements DesignMode
|
||||
|
||||
/**
|
||||
* Converts the specified GeoPosition to a point in the JXMapViewer's local coordinate space. This method is
|
||||
* especially useful when drawing lat/long positions on the ua.in.smartjava.map.
|
||||
* @param pos a GeoPosition on the ua.in.smartjava.map
|
||||
* @return the point in the local coordinate space of the ua.in.smartjava.map
|
||||
* especially useful when drawing lat/long positions on the map.
|
||||
* @param pos a GeoPosition on the map
|
||||
* @return the point in the local coordinate space of the map
|
||||
*/
|
||||
public Point2D convertGeoPositionToPoint(GeoPosition pos)
|
||||
{
|
||||
@@ -759,9 +751,9 @@ public class JXMapViewer extends JPanel implements DesignMode
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the specified Point2D in the JXMapViewer's local coordinate space to a GeoPosition on the ua.in.smartjava.map. This
|
||||
* Converts the specified Point2D in the JXMapViewer's local coordinate space to a GeoPosition on the map. This
|
||||
* method is especially useful for determining the GeoPosition under the mouse cursor.
|
||||
* @param pt a point in the local coordinate space of the ua.in.smartjava.map
|
||||
* @param pt a point in the local coordinate space of the map
|
||||
* @return the point converted to a GeoPosition
|
||||
*/
|
||||
public GeoPosition convertPointToGeoPosition(Point2D pt)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
//
|
||||
// Copyright (c) Fraunhofer IGD. All rights reserved.
|
||||
//
|
||||
// This ua.in.smartjava.source code is property of the Fraunhofer IGD and underlies
|
||||
// This source code is property of the Fraunhofer IGD and underlies
|
||||
// copyright restrictions. It may only be used with explicit
|
||||
// permission from the respective owner.
|
||||
|
||||
|
||||
@@ -28,22 +28,22 @@ import org.jdesktop.swingx.mapviewer.TileFactoryInfo;
|
||||
public class VirtualEarthTileFactoryInfo extends TileFactoryInfo
|
||||
{
|
||||
/**
|
||||
* Use road ua.in.smartjava.map
|
||||
* Use road map
|
||||
*/
|
||||
public final static MVEMode MAP = new MVEMode("ua/in/smartjava/map", "ua/in/smartjava/map", "r", ".png");
|
||||
public final static MVEMode MAP = new MVEMode("map", "map", "r", ".png");
|
||||
|
||||
/**
|
||||
* Use satellite ua.in.smartjava.map
|
||||
* Use satellite map
|
||||
*/
|
||||
public final static MVEMode SATELLITE = new MVEMode("satellite", "satellite", "a", ".jpeg");
|
||||
|
||||
/**
|
||||
* Use hybrid ua.in.smartjava.map
|
||||
* Use hybrid map
|
||||
*/
|
||||
public final static MVEMode HYBRID = new MVEMode("hybrid", "hybrid", "h", ".jpeg");
|
||||
|
||||
/**
|
||||
* The ua.in.smartjava.map mode
|
||||
* The map mode
|
||||
*/
|
||||
public static class MVEMode
|
||||
{
|
||||
|
||||
@@ -17,17 +17,16 @@
|
||||
******************************************************************************/
|
||||
package org.jdesktop.swingx.input;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import org.jdesktop.swingx.JXMapViewer;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import org.jdesktop.swingx.JXMapViewer;
|
||||
|
||||
/**
|
||||
* Centers the ua.in.smartjava.map on the mouse cursor
|
||||
* Centers the map on the mouse cursor
|
||||
* if left is double-clicked or middle mouse
|
||||
* button is pressed.
|
||||
* @author Martin Steiger
|
||||
|
||||
@@ -17,13 +17,13 @@
|
||||
******************************************************************************/
|
||||
package org.jdesktop.swingx.input;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import org.jdesktop.swingx.JXMapViewer;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.KeyAdapter;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
import org.jdesktop.swingx.JXMapViewer;
|
||||
|
||||
/**
|
||||
* used to pan using the arrow keys
|
||||
* @author joshy
|
||||
|
||||
@@ -17,16 +17,14 @@
|
||||
******************************************************************************/
|
||||
package org.jdesktop.swingx.input;
|
||||
|
||||
import java.awt.Cursor;
|
||||
import java.awt.Point;
|
||||
import org.jdesktop.swingx.JXMapViewer;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.MouseInputAdapter;
|
||||
import java.awt.*;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.event.MouseInputAdapter;
|
||||
|
||||
import org.jdesktop.swingx.JXMapViewer;
|
||||
|
||||
/**
|
||||
* Used to pan using press and drag mouse gestures
|
||||
* @author joshy
|
||||
|
||||
@@ -17,11 +17,11 @@
|
||||
******************************************************************************/
|
||||
package org.jdesktop.swingx.input;
|
||||
|
||||
import org.jdesktop.swingx.JXMapViewer;
|
||||
|
||||
import java.awt.event.MouseWheelEvent;
|
||||
import java.awt.event.MouseWheelListener;
|
||||
|
||||
import org.jdesktop.swingx.JXMapViewer;
|
||||
|
||||
/**
|
||||
* zooms using the mouse wheel on the view center
|
||||
* @author joshy
|
||||
|
||||
@@ -17,15 +17,13 @@
|
||||
******************************************************************************/
|
||||
package org.jdesktop.swingx.input;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import org.jdesktop.swingx.JXMapViewer;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.MouseWheelEvent;
|
||||
import java.awt.event.MouseWheelListener;
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
import org.jdesktop.swingx.JXMapViewer;
|
||||
|
||||
/**
|
||||
* zooms to the current mouse cursor
|
||||
* using the mouse wheel
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
******************************************************************************/
|
||||
package org.jdesktop.swingx.mapviewer;
|
||||
|
||||
import org.jdesktop.swingx.mapviewer.util.GeoUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
@@ -35,13 +41,6 @@ import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.PriorityBlockingQueue;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import org.jdesktop.swingx.mapviewer.util.GeoUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* The <code>AbstractTileFactory</code> provides
|
||||
* a basic implementation for the TileFactory.
|
||||
|
||||
@@ -9,16 +9,15 @@
|
||||
|
||||
package org.jdesktop.swingx.mapviewer;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
import org.jdesktop.swingx.JXMapViewer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.*;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
/**
|
||||
* This is a standard waypoint renderer.
|
||||
* @author joshy
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
******************************************************************************/
|
||||
package org.jdesktop.swingx.mapviewer;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
@@ -34,9 +37,6 @@ import java.net.URLConnection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author joshy
|
||||
*/
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
|
||||
package org.jdesktop.swingx.mapviewer;
|
||||
|
||||
import org.jdesktop.beans.AbstractBean;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.lang.ref.SoftReference;
|
||||
|
||||
import org.jdesktop.beans.AbstractBean;
|
||||
|
||||
/**
|
||||
* The Tile class represents a particular square image piece of the world bitmap at a particular zoom level.
|
||||
* @author joshy
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
package org.jdesktop.swingx.mapviewer;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
@@ -17,8 +18,6 @@ import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
/**
|
||||
* An implementation only class for now. For internal use only.
|
||||
* @author joshua.marinacci@sun.com
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
package org.jdesktop.swingx.mapviewer;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import org.jdesktop.swingx.mapviewer.util.GeoUtil;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.jdesktop.swingx.mapviewer.util.GeoUtil;
|
||||
|
||||
/**
|
||||
* A class that can produce tiles and convert coordinates to pixels
|
||||
* @author joshy
|
||||
@@ -45,9 +45,9 @@ public abstract class TileFactory
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a Dimension containing the width and height of the ua.in.smartjava.map, in tiles at the current zoom level. So a
|
||||
* Returns a Dimension containing the width and height of the map, in tiles at the current zoom level. So a
|
||||
* Dimension that returns 10x20 would be 10 tiles wide and 20 tiles tall. These values can be multipled by
|
||||
* getTileSize() to determine the pixel width/height for the ua.in.smartjava.map at the given zoom level
|
||||
* getTileSize() to determine the pixel width/height for the map at the given zoom level
|
||||
* @return the size of the world bitmap in tiles
|
||||
* @param zoom the current zoom level
|
||||
*/
|
||||
@@ -61,7 +61,7 @@ public abstract class TileFactory
|
||||
* @return the tile that is located at the given tilePoint for this zoom level. For example, if getMapSize() returns
|
||||
* 10x20 for this zoom, and the tilePoint is (3,5), then the appropriate tile will be located and returned. This
|
||||
* method must not return null. However, it can return dummy tiles that contain no data if it wants. This is
|
||||
* appropriate, for example, for tiles which are outside of the bounds of the ua.in.smartjava.map and if the factory doesn't
|
||||
* appropriate, for example, for tiles which are outside of the bounds of the map and if the factory doesn't
|
||||
* implement wrapping.
|
||||
* @param x the x value
|
||||
* @param y the y value
|
||||
|
||||
@@ -12,8 +12,8 @@ package org.jdesktop.swingx.mapviewer;
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
/**
|
||||
* A TileFactoryInfo encapsulates all information specific to a ua.in.smartjava.map server. This includes everything from the url to
|
||||
* load the ua.in.smartjava.map tiles from to the size and depth of the tiles. Theoretically any ua.in.smartjava.map server can be used by installing a
|
||||
* A TileFactoryInfo encapsulates all information specific to a map server. This includes everything from the url to
|
||||
* load the map tiles from to the size and depth of the tiles. Theoretically any map server can be used by installing a
|
||||
* customized TileFactoryInfo. Currently
|
||||
* @author joshy
|
||||
*/
|
||||
@@ -30,7 +30,7 @@ public class TileFactoryInfo
|
||||
*/
|
||||
private int[] mapWidthInTilesAtZoom;
|
||||
/**
|
||||
* An array of coordinates in <em>pixels</em> that indicates the center in the world ua.in.smartjava.map for the given zoom level.
|
||||
* An array of coordinates in <em>pixels</em> that indicates the center in the world map for the given zoom level.
|
||||
*/
|
||||
private Point2D[] mapCenterInPixelsAtZoom;// = new Point2D.Double[18];
|
||||
|
||||
@@ -62,7 +62,7 @@ public class TileFactoryInfo
|
||||
|
||||
/**
|
||||
* Creates a new instance of TileFactoryInfo. Note that TileFactoryInfo should be considered invariate, meaning that
|
||||
* subclasses should ensure all of the ua.in.smartjava.properties stay the same after the class is constructed. Returning different
|
||||
* subclasses should ensure all of the properties stay the same after the class is constructed. Returning different
|
||||
* values of getTileSize() for example is considered an error and may result in unexpected behavior.
|
||||
* @param minimumZoomLevel The minimum zoom level
|
||||
* @param maximumZoomLevel the maximum zoom level
|
||||
@@ -76,7 +76,7 @@ public class TileFactoryInfo
|
||||
* @param zparam the z parameter for the tile url
|
||||
*/
|
||||
/*
|
||||
* @param xr2l true if tile x is measured from the far left of the ua.in.smartjava.map to the far right, or else false if based on
|
||||
* @param xr2l true if tile x is measured from the far left of the map to the far right, or else false if based on
|
||||
* the center line.
|
||||
* @param yt2b true if tile y is measured from the top (north pole) to the bottom (south pole) or else false if
|
||||
* based on the equator.
|
||||
@@ -90,7 +90,7 @@ public class TileFactoryInfo
|
||||
|
||||
/**
|
||||
* Creates a new instance of TileFactoryInfo. Note that TileFactoryInfo should be considered invariate, meaning that
|
||||
* subclasses should ensure all of the ua.in.smartjava.properties stay the same after the class is constructed. Returning different
|
||||
* subclasses should ensure all of the properties stay the same after the class is constructed. Returning different
|
||||
* values of getTileSize() for example is considered an error and may result in unexpected behavior.
|
||||
* @param name A name to identify this information.
|
||||
* @param minimumZoomLevel The minimum zoom level
|
||||
@@ -105,7 +105,7 @@ public class TileFactoryInfo
|
||||
* @param zparam the z parameter for the tile url
|
||||
*/
|
||||
/*
|
||||
* @param xr2l true if tile x is measured from the far left of the ua.in.smartjava.map to the far right, or else false if based on
|
||||
* @param xr2l true if tile x is measured from the far left of the map to the far right, or else false if based on
|
||||
* the center line.
|
||||
* @param yt2b true if tile y is measured from the top (north pole) to the bottom (south pole) or else false if
|
||||
* based on the equator.
|
||||
@@ -170,7 +170,7 @@ public class TileFactoryInfo
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the total ua.in.smartjava.map zoom level
|
||||
* @return the total map zoom level
|
||||
*/
|
||||
public int getTotalMapZoom()
|
||||
{
|
||||
@@ -179,7 +179,7 @@ public class TileFactoryInfo
|
||||
|
||||
/**
|
||||
* @param zoom the zoom level
|
||||
* @return the ua.in.smartjava.map width in tiles
|
||||
* @return the map width in tiles
|
||||
*/
|
||||
public int getMapWidthInTilesAtZoom(int zoom)
|
||||
{
|
||||
@@ -188,7 +188,7 @@ public class TileFactoryInfo
|
||||
|
||||
/**
|
||||
* @param zoom the zoom level
|
||||
* @return the ua.in.smartjava.map center in pixels
|
||||
* @return the map center in pixels
|
||||
*/
|
||||
public Point2D getMapCenterInPixelsAtZoom(int zoom)
|
||||
{
|
||||
@@ -211,7 +211,7 @@ public class TileFactoryInfo
|
||||
public String getTileUrl(int x, int y, int zoom)
|
||||
{
|
||||
// System.out.println("getting tile at zoom: " + zoom);
|
||||
// System.out.println("ua.in.smartjava.map width at zoom = " + getMapWidthInTilesAtZoom(zoom));
|
||||
// System.out.println("map width at zoom = " + getMapWidthInTilesAtZoom(zoom));
|
||||
String ypart = "&" + yparam + "=" + y;
|
||||
// System.out.println("ypart = " + ypart);
|
||||
|
||||
|
||||
@@ -9,15 +9,14 @@
|
||||
|
||||
package org.jdesktop.swingx.mapviewer;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Rectangle;
|
||||
import org.jdesktop.swingx.JXMapViewer;
|
||||
import org.jdesktop.swingx.painter.AbstractPainter;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.jdesktop.swingx.JXMapViewer;
|
||||
import org.jdesktop.swingx.painter.AbstractPainter;
|
||||
|
||||
/**
|
||||
* Paints waypoints on the JXMapViewer. This is an
|
||||
* instance of Painter that only can draw on to JXMapViewers.
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
package org.jdesktop.swingx.mapviewer;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
|
||||
import org.jdesktop.swingx.JXMapViewer;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* A interface that draws waypoints. Implementations of WaypointRenderer can
|
||||
* be set on a WayPointPainter to draw waypoints on a JXMapViewer
|
||||
@@ -22,9 +22,9 @@ import org.jdesktop.swingx.JXMapViewer;
|
||||
public interface WaypointRenderer<W>
|
||||
{
|
||||
/**
|
||||
* paint the specified waypoint on the specified ua.in.smartjava.map and graphics context
|
||||
* paint the specified waypoint on the specified map and graphics context
|
||||
* @param g the graphics2D object
|
||||
* @param map the ua.in.smartjava.map
|
||||
* @param map the map
|
||||
* @param waypoint the waypoint
|
||||
*/
|
||||
public void paintWaypoint(Graphics2D g, JXMapViewer map, W waypoint);
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
******************************************************************************/
|
||||
package org.jdesktop.swingx.mapviewer.bmng;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
import org.jdesktop.swingx.mapviewer.DefaultTileFactory;
|
||||
import org.jdesktop.swingx.mapviewer.GeoPosition;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
/**
|
||||
* @author joshy
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,7 @@ package org.jdesktop.swingx.mapviewer.bmng;
|
||||
import org.jdesktop.swingx.mapviewer.TileFactoryInfo;
|
||||
|
||||
/**
|
||||
* A TileFactoryInfo subclass which knows how to connect to the SwingLabs ua.in.smartjava.map server. This server contains 2k resolution
|
||||
* A TileFactoryInfo subclass which knows how to connect to the SwingLabs map server. This server contains 2k resolution
|
||||
* Blue Marble data from NASA.
|
||||
*/
|
||||
public class SLMapServerInfo extends TileFactoryInfo
|
||||
|
||||
@@ -9,15 +9,13 @@
|
||||
|
||||
package org.jdesktop.swingx.mapviewer.empty;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.RenderingHints;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
import org.jdesktop.swingx.mapviewer.Tile;
|
||||
import org.jdesktop.swingx.mapviewer.TileFactory;
|
||||
import org.jdesktop.swingx.mapviewer.TileFactoryInfo;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
/**
|
||||
* A null implementation of TileFactory. Draws empty areas.
|
||||
* @author joshy
|
||||
|
||||
@@ -9,15 +9,15 @@
|
||||
|
||||
package org.jdesktop.swingx.mapviewer.esri;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
import org.jdesktop.swingx.mapviewer.DefaultTileFactory;
|
||||
import org.jdesktop.swingx.mapviewer.GeoPosition;
|
||||
import org.jdesktop.swingx.mapviewer.TileFactoryInfo;
|
||||
import org.jdesktop.swingx.mapviewer.util.GeoUtil;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
/**
|
||||
* @author rbair
|
||||
*/
|
||||
@@ -58,7 +58,7 @@ public class ESRITileFactory extends DefaultTileFactory
|
||||
{
|
||||
// "&usrid=&ds=&c=-117.1817|34.0556&sf=52500&fmt=&ocs=";
|
||||
// System.out.println("getting tile at zoom: " + zoom);
|
||||
// System.out.println("ua.in.smartjava.map width at zoom = " + getMapWidthInTilesAtZoom(zoom));
|
||||
// System.out.println("map width at zoom = " + getMapWidthInTilesAtZoom(zoom));
|
||||
|
||||
// provide the center point of the tile, in lat/long coords
|
||||
int tileY = y;
|
||||
|
||||
@@ -9,18 +9,18 @@
|
||||
|
||||
package org.jdesktop.swingx.mapviewer.util;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.jdesktop.swingx.JXMapViewer;
|
||||
import org.jdesktop.swingx.mapviewer.GeoBounds;
|
||||
import org.jdesktop.swingx.mapviewer.GeoPosition;
|
||||
import org.jdesktop.swingx.mapviewer.TileFactory;
|
||||
import org.jdesktop.swingx.mapviewer.TileFactoryInfo;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* These are math utilities for converting between pixels, tiles, and geographic coordinates. Implements a Google Maps
|
||||
* style mercator projection.
|
||||
|
||||
@@ -21,17 +21,14 @@
|
||||
|
||||
package org.jdesktop.swingx.painter;
|
||||
|
||||
import java.awt.AlphaComposite;
|
||||
import java.awt.Composite;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.RenderingHints;
|
||||
import org.jdesktop.beans.AbstractBean;
|
||||
import org.jdesktop.swingx.util.GraphicsUtilities;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.BufferedImageOp;
|
||||
import java.lang.ref.SoftReference;
|
||||
|
||||
import org.jdesktop.beans.AbstractBean;
|
||||
import org.jdesktop.swingx.util.GraphicsUtilities;
|
||||
|
||||
/**
|
||||
* <p>A convenient base class from which concrete {@link Painter} implementations may
|
||||
* extend. It extends {@link org.jdesktop.beans.AbstractBean} as a convenience for
|
||||
@@ -61,7 +58,7 @@ import org.jdesktop.swingx.util.GraphicsUtilities;
|
||||
public abstract class AbstractPainter<T> extends AbstractBean implements Painter<T> {
|
||||
/**
|
||||
* An enum representing the possible interpolation values of Bicubic, Bilinear, and
|
||||
* Nearest Neighbor. These ua.in.smartjava.map to the underlying RenderingHints,
|
||||
* Nearest Neighbor. These map to the underlying RenderingHints,
|
||||
* but are easier to use and serialization safe.
|
||||
*/
|
||||
public enum Interpolation {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
package org.jdesktop.swingx.painter;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.*;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
@@ -39,7 +39,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
||||
* <p>A {@link Painter} implementation composed of an array of <code>Painter</code>s.
|
||||
* <code>CompoundPainter</code> provides a means for combining several individual
|
||||
* <code>Painter</code>s, or groups of them, into one logical unit. Each of the
|
||||
* <code>Painter</code>s are executed in order. BufferedImageOp ua.in.smartjava.filter effects can
|
||||
* <code>Painter</code>s are executed in order. BufferedImageOp filter effects can
|
||||
* be applied to them together as a whole. The entire set of painting operations
|
||||
* may be cached together.</p>
|
||||
*
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
package org.jdesktop.swingx.painter;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* <p>A painting delegate. The Painter interface defines exactly one method,
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
* Copyright (c) 2006 Romain Guy <romain.guy@mac.com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in ua.in.smartjava.source and binary forms, with or without
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of ua.in.smartjava.source code must retain the above copyright
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
@@ -34,17 +34,9 @@
|
||||
|
||||
package org.jdesktop.swingx.util;
|
||||
|
||||
import java.awt.AlphaComposite;
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.awt.Image;
|
||||
import java.awt.Insets;
|
||||
import java.awt.RenderingHints;
|
||||
import java.awt.Shape;
|
||||
import java.awt.Transparency;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.ColorModel;
|
||||
import java.awt.image.Raster;
|
||||
@@ -53,9 +45,6 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.JComponent;
|
||||
|
||||
/**
|
||||
* <p><code>GraphicsUtilities</code> contains a set of tools to perform
|
||||
* common graphics operations easily. These operations are divided into
|
||||
@@ -151,7 +140,7 @@ public class GraphicsUtilities {
|
||||
* transparency as the image specified as a parameter. That is, the
|
||||
* returned BufferedImage will be compatible with the graphics hardware.
|
||||
* If this method is called in a headless environment, then
|
||||
* the returned BufferedImage will be compatible with the ua.in.smartjava.source
|
||||
* the returned BufferedImage will be compatible with the source
|
||||
* image.</p>
|
||||
*
|
||||
* @see java.awt.Transparency
|
||||
@@ -175,7 +164,7 @@ public class GraphicsUtilities {
|
||||
* That is, the returned <code>BufferedImage</code> is compatible with
|
||||
* the graphics hardware. If the method is called in a headless
|
||||
* environment, then the returned BufferedImage will be compatible with
|
||||
* the ua.in.smartjava.source image.</p>
|
||||
* the source image.</p>
|
||||
*
|
||||
* @see java.awt.Transparency
|
||||
* @see #createCompatibleImage(java.awt.image.BufferedImage)
|
||||
@@ -203,7 +192,7 @@ public class GraphicsUtilities {
|
||||
* height. That is, the returned <code>BufferedImage</code> is compatible with
|
||||
* the graphics hardware. If the method is called in a headless
|
||||
* environment, then the returned BufferedImage will be compatible with
|
||||
* the ua.in.smartjava.source image.</p>
|
||||
* the source image.</p>
|
||||
*
|
||||
* @see #createCompatibleImage(java.awt.image.BufferedImage)
|
||||
* @see #createCompatibleImage(java.awt.image.BufferedImage, int, int)
|
||||
@@ -226,7 +215,7 @@ public class GraphicsUtilities {
|
||||
* height. That is, the returned <code>BufferedImage</code> is compatible with
|
||||
* the graphics hardware. If the method is called in a headless
|
||||
* environment, then the returned BufferedImage will be compatible with
|
||||
* the ua.in.smartjava.source image.</p>
|
||||
* the source image.</p>
|
||||
*
|
||||
* @see #createCompatibleImage(java.awt.image.BufferedImage)
|
||||
* @see #createCompatibleImage(java.awt.image.BufferedImage, int, int)
|
||||
@@ -298,7 +287,7 @@ public class GraphicsUtilities {
|
||||
* and therefore optimized for fast blitting operations.</p>
|
||||
*
|
||||
* <p>If the method is called in a headless environment, then the returned
|
||||
* <code>BufferedImage</code> will be the ua.in.smartjava.source image.</p>
|
||||
* <code>BufferedImage</code> will be the source image.</p>
|
||||
*
|
||||
* @see #createCompatibleImage(java.awt.image.BufferedImage)
|
||||
* @see #createCompatibleImage(java.awt.image.BufferedImage, int, int)
|
||||
@@ -335,12 +324,12 @@ public class GraphicsUtilities {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Returns a thumbnail of a ua.in.smartjava.source image. <code>newSize</code> defines
|
||||
* <p>Returns a thumbnail of a source image. <code>newSize</code> defines
|
||||
* the length of the longest dimension of the thumbnail. The other
|
||||
* dimension is then computed according to the dimensions ratio of the
|
||||
* original picture.</p>
|
||||
* <p>This method favors speed over quality. When the new size is less than
|
||||
* half the longest dimension of the ua.in.smartjava.source image,
|
||||
* half the longest dimension of the source image,
|
||||
* {@link #createThumbnail(BufferedImage, int)} or
|
||||
* {@link #createThumbnail(BufferedImage, int, int)} should be used instead
|
||||
* to ensure the quality of the result without sacrificing too much
|
||||
@@ -349,7 +338,7 @@ public class GraphicsUtilities {
|
||||
* @see #createThumbnailFast(java.awt.image.BufferedImage, int, int)
|
||||
* @see #createThumbnail(java.awt.image.BufferedImage, int)
|
||||
* @see #createThumbnail(java.awt.image.BufferedImage, int, int)
|
||||
* @param image the ua.in.smartjava.source image
|
||||
* @param image the source image
|
||||
* @param newSize the length of the largest dimension of the thumbnail
|
||||
* @return a new compatible <code>BufferedImage</code> containing a
|
||||
* thumbnail of <code>image</code>
|
||||
@@ -403,9 +392,9 @@ public class GraphicsUtilities {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Returns a thumbnail of a ua.in.smartjava.source image.</p>
|
||||
* <p>Returns a thumbnail of a source image.</p>
|
||||
* <p>This method favors speed over quality. When the new size is less than
|
||||
* half the longest dimension of the ua.in.smartjava.source image,
|
||||
* half the longest dimension of the source image,
|
||||
* {@link #createThumbnail(BufferedImage, int)} or
|
||||
* {@link #createThumbnail(BufferedImage, int, int)} should be used instead
|
||||
* to ensure the quality of the result without sacrificing too much
|
||||
@@ -414,7 +403,7 @@ public class GraphicsUtilities {
|
||||
* @see #createThumbnailFast(java.awt.image.BufferedImage, int)
|
||||
* @see #createThumbnail(java.awt.image.BufferedImage, int)
|
||||
* @see #createThumbnail(java.awt.image.BufferedImage, int, int)
|
||||
* @param image the ua.in.smartjava.source image
|
||||
* @param image the source image
|
||||
* @param newWidth the width of the thumbnail
|
||||
* @param newHeight the height of the thumbnail
|
||||
* @return a new compatible <code>BufferedImage</code> containing a
|
||||
@@ -451,20 +440,20 @@ public class GraphicsUtilities {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Returns a thumbnail of a ua.in.smartjava.source image. <code>newSize</code> defines
|
||||
* <p>Returns a thumbnail of a source image. <code>newSize</code> defines
|
||||
* the length of the longest dimension of the thumbnail. The other
|
||||
* dimension is then computed according to the dimensions ratio of the
|
||||
* original picture.</p>
|
||||
* <p>This method offers a good trade-off between speed and quality.
|
||||
* The result looks better than
|
||||
* {@link #createThumbnailFast(java.awt.image.BufferedImage, int)} when
|
||||
* the new size is less than half the longest dimension of the ua.in.smartjava.source
|
||||
* the new size is less than half the longest dimension of the source
|
||||
* image, yet the rendering speed is almost similar.</p>
|
||||
*
|
||||
* @see #createThumbnailFast(java.awt.image.BufferedImage, int, int)
|
||||
* @see #createThumbnailFast(java.awt.image.BufferedImage, int)
|
||||
* @see #createThumbnail(java.awt.image.BufferedImage, int, int)
|
||||
* @param image the ua.in.smartjava.source image
|
||||
* @param image the source image
|
||||
* @param newSize the length of the largest dimension of the thumbnail
|
||||
* @return a new compatible <code>BufferedImage</code> containing a
|
||||
* thumbnail of <code>image</code>
|
||||
@@ -567,17 +556,17 @@ public class GraphicsUtilities {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Returns a thumbnail of a ua.in.smartjava.source image.</p>
|
||||
* <p>Returns a thumbnail of a source image.</p>
|
||||
* <p>This method offers a good trade-off between speed and quality.
|
||||
* The result looks better than
|
||||
* {@link #createThumbnailFast(java.awt.image.BufferedImage, int)} when
|
||||
* the new size is less than half the longest dimension of the ua.in.smartjava.source
|
||||
* the new size is less than half the longest dimension of the source
|
||||
* image, yet the rendering speed is almost similar.</p>
|
||||
*
|
||||
* @see #createThumbnailFast(java.awt.image.BufferedImage, int)
|
||||
* @see #createThumbnailFast(java.awt.image.BufferedImage, int, int)
|
||||
* @see #createThumbnail(java.awt.image.BufferedImage, int)
|
||||
* @param image the ua.in.smartjava.source image
|
||||
* @param image the source image
|
||||
* @param newWidth the width of the thumbnail
|
||||
* @param newHeight the height of the thumbnail
|
||||
* @return a new compatible <code>BufferedImage</code> containing a
|
||||
@@ -678,7 +667,7 @@ public class GraphicsUtilities {
|
||||
* an image of type different from <code>BufferedImage.TYPE_INT_ARGB</code>
|
||||
* and <code>BufferedImage.TYPE_INT_RGB</code> will unmanage the image.</p>
|
||||
*
|
||||
* @param img the ua.in.smartjava.source image
|
||||
* @param img the source image
|
||||
* @param x the x location at which to start grabbing pixels
|
||||
* @param y the y location at which to start grabbing pixels
|
||||
* @param w the width of the rectangle of pixels to grab
|
||||
|
||||
@@ -20,11 +20,7 @@
|
||||
*/
|
||||
package org.jdesktop.swingx.util;
|
||||
|
||||
import java.awt.Font;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Polygon;
|
||||
import java.awt.Shape;
|
||||
import java.awt.*;
|
||||
import java.awt.font.GlyphVector;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.Area;
|
||||
|
||||
Reference in New Issue
Block a user