Index: /applications/editors/josm/plugins/00_plugin_dir_template/build.xml
===================================================================
--- /applications/editors/josm/plugins/00_plugin_dir_template/build.xml	(revision 26361)
+++ /applications/editors/josm/plugins/00_plugin_dir_template/build.xml	(revision 26362)
@@ -28,9 +28,9 @@
 **
 -->
-<project name="myPluginName" default="dist" basedir=".">
+<project name="InfoMode" default="dist" basedir=".">
     <!-- enter the SVN commit message -->
-    <property name="commit.message" value="Commit message"/>
+    <property name="commit.message" value="InfoMode initial commit"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value=""/>
+    <property name="plugin.main.version" value="4201"/>
     <!-- should not be necessary to change the following properties -->
     <property name="josm" location="../../core/dist/josm-custom.jar"/>
@@ -94,10 +94,11 @@
             -->
             <manifest>
-                <attribute name="Author" value="..."/>
-                <attribute name="Plugin-Class" value="..."/>
+                <attribute name="Author" value="Alexei Kasatkin"/>
+                <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.infomode.InfoModePlugin"/>
                 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
-                <attribute name="Plugin-Description" value="..."/>
-                <attribute name="Plugin-Icon" value="..."/>
-                <attribute name="Plugin-Link" value="..."/>
+                <attribute name="Plugin-Description" value="Extra information about current layer objects pop ups - currently GPX trackpoint info"/>
+<!--                <attribute name="Plugin-Icon" value="..."/> -->
+                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/InfoMode"/>
+                <attribute name="ru_Plugin-Link" value="http://wiki.openstreetmap.org/wiki/RU:JOSM/Plugins/InfoMode"/>
                 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
@@ -231,3 +232,9 @@
     <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
     </target>
+    <target name="runjosm" depends="install">
+        <java jar="${josm}" fork="true">
+            <arg line="../../core/data_nodist/munich.gpx"/>
+        </java>
+    </target>
+
 </project>
Index: /applications/editors/josm/plugins/00_plugin_dir_template/nbproject/private/private.xml
===================================================================
--- /applications/editors/josm/plugins/00_plugin_dir_template/nbproject/private/private.xml	(revision 26362)
+++ /applications/editors/josm/plugins/00_plugin_dir_template/nbproject/private/private.xml	(revision 26362)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
+    <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
+</project-private>
Index: /applications/editors/josm/plugins/00_plugin_dir_template/nbproject/project.xml
===================================================================
--- /applications/editors/josm/plugins/00_plugin_dir_template/nbproject/project.xml	(revision 26362)
+++ /applications/editors/josm/plugins/00_plugin_dir_template/nbproject/project.xml	(revision 26362)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+    <type>org.netbeans.modules.ant.freeform</type>
+    <configuration>
+        <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1">
+            <name>infomode</name>
+        </general-data>
+        <general-data xmlns="http://www.netbeans.org/ns/freeform-project/2">
+            <!-- Не используйте диалоговое окно свойств проекта при редактировании данного файла вручную. -->
+            <name>infomode</name>
+            <properties/>
+            <folders>
+                <source-folder>
+                    <label>infomode</label>
+                    <location>.</location>
+                    <encoding>UTF-8</encoding>
+                </source-folder>
+                <source-folder>
+                    <label>src</label>
+                    <type>java</type>
+                    <location>src</location>
+                    <encoding>UTF-8</encoding>
+                </source-folder>
+            </folders>
+            <ide-actions>
+                <action name="build">
+                    <target>install</target>
+                </action>
+                <action name="clean">
+                    <target>clean</target>
+                </action>
+                <action name="rebuild">
+                    <target>clean</target>
+                    <target>install</target>
+                </action>
+                <action name="run">
+                    <target>runjosm</target>
+                </action>
+            </ide-actions>
+            <view>
+                <items>
+                    <source-folder style="packages">
+                        <label>src</label>
+                        <location>src</location>
+                    </source-folder>
+                    <source-file>
+                        <location>build.xml</location>
+                    </source-file>
+                </items>
+                <context-menu>
+                    <ide-action name="build"/>
+                    <ide-action name="rebuild"/>
+                    <ide-action name="clean"/>
+                    <ide-action name="run"/>
+                </context-menu>
+            </view>
+            <subprojects/>
+        </general-data>
+        <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/3">
+            <compilation-unit>
+                <package-root>src</package-root>
+                <classpath mode="compile">../../core/src</classpath>
+                <source-level>1.6</source-level>
+            </compilation-unit>
+        </java-data>
+    </configuration>
+</project>
Index: /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/infomode/InfoMode.java
===================================================================
--- /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/infomode/InfoMode.java	(revision 26362)
+++ /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/infomode/InfoMode.java	(revision 26362)
@@ -0,0 +1,234 @@
+/*
+ * This file is part of InfoMode plugin for JOSM.
+ * http://wiki.openstreetmap.org/wiki/JOSM/Plugins/InfoMode
+ *
+ * Licence: GPL v2 or later
+ * Author:  Alexei Kasatkin, 2011
+ * Thanks to authors of BuildingTools, ImproveWayAccuracy
+ * for good sample code
+ */
+package org.openstreetmap.josm.plugins.infomode;
+
+import java.awt.AWTEvent;
+import java.awt.Color;
+import java.awt.Point;
+import java.awt.event.MouseEvent;
+import org.openstreetmap.josm.data.coor.EastNorth;
+import org.openstreetmap.josm.data.gpx.WayPoint;
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.Cursor;
+import java.awt.Graphics2D;
+import java.awt.Toolkit;
+import java.awt.event.AWTEventListener;
+import java.awt.event.ActionEvent;
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import java.text.DateFormat;
+import java.util.Locale;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.mapmode.MapMode;
+import org.openstreetmap.josm.data.Bounds;
+import org.openstreetmap.josm.data.gpx.GpxTrack;
+import org.openstreetmap.josm.data.gpx.GpxTrackSegment;
+import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.gui.MapView;
+import org.openstreetmap.josm.gui.layer.GpxLayer;
+import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.gui.layer.MapViewPaintable;
+import org.openstreetmap.josm.tools.Shortcut;
+
+class InfoMode extends MapMode implements MapViewPaintable, AWTEventListener {
+    private MapView mv;
+    private String statusText;
+    private boolean drawing;
+    private boolean ctrl;
+    private boolean shift;
+    private boolean oldCtrl;
+    private boolean oldShift;
+    private EastNorth pos;
+    DateFormat df;
+
+    InfoMode(MapFrame mapFrame) {
+        super(tr("InfoMode"), "infomode.png", tr("GPX info mode"), Shortcut.registerShortcut(
+                "mapmode/infomode",
+                tr("Mode: {0}", tr("GPX info mode")),
+                KeyEvent.VK_BACK_SLASH, Shortcut.GROUP_EDIT), mapFrame, Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+        df = DateFormat.getDateTimeInstance(DateFormat.DEFAULT,DateFormat.DEFAULT, Locale.getDefault()); 
+        
+    }
+
+// <editor-fold defaultstate="collapsed" desc="Event listeners">
+
+    @Override
+    public void enterMode() {
+        System.out.println("entering mode");
+        if (!isEnabled()) return;
+        super.enterMode();
+        System.out.println("enter mode");
+        
+        
+        mv = Main.map.mapView;
+        
+        Main.map.mapView.addMouseListener(this);
+        Main.map.mapView.addMouseMotionListener(this);
+        Main.map.mapView.addTemporaryLayer(this);
+
+
+        try {
+            Toolkit.getDefaultToolkit().addAWTEventListener(this,
+                    AWTEvent.KEY_EVENT_MASK);
+        } catch (SecurityException ex) {
+        }
+    }
+
+    @Override
+    public void exitMode() {
+        super.exitMode();
+        System.out.println("exit mode");
+        Main.map.mapView.removeMouseListener(this);
+        Main.map.mapView.removeMouseMotionListener(this);
+
+        Main.map.mapView.removeTemporaryLayer(this);
+
+        try {
+            Toolkit.getDefaultToolkit().removeAWTEventListener(this);
+        } catch (SecurityException ex) {
+        }
+        
+        repaint();
+    }
+
+    @Override
+    public boolean layerIsSupported(Layer l) {
+        return true;
+    }
+
+
+
+    //////////    Event listener methods
+
+    @Override
+    public void paint(Graphics2D g, MapView mv, Bounds bbox) {
+        
+        Layer l = Main.main.getActiveLayer();
+        
+        if (l instanceof GpxLayer && pos!=null) {
+            GpxLayer gpxL = (GpxLayer )l;
+            
+            double minDist=1e9,d,len=0;
+            WayPoint wp=null;
+            GpxTrack trk=null;
+            for (GpxTrack track : gpxL.data.tracks) {
+                for (GpxTrackSegment seg : track.getSegments()) {
+                    for (WayPoint S : seg.getWayPoints()) {
+                        d = S.getEastNorth().distance(pos);
+                        if (d<minDist && d<10) {
+                            minDist = d;
+                            wp=S;
+                            trk=track;
+                            }
+                        if (track==trk) len+=seg.length();
+                        }
+                    }
+            }
+            if (wp!=null) {
+                Point p = mv.getPoint(wp.getCoor());
+                g.setColor(Color.RED);
+                g.fillOval(p.x-10, p.y-10, 20, 20); // mark selected point
+                p.translate(20, 5);
+                g.setColor(Color.WHITE);
+                g.fillRoundRect(p.x, p.y-25, 200, 50,10,10);
+                g.setColor(Color.BLACK);
+                g.drawString(df.format(wp.getTime()), p.x+5, p.y-10);
+                String s = (String) trk.getAttributes().get("name");
+                if (s!=null) g.drawString(s, p.x+5, p.y+5);
+                System.out.println(trk.getAttributes().toString());                
+                System.out.println(wp.attr.toString());                
+                s = (String) wp.attr.get("ele");
+                String s1=null;
+                try {s1 = String.format("%3.1f", Double.parseDouble(s));} catch (Exception e) {  }
+                if (s1!=null) g.drawString("H="+s1, p.x+5, p.y+20);
+            }
+            
+        }
+    }
+
+    @Override
+    public void eventDispatched(AWTEvent event) {
+        updateKeyModifiers((InputEvent) event);
+        if (event.getID() == KeyEvent.KEY_PRESSED) {
+            doKeyEvent((KeyEvent) event);
+        }
+//        updateStatusLine();
+        repaint();
+    }
+
+    @Override
+    public void mousePressed(MouseEvent e) {
+        if (!isEnabled()) return;
+        if (e.getButton() != MouseEvent.BUTTON1) return;
+        
+        //setStatusLine(tr("Please move the mouse to draw new way"));
+        repaint();
+
+    }
+
+    @Override
+    public void mouseReleased(MouseEvent e) {
+        if (!isEnabled()) return;
+        if (e.getButton() != MouseEvent.BUTTON1) return;
+        
+        repaint();
+    }
+
+    @Override
+    public void mouseDragged(MouseEvent e) {
+        mouseMoved(e);
+    }
+
+    @Override
+    public void mouseMoved(MouseEvent e) {
+        if (!isEnabled()) return;
+        pos = mv.getEastNorth(e.getX(), e.getY());
+        repaint();
+    }
+
+    private void doKeyEvent(KeyEvent e) {
+        ///  System.out.println(e);
+        if (e.getKeyCode() == KeyEvent.VK_BACK_SPACE) {
+        }
+    }
+
+    /**
+     * Updates shift and ctrl key states
+     */
+    private void updateKeyModifiers(InputEvent e) {
+        oldCtrl = ctrl;
+        oldShift = shift;
+        ctrl = (e.getModifiers() & ActionEvent.CTRL_MASK) != 0;
+        shift = (e.getModifiers() & ActionEvent.SHIFT_MASK) != 0;
+    }
+
+    @Override
+    protected void updateStatusLine() {
+        Main.map.statusLine.setHelpText(statusText);
+        Main.map.statusLine.repaint();
+    }
+// </editor-fold>
+
+
+
+    private void repaint() {
+        Main.map.mapView.repaint();
+    }
+    private void setStatusLine(String tr) {
+        statusText=tr;
+        updateStatusLine();
+    }
+
+    
+
+    
+}
Index: /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/infomode/InfoModePlugin.java
===================================================================
--- /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/infomode/InfoModePlugin.java	(revision 26362)
+++ /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/infomode/InfoModePlugin.java	(revision 26362)
@@ -0,0 +1,27 @@
+/*
+ * This file is part of InfoMode plugin for JOSM.
+ * http://wiki.openstreetmap.org/wiki/JOSM/Plugins/InfoMode
+ *
+ * Licence: GPL v2 or later
+ * Author:  Alexei Kasatkin, 2011
+ */
+
+package org.openstreetmap.josm.plugins.infomode;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.IconToggleButton;
+import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.plugins.Plugin;
+import org.openstreetmap.josm.plugins.PluginInformation;
+public class InfoModePlugin extends Plugin {
+
+    public InfoModePlugin(PluginInformation info) {
+        super(info);
+    }
+
+    @Override
+    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
+        if (oldFrame == null && newFrame != null) {
+            Main.map.addMapMode(new IconToggleButton(new InfoMode(Main.map)));
+        }        
+    }
+}
