Changeset 135 in josm


Ignore:
Timestamp:
2006-08-15T17:55:31+02:00 (15 years ago)
Author:
imi
Message:
  • fixed test directory structure
  • shortkeys do not cycle through modes anymore
  • Ctrl+, and Ctrl+. to zoom in/out. Should work on Mac now.
Files:
9 added
1 deleted
4 edited
3 copied

Legend:

Unmodified
Added
Removed
  • .classpath

    r111 r135  
    22<classpath>
    33        <classpathentry kind="src" path="src"/>
    4         <classpathentry including="images/" excluding="po/org/|po/" kind="src" path=""/>
     4        <classpathentry kind="src" path="test"/>
     5        <classpathentry excluding="po/|src/|test/" including="images/" kind="src" path=""/>
    56        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    6         <classpathentry sourcepath="JUNIT_SRC_HOME/junitsrc.zip" kind="var" path="JUNIT_HOME/junit.jar"/>
     7        <classpathentry kind="var" path="JUNIT_HOME/junit.jar" sourcepath="JUNIT_SRC_HOME/junitsrc.zip"/>
    78        <classpathentry kind="lib" path="lib/MinML2.jar"/>
    89        <classpathentry kind="lib" path="lib/metadata-extractor-2.3.1.jar"/>
  • build.xml

    r134 r135  
    3131        </target>
    3232
    33         <target name="dist" depends="compile,gettext">
     33        <target name="dist" depends="compile">
    3434                <!-- jars -->
    3535                <unjar src="${lib}/MinML2.jar" dest="${build}" />
  • src/org/openstreetmap/josm/actions/GroupAction.java

    r101 r135  
    33import java.awt.event.ActionEvent;
    44import java.awt.event.ActionListener;
     5import java.awt.event.KeyEvent;
    56import java.beans.PropertyChangeEvent;
    67import java.beans.PropertyChangeListener;
     
    89import java.util.List;
    910
     11import javax.swing.AbstractAction;
    1012import javax.swing.Action;
    1113import javax.swing.Icon;
     
    3032        private PropertyChangeListener forwardActiveListener = new PropertyChangeListener(){
    3133                public void propertyChange(PropertyChangeEvent evt) {
    32                         if (evt.getPropertyName().equals("active")) {
     34                        if (evt.getPropertyName().equals("active"))
    3335                                putValue("active", evt.getNewValue());
    34                                 if (evt.getNewValue() == Boolean.FALSE)
    35                                         cycle = false;
    36                         }
    3736                }
    3837        };
    39         public boolean cycle;
    4038
    4139        protected void setCurrent(int current) {
     
    5351                String idName = getClass().getName();
    5452                Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(shortCut, modifiers), idName);
    55         Main.contentPane.getActionMap().put(idName, this);
     53                Main.contentPane.getActionMap().put(idName, this);
    5654                shortCutName = ShortCutLabel.name(shortCut, modifiers);
    57                 addPropertyChangeListener(new PropertyChangeListener(){
    58                         public void propertyChange(PropertyChangeEvent evt) {
    59                                 if (evt.getPropertyName().equals("active") && evt.getNewValue() == Boolean.FALSE)
    60                                         cycle = false;
    61             }
     55                Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(shortCut, KeyEvent.SHIFT_DOWN_MASK), idName+".cycle");
     56                Main.contentPane.getActionMap().put(idName+".cycle", new AbstractAction(){
     57                        public void actionPerformed(ActionEvent e) {
     58                                setCurrent((current+1)%actions.size());
     59                                actions.get(current).actionPerformed(e);
     60                        }
    6261                });
    6362        }
     
    6867                        b.setSelected(!b.isSelected());
    6968                        openPopup(b);
    70                 } else {
    71                         if (cycle)
    72                                 setCurrent((current+1)%actions.size());
    73                         else
    74                                 cycle = true;
     69                } else
    7570                        actions.get(current).actionPerformed(e);
    76                 }
    7771        }
    7872
  • src/org/openstreetmap/josm/gui/MapMover.java

    r102 r135  
    3232        }
    3333            public void actionPerformed(ActionEvent e) {
    34                 if (action.equals("+") || action.equals("-")) {
     34                System.out.println("e="+e.toString()+" action="+e.getActionCommand());
     35                if (action.equals(".") || action.equals(",")) {
    3536                        Point mouse = nc.getMousePosition();
    3637                        if (mouse == null)
    3738                                mouse = new Point((int)nc.getBounds().getCenterX(), (int)nc.getBounds().getCenterY());
    38                         MouseWheelEvent we = new MouseWheelEvent(nc, e.getID(), e.getWhen(), e.getModifiers(), mouse.x, mouse.y, 0, false, MouseWheelEvent.WHEEL_UNIT_SCROLL, 1, action.equals("+") ? -1 : 1);
     39                        MouseWheelEvent we = new MouseWheelEvent(nc, e.getID(), e.getWhen(), e.getModifiers(), mouse.x, mouse.y, 0, false, MouseWheelEvent.WHEEL_UNIT_SCROLL, 1, action.equals(",") ? -1 : 1);
    3940                        mouseWheelMoved(we);
    4041                } else {
     
    7879                nc.addMouseWheelListener(this);
    7980               
    80                 String[] n = {"+","-","up","right","down","left"};
    81                 int[] k = {KeyEvent.VK_PLUS, KeyEvent.VK_MINUS, KeyEvent.VK_UP, KeyEvent.VK_RIGHT, KeyEvent.VK_DOWN, KeyEvent.VK_LEFT};
     81                String[] n = {",",".","up","right","down","left"};
     82                int[] k = {KeyEvent.VK_COMMA, KeyEvent.VK_PERIOD, KeyEvent.VK_UP, KeyEvent.VK_RIGHT, KeyEvent.VK_DOWN, KeyEvent.VK_LEFT};
    8283
    8384                for (int i = 0; i < n.length; ++i) {
  • test/org/openstreetmap/josm/data/osm/visitor/MergeVisitorTest.java

    r132 r135  
    1 package org.openstreetmap.josm.test;
     1package org.openstreetmap.josm.data.osm.visitor;
    22
    33import java.util.Date;
     
    1212import org.openstreetmap.josm.data.osm.Way;
    1313import org.openstreetmap.josm.data.osm.visitor.MergeVisitor;
    14 import org.openstreetmap.josm.test.framework.Bug;
    15 import org.openstreetmap.josm.test.framework.DataSetTestCaseHelper;
     14import org.openstreetmap.josm.testframework.Bug;
     15import org.openstreetmap.josm.testframework.DataSetTestCaseHelper;
    1616
    1717public class MergeVisitorTest extends TestCase {
  • test/org/openstreetmap/josm/testframework/Bug.java

    r132 r135  
    1 package org.openstreetmap.josm.test.framework;
     1package org.openstreetmap.josm.testframework;
    22
    33/**
  • test/org/openstreetmap/josm/testframework/DataSetTestCaseHelper.java

    r132 r135  
    1 package org.openstreetmap.josm.test.framework;
     1package org.openstreetmap.josm.testframework;
    22
    33import java.util.Arrays;
Note: See TracChangeset for help on using the changeset viewer.