Index: applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OhePlugin.java
===================================================================
--- applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OhePlugin.java	(revision 22873)
+++ applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OhePlugin.java	(revision 23192)
@@ -38,240 +38,240 @@
 public class OhePlugin extends Plugin {
 
-	// Strings for choosing which key of an object with given tags should be
-	// edited
-	// the order is referencing the preference of the keys
-	// String[] -> {key, value, to-editing-key} key and value can contain regexp
-	private final String[][] TAG_EDIT_STRINGS = new String[][] {
-			{ "opening_hours", ".*", "opening_hours" },
-			{ "collection_times", ".*", "collection_times" },
-			{ "collection_times:local", ".*", "collection_times:local" },
-			{ "lit", ".*", "lit" },
-			{ "amenity", "post_box", "collection_times" },
-			{ "amenity", ".*", "opening_hours" },
-			{ "shop", ".*", "opening_hours" }, { "highway", ".*", "lit" } };
-
-	/**
-	 * Will be invoked by JOSM to bootstrap the plugin
-	 * 
-	 * @param info
-	 *            information about the plugin and its local installation
-	 */
-	public OhePlugin(PluginInformation info) {
-		super(info);
-		Main.main.menu.toolsMenu.add(new OheMenuAction());
-	}
-
-	class OheMenuAction extends JosmAction {
-		public OheMenuAction() {
-			super(
-					tr("Edit opening hours"),
-					"opening_hours.png",
-					tr("Edit time-tag of selected element in a graphical interface"),
-					Shortcut.registerShortcut("tools:opening_hourseditor", tr(
-							"Tool: {0}", tr("Edit opening hours")),
-							KeyEvent.VK_T, Shortcut.GROUP_MENU), false);
-		}
-
-		@Override
-		protected void updateEnabledState() {
-			if (getCurrentDataSet() == null) {
-				setEnabled(false);
-			} else {
-				updateEnabledState(getCurrentDataSet().getSelected());
-			}
-		}
-
-		@Override
-		protected void updateEnabledState(
-				Collection<? extends OsmPrimitive> selection) {
-			setEnabled(selection != null && !selection.isEmpty());
-		}
-
-		public void actionPerformed(ActionEvent evt) {
-			// fetch active Layer
-			OsmDataLayer osmlayer = Main.main.getEditLayer();
-			if (osmlayer != null) {
-				Collection<OsmPrimitive> selection = osmlayer.data
-						.getSelected();
-				if (selection.size() == 1) { // one object selected
-					OsmPrimitive object = selection.iterator().next();
-					String[] keyValuePair = editTimeTags(object.getKeys());
-					if (keyValuePair != null) {
-						String key = keyValuePair[0].trim();
-						String newkey = keyValuePair[1].trim();
-						String value = keyValuePair[2].trim();
-
-						if (value.equals("")) {
-							value = null; // delete the key
-						}
-						if (newkey.equals("")) {
-							newkey = key;
-							value = null; // delete the key instead
-						}
-						if (key.equals(newkey)
-								&& tr("<different>").equals(value))
-							return;
-						if (key.equals(newkey) || value == null) {
-							Main.main.undoRedo.add(new ChangePropertyCommand(
-									object, newkey, value));
-						} else {
-							Collection<Command> commands = new Vector<Command>();
-							commands.add(new ChangePropertyCommand(object, key,
-									null));
-							commands.add(new ChangePropertyCommand(object,
-									newkey, value));
-							Main.main.undoRedo.add(new SequenceCommand(
-									tr("Change properties of 1 object"),
-									commands));
-						}
-					}
-				} else { // Not possible to edit 0, 2 or more objects
-					JOptionPane
-							.showMessageDialog(
-									Main.parent,
-									tr(
-											"You have {0} Elements selected. But you can edit only one element!",
-											selection.size()),
-									"openingHoursEditor Warning",
-									JOptionPane.ERROR_MESSAGE);
-				}
-			}
-		}
-	}
-
-	// opens up dialogs to change one of the key-value-pairs and returns the
-	// changed pair
-	private String[] editTimeTags(Map<String, String> keyValueMap) {
-		String selectedKey = "";
-
-		if ((selectedKey = tagChooseDialog(keyValueMap)) == null)
-			return null;
-
-		final String value = (keyValueMap.containsKey(selectedKey)) ? keyValueMap
-				.get(selectedKey)
-				: "";
-		OheDialogPanel panel = new OheDialogPanel(this, selectedKey, value);
-
-		final JOptionPane optionPane = new JOptionPane(panel,
-				JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
-		final JDialog dlg = optionPane.createDialog(Main.parent, tr("Edit"));
-
-		dlg.setResizable(true);
-		dlg.setVisible(true);
-
-		Object answer = optionPane.getValue();
-		if (!(answer == null || answer == JOptionPane.UNINITIALIZED_VALUE || (answer instanceof Integer && (Integer) answer != JOptionPane.OK_OPTION)))
-			return panel.getChangedKeyValuePair();
-
-		return null;
-	}
-
-	// opens a dialog for choosing from a set of tags which can be edited
-	// the chosen one is returned
-	private String tagChooseDialog(Map<String, String> keyValueMap) {
-		String preSelectedKey = getPreSelectedKey(keyValueMap);
-		int preSelectedRow = -1;
-
-		String[][] rowData = new String[keyValueMap.size()][2];
-		int cnt = 0;
-		for (Object key : keyValueMap.keySet().toArray()) {
-			rowData[cnt][0] = key.toString();
-			rowData[cnt][1] = keyValueMap.get(key);
-			if (key.toString().equals(preSelectedKey))
-				preSelectedRow = cnt;
-			cnt++;
-		}
-
-		final JTable table = new JTable(rowData,
-				new String[] { "key", "value" }) {
-			public boolean isCellEditable(int rowIndex, int colIndex) {
-				return false; // Disallow the editing of any cell
-			}
-		};
-		table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-		JScrollPane sp = new JScrollPane(
-				JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
-				JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
-		sp.setViewportView(table);
-
-		final JTextField tf = new JTextField();
-
-		ActionListener al = new ActionListener() {
-			@Override
-			public void actionPerformed(ActionEvent e) {
-				if (e.getActionCommand().equals("edit")) {
-					table.setEnabled(true);
-					tf.setEnabled(false);
-				} else if (e.getActionCommand().equals("new")) {
-					table.setEnabled(false);
-					tf.setEnabled(true);
-				}
-			}
-		};
-
-		JRadioButton editButton = new JRadioButton("edit existing tag");
-		editButton.setActionCommand("edit");
-		editButton.addActionListener(al);
-		JRadioButton newButton = new JRadioButton("edit new tag");
-		newButton.setActionCommand("new");
-		newButton.addActionListener(al);
-		ButtonGroup group = new ButtonGroup();
-		group.add(newButton);
-		group.add(editButton);
-
-		if (preSelectedRow != -1) {
-			table.setEnabled(true);
-			tf.setEnabled(false);
-			table.setRowSelectionInterval(preSelectedRow, preSelectedRow);
-			editButton.setSelected(true);
-		} else {
-			table.setEnabled(false);
-			tf.setEnabled(true);
-			tf.setText(preSelectedKey);
-			newButton.setSelected(true);
-		}
-
-		JPanel dlgPanel = new JPanel(new GridBagLayout());
-		dlgPanel.add(editButton, GBC.std().anchor(GBC.CENTER));
-		dlgPanel.add(sp, GBC.eol().fill(GBC.BOTH));
-		dlgPanel.add(newButton, GBC.std().anchor(GBC.CENTER));
-		dlgPanel.add(tf, GBC.eol().fill(GBC.HORIZONTAL));
-
-		JOptionPane optionPane = new JOptionPane(dlgPanel,
-				JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
-		JDialog dlg = optionPane.createDialog(Main.parent, tr("Choose key"));
-
-		dlg.pack();
-		dlg.setResizable(true);
-		dlg.setVisible(true);
-
-		Object answer = optionPane.getValue();
-		if (answer != null
-				&& answer != JOptionPane.UNINITIALIZED_VALUE
-				&& (answer instanceof Integer && (Integer) answer == JOptionPane.OK_OPTION))
-			if (editButton.isSelected() && table.getSelectedRow() != -1)
-				return rowData[table.getSelectedRow()][0];
-			else if (newButton.isSelected())
-				return tf.getText();
-
-		return null;
-	}
-
-	private String getPreSelectedKey(Map<String, String> keyValueMap) {
-		for (String[] pattern : TAG_EDIT_STRINGS) {
-			Pattern keyPattern = Pattern.compile(pattern[0]);
-			Pattern valuePattern = Pattern.compile(pattern[1]);
-			for (Object key : keyValueMap.keySet().toArray()) {
-				Matcher keyMatcher = keyPattern.matcher(key.toString());
-				if (keyMatcher.matches()) {
-					Matcher valueMatcher = valuePattern.matcher(keyValueMap
-							.get(key));
-					if (valueMatcher.matches()) {
-						return pattern[2];
-					}
-				}
-			}
-		}
-		return "";
-	}
+    // Strings for choosing which key of an object with given tags should be
+    // edited
+    // the order is referencing the preference of the keys
+    // String[] -> {key, value, to-editing-key} key and value can contain regexp
+    private final String[][] TAG_EDIT_STRINGS = new String[][] {
+            { "opening_hours", ".*", "opening_hours" },
+            { "collection_times", ".*", "collection_times" },
+            { "collection_times:local", ".*", "collection_times:local" },
+            { "lit", ".*", "lit" },
+            { "amenity", "post_box", "collection_times" },
+            { "amenity", ".*", "opening_hours" },
+            { "shop", ".*", "opening_hours" }, { "highway", ".*", "lit" } };
+
+    /**
+     * Will be invoked by JOSM to bootstrap the plugin
+     *
+     * @param info
+     *            information about the plugin and its local installation
+     */
+    public OhePlugin(PluginInformation info) {
+        super(info);
+        Main.main.menu.toolsMenu.add(new OheMenuAction());
+    }
+
+    class OheMenuAction extends JosmAction {
+        public OheMenuAction() {
+            super(
+                    tr("Edit opening hours"),
+                    "opening_hours.png",
+                    tr("Edit time-tag of selected element in a graphical interface"),
+                    Shortcut.registerShortcut("tools:opening_hourseditor", tr(
+                            "Tool: {0}", tr("Edit opening hours")),
+                            KeyEvent.VK_T, Shortcut.GROUP_MENU), false);
+        }
+
+        @Override
+        protected void updateEnabledState() {
+            if (getCurrentDataSet() == null) {
+                setEnabled(false);
+            } else {
+                updateEnabledState(getCurrentDataSet().getSelected());
+            }
+        }
+
+        @Override
+        protected void updateEnabledState(
+                Collection<? extends OsmPrimitive> selection) {
+            setEnabled(selection != null && !selection.isEmpty());
+        }
+
+        public void actionPerformed(ActionEvent evt) {
+            // fetch active Layer
+            OsmDataLayer osmlayer = Main.main.getEditLayer();
+            if (osmlayer != null) {
+                Collection<OsmPrimitive> selection = osmlayer.data
+                        .getSelected();
+                if (selection.size() == 1) { // one object selected
+                    OsmPrimitive object = selection.iterator().next();
+                    String[] keyValuePair = editTimeTags(object.getKeys());
+                    if (keyValuePair != null) {
+                        String key = keyValuePair[0].trim();
+                        String newkey = keyValuePair[1].trim();
+                        String value = keyValuePair[2].trim();
+
+                        if (value.equals("")) {
+                            value = null; // delete the key
+                        }
+                        if (newkey.equals("")) {
+                            newkey = key;
+                            value = null; // delete the key instead
+                        }
+                        if (key.equals(newkey)
+                                && tr("<different>").equals(value))
+                            return;
+                        if (key.equals(newkey) || value == null) {
+                            Main.main.undoRedo.add(new ChangePropertyCommand(
+                                    object, newkey, value));
+                        } else {
+                            Collection<Command> commands = new Vector<Command>();
+                            commands.add(new ChangePropertyCommand(object, key,
+                                    null));
+                            commands.add(new ChangePropertyCommand(object,
+                                    newkey, value));
+                            Main.main.undoRedo.add(new SequenceCommand(
+                                    tr("Change properties of 1 object"),
+                                    commands));
+                        }
+                    }
+                } else { // Not possible to edit 0, 2 or more objects
+                    JOptionPane
+                            .showMessageDialog(
+                                    Main.parent,
+                                    tr(
+                                            "You have {0} Elements selected. But you can edit only one element!",
+                                            selection.size()),
+                                    "openingHoursEditor Warning",
+                                    JOptionPane.ERROR_MESSAGE);
+                }
+            }
+        }
+    }
+
+    // opens up dialogs to change one of the key-value-pairs and returns the
+    // changed pair
+    private String[] editTimeTags(Map<String, String> keyValueMap) {
+        String selectedKey = "";
+
+        if ((selectedKey = tagChooseDialog(keyValueMap)) == null)
+            return null;
+
+        final String value = (keyValueMap.containsKey(selectedKey)) ? keyValueMap
+                .get(selectedKey)
+                : "";
+        OheDialogPanel panel = new OheDialogPanel(this, selectedKey, value);
+
+        final JOptionPane optionPane = new JOptionPane(panel,
+                JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
+        final JDialog dlg = optionPane.createDialog(Main.parent, tr("Edit"));
+
+        dlg.setResizable(true);
+        dlg.setVisible(true);
+
+        Object answer = optionPane.getValue();
+        if (!(answer == null || answer == JOptionPane.UNINITIALIZED_VALUE || (answer instanceof Integer && (Integer) answer != JOptionPane.OK_OPTION)))
+            return panel.getChangedKeyValuePair();
+
+        return null;
+    }
+
+    // opens a dialog for choosing from a set of tags which can be edited
+    // the chosen one is returned
+    private String tagChooseDialog(Map<String, String> keyValueMap) {
+        String preSelectedKey = getPreSelectedKey(keyValueMap);
+        int preSelectedRow = -1;
+
+        String[][] rowData = new String[keyValueMap.size()][2];
+        int cnt = 0;
+        for (Object key : keyValueMap.keySet().toArray()) {
+            rowData[cnt][0] = key.toString();
+            rowData[cnt][1] = keyValueMap.get(key);
+            if (key.toString().equals(preSelectedKey))
+                preSelectedRow = cnt;
+            cnt++;
+        }
+
+        final JTable table = new JTable(rowData,
+                new String[] { "key", "value" }) {
+            public boolean isCellEditable(int rowIndex, int colIndex) {
+                return false; // Disallow the editing of any cell
+            }
+        };
+        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        JScrollPane sp = new JScrollPane(
+                JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
+                JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+        sp.setViewportView(table);
+
+        final JTextField tf = new JTextField();
+
+        ActionListener al = new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                if (e.getActionCommand().equals("edit")) {
+                    table.setEnabled(true);
+                    tf.setEnabled(false);
+                } else if (e.getActionCommand().equals("new")) {
+                    table.setEnabled(false);
+                    tf.setEnabled(true);
+                }
+            }
+        };
+
+        JRadioButton editButton = new JRadioButton("edit existing tag");
+        editButton.setActionCommand("edit");
+        editButton.addActionListener(al);
+        JRadioButton newButton = new JRadioButton("edit new tag");
+        newButton.setActionCommand("new");
+        newButton.addActionListener(al);
+        ButtonGroup group = new ButtonGroup();
+        group.add(newButton);
+        group.add(editButton);
+
+        if (preSelectedRow != -1) {
+            table.setEnabled(true);
+            tf.setEnabled(false);
+            table.setRowSelectionInterval(preSelectedRow, preSelectedRow);
+            editButton.setSelected(true);
+        } else {
+            table.setEnabled(false);
+            tf.setEnabled(true);
+            tf.setText(preSelectedKey);
+            newButton.setSelected(true);
+        }
+
+        JPanel dlgPanel = new JPanel(new GridBagLayout());
+        dlgPanel.add(editButton, GBC.std().anchor(GBC.CENTER));
+        dlgPanel.add(sp, GBC.eol().fill(GBC.BOTH));
+        dlgPanel.add(newButton, GBC.std().anchor(GBC.CENTER));
+        dlgPanel.add(tf, GBC.eol().fill(GBC.HORIZONTAL));
+
+        JOptionPane optionPane = new JOptionPane(dlgPanel,
+                JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
+        JDialog dlg = optionPane.createDialog(Main.parent, tr("Choose key"));
+
+        dlg.pack();
+        dlg.setResizable(true);
+        dlg.setVisible(true);
+
+        Object answer = optionPane.getValue();
+        if (answer != null
+                && answer != JOptionPane.UNINITIALIZED_VALUE
+                && (answer instanceof Integer && (Integer) answer == JOptionPane.OK_OPTION))
+            if (editButton.isSelected() && table.getSelectedRow() != -1)
+                return rowData[table.getSelectedRow()][0];
+            else if (newButton.isSelected())
+                return tf.getText();
+
+        return null;
+    }
+
+    private String getPreSelectedKey(Map<String, String> keyValueMap) {
+        for (String[] pattern : TAG_EDIT_STRINGS) {
+            Pattern keyPattern = Pattern.compile(pattern[0]);
+            Pattern valuePattern = Pattern.compile(pattern[1]);
+            for (Object key : keyValueMap.keySet().toArray()) {
+                Matcher keyMatcher = keyPattern.matcher(key.toString());
+                if (keyMatcher.matches()) {
+                    Matcher valueMatcher = valuePattern.matcher(keyValueMap
+                            .get(key));
+                    if (valueMatcher.matches()) {
+                        return pattern[2];
+                    }
+                }
+            }
+        }
+        return "";
+    }
 }
Index: applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OpeningTimeUtils.java
===================================================================
--- applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OpeningTimeUtils.java	(revision 22873)
+++ applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OpeningTimeUtils.java	(revision 23192)
@@ -7,218 +7,218 @@
 
 public class OpeningTimeUtils {
-	// implements the subtraction of daytimes in spans of days when a day in
-	// the list occurs direct afterwards
-	public static ArrayList<int[]> convert(ArrayList<DateTime> dateTimes) {
-		ArrayList<int[]> ret = new ArrayList<int[]>(); // the list which is
-		// returned
-		for (int i = 0; i < dateTimes.size(); ++i) { // iterate over every entry
-			DateTime dateTime = dateTimes.get(i);
-			ArrayList<DateTime> newDateTimes = new ArrayList<DateTime>();
-
-			// test if the given entry is a single dayspan
-			if (dateTime.daySpans.size() == 1
-					&& dateTime.daySpans.get(0).isSpan()) {
-				ArrayList<DaySpan> partDaySpans = new ArrayList<DaySpan>();
-				int start_day = dateTime.daySpans.get(0).startDay;
-
-				// look in every entry behind
-				while (i + 1 < dateTimes.size()) {
-					ArrayList<DaySpan> following = dateTimes.get(i + 1).daySpans;
-					if (following.size() == 1
-							&& following.get(0).startDay > dateTime.daySpans
-									.get(0).startDay
-							&& following.get(0).endDay < dateTime.daySpans
-									.get(0).endDay) {
-						partDaySpans.add(new DaySpan(start_day, following
-								.get(0).startDay - 1));
-						start_day = following.get(0).endDay + 1;
-						newDateTimes.add(dateTimes.get(i + 1));
-						i++;
-					} else
-						break;
-				}
-
-				partDaySpans.add(new DaySpan(start_day, dateTime.daySpans
-						.get(0).endDay));
-				newDateTimes.add(new DateTime(partDaySpans,
-						dateTime.daytimeSpans));
-			}
-			if (newDateTimes.isEmpty())
-				newDateTimes.add(dateTime);
-
-			// create the int-array
-			for (int j = 0; j < newDateTimes.size(); ++j) {
-				DateTime dateTime2 = newDateTimes.get(j);
-				for (DaySpan dayspan : dateTime2.daySpans) {
-					for (DaytimeSpan timespan : dateTime2.daytimeSpans) {
-						if (!timespan.isOff())
-							ret.add(new int[] { dayspan.startDay,
-									dayspan.endDay, timespan.startMinute,
-									timespan.endMinute });
-					}
-				}
-			}
-		}
-		return ret;
-	}
-
-	public static class DaySpan {
-		public int startDay;
-		public int endDay;
-
-		public DaySpan(int startDay, int endDay) {
-			this.startDay = startDay;
-			this.endDay = endDay;
-		}
-
-		public boolean isSpan() {
-			return endDay > startDay;
-		}
-
-		public boolean isSingleDay() {
-			return startDay == endDay;
-		}
-	}
-
-	public static class DaytimeSpan {
-		public int startMinute;
-		public int endMinute;
-
-		public DaytimeSpan(int startMinute, int endMinute) {
-			this.startMinute = startMinute;
-			this.endMinute = endMinute;
-		}
-
-		public boolean isOff() {
-			return startMinute == -1;
-		}
-
-		public boolean isSpan() {
-			return endMinute > startMinute;
-		}
-	}
-
-	public static class DateTime {
-		public ArrayList<DaySpan> daySpans;
-		public ArrayList<DaytimeSpan> daytimeSpans;
-
-		public DateTime(ArrayList<DaySpan> daySpans,
-				ArrayList<DaytimeSpan> daytimeSpans) {
-			this.daySpans = daySpans;
-			this.daytimeSpans = daytimeSpans;
-		}
-	}
-
-	// returns a String (e.g "Mo-Sa 10:00-20:00; Tu off") representing the
-	// TimeRects
-	public static String makeStringFromRects(ArrayList<TimeRect> givenTimeRects) {
-		// create an array of booleans representing every minute on all the days
-		// in a week
-		boolean[][] minuteArray = new boolean[7][24 * 60 + 2];
-		for (int day = 0; day < 7; ++day)
-			for (int minute = 0; minute < 24 * 60 + 2; ++minute)
-				minuteArray[day][minute] = false;
-		for (TimeRect timeRect : givenTimeRects)
-			for (int day = timeRect.getDayStart(); day <= timeRect.getDayEnd(); ++day)
-				for (int minute = timeRect.getMinuteStart(); minute <= timeRect
-						.getMinuteEnd(); ++minute)
-					minuteArray[day][minute] = true;
-
-		String ret = "";
-		int[] days = new int[7]; // an array representing the status of the days
-		// 0 means nothing done with this day yet
-		// 8 means the day is off
-		// 0<x<8 means the day have the openinghours of day x
-		// -8<x<0 means nothing done with this day yet, but it intersects a
-		// range of days with same opening_hours
-		for (int i = 0; i < 7; ++i) {
-			String add = "";
-
-			if (isArrayEmpty(minuteArray[i]) && days[i] == 0) {
-				days[i] = 8;
-			} else if (isArrayEmpty(minuteArray[i]) && days[i] < 0) {
-				add = OpeningTimeCompiler.WEEKDAYS[i] + " off";
-				days[i] = -8;
-			} else if (days[i] <= 0) {
-				days[i] = i + 1;
-				int lastSameDay = i;
-				int sameDayCount = 1;
-				for (int j = i + 1; j < 7; ++j) {
-					if (arraysEqual(minuteArray[i], minuteArray[j])) {
-						days[j] = i + 1;
-						lastSameDay = j;
-						sameDayCount++;
-					}
-				}
-				if (sameDayCount == 1) {
-					// a single Day with this special opening_hours
-					add = OpeningTimeCompiler.WEEKDAYS[i] + " "
-							+ makeStringFromMinuteArray(minuteArray[i]);
-				} else if (sameDayCount == 2) {
-					// exactly two Days with this special opening_hours
-					add = OpeningTimeCompiler.WEEKDAYS[i] + ","
-							+ OpeningTimeCompiler.WEEKDAYS[lastSameDay] + " "
-							+ makeStringFromMinuteArray(minuteArray[i]);
-				} else if (sameDayCount > 2) {
-					// more than two Days with this special opening_hours
-					add = OpeningTimeCompiler.WEEKDAYS[i] + "-"
-							+ OpeningTimeCompiler.WEEKDAYS[lastSameDay] + " "
-							+ makeStringFromMinuteArray(minuteArray[i]);
-					for (int j = i + 1; j < lastSameDay; ++j) {
-						if (days[j] == 0)
-							days[j] = -i - 1;
-					}
-				}
-			}
-
-			if (!add.isEmpty()) {
-				if (!ret.isEmpty())
-					ret += "; ";
-				ret += add;
-			}
-		}
-		return ret;
-	}
-
-	// returns a String representing the openinghours on one special day (e.g.
-	// "10:00-20:00")
-	private static String makeStringFromMinuteArray(boolean[] minutes) {
-		String ret = "";
-		for (int i = 0; i < minutes.length; ++i) {
-			if (minutes[i]) {
-				int start = i;
-				while (i < minutes.length && minutes[i])
-					++i;
-				String addString = timeString(start);
-				if (i - 1 == 24 * 60 + 1) // open end
-					addString += "+";
-				else if (start != i - 1) // closing time
-					addString += "-" + timeString(i - 1);
-				if (!ret.isEmpty())
-					ret += ",";
-				ret += addString;
-			}
-		}
-		return ret;
-	}
-
-	public static String timeString(int minutes) {
-		int h = minutes / 60;
-		int m = minutes % 60;
-		return (h < 10 ? "0" : "") + h + ":" + (m < 10 ? "0" : "") + m;
-	}
-
-	private static boolean isArrayEmpty(boolean[] bs) {
-		for (int i = 0; i < bs.length; i++)
-			if (bs[i])
-				return false;
-		return true;
-	}
-
-	private static boolean arraysEqual(boolean[] bs, boolean[] bs2) {
-		boolean ret = true;
-		for (int i = 0; i < bs.length; i++)
-			ret &= bs[i] == bs2[i];
-		return ret;
-	}
+    // implements the subtraction of daytimes in spans of days when a day in
+    // the list occurs direct afterwards
+    public static ArrayList<int[]> convert(ArrayList<DateTime> dateTimes) {
+        ArrayList<int[]> ret = new ArrayList<int[]>(); // the list which is
+        // returned
+        for (int i = 0; i < dateTimes.size(); ++i) { // iterate over every entry
+            DateTime dateTime = dateTimes.get(i);
+            ArrayList<DateTime> newDateTimes = new ArrayList<DateTime>();
+
+            // test if the given entry is a single dayspan
+            if (dateTime.daySpans.size() == 1
+                    && dateTime.daySpans.get(0).isSpan()) {
+                ArrayList<DaySpan> partDaySpans = new ArrayList<DaySpan>();
+                int start_day = dateTime.daySpans.get(0).startDay;
+
+                // look in every entry behind
+                while (i + 1 < dateTimes.size()) {
+                    ArrayList<DaySpan> following = dateTimes.get(i + 1).daySpans;
+                    if (following.size() == 1
+                            && following.get(0).startDay > dateTime.daySpans
+                                    .get(0).startDay
+                            && following.get(0).endDay < dateTime.daySpans
+                                    .get(0).endDay) {
+                        partDaySpans.add(new DaySpan(start_day, following
+                                .get(0).startDay - 1));
+                        start_day = following.get(0).endDay + 1;
+                        newDateTimes.add(dateTimes.get(i + 1));
+                        i++;
+                    } else
+                        break;
+                }
+
+                partDaySpans.add(new DaySpan(start_day, dateTime.daySpans
+                        .get(0).endDay));
+                newDateTimes.add(new DateTime(partDaySpans,
+                        dateTime.daytimeSpans));
+            }
+            if (newDateTimes.isEmpty())
+                newDateTimes.add(dateTime);
+
+            // create the int-array
+            for (int j = 0; j < newDateTimes.size(); ++j) {
+                DateTime dateTime2 = newDateTimes.get(j);
+                for (DaySpan dayspan : dateTime2.daySpans) {
+                    for (DaytimeSpan timespan : dateTime2.daytimeSpans) {
+                        if (!timespan.isOff())
+                            ret.add(new int[] { dayspan.startDay,
+                                    dayspan.endDay, timespan.startMinute,
+                                    timespan.endMinute });
+                    }
+                }
+            }
+        }
+        return ret;
+    }
+
+    public static class DaySpan {
+        public int startDay;
+        public int endDay;
+
+        public DaySpan(int startDay, int endDay) {
+            this.startDay = startDay;
+            this.endDay = endDay;
+        }
+
+        public boolean isSpan() {
+            return endDay > startDay;
+        }
+
+        public boolean isSingleDay() {
+            return startDay == endDay;
+        }
+    }
+
+    public static class DaytimeSpan {
+        public int startMinute;
+        public int endMinute;
+
+        public DaytimeSpan(int startMinute, int endMinute) {
+            this.startMinute = startMinute;
+            this.endMinute = endMinute;
+        }
+
+        public boolean isOff() {
+            return startMinute == -1;
+        }
+
+        public boolean isSpan() {
+            return endMinute > startMinute;
+        }
+    }
+
+    public static class DateTime {
+        public ArrayList<DaySpan> daySpans;
+        public ArrayList<DaytimeSpan> daytimeSpans;
+
+        public DateTime(ArrayList<DaySpan> daySpans,
+                ArrayList<DaytimeSpan> daytimeSpans) {
+            this.daySpans = daySpans;
+            this.daytimeSpans = daytimeSpans;
+        }
+    }
+
+    // returns a String (e.g "Mo-Sa 10:00-20:00; Tu off") representing the
+    // TimeRects
+    public static String makeStringFromRects(ArrayList<TimeRect> givenTimeRects) {
+        // create an array of booleans representing every minute on all the days
+        // in a week
+        boolean[][] minuteArray = new boolean[7][24 * 60 + 2];
+        for (int day = 0; day < 7; ++day)
+            for (int minute = 0; minute < 24 * 60 + 2; ++minute)
+                minuteArray[day][minute] = false;
+        for (TimeRect timeRect : givenTimeRects)
+            for (int day = timeRect.getDayStart(); day <= timeRect.getDayEnd(); ++day)
+                for (int minute = timeRect.getMinuteStart(); minute <= timeRect
+                        .getMinuteEnd(); ++minute)
+                    minuteArray[day][minute] = true;
+
+        String ret = "";
+        int[] days = new int[7]; // an array representing the status of the days
+        // 0 means nothing done with this day yet
+        // 8 means the day is off
+        // 0<x<8 means the day have the openinghours of day x
+        // -8<x<0 means nothing done with this day yet, but it intersects a
+        // range of days with same opening_hours
+        for (int i = 0; i < 7; ++i) {
+            String add = "";
+
+            if (isArrayEmpty(minuteArray[i]) && days[i] == 0) {
+                days[i] = 8;
+            } else if (isArrayEmpty(minuteArray[i]) && days[i] < 0) {
+                add = OpeningTimeCompiler.WEEKDAYS[i] + " off";
+                days[i] = -8;
+            } else if (days[i] <= 0) {
+                days[i] = i + 1;
+                int lastSameDay = i;
+                int sameDayCount = 1;
+                for (int j = i + 1; j < 7; ++j) {
+                    if (arraysEqual(minuteArray[i], minuteArray[j])) {
+                        days[j] = i + 1;
+                        lastSameDay = j;
+                        sameDayCount++;
+                    }
+                }
+                if (sameDayCount == 1) {
+                    // a single Day with this special opening_hours
+                    add = OpeningTimeCompiler.WEEKDAYS[i] + " "
+                            + makeStringFromMinuteArray(minuteArray[i]);
+                } else if (sameDayCount == 2) {
+                    // exactly two Days with this special opening_hours
+                    add = OpeningTimeCompiler.WEEKDAYS[i] + ","
+                            + OpeningTimeCompiler.WEEKDAYS[lastSameDay] + " "
+                            + makeStringFromMinuteArray(minuteArray[i]);
+                } else if (sameDayCount > 2) {
+                    // more than two Days with this special opening_hours
+                    add = OpeningTimeCompiler.WEEKDAYS[i] + "-"
+                            + OpeningTimeCompiler.WEEKDAYS[lastSameDay] + " "
+                            + makeStringFromMinuteArray(minuteArray[i]);
+                    for (int j = i + 1; j < lastSameDay; ++j) {
+                        if (days[j] == 0)
+                            days[j] = -i - 1;
+                    }
+                }
+            }
+
+            if (!add.isEmpty()) {
+                if (!ret.isEmpty())
+                    ret += "; ";
+                ret += add;
+            }
+        }
+        return ret;
+    }
+
+    // returns a String representing the openinghours on one special day (e.g.
+    // "10:00-20:00")
+    private static String makeStringFromMinuteArray(boolean[] minutes) {
+        String ret = "";
+        for (int i = 0; i < minutes.length; ++i) {
+            if (minutes[i]) {
+                int start = i;
+                while (i < minutes.length && minutes[i])
+                    ++i;
+                String addString = timeString(start);
+                if (i - 1 == 24 * 60 + 1) // open end
+                    addString += "+";
+                else if (start != i - 1) // closing time
+                    addString += "-" + timeString(i - 1);
+                if (!ret.isEmpty())
+                    ret += ",";
+                ret += addString;
+            }
+        }
+        return ret;
+    }
+
+    public static String timeString(int minutes) {
+        int h = minutes / 60;
+        int m = minutes % 60;
+        return (h < 10 ? "0" : "") + h + ":" + (m < 10 ? "0" : "") + m;
+    }
+
+    private static boolean isArrayEmpty(boolean[] bs) {
+        for (int i = 0; i < bs.length; i++)
+            if (bs[i])
+                return false;
+        return true;
+    }
+
+    private static boolean arraysEqual(boolean[] bs, boolean[] bs2) {
+        boolean ret = true;
+        for (int i = 0; i < bs.length; i++)
+            ret &= bs[i] == bs2[i];
+        return ret;
+    }
 }
Index: applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheDialogPanel.java
===================================================================
--- applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheDialogPanel.java	(revision 22873)
+++ applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheDialogPanel.java	(revision 23192)
@@ -26,133 +26,133 @@
 public class OheDialogPanel extends JPanel {
 
-	private final JTextField keyField;
+    private final JTextField keyField;
 
-	// The Component for showing the Time as a Text
-	private final JTextField valueField;
+    // The Component for showing the Time as a Text
+    private final JTextField valueField;
 
-	private final JButton twentyfourSevenButton;
-	private final JLabel actualPostionLabel;
+    private final JButton twentyfourSevenButton;
+    private final JLabel actualPostionLabel;
 
-	// The important Panel for showing/editing the Time graphical
-	private final OheEditor editorPanel;
+    // The important Panel for showing/editing the Time graphical
+    private final OheEditor editorPanel;
 
-	private final String oldkey;
+    private final String oldkey;
 
-	public OheDialogPanel(OhePlugin plugin, String key, String value) {
-		oldkey = key;
-		keyField = new JTextField(key);
+    public OheDialogPanel(OhePlugin plugin, String key, String value) {
+        oldkey = key;
+        keyField = new JTextField(key);
 
-		valueField = new JTextField(value);
-		valueField.addActionListener(new ActionListener() {
-			@Override
-			public void actionPerformed(ActionEvent evt) {
-				// on every action in the textfield the timeRects are reloaded
-				editorPanel.initTimeRects();
-			}
-		});
+        valueField = new JTextField(value);
+        valueField.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent evt) {
+                // on every action in the textfield the timeRects are reloaded
+                editorPanel.initTimeRects();
+            }
+        });
 
-		twentyfourSevenButton = new JButton(tr("apply {0}", "24/7"));
-		twentyfourSevenButton.addActionListener(new ActionListener() {
-			@Override
-			public void actionPerformed(ActionEvent arg0) {
-				valueField.setText("24/7");
-				editorPanel.initTimeRects();
-			}
-		});
+        twentyfourSevenButton = new JButton(tr("apply {0}", "24/7"));
+        twentyfourSevenButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent arg0) {
+                valueField.setText("24/7");
+                editorPanel.initTimeRects();
+            }
+        });
 
-		actualPostionLabel = new JLabel("Mo 00:00");
-		JPanel toolsPanel = new JPanel(new GridBagLayout());
-		toolsPanel.add(twentyfourSevenButton, GBC.std());
-		toolsPanel.add(Box.createGlue(), GBC.std().fill(GBC.HORIZONTAL));
-		toolsPanel.add(actualPostionLabel, GBC.eop());
+        actualPostionLabel = new JLabel("Mo 00:00");
+        JPanel toolsPanel = new JPanel(new GridBagLayout());
+        toolsPanel.add(twentyfourSevenButton, GBC.std());
+        toolsPanel.add(Box.createGlue(), GBC.std().fill(GBC.HORIZONTAL));
+        toolsPanel.add(actualPostionLabel, GBC.eop());
 
-		editorPanel = new OheEditor(this);
+        editorPanel = new OheEditor(this);
 
-		// adding all Components in a Gridbaglayout
-		setLayout(new GridBagLayout());
-		add(new JLabel(tr("Key")), GBC.std());
-		add(Box.createHorizontalStrut(10), GBC.std());
-		add(keyField, GBC.eol().fill(GBC.HORIZONTAL));
-		add(new JLabel(tr("Value")), GBC.std());
-		add(Box.createHorizontalStrut(10), GBC.std());
-		add(valueField, GBC.eop().fill(GBC.HORIZONTAL));
-		add(toolsPanel, GBC.eol().fill(GBC.HORIZONTAL));
-		add(editorPanel, GBC.eol().fill());
+        // adding all Components in a Gridbaglayout
+        setLayout(new GridBagLayout());
+        add(new JLabel(tr("Key")), GBC.std());
+        add(Box.createHorizontalStrut(10), GBC.std());
+        add(keyField, GBC.eol().fill(GBC.HORIZONTAL));
+        add(new JLabel(tr("Value")), GBC.std());
+        add(Box.createHorizontalStrut(10), GBC.std());
+        add(valueField, GBC.eop().fill(GBC.HORIZONTAL));
+        add(toolsPanel, GBC.eol().fill(GBC.HORIZONTAL));
+        add(editorPanel, GBC.eol().fill());
 
-		valueField.requestFocus();
-		setPreferredSize(new Dimension(480, 520));
-	}
+        valueField.requestFocus();
+        setPreferredSize(new Dimension(480, 520));
+    }
 
-	public String[] getChangedKeyValuePair() {
-		return new String[] { oldkey, keyField.getText(), valueField.getText() };
-	}
+    public String[] getChangedKeyValuePair() {
+        return new String[] { oldkey, keyField.getText(), valueField.getText() };
+    }
 
-	// returns the compiled Time from the valueField
-	public ArrayList<int[]> getTime() throws Exception {
-		String value = valueField.getText();
-		ArrayList<int[]> time = null;
-		if (value.length() > 0) {
-			OpeningTimeCompiler compiler = new OpeningTimeCompiler(value);
-			try {
-				time = OpeningTimeUtils.convert(compiler.startCompile());
-			} catch (Throwable t) {
-				int tColumns[] = null;
-				String info = null;
+    // returns the compiled Time from the valueField
+    public ArrayList<int[]> getTime() throws Exception {
+        String value = valueField.getText();
+        ArrayList<int[]> time = null;
+        if (value.length() > 0) {
+            OpeningTimeCompiler compiler = new OpeningTimeCompiler(value);
+            try {
+                time = OpeningTimeUtils.convert(compiler.startCompile());
+            } catch (Throwable t) {
+                int tColumns[] = null;
+                String info = null;
 
-				if (t instanceof ParseException) {
-					ParseException parserExc = (ParseException) t;
-					tColumns = new int[] {
-							parserExc.currentToken.beginColumn - 1,
-							parserExc.currentToken.endColumn + 1 };
-				} else if (t instanceof SyntaxException) {
-					SyntaxException syntaxError = (SyntaxException) t;
-					tColumns = new int[] { syntaxError.getStartColumn(),
-							syntaxError.getEndColumn() };
-					info = syntaxError.getInfo();
-				} else if (t instanceof TokenMgrError) {
-					TokenMgrError tokenMgrError = (TokenMgrError) t;
-					tColumns = new int[] { tokenMgrError.errorColumn - 1,
-							tokenMgrError.errorColumn + 1 };
-				} else {
-					t.printStackTrace();
-				}
+                if (t instanceof ParseException) {
+                    ParseException parserExc = (ParseException) t;
+                    tColumns = new int[] {
+                            parserExc.currentToken.beginColumn - 1,
+                            parserExc.currentToken.endColumn + 1 };
+                } else if (t instanceof SyntaxException) {
+                    SyntaxException syntaxError = (SyntaxException) t;
+                    tColumns = new int[] { syntaxError.getStartColumn(),
+                            syntaxError.getEndColumn() };
+                    info = syntaxError.getInfo();
+                } else if (t instanceof TokenMgrError) {
+                    TokenMgrError tokenMgrError = (TokenMgrError) t;
+                    tColumns = new int[] { tokenMgrError.errorColumn - 1,
+                            tokenMgrError.errorColumn + 1 };
+                } else {
+                    t.printStackTrace();
+                }
 
-				// shows a Information Dialog, where the Error occurred
-				if (tColumns != null) {
-					int first = Math.max(0, tColumns[0]);
-					int last = Math.min(value.length(), tColumns[1]);
-					String begin = value.substring(0, first);
-					String middle = value.substring(first, last);
-					String end = value.substring(last);
-					String message = "<html>"
-							+ tr("There is something wrong in the value near:")
-							+ "<br>" + begin
-							+ "<span style='background-color:red;'>" + middle
-							+ "</span>" + end;
-					if (info != null)
-						message += "<br>" + tr("Info: {0}", tr(info));
-					message += "<br>"
-							+ tr("Correct the value manually and than press Enter.");
-					message += "</html>";
-					JOptionPane.showMessageDialog(this, message,
-							tr("Error in timeformat"),
-							JOptionPane.INFORMATION_MESSAGE);
-				}
+                // shows a Information Dialog, where the Error occurred
+                if (tColumns != null) {
+                    int first = Math.max(0, tColumns[0]);
+                    int last = Math.min(value.length(), tColumns[1]);
+                    String begin = value.substring(0, first);
+                    String middle = value.substring(first, last);
+                    String end = value.substring(last);
+                    String message = "<html>"
+                            + tr("There is something wrong in the value near:")
+                            + "<br>" + begin
+                            + "<span style='background-color:red;'>" + middle
+                            + "</span>" + end;
+                    if (info != null)
+                        message += "<br>" + tr("Info: {0}", tr(info));
+                    message += "<br>"
+                            + tr("Correct the value manually and than press Enter.");
+                    message += "</html>";
+                    JOptionPane.showMessageDialog(this, message,
+                            tr("Error in timeformat"),
+                            JOptionPane.INFORMATION_MESSAGE);
+                }
 
-				throw new Exception("Error in the TimeValue");
-			}
-		}
+                throw new Exception("Error in the TimeValue");
+            }
+        }
 
-		return time;
-	}
+        return time;
+    }
 
-	// updates the valueField with the given timeRects
-	public void updateValueField(ArrayList<TimeRect> timeRects) {
-		if (valueField != null && timeRects != null)
-			valueField.setText(OpeningTimeUtils.makeStringFromRects(timeRects));
-	}
+    // updates the valueField with the given timeRects
+    public void updateValueField(ArrayList<TimeRect> timeRects) {
+        if (valueField != null && timeRects != null)
+            valueField.setText(OpeningTimeUtils.makeStringFromRects(timeRects));
+    }
 
-	public void setMousePositionText(String positionText) {
-		actualPostionLabel.setText(positionText);
-	}
+    public void setMousePositionText(String positionText) {
+        actualPostionLabel.setText(positionText);
+    }
 }
Index: applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheEditor.java
===================================================================
--- applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheEditor.java	(revision 22873)
+++ applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheEditor.java	(revision 23192)
@@ -20,308 +20,308 @@
 
 public class OheEditor extends JPanel implements MouseListener,
-		MouseMotionListener {
-	final OheDialogPanel dialog;
-
-	final private JScrollPane scrollPane;
-	final JPanel contentPanel;
-
-	ArrayList<TimeRect> timeRects;
-
-	final private int dayAxisHeight = 20;
-	final private int timeAxisWidth = 45;
-
-	public OheEditor(OheDialogPanel oheDialogPanel) {
-		dialog = oheDialogPanel;
-
-		// the MainPanel for showing the TimeRects
-		contentPanel = new JPanel() {
-			@Override
-			public void setSize(Dimension d) {
-				super.setSize(d);
-				repositionTimeRects();
-			}
-
-			@Override
-			public void paintComponent(Graphics g) {
-				if (OheEditor.this.isEnabled()) {
-					g.setColor(Color.WHITE);
-					g.fillRect(0, 0, getWidth(), getHeight());
-
-					// horizontal Lines
-					for (int i = 1; i < 24; ++i) {
-						if (i % 3 == 0)
-							g.setColor(Color.BLACK);
-						else
-							g.setColor(Color.LIGHT_GRAY);
-
-						g.drawLine(0, getMinutePosition(i * 60), getWidth(),
-								getMinutePosition(i * 60));
-					}
-
-					// vertical Lines
-					g.setColor(Color.BLACK);
-					for (int i = 1; i < 7; ++i)
-						g.drawLine(getDayPosition(i), 0, getDayPosition(i),
-								getHeight());
-
-					// if a new Rect is dragged draw it
-					if (day0 >= 0) {
-						Graphics2D g2D = (Graphics2D) g;
-
-						int day2 = Math.min(day0, day1);
-						int day3 = Math.max(day0, day1);
-						int minute2 = Math.min(minute0, minute1);
-						int minute3 = Math.max(minute0, minute1);
-						Rectangle bounds = getPanelBoundsForTimeinterval(day2,
-								day3 + 1, minute2, minute3);
-
-						TimeRect.drawTimeRect(g2D, bounds, minute2 == minute3, false);
-					}
-				} else {
-					g.setColor(Color.LIGHT_GRAY);
-					g.fillRect(0, 0, getWidth(), getHeight());
-				}
-			}
-		};
-		contentPanel.addMouseListener(this);
-		contentPanel.addMouseMotionListener(this);
-		contentPanel.setLayout(null);
-		contentPanel.setPreferredSize(new Dimension(180, 384));
-
-		initTimeRects();
-
-		scrollPane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
-				JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
-		scrollPane.setViewportView(contentPanel);
-
-		// the upper Panel for showing Weekdays
-		scrollPane.setColumnHeaderView(new JPanel() {
-			@Override
-			public Dimension getPreferredSize() {
-				return new Dimension(contentPanel.getWidth(), dayAxisHeight);
-			}
-
-			@Override
-			public void paintComponent(Graphics g) {
-				g.setColor(Color.WHITE);
-				g.fillRect(0, 0, getWidth(), getHeight());
-
-				g.setColor(Color.BLACK);
-				for (int i = 0; i < 7; ++i) {
-					if (i > 0)
-						g.drawLine(getDayPosition(i) + 1, 0,
-								getDayPosition(i) + 1, getHeight());
-
-					String text = OpeningTimeCompiler.WEEKDAYS[i];
-					g.drawString(text, (int) (getDayPosition(i + 0.5) - g
-							.getFontMetrics().stringWidth(text) * 0.5),
-							(int) (dayAxisHeight * 0.5 + g.getFontMetrics()
-									.getHeight() * 0.35));
-				}
-			}
-		});
-
-		// the left Panel for showing the hours
-		scrollPane.setRowHeaderView(new JPanel() {
-			@Override
-			public Dimension getPreferredSize() {
-				return new Dimension(timeAxisWidth, contentPanel.getHeight());
-			}
-
-			@Override
-			public void paintComponent(Graphics g) {
-				g.setColor(Color.WHITE);
-				g.fillRect(0, 0, getWidth(), getHeight());
-
-				for (int i = 1; i < 24; ++i) {
-					if (i % 3 == 0) {
-						g.setColor(Color.BLACK);
-						String text = ((i < 10) ? "0" + i : i) + ":00";
-						g
-								.drawString(text, timeAxisWidth - 10
-										- g.getFontMetrics().stringWidth(text),
-										getMinutePosition(i * 60)
-												+ (int) (g.getFontMetrics()
-														.getHeight() * 0.35));
-					} else
-						g.setColor(Color.LIGHT_GRAY);
-
-					g.drawLine(getWidth() - 4, getMinutePosition(i * 60) + 1,
-							getWidth(), getMinutePosition(i * 60) + 1);
-				}
-			}
-		});
-
-		setLayout(new BorderLayout());
-		add(scrollPane, BorderLayout.CENTER);
-	}
-
-	// update all the TimeRects with new Data
-	public void initTimeRects() {
-		contentPanel.removeAll();
-
-		ArrayList<int[]> time;
-		try {
-			time = dialog.getTime();
-		} catch (Exception exc) {
-			setEnabled(false);
-			return;
-		}
-
-		setEnabled(true);
-		timeRects = new ArrayList<TimeRect>();
-		if (time != null) {
-			for (int[] timeRectValues : time) {
-				int day0 = timeRectValues[0];
-				int day1 = timeRectValues[1];
-				int minute0 = timeRectValues[2];
-				int minute1 = timeRectValues[3];
-				TimeRect timeRect = new TimeRect(OheEditor.this, day0, day1,
-						minute0, minute1);
-				timeRects.add(timeRect);
-				contentPanel.add(timeRect);
-			}
-		}
-
-		repositionTimeRects();
-		repaint();
-	}
-
-	protected void repositionTimeRects() {
-		if (timeRects != null)
-			for (TimeRect timeRect : timeRects)
-				timeRect.reposition();
-	}
-
-	// returns the physical Borders of the TimeRect on the mainPanel
-	public Rectangle getPanelBoundsForTimeinterval(int dayStart, int dayEnd,
-			int minutesStart, int minutesEnd) {
-		int x = getDayPosition(dayStart);
-		int y = getMinutePosition(minutesStart);
-		int width = getDayPosition(dayEnd) - getDayPosition(dayStart);
-		int height = getMinutePosition(minutesEnd)
-				- getMinutePosition(minutesStart);
-
-		// work around openjdk bug
-		if (Main.isOpenjdk) {
-			x++;
-			y++;
-		}
-
-		if (minutesStart == minutesEnd)
-			return new Rectangle(x, y - 2 - TimeRect.verticalNonDrawedPixels,
-					width, height + 5 + 2 * TimeRect.verticalNonDrawedPixels);
-
-		return new Rectangle(x, y, width, height + 1);
-	}
-
-	public double getDayWidth() {
-		return (contentPanel.getWidth() - 1) / 7.0;
-	}
-
-	public int getDayPosition(double d) {
-		return (int) (d * getDayWidth());
-	}
-
-	public double getMinuteHeight() {
-		return (contentPanel.getHeight() - 1) / (24.0 * 60);
-	}
-
-	public int getMinutePosition(int minute) {
-		return (int) (minute * getMinuteHeight());
-	}
-
-	// removes the given timerect from the panel and from the arraylist
-	public void removeTimeRect(TimeRect timeRectToRemove) {
-		timeRects.remove(timeRectToRemove);
-		contentPanel.remove(timeRectToRemove);
-		dialog.updateValueField(timeRects);
-		repaint();
-	}
-
-	// drawing a new Rect
-	private int day0 = -1;
-	private int minute0;
-	private int day1;
-	private int minute1;
-	private int xDragStart;
-	private int yDragStart;
-
-	@Override
-	public void mouseClicked(MouseEvent evt) {
-	}
-
-	@Override
-	public void mouseEntered(MouseEvent evt) {
-	}
-
-	@Override
-	public void mouseExited(MouseEvent evt) {
-	}
-
-	@Override
-	public void mousePressed(MouseEvent evt) {
-		day0 = (int) Math.floor(evt.getX() / getDayWidth());
-		minute0 = (int) Math.floor(evt.getY()
-				/ (getMinuteHeight() * TimeRect.minuteResterize))
-				* TimeRect.minuteResterize;
-		day1 = day0;
-		minute1 = minute0;
-		xDragStart = evt.getX();
-		yDragStart = evt.getY();
-	}
-
-	@Override
-	public void mouseReleased(MouseEvent evt) {
-		// mouse must be moved 5px before creating a rect
-		if (xDragStart == -1
-				|| Math.abs(evt.getX() - xDragStart)
-						+ Math.abs(evt.getY() - yDragStart) > 5) {
-			int day2 = Math.min(day0, day1);
-			int day3 = Math.max(day0, day1);
-			int minute2 = Math.min(minute0, minute1);
-			int minute3 = Math.max(minute0, minute1);
-
-			TimeRect timeRect = new TimeRect(OheEditor.this, day2, day3,
-					minute2, minute3);
-			timeRects.add(timeRect);
-			contentPanel.add(timeRect);
-			timeRect.reposition();
-			dialog.updateValueField(timeRects);
-
-			day0 = -1;
-			repaint();
-		}
-	}
-
-	@Override
-	public void mouseDragged(MouseEvent evt) {
-		// mouse must be moved 5px before drawing a rect
-		if (xDragStart == -1
-				|| Math.abs(evt.getX() - xDragStart)
-						+ Math.abs(evt.getY() - yDragStart) > 5) {
-			xDragStart = -1;
-			day1 = (int) Math.floor(evt.getX() / getDayWidth());
-			minute1 = (int) Math.floor(evt.getY()
-					/ (getMinuteHeight() * TimeRect.minuteResterize))
-					* TimeRect.minuteResterize;
-			repaint();
-		}
-	}
-
-	@Override
-	public void mouseMoved(MouseEvent evt) {
-		mousePositionChanged(evt.getX(), evt.getY());
-	}
-
-	public void mousePositionChanged(int x, int y) {
-		int actualDay = (int) Math.floor(x / getDayWidth());
-		int minutes = (int) Math.floor(y
-				/ (getMinuteHeight() * TimeRect.minuteResterize))
-				* TimeRect.minuteResterize;
-		actualDay = Math.max(0, Math.min(6, actualDay));
-		minutes = Math.max(0, Math.min(24 * 60, minutes));
-		dialog.setMousePositionText(OpeningTimeCompiler.WEEKDAYS[actualDay]
-				+ " " + OpeningTimeUtils.timeString(minutes));
-	}
+        MouseMotionListener {
+    final OheDialogPanel dialog;
+
+    final private JScrollPane scrollPane;
+    final JPanel contentPanel;
+
+    ArrayList<TimeRect> timeRects;
+
+    final private int dayAxisHeight = 20;
+    final private int timeAxisWidth = 45;
+
+    public OheEditor(OheDialogPanel oheDialogPanel) {
+        dialog = oheDialogPanel;
+
+        // the MainPanel for showing the TimeRects
+        contentPanel = new JPanel() {
+            @Override
+            public void setSize(Dimension d) {
+                super.setSize(d);
+                repositionTimeRects();
+            }
+
+            @Override
+            public void paintComponent(Graphics g) {
+                if (OheEditor.this.isEnabled()) {
+                    g.setColor(Color.WHITE);
+                    g.fillRect(0, 0, getWidth(), getHeight());
+
+                    // horizontal Lines
+                    for (int i = 1; i < 24; ++i) {
+                        if (i % 3 == 0)
+                            g.setColor(Color.BLACK);
+                        else
+                            g.setColor(Color.LIGHT_GRAY);
+
+                        g.drawLine(0, getMinutePosition(i * 60), getWidth(),
+                                getMinutePosition(i * 60));
+                    }
+
+                    // vertical Lines
+                    g.setColor(Color.BLACK);
+                    for (int i = 1; i < 7; ++i)
+                        g.drawLine(getDayPosition(i), 0, getDayPosition(i),
+                                getHeight());
+
+                    // if a new Rect is dragged draw it
+                    if (day0 >= 0) {
+                        Graphics2D g2D = (Graphics2D) g;
+
+                        int day2 = Math.min(day0, day1);
+                        int day3 = Math.max(day0, day1);
+                        int minute2 = Math.min(minute0, minute1);
+                        int minute3 = Math.max(minute0, minute1);
+                        Rectangle bounds = getPanelBoundsForTimeinterval(day2,
+                                day3 + 1, minute2, minute3);
+
+                        TimeRect.drawTimeRect(g2D, bounds, minute2 == minute3, false);
+                    }
+                } else {
+                    g.setColor(Color.LIGHT_GRAY);
+                    g.fillRect(0, 0, getWidth(), getHeight());
+                }
+            }
+        };
+        contentPanel.addMouseListener(this);
+        contentPanel.addMouseMotionListener(this);
+        contentPanel.setLayout(null);
+        contentPanel.setPreferredSize(new Dimension(180, 384));
+
+        initTimeRects();
+
+        scrollPane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
+                JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+        scrollPane.setViewportView(contentPanel);
+
+        // the upper Panel for showing Weekdays
+        scrollPane.setColumnHeaderView(new JPanel() {
+            @Override
+            public Dimension getPreferredSize() {
+                return new Dimension(contentPanel.getWidth(), dayAxisHeight);
+            }
+
+            @Override
+            public void paintComponent(Graphics g) {
+                g.setColor(Color.WHITE);
+                g.fillRect(0, 0, getWidth(), getHeight());
+
+                g.setColor(Color.BLACK);
+                for (int i = 0; i < 7; ++i) {
+                    if (i > 0)
+                        g.drawLine(getDayPosition(i) + 1, 0,
+                                getDayPosition(i) + 1, getHeight());
+
+                    String text = OpeningTimeCompiler.WEEKDAYS[i];
+                    g.drawString(text, (int) (getDayPosition(i + 0.5) - g
+                            .getFontMetrics().stringWidth(text) * 0.5),
+                            (int) (dayAxisHeight * 0.5 + g.getFontMetrics()
+                                    .getHeight() * 0.35));
+                }
+            }
+        });
+
+        // the left Panel for showing the hours
+        scrollPane.setRowHeaderView(new JPanel() {
+            @Override
+            public Dimension getPreferredSize() {
+                return new Dimension(timeAxisWidth, contentPanel.getHeight());
+            }
+
+            @Override
+            public void paintComponent(Graphics g) {
+                g.setColor(Color.WHITE);
+                g.fillRect(0, 0, getWidth(), getHeight());
+
+                for (int i = 1; i < 24; ++i) {
+                    if (i % 3 == 0) {
+                        g.setColor(Color.BLACK);
+                        String text = ((i < 10) ? "0" + i : i) + ":00";
+                        g
+                                .drawString(text, timeAxisWidth - 10
+                                        - g.getFontMetrics().stringWidth(text),
+                                        getMinutePosition(i * 60)
+                                                + (int) (g.getFontMetrics()
+                                                        .getHeight() * 0.35));
+                    } else
+                        g.setColor(Color.LIGHT_GRAY);
+
+                    g.drawLine(getWidth() - 4, getMinutePosition(i * 60) + 1,
+                            getWidth(), getMinutePosition(i * 60) + 1);
+                }
+            }
+        });
+
+        setLayout(new BorderLayout());
+        add(scrollPane, BorderLayout.CENTER);
+    }
+
+    // update all the TimeRects with new Data
+    public void initTimeRects() {
+        contentPanel.removeAll();
+
+        ArrayList<int[]> time;
+        try {
+            time = dialog.getTime();
+        } catch (Exception exc) {
+            setEnabled(false);
+            return;
+        }
+
+        setEnabled(true);
+        timeRects = new ArrayList<TimeRect>();
+        if (time != null) {
+            for (int[] timeRectValues : time) {
+                int day0 = timeRectValues[0];
+                int day1 = timeRectValues[1];
+                int minute0 = timeRectValues[2];
+                int minute1 = timeRectValues[3];
+                TimeRect timeRect = new TimeRect(OheEditor.this, day0, day1,
+                        minute0, minute1);
+                timeRects.add(timeRect);
+                contentPanel.add(timeRect);
+            }
+        }
+
+        repositionTimeRects();
+        repaint();
+    }
+
+    protected void repositionTimeRects() {
+        if (timeRects != null)
+            for (TimeRect timeRect : timeRects)
+                timeRect.reposition();
+    }
+
+    // returns the physical Borders of the TimeRect on the mainPanel
+    public Rectangle getPanelBoundsForTimeinterval(int dayStart, int dayEnd,
+            int minutesStart, int minutesEnd) {
+        int x = getDayPosition(dayStart);
+        int y = getMinutePosition(minutesStart);
+        int width = getDayPosition(dayEnd) - getDayPosition(dayStart);
+        int height = getMinutePosition(minutesEnd)
+                - getMinutePosition(minutesStart);
+
+        // work around openjdk bug
+        if (Main.isOpenjdk) {
+            x++;
+            y++;
+        }
+
+        if (minutesStart == minutesEnd)
+            return new Rectangle(x, y - 2 - TimeRect.verticalNonDrawedPixels,
+                    width, height + 5 + 2 * TimeRect.verticalNonDrawedPixels);
+
+        return new Rectangle(x, y, width, height + 1);
+    }
+
+    public double getDayWidth() {
+        return (contentPanel.getWidth() - 1) / 7.0;
+    }
+
+    public int getDayPosition(double d) {
+        return (int) (d * getDayWidth());
+    }
+
+    public double getMinuteHeight() {
+        return (contentPanel.getHeight() - 1) / (24.0 * 60);
+    }
+
+    public int getMinutePosition(int minute) {
+        return (int) (minute * getMinuteHeight());
+    }
+
+    // removes the given timerect from the panel and from the arraylist
+    public void removeTimeRect(TimeRect timeRectToRemove) {
+        timeRects.remove(timeRectToRemove);
+        contentPanel.remove(timeRectToRemove);
+        dialog.updateValueField(timeRects);
+        repaint();
+    }
+
+    // drawing a new Rect
+    private int day0 = -1;
+    private int minute0;
+    private int day1;
+    private int minute1;
+    private int xDragStart;
+    private int yDragStart;
+
+    @Override
+    public void mouseClicked(MouseEvent evt) {
+    }
+
+    @Override
+    public void mouseEntered(MouseEvent evt) {
+    }
+
+    @Override
+    public void mouseExited(MouseEvent evt) {
+    }
+
+    @Override
+    public void mousePressed(MouseEvent evt) {
+        day0 = (int) Math.floor(evt.getX() / getDayWidth());
+        minute0 = (int) Math.floor(evt.getY()
+                / (getMinuteHeight() * TimeRect.minuteResterize))
+                * TimeRect.minuteResterize;
+        day1 = day0;
+        minute1 = minute0;
+        xDragStart = evt.getX();
+        yDragStart = evt.getY();
+    }
+
+    @Override
+    public void mouseReleased(MouseEvent evt) {
+        // mouse must be moved 5px before creating a rect
+        if (xDragStart == -1
+                || Math.abs(evt.getX() - xDragStart)
+                        + Math.abs(evt.getY() - yDragStart) > 5) {
+            int day2 = Math.min(day0, day1);
+            int day3 = Math.max(day0, day1);
+            int minute2 = Math.min(minute0, minute1);
+            int minute3 = Math.max(minute0, minute1);
+
+            TimeRect timeRect = new TimeRect(OheEditor.this, day2, day3,
+                    minute2, minute3);
+            timeRects.add(timeRect);
+            contentPanel.add(timeRect);
+            timeRect.reposition();
+            dialog.updateValueField(timeRects);
+
+            day0 = -1;
+            repaint();
+        }
+    }
+
+    @Override
+    public void mouseDragged(MouseEvent evt) {
+        // mouse must be moved 5px before drawing a rect
+        if (xDragStart == -1
+                || Math.abs(evt.getX() - xDragStart)
+                        + Math.abs(evt.getY() - yDragStart) > 5) {
+            xDragStart = -1;
+            day1 = (int) Math.floor(evt.getX() / getDayWidth());
+            minute1 = (int) Math.floor(evt.getY()
+                    / (getMinuteHeight() * TimeRect.minuteResterize))
+                    * TimeRect.minuteResterize;
+            repaint();
+        }
+    }
+
+    @Override
+    public void mouseMoved(MouseEvent evt) {
+        mousePositionChanged(evt.getX(), evt.getY());
+    }
+
+    public void mousePositionChanged(int x, int y) {
+        int actualDay = (int) Math.floor(x / getDayWidth());
+        int minutes = (int) Math.floor(y
+                / (getMinuteHeight() * TimeRect.minuteResterize))
+                * TimeRect.minuteResterize;
+        actualDay = Math.max(0, Math.min(6, actualDay));
+        minutes = Math.max(0, Math.min(24 * 60, minutes));
+        dialog.setMousePositionText(OpeningTimeCompiler.WEEKDAYS[actualDay]
+                + " " + OpeningTimeUtils.timeString(minutes));
+    }
 }
Index: applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/TimeRect.java
===================================================================
--- applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/TimeRect.java	(revision 22873)
+++ applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/TimeRect.java	(revision 23192)
@@ -20,277 +20,277 @@
 
 public class TimeRect extends JPanel implements MouseListener,
-		MouseMotionListener {
-	public static final int[] transformCursorTypes = new int[] {
-			Cursor.MOVE_CURSOR, Cursor.N_RESIZE_CURSOR,
-			Cursor.NE_RESIZE_CURSOR, Cursor.E_RESIZE_CURSOR,
-			Cursor.SE_RESIZE_CURSOR, Cursor.S_RESIZE_CURSOR,
-			Cursor.SW_RESIZE_CURSOR, Cursor.W_RESIZE_CURSOR,
-			Cursor.NW_RESIZE_CURSOR };
-
-	public static final int minuteResterize = 15;
-	public static final int verticalNonDrawedPixels = 5;
-
-	public static final boolean[][] transformDirections = new boolean[][] {
-			{ true, true, true, true }, // Drag
-			{ true, false, false, false }, // N
-			{ true, true, false, false }, // NE
-			{ false, true, false, false }, // E
-			{ false, true, true, false }, // SE
-			{ false, false, true, false }, // S
-			{ false, false, true, true }, // SW
-			{ false, false, false, true }, // W
-			{ true, false, false, true }, // NW
-	};
-
-	public static final int roundCornerSize = 8;
-	private final int clickAreaSize = 16;
-
-	private OheEditor editor;
-
-	private int dayStart;
-	private int dayEnd;
-	private int minuteStart;
-	private int minuteEnd;
-
-	public TimeRect(OheEditor editor, int dayStart, int dayEnd,
-			int minutesStart, int minutesEnd) {
-		this.editor = editor;
-
-		this.dayStart = dayStart;
-		this.dayEnd = dayEnd;
-		this.minuteStart = minutesStart;
-		this.minuteEnd = minutesEnd;
-
-		transformType = -1;
-
-		setOpaque(true);
-
-		addMouseListener(this);
-		addMouseMotionListener(this);
-	}
-
-	public int getDayStart() {
-		return dayStart;
-	}
-
-	public int getDayEnd() {
-		return dayEnd;
-	}
-
-	public int getMinuteStart() {
-		return minuteStart;
-	}
-
-	public int getMinuteEnd() {
-		return minuteEnd;
-	}
-
-	public void reposition() {
-		setBounds(editor.getPanelBoundsForTimeinterval(dayStart, dayEnd + 1,
-				minuteStart, minuteEnd));
-		editor.contentPanel.repaint();
-	}
-
-	private boolean isZeroMinuteInterval() {
-		return minuteStart == minuteEnd;
-	}
-
-	private boolean isOpenEndInterval() {
-		return minuteEnd == 24 * 60 + 1;
-	}
-
-	private void updateTimeInterval(int newDayStart, int newDayEnd,
-			int newMinuteStart, int newMinuteEnd) {
-		dayStart = newDayStart;
-		dayEnd = newDayEnd;
-		minuteStart = newMinuteStart;
-		minuteEnd = newMinuteEnd;
-
-		editor.dialog.updateValueField(editor.timeRects);
-		reposition();
-	}
-
-	@Override
-	public void paintComponent(Graphics g) {
-		drawTimeRect((Graphics2D) g, new Rectangle(0, 0, getWidth(),
-				getHeight()), isZeroMinuteInterval(), isOpenEndInterval());
-	}
-
-	public static void drawTimeRect(Graphics2D g2D, Rectangle bounds,
-			boolean isZeroMinuteInterval, boolean isOpenEndInterval) {
-
-		Color innerColor = new Color(135, 135, 234);
-		if (isOpenEndInterval)
-			innerColor = new Color(234, 135, 135);
-
-		int tmpRoundCornerSize = TimeRect.roundCornerSize;
-		int verticalNonFilledBorder = 1;
-		if (isZeroMinuteInterval) {
-			innerColor = new Color(135, 234, 135);
-			tmpRoundCornerSize = 0;
-			verticalNonFilledBorder = verticalNonDrawedPixels;
-		}
-
-		g2D.setColor(innerColor);
-		g2D.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
-				.6f));
-		g2D.fillRoundRect(bounds.x + 1, bounds.y + verticalNonFilledBorder,
-				bounds.width - 2, bounds.height - 1 - 2
-						* verticalNonFilledBorder, tmpRoundCornerSize,
-				tmpRoundCornerSize);
-
-		g2D.setColor(new Color(255, 0, 0));
-		g2D.setComposite(AlphaComposite
-				.getInstance(AlphaComposite.SRC_OVER, 1f));
-		g2D.drawRoundRect(bounds.x + 1, bounds.y + verticalNonFilledBorder,
-				bounds.width - 2, bounds.height - 1 - 2
-						* verticalNonFilledBorder, tmpRoundCornerSize,
-				tmpRoundCornerSize);
-
-	}
-
-	private int actualDayDrag;
-	private int actualMinuteDrag;
-	private int dragX;
-	private int dragY;
-	private int transformType;
-
-	// Calculate where the Component was clicked and returns the
-	// transformtype
-	private int getTransformType(MouseEvent evt) {
-		int tmpClickAreaWidth = Math.min(clickAreaSize, getWidth() / 3);
-		int tmpClickAreaHeight = Math.min(clickAreaSize, getHeight() / 3);
-
-		boolean isInNorthernTransformClickArea = evt.getY() < tmpClickAreaHeight;
-		boolean isInEasternTransformClickArea = evt.getX() > getWidth()
-				- tmpClickAreaWidth;
-		boolean isInSouthernTransformClickArea = evt.getY() > getHeight()
-				- tmpClickAreaHeight;
-		boolean isInWesternTransformClickArea = evt.getX() < tmpClickAreaWidth;
-
-		if (isZeroMinuteInterval()) {
-			isInNorthernTransformClickArea = false;
-			isInSouthernTransformClickArea = false;
-		}
-
-		int tType = 0;
-		for (int i = 1; i < transformDirections.length && tType == 0; i++) {
-			if (isInNorthernTransformClickArea == transformDirections[i][0]
-					&& isInEasternTransformClickArea == transformDirections[i][1]
-					&& isInSouthernTransformClickArea == transformDirections[i][2]
-					&& isInWesternTransformClickArea == transformDirections[i][3])
-				tType = i;
-		}
-
-		return tType;
-	}
-
-	public void showMenu(MouseEvent evt) {
-		JPopupMenu menu = new JPopupMenu();
-		final JCheckBoxMenuItem cbMenuItem = new JCheckBoxMenuItem(
-				tr("open end"), isOpenEndInterval());
-		menu.add(cbMenuItem);
-		cbMenuItem.addActionListener(new ActionListener() {
-			@Override
-			public void actionPerformed(ActionEvent e) {
-				if (cbMenuItem.isSelected())
-					updateTimeInterval(dayStart, dayEnd, minuteStart,
-							24 * 60 + 1);
-				else
-					updateTimeInterval(dayStart, dayEnd, minuteStart, 24 * 60);
-			}
-		});
-		menu.show(this, evt.getX(), evt.getY());
-	}
-
-	@Override
-	public void mouseClicked(MouseEvent evt) {
-	}
-
-	@Override
-	public void mouseEntered(MouseEvent evt) {
-	}
-
-	@Override
-	public void mouseExited(MouseEvent evt) {
-		if (transformType < 0)
-			setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
-	}
-
-	@Override
-	public void mousePressed(MouseEvent evt) {
-		if (evt.isPopupTrigger()) {
-			showMenu(evt);
-		} else {
-			actualDayDrag = 0;
-			actualMinuteDrag = 0;
-			dragX = evt.getXOnScreen();
-			dragY = evt.getYOnScreen();
-			transformType = getTransformType(evt);
-		}
-	}
-
-	@Override
-	public void mouseReleased(MouseEvent evt) {
-		transformType = -1;
-	}
-
-	@Override
-	public void mouseDragged(MouseEvent evt) {
-		if (transformType >= 0) {
-			int xDiff = evt.getXOnScreen() - dragX;
-			int yDiff = evt.getYOnScreen() - dragY;
-
-			xDiff = (int) Math.round(xDiff / editor.getDayWidth())
-					- actualDayDrag;
-			yDiff = (int) Math.round(yDiff
-					/ (editor.getMinuteHeight() * minuteResterize))
-					* minuteResterize - actualMinuteDrag;
-
-			if (xDiff != 0) {
-				int newDayStart = dayStart;
-				int newDayEnd = dayEnd;
-
-				if (transformDirections[transformType][3])
-					newDayStart += xDiff;
-				if (transformDirections[transformType][1])
-					newDayEnd += xDiff;
-
-				if (newDayStart > newDayEnd) {
-					editor.removeTimeRect(this);
-					transformType = -1;
-					setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
-				} else if (newDayStart >= 0 && newDayEnd <= 6) {
-					actualDayDrag += xDiff;
-					updateTimeInterval(newDayStart, newDayEnd, minuteStart,
-							minuteEnd);
-				}
-			}
-			if (yDiff != 0 && transformType >= 0) {
-				int newMinutesStart = minuteStart;
-				int newMinutesEnd = minuteEnd;
-
-				if (transformDirections[transformType][0])
-					newMinutesStart = newMinutesStart + yDiff;
-				if (transformDirections[transformType][2]
-						&& !isOpenEndInterval())
-					newMinutesEnd = newMinutesEnd + yDiff;
-
-				if (newMinutesStart >= 0
-						&& (newMinutesEnd <= 24 * 60 || isOpenEndInterval())) {
-					actualMinuteDrag += yDiff;
-					updateTimeInterval(dayStart, dayEnd, newMinutesStart,
-							newMinutesEnd);
-				}
-			}
-		}
-		editor.mousePositionChanged(evt.getX() + getX(), evt.getY() + getY());
-	}
-
-	@Override
-	public void mouseMoved(MouseEvent evt) {
-		if (transformType < 0)
-			setCursor(new Cursor(transformCursorTypes[getTransformType(evt)]));
-		editor.mousePositionChanged(evt.getX() + getX(), evt.getY() + getY());
-	}
+        MouseMotionListener {
+    public static final int[] transformCursorTypes = new int[] {
+            Cursor.MOVE_CURSOR, Cursor.N_RESIZE_CURSOR,
+            Cursor.NE_RESIZE_CURSOR, Cursor.E_RESIZE_CURSOR,
+            Cursor.SE_RESIZE_CURSOR, Cursor.S_RESIZE_CURSOR,
+            Cursor.SW_RESIZE_CURSOR, Cursor.W_RESIZE_CURSOR,
+            Cursor.NW_RESIZE_CURSOR };
+
+    public static final int minuteResterize = 15;
+    public static final int verticalNonDrawedPixels = 5;
+
+    public static final boolean[][] transformDirections = new boolean[][] {
+            { true, true, true, true }, // Drag
+            { true, false, false, false }, // N
+            { true, true, false, false }, // NE
+            { false, true, false, false }, // E
+            { false, true, true, false }, // SE
+            { false, false, true, false }, // S
+            { false, false, true, true }, // SW
+            { false, false, false, true }, // W
+            { true, false, false, true }, // NW
+    };
+
+    public static final int roundCornerSize = 8;
+    private final int clickAreaSize = 16;
+
+    private OheEditor editor;
+
+    private int dayStart;
+    private int dayEnd;
+    private int minuteStart;
+    private int minuteEnd;
+
+    public TimeRect(OheEditor editor, int dayStart, int dayEnd,
+            int minutesStart, int minutesEnd) {
+        this.editor = editor;
+
+        this.dayStart = dayStart;
+        this.dayEnd = dayEnd;
+        this.minuteStart = minutesStart;
+        this.minuteEnd = minutesEnd;
+
+        transformType = -1;
+
+        setOpaque(true);
+
+        addMouseListener(this);
+        addMouseMotionListener(this);
+    }
+
+    public int getDayStart() {
+        return dayStart;
+    }
+
+    public int getDayEnd() {
+        return dayEnd;
+    }
+
+    public int getMinuteStart() {
+        return minuteStart;
+    }
+
+    public int getMinuteEnd() {
+        return minuteEnd;
+    }
+
+    public void reposition() {
+        setBounds(editor.getPanelBoundsForTimeinterval(dayStart, dayEnd + 1,
+                minuteStart, minuteEnd));
+        editor.contentPanel.repaint();
+    }
+
+    private boolean isZeroMinuteInterval() {
+        return minuteStart == minuteEnd;
+    }
+
+    private boolean isOpenEndInterval() {
+        return minuteEnd == 24 * 60 + 1;
+    }
+
+    private void updateTimeInterval(int newDayStart, int newDayEnd,
+            int newMinuteStart, int newMinuteEnd) {
+        dayStart = newDayStart;
+        dayEnd = newDayEnd;
+        minuteStart = newMinuteStart;
+        minuteEnd = newMinuteEnd;
+
+        editor.dialog.updateValueField(editor.timeRects);
+        reposition();
+    }
+
+    @Override
+    public void paintComponent(Graphics g) {
+        drawTimeRect((Graphics2D) g, new Rectangle(0, 0, getWidth(),
+                getHeight()), isZeroMinuteInterval(), isOpenEndInterval());
+    }
+
+    public static void drawTimeRect(Graphics2D g2D, Rectangle bounds,
+            boolean isZeroMinuteInterval, boolean isOpenEndInterval) {
+
+        Color innerColor = new Color(135, 135, 234);
+        if (isOpenEndInterval)
+            innerColor = new Color(234, 135, 135);
+
+        int tmpRoundCornerSize = TimeRect.roundCornerSize;
+        int verticalNonFilledBorder = 1;
+        if (isZeroMinuteInterval) {
+            innerColor = new Color(135, 234, 135);
+            tmpRoundCornerSize = 0;
+            verticalNonFilledBorder = verticalNonDrawedPixels;
+        }
+
+        g2D.setColor(innerColor);
+        g2D.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
+                .6f));
+        g2D.fillRoundRect(bounds.x + 1, bounds.y + verticalNonFilledBorder,
+                bounds.width - 2, bounds.height - 1 - 2
+                        * verticalNonFilledBorder, tmpRoundCornerSize,
+                tmpRoundCornerSize);
+
+        g2D.setColor(new Color(255, 0, 0));
+        g2D.setComposite(AlphaComposite
+                .getInstance(AlphaComposite.SRC_OVER, 1f));
+        g2D.drawRoundRect(bounds.x + 1, bounds.y + verticalNonFilledBorder,
+                bounds.width - 2, bounds.height - 1 - 2
+                        * verticalNonFilledBorder, tmpRoundCornerSize,
+                tmpRoundCornerSize);
+
+    }
+
+    private int actualDayDrag;
+    private int actualMinuteDrag;
+    private int dragX;
+    private int dragY;
+    private int transformType;
+
+    // Calculate where the Component was clicked and returns the
+    // transformtype
+    private int getTransformType(MouseEvent evt) {
+        int tmpClickAreaWidth = Math.min(clickAreaSize, getWidth() / 3);
+        int tmpClickAreaHeight = Math.min(clickAreaSize, getHeight() / 3);
+
+        boolean isInNorthernTransformClickArea = evt.getY() < tmpClickAreaHeight;
+        boolean isInEasternTransformClickArea = evt.getX() > getWidth()
+                - tmpClickAreaWidth;
+        boolean isInSouthernTransformClickArea = evt.getY() > getHeight()
+                - tmpClickAreaHeight;
+        boolean isInWesternTransformClickArea = evt.getX() < tmpClickAreaWidth;
+
+        if (isZeroMinuteInterval()) {
+            isInNorthernTransformClickArea = false;
+            isInSouthernTransformClickArea = false;
+        }
+
+        int tType = 0;
+        for (int i = 1; i < transformDirections.length && tType == 0; i++) {
+            if (isInNorthernTransformClickArea == transformDirections[i][0]
+                    && isInEasternTransformClickArea == transformDirections[i][1]
+                    && isInSouthernTransformClickArea == transformDirections[i][2]
+                    && isInWesternTransformClickArea == transformDirections[i][3])
+                tType = i;
+        }
+
+        return tType;
+    }
+
+    public void showMenu(MouseEvent evt) {
+        JPopupMenu menu = new JPopupMenu();
+        final JCheckBoxMenuItem cbMenuItem = new JCheckBoxMenuItem(
+                tr("open end"), isOpenEndInterval());
+        menu.add(cbMenuItem);
+        cbMenuItem.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                if (cbMenuItem.isSelected())
+                    updateTimeInterval(dayStart, dayEnd, minuteStart,
+                            24 * 60 + 1);
+                else
+                    updateTimeInterval(dayStart, dayEnd, minuteStart, 24 * 60);
+            }
+        });
+        menu.show(this, evt.getX(), evt.getY());
+    }
+
+    @Override
+    public void mouseClicked(MouseEvent evt) {
+    }
+
+    @Override
+    public void mouseEntered(MouseEvent evt) {
+    }
+
+    @Override
+    public void mouseExited(MouseEvent evt) {
+        if (transformType < 0)
+            setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+    }
+
+    @Override
+    public void mousePressed(MouseEvent evt) {
+        if (evt.isPopupTrigger()) {
+            showMenu(evt);
+        } else {
+            actualDayDrag = 0;
+            actualMinuteDrag = 0;
+            dragX = evt.getXOnScreen();
+            dragY = evt.getYOnScreen();
+            transformType = getTransformType(evt);
+        }
+    }
+
+    @Override
+    public void mouseReleased(MouseEvent evt) {
+        transformType = -1;
+    }
+
+    @Override
+    public void mouseDragged(MouseEvent evt) {
+        if (transformType >= 0) {
+            int xDiff = evt.getXOnScreen() - dragX;
+            int yDiff = evt.getYOnScreen() - dragY;
+
+            xDiff = (int) Math.round(xDiff / editor.getDayWidth())
+                    - actualDayDrag;
+            yDiff = (int) Math.round(yDiff
+                    / (editor.getMinuteHeight() * minuteResterize))
+                    * minuteResterize - actualMinuteDrag;
+
+            if (xDiff != 0) {
+                int newDayStart = dayStart;
+                int newDayEnd = dayEnd;
+
+                if (transformDirections[transformType][3])
+                    newDayStart += xDiff;
+                if (transformDirections[transformType][1])
+                    newDayEnd += xDiff;
+
+                if (newDayStart > newDayEnd) {
+                    editor.removeTimeRect(this);
+                    transformType = -1;
+                    setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+                } else if (newDayStart >= 0 && newDayEnd <= 6) {
+                    actualDayDrag += xDiff;
+                    updateTimeInterval(newDayStart, newDayEnd, minuteStart,
+                            minuteEnd);
+                }
+            }
+            if (yDiff != 0 && transformType >= 0) {
+                int newMinutesStart = minuteStart;
+                int newMinutesEnd = minuteEnd;
+
+                if (transformDirections[transformType][0])
+                    newMinutesStart = newMinutesStart + yDiff;
+                if (transformDirections[transformType][2]
+                        && !isOpenEndInterval())
+                    newMinutesEnd = newMinutesEnd + yDiff;
+
+                if (newMinutesStart >= 0
+                        && (newMinutesEnd <= 24 * 60 || isOpenEndInterval())) {
+                    actualMinuteDrag += yDiff;
+                    updateTimeInterval(dayStart, dayEnd, newMinutesStart,
+                            newMinutesEnd);
+                }
+            }
+        }
+        editor.mousePositionChanged(evt.getX() + getX(), evt.getY() + getY());
+    }
+
+    @Override
+    public void mouseMoved(MouseEvent evt) {
+        if (transformType < 0)
+            setCursor(new Cursor(transformCursorTypes[getTransformType(evt)]));
+        editor.mousePositionChanged(evt.getX() + getX(), evt.getY() + getY());
+    }
 }
Index: applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/OpeningTimeCompilerTokenManager.java
===================================================================
--- applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/OpeningTimeCompilerTokenManager.java	(revision 22873)
+++ applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/OpeningTimeCompilerTokenManager.java	(revision 23192)
@@ -274,5 +274,5 @@
 /** Token literal values. */
 public static final String[] jjstrLiteralImages = {
-"", null, null, "\53", "\157\146\146", "\62\64\57\67", "\73\40", "\40", "\54", 
+"", null, null, "\53", "\157\146\146", "\62\64\57\67", "\73\40", "\40", "\54",
 "\55", "\72", };
 
@@ -362,5 +362,5 @@
 
 /** Get the next Token. */
-public Token getNextToken() 
+public Token getNextToken()
 {
   Token matchedToken;
Index: applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/SyntaxException.java
===================================================================
--- applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/SyntaxException.java	(revision 22873)
+++ applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/SyntaxException.java	(revision 23192)
@@ -3,24 +3,24 @@
 public class SyntaxException extends Exception {
 
-	private int startColumn;
-	private int endColumn;
-	private String info;
+    private int startColumn;
+    private int endColumn;
+    private String info;
 
-	public int getStartColumn() {
-		return startColumn;
-	}
+    public int getStartColumn() {
+        return startColumn;
+    }
 
-	public int getEndColumn() {
-		return endColumn;
-	}
+    public int getEndColumn() {
+        return endColumn;
+    }
 
-	public String getInfo() {
-		return info;
-	}
+    public String getInfo() {
+        return info;
+    }
 
-	public SyntaxException(String info, int startColumn, int endColumn) {
-		this.startColumn = startColumn;
-		this.endColumn = endColumn;
-		this.info = info;
-	}
+    public SyntaxException(String info, int startColumn, int endColumn) {
+        this.startColumn = startColumn;
+        this.endColumn = endColumn;
+        this.info = info;
+    }
 }
Index: applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/TokenMgrError.java
===================================================================
--- applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/TokenMgrError.java	(revision 22873)
+++ applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/TokenMgrError.java	(revision 23192)
@@ -6,160 +6,160 @@
 public class TokenMgrError extends Error {
 
-	/**
-	 * The version identifier for this Serializable class. Increment only if the
-	 * <i>serialized</i> form of the class changes.
-	 */
-	private static final long serialVersionUID = 1L;
+    /**
+     * The version identifier for this Serializable class. Increment only if the
+     * <i>serialized</i> form of the class changes.
+     */
+    private static final long serialVersionUID = 1L;
 
-	/*
-	 * Ordinals for various reasons why an Error of this type can be thrown.
-	 */
+    /*
+     * Ordinals for various reasons why an Error of this type can be thrown.
+     */
 
-	/**
-	 * Lexical error occurred.
-	 */
-	static final int LEXICAL_ERROR = 0;
+    /**
+     * Lexical error occurred.
+     */
+    static final int LEXICAL_ERROR = 0;
 
-	/**
-	 * An attempt was made to create a second instance of a static token
-	 * manager.
-	 */
-	static final int STATIC_LEXER_ERROR = 1;
+    /**
+     * An attempt was made to create a second instance of a static token
+     * manager.
+     */
+    static final int STATIC_LEXER_ERROR = 1;
 
-	/**
-	 * Tried to change to an invalid lexical state.
-	 */
-	static final int INVALID_LEXICAL_STATE = 2;
+    /**
+     * Tried to change to an invalid lexical state.
+     */
+    static final int INVALID_LEXICAL_STATE = 2;
 
-	/**
-	 * Detected (and bailed out of) an infinite loop in the token manager.
-	 */
-	static final int LOOP_DETECTED = 3;
+    /**
+     * Detected (and bailed out of) an infinite loop in the token manager.
+     */
+    static final int LOOP_DETECTED = 3;
 
-	/**
-	 * Indicates the reason why the exception is thrown. It will have one of the
-	 * above 4 values.
-	 */
-	int errorCode;
+    /**
+     * Indicates the reason why the exception is thrown. It will have one of the
+     * above 4 values.
+     */
+    int errorCode;
 
-	/**
-	 * Replaces unprintable characters by their escaped (or unicode escaped)
-	 * equivalents in the given string
-	 */
-	protected static final String addEscapes(String str) {
-		StringBuffer retval = new StringBuffer();
-		char ch;
-		for (int i = 0; i < str.length(); i++) {
-			switch (str.charAt(i)) {
-			case 0:
-				continue;
-			case '\b':
-				retval.append("\\b");
-				continue;
-			case '\t':
-				retval.append("\\t");
-				continue;
-			case '\n':
-				retval.append("\\n");
-				continue;
-			case '\f':
-				retval.append("\\f");
-				continue;
-			case '\r':
-				retval.append("\\r");
-				continue;
-			case '\"':
-				retval.append("\\\"");
-				continue;
-			case '\'':
-				retval.append("\\\'");
-				continue;
-			case '\\':
-				retval.append("\\\\");
-				continue;
-			default:
-				if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
-					String s = "0000" + Integer.toString(ch, 16);
-					retval.append("\\u"
-							+ s.substring(s.length() - 4, s.length()));
-				} else {
-					retval.append(ch);
-				}
-				continue;
-			}
-		}
-		return retval.toString();
-	}
+    /**
+     * Replaces unprintable characters by their escaped (or unicode escaped)
+     * equivalents in the given string
+     */
+    protected static final String addEscapes(String str) {
+        StringBuffer retval = new StringBuffer();
+        char ch;
+        for (int i = 0; i < str.length(); i++) {
+            switch (str.charAt(i)) {
+            case 0:
+                continue;
+            case '\b':
+                retval.append("\\b");
+                continue;
+            case '\t':
+                retval.append("\\t");
+                continue;
+            case '\n':
+                retval.append("\\n");
+                continue;
+            case '\f':
+                retval.append("\\f");
+                continue;
+            case '\r':
+                retval.append("\\r");
+                continue;
+            case '\"':
+                retval.append("\\\"");
+                continue;
+            case '\'':
+                retval.append("\\\'");
+                continue;
+            case '\\':
+                retval.append("\\\\");
+                continue;
+            default:
+                if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+                    String s = "0000" + Integer.toString(ch, 16);
+                    retval.append("\\u"
+                            + s.substring(s.length() - 4, s.length()));
+                } else {
+                    retval.append(ch);
+                }
+                continue;
+            }
+        }
+        return retval.toString();
+    }
 
-	/**
-	 * Returns a detailed message for the Error when it is thrown by the token
-	 * manager to indicate a lexical error. Parameters : EOFSeen : indicates if
-	 * EOF caused the lexical error curLexState : lexical state in which this
-	 * error occurred errorLine : line number when the error occurred
-	 * errorColumn : column number when the error occurred errorAfter : prefix
-	 * that was seen before this error occurred curchar : the offending
-	 * character Note: You can customize the lexical error message by modifying
-	 * this method.
-	 */
-	protected static String LexicalError(boolean EOFSeen, int lexState,
-			int errorLine, int errorColumn, String errorAfter, char curChar) {
-		return ("Lexical error at line "
-				+ errorLine
-				+ ", column "
-				+ errorColumn
-				+ ".  Encountered: "
-				+ (EOFSeen ? "<EOF> " : ("\""
-						+ addEscapes(String.valueOf(curChar)) + "\"")
-						+ " (" + (int) curChar + "), ") + "after : \""
-				+ addEscapes(errorAfter) + "\"");
-	}
+    /**
+     * Returns a detailed message for the Error when it is thrown by the token
+     * manager to indicate a lexical error. Parameters : EOFSeen : indicates if
+     * EOF caused the lexical error curLexState : lexical state in which this
+     * error occurred errorLine : line number when the error occurred
+     * errorColumn : column number when the error occurred errorAfter : prefix
+     * that was seen before this error occurred curchar : the offending
+     * character Note: You can customize the lexical error message by modifying
+     * this method.
+     */
+    protected static String LexicalError(boolean EOFSeen, int lexState,
+            int errorLine, int errorColumn, String errorAfter, char curChar) {
+        return ("Lexical error at line "
+                + errorLine
+                + ", column "
+                + errorColumn
+                + ".  Encountered: "
+                + (EOFSeen ? "<EOF> " : ("\""
+                        + addEscapes(String.valueOf(curChar)) + "\"")
+                        + " (" + (int) curChar + "), ") + "after : \""
+                + addEscapes(errorAfter) + "\"");
+    }
 
-	/**
-	 * You can also modify the body of this method to customize your error
-	 * messages. For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE
-	 * are not of end-users concern, so you can return something like :
-	 *
-	 * "Internal Error : Please file a bug report .... "
-	 *
-	 * from this method for such cases in the release version of your parser.
-	 */
-	@Override
-	public String getMessage() {
-		return super.getMessage();
-	}
+    /**
+     * You can also modify the body of this method to customize your error
+     * messages. For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE
+     * are not of end-users concern, so you can return something like :
+     *
+     * "Internal Error : Please file a bug report .... "
+     *
+     * from this method for such cases in the release version of your parser.
+     */
+    @Override
+    public String getMessage() {
+        return super.getMessage();
+    }
 
-	/*
-	 * Constructors of various flavors follow.
-	 */
+    /*
+     * Constructors of various flavors follow.
+     */
 
-	/** No arg constructor. */
-	public TokenMgrError() {
-	}
+    /** No arg constructor. */
+    public TokenMgrError() {
+    }
 
-	/** Constructor with message and reason. */
-	public TokenMgrError(String message, int reason) {
-		super(message);
-		errorCode = reason;
-	}
+    /** Constructor with message and reason. */
+    public TokenMgrError(String message, int reason) {
+        super(message);
+        errorCode = reason;
+    }
 
-	public boolean EOFSeen;
-	public int lexState;
-	public int errorLine;
-	public int errorColumn;
-	public String errorAfter;
-	public char curChar;
-	public int reason;
+    public boolean EOFSeen;
+    public int lexState;
+    public int errorLine;
+    public int errorColumn;
+    public String errorAfter;
+    public char curChar;
+    public int reason;
 
-	/** Full Constructor. */
-	public TokenMgrError(boolean EOFSeen, int lexState, int errorLine,
-			int errorColumn, String errorAfter, char curChar, int reason) {
-		this.EOFSeen = EOFSeen;
-		this.lexState = lexState;
-		this.errorLine = errorLine;
-		this.errorColumn = errorColumn;
-		this.errorAfter = errorAfter;
-		this.curChar = curChar;
-		this.reason = reason;
-	}
+    /** Full Constructor. */
+    public TokenMgrError(boolean EOFSeen, int lexState, int errorLine,
+            int errorColumn, String errorAfter, char curChar, int reason) {
+        this.EOFSeen = EOFSeen;
+        this.lexState = lexState;
+        this.errorLine = errorLine;
+        this.errorColumn = errorColumn;
+        this.errorAfter = errorAfter;
+        this.curChar = curChar;
+        this.reason = reason;
+    }
 }
 /*
