Re: [OpenMap Users] Using DrawingTool whithout the MapHandler

From: Don Dietrick <dietrick_at_bbn.com>
Date: Tue, 21 Jun 2005 14:31:56 -0400

Hi Chuck,


Something like this?


import com.bbn.openmap.LayerHandler;
import com.bbn.openmap.MouseDelegator;
import com.bbn.openmap.event.SelectMouseMode;
import com.bbn.openmap.gui.*;
import com.bbn.openmap.layer.editor.EditorLayer;
import com.bbn.openmap.layer.shape.ShapeLayer;
import com.bbn.openmap.omGraphics.DrawingAttributes;

import java.util.Properties;
import javax.swing.JFrame;

public class Map {

     public static void main(String[] argv) {
     JFrame jFrame = new JFrame("Map");

     BasicMapPanel basicMapPanel =
             new BasicMapPanel();


         basicMapPanel.addMapComponent(new ToolPanel());
         basicMapPanel.addMapComponent(new NavigatePanel());
         basicMapPanel.addMapComponent(new ZoomPanel());
         basicMapPanel.addMapComponent(new MouseModeButtonPanel());
         basicMapPanel.addMapComponent(new MouseDelegator());
         basicMapPanel.addMapComponent(new SelectMouseMode());
         basicMapPanel.addMapComponent(new LayerHandler());
         ShapeLayer shapeLayer = new ShapeLayer("/data/shape/world/
cntry02/cntry02.shp");
         shapeLayer.setDrawingAttributes((DrawingAttributes)
DrawingAttributes.DEFAULT.clone());
         basicMapPanel.addMapComponent(shapeLayer);

         Properties editorProps = new Properties();
         editorProps.put("prettyName", "Drawing Layer");
         editorProps.put("editor",
"com.bbn.openmap.layer.editor.DrawingEditorTool");

         editorProps.put("loaders", "distance lines polys rects
circles points text");
         editorProps.put("mouseModes", "Gestures");
         editorProps.put("distance.class",
"com.bbn.openmap.tools.drawing.OMDistanceLoader");
         editorProps.put("lines.class",
"com.bbn.openmap.tools.drawing.OMLineLoader");
         editorProps.put("polys.class",
"com.bbn.openmap.tools.drawing.OMPolyLoader");
         editorProps.put("rects.class",
"com.bbn.openmap.tools.drawing.OMRectLoader");
         editorProps.put("circles.class",
"com.bbn.openmap.tools.drawing.OMCircleLoader");
         editorProps.put("points.class",
"com.bbn.openmap.tools.drawing.OMPointLoader");
         editorProps.put("text.class",
"com.bbn.openmap.tools.drawing.OMTextLoader");
         EditorLayer editorLayer = new EditorLayer();
         editorLayer.setProperties(editorProps);
         basicMapPanel.addMapComponent(editorLayer);

     // Add MapPanel as Swing Component
     jFrame.getContentPane().add(basicMapPanel);
     // If you want to set MenuBar for Map controls
     jFrame.setJMenuBar(basicMapPanel.getMapMenuBar());

     jFrame.pack();
     jFrame.show();
     }
}




On Jun 21, 2005, at 6:58 AM, Vincent, Chuck wrote:

>
>
> I am doing something very similar. I have a swing app, where all I
> am using is the mapBean in a JPanel. I would like to be able to do
> simple projection changes (zoom & pan) and to be able to draw
> things on top.
>
>
>
> Any help pointing me in the right direction would be great. Please
> keep in mind I am new to Java (former c++ programmer).
>
>
>
> -Chuck
>
>
>
>
>
>
> <image001.jpg>
>
>
>
> -----Original Message-----
> From: owner-openmap-users_at_bbn.com [mailto:owner-openmap-
> users_at_bbn.com] On Behalf Of Dirk Aagaard
> Sent: Tuesday, June 21, 2005 3:36 AM
> To: openmap-users_at_bbn.com
> Subject: [OpenMap Users] Using DrawingTool whithout the MapHandler
>
>
>
>
>
> Hello Don, hello Group,
>
>
>
> How can I use the DrawingTool whithout the MapHandler.
>
>
>
> I have a GUI Application whith a MenuBar and a Toolbar. The main
> Panel has a JTree on the left side and a Panel on the right. Using
> reflection i can load different
>
> Panels in this MainPanel. One of them is a MapBean whith some
> Layers. At the moment all works fine for me.
>
>
>
> My problem now is how can I use the DrawingTool whithout the
> MapHandler in my own Layer witch extends OMGraphicHandlerLayer?
>
>
>
> Regards,
>
>
>
>
>
> Dirk
>
> ______________________________________________________________
>
> Verschicken Sie romantische, coole und witzige Bilder per SMS!
>
> Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
>
>
>
> --
>
> [To unsubscribe to this list send an email to "majdart_at_bbn.com"
>
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]
>
>

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Tue Jun 21 2005 - 14:32:55 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:07 EDT