@@ -1,54 +1,54 @@
/*
This file is part of RouteConverter.
RouteConverter is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
RouteConverter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RouteConverter; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Christian Pesch. All Rights Reserved.
*/

package slash.navigation.converter.gui.actions;

import slash.navigation.converter.gui.helper.BatchPositionAugmenter;
import slash.navigation.converter.gui.models.PositionsModel;
import slash.navigation.gui.FrameAction;

import javax.swing.*;
import java.awt.event.ActionListener;

/**
* {@link ActionListener} that adds postal addresses from Google Maps as comments to
* the selected rows of a {@link JTable} with the help of a {@link slash.navigation.converter.gui.helper.BatchPositionAugmenter}.
*
* @author Christian Pesch
*/

public class AddPostalAddressToPositions extends FrameAction {
private final JTable table;
private final PositionsModel positionsModel;
private final BatchPositionAugmenter augmenter;

public AddPostalAddressToPositions(JTable table, PositionsModel positionsModel, BatchPositionAugmenter augmenter) {
this.table = table;
this.positionsModel = positionsModel;
this.augmenter = augmenter;
}

public void run() {
int[] selectedRows = table.getSelectedRows();
if (selectedRows.length > 0) {
augmenter.addPostalAddresses(table, positionsModel, selectedRows);
}
}
/*
This file is part of RouteConverter.
RouteConverter is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
RouteConverter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RouteConverter; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Christian Pesch. All Rights Reserved.
*/

package slash.navigation.converter.gui.actions;

import slash.navigation.converter.gui.helper.BatchPositionAugmenter;
import slash.navigation.converter.gui.models.PositionsModel;
import slash.navigation.gui.FrameAction;

import javax.swing.*;
import java.awt.event.ActionListener;

/**
* {@link ActionListener} that adds postal addresses from Google Maps as comments to
* the selected rows of a {@link JTable} with the help of a {@link slash.navigation.converter.gui.helper.BatchPositionAugmenter}.
*
* @author Christian Pesch
*/

public class AddPostalAddressToPositionsAction extends FrameAction {
private final JTable table;
private final PositionsModel positionsModel;
private final BatchPositionAugmenter augmenter;

public AddPostalAddressToPositionsAction(JTable table, PositionsModel positionsModel, BatchPositionAugmenter augmenter) {
this.table = table;
this.positionsModel = positionsModel;
this.augmenter = augmenter;
}

public void run() {
int[] selectedRows = table.getSelectedRows();
if (selectedRows.length > 0) {
augmenter.addPostalAddresses(table, positionsModel, selectedRows);
}
}
}
@@ -1,54 +1,54 @@
/*
This file is part of RouteConverter.
RouteConverter is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
RouteConverter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RouteConverter; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Christian Pesch. All Rights Reserved.
*/

package slash.navigation.converter.gui.actions;

import slash.navigation.converter.gui.helper.BatchPositionAugmenter;
import slash.navigation.converter.gui.models.PositionsModel;
import slash.navigation.gui.FrameAction;

import javax.swing.*;
import java.awt.event.ActionListener;

/**
* {@link ActionListener} that adds speeds to the selected rows of a {@link JTable}
* with the help of a {@link slash.navigation.converter.gui.helper.BatchPositionAugmenter}.
*
* @author Christian Pesch
*/

public class AddSpeedToPositions extends FrameAction {
private final JTable table;
private final PositionsModel positionsModel;
private final BatchPositionAugmenter augmenter;

public AddSpeedToPositions(JTable table, PositionsModel positionsModel, BatchPositionAugmenter augmenter) {
this.table = table;
this.positionsModel = positionsModel;
this.augmenter = augmenter;
}

public void run() {
int[] selectedRows = table.getSelectedRows();
if (selectedRows.length > 0) {
augmenter.addSpeeds(table, positionsModel, selectedRows);
}
}
/*
This file is part of RouteConverter.
RouteConverter is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
RouteConverter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RouteConverter; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Christian Pesch. All Rights Reserved.
*/

package slash.navigation.converter.gui.actions;

import slash.navigation.converter.gui.helper.BatchPositionAugmenter;
import slash.navigation.converter.gui.models.PositionsModel;
import slash.navigation.gui.FrameAction;

import javax.swing.*;
import java.awt.event.ActionListener;

/**
* {@link ActionListener} that adds speeds to the selected rows of a {@link JTable}
* with the help of a {@link slash.navigation.converter.gui.helper.BatchPositionAugmenter}.
*
* @author Christian Pesch
*/

public class AddSpeedToPositionsAction extends FrameAction {
private final JTable table;
private final PositionsModel positionsModel;
private final BatchPositionAugmenter augmenter;

public AddSpeedToPositionsAction(JTable table, PositionsModel positionsModel, BatchPositionAugmenter augmenter) {
this.table = table;
this.positionsModel = positionsModel;
this.augmenter = augmenter;
}

public void run() {
int[] selectedRows = table.getSelectedRows();
if (selectedRows.length > 0) {
augmenter.addSpeeds(table, positionsModel, selectedRows);
}
}
}
@@ -42,6 +42,6 @@ public DeletePositionListAction(FormatAndRoutesModel formatAndRoutesModel) {
public void run() {
BaseRoute selectedRoute = formatAndRoutesModel.getSelectedRoute();
if (selectedRoute != null)
formatAndRoutesModel.removeRoute(selectedRoute);
formatAndRoutesModel.removePositionList(selectedRoute);
}
}
@@ -31,10 +31,10 @@
* @author Christian Pesch
*/

public class ExportPositionList extends FrameAction {
public class ExportPositionListAction extends FrameAction {
private final ConvertPanel convertPanel;

public ExportPositionList(ConvertPanel convertPanel) {
public ExportPositionListAction(ConvertPanel convertPanel) {
this.convertPanel = convertPanel;
}

@@ -1,44 +1,44 @@
/*
This file is part of RouteConverter.
RouteConverter is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
RouteConverter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RouteConverter; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Christian Pesch. All Rights Reserved.
*/

package slash.navigation.converter.gui.actions;

import slash.navigation.converter.gui.panels.ConvertPanel;
import slash.navigation.gui.FrameAction;

import javax.swing.*;

/**
* {@link Action} that imports files to the current position list at the selected row.
*
* @author Christian Pesch
*/

public class ImportPositionList extends FrameAction {
private final ConvertPanel convertPanel;

public ImportPositionList(ConvertPanel convertPanel) {
this.convertPanel = convertPanel;
}

public void run() {
convertPanel.importPositionList();
}
/*
This file is part of RouteConverter.
RouteConverter is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
RouteConverter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RouteConverter; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Christian Pesch. All Rights Reserved.
*/

package slash.navigation.converter.gui.actions;

import slash.navigation.converter.gui.panels.ConvertPanel;
import slash.navigation.gui.FrameAction;

import javax.swing.*;

/**
* {@link Action} that imports files to the current position list at the selected row.
*
* @author Christian Pesch
*/

public class ImportPositionListAction extends FrameAction {
private final ConvertPanel convertPanel;

public ImportPositionListAction(ConvertPanel convertPanel) {
this.convertPanel = convertPanel;
}

public void run() {
convertPanel.importPositionList();
}
}
@@ -1,67 +1,67 @@
/*
This file is part of RouteConverter.
RouteConverter is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
RouteConverter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RouteConverter; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Christian Pesch. All Rights Reserved.
*/

package slash.navigation.converter.gui.actions;

import slash.navigation.base.BaseRoute;
import slash.navigation.converter.gui.helper.AbstractListDataListener;
import slash.navigation.converter.gui.models.FormatAndRoutesModel;
import slash.navigation.converter.gui.models.PositionsModel;
import slash.navigation.gui.FrameAction;

import javax.swing.*;
import javax.swing.event.ListDataEvent;
import java.awt.event.ActionListener;

/**
* {@link ActionListener} that inserts the position list of a {@link PositionsModel} at
* the selected row of a {@link JTable} and removes it from the {@link FormatAndRoutesModel}.
*
* @author Christian Pesch
*/

public class MergePositionList extends FrameAction {
private final JTable table;
private final BaseRoute sourceRoute;
private final FormatAndRoutesModel formatAndRoutesModel;

public MergePositionList(JTable table, BaseRoute sourceRoute, FormatAndRoutesModel formatAndRoutesModel) {
this.table = table;
this.sourceRoute = sourceRoute;
this.formatAndRoutesModel = formatAndRoutesModel;
initialize();
}

protected void initialize() {
setEnabled(!sourceRoute.equals(formatAndRoutesModel.getSelectedRoute()));
formatAndRoutesModel.addListDataListener(new AbstractListDataListener() {
public void process(ListDataEvent e) {
setEnabled(!sourceRoute.equals(formatAndRoutesModel.getSelectedRoute()));
}
});
}

@SuppressWarnings("unchecked")
public void run() {
int selectedRow = Math.min(table.getSelectedRow() + 1, table.getRowCount());
formatAndRoutesModel.getPositionsModel().add(selectedRow, sourceRoute.getPositions());
formatAndRoutesModel.removeRoute(sourceRoute);
}
/*
This file is part of RouteConverter.
RouteConverter is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
RouteConverter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RouteConverter; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Christian Pesch. All Rights Reserved.
*/

package slash.navigation.converter.gui.actions;

import slash.navigation.base.BaseRoute;
import slash.navigation.converter.gui.helper.AbstractListDataListener;
import slash.navigation.converter.gui.models.FormatAndRoutesModel;
import slash.navigation.converter.gui.models.PositionsModel;
import slash.navigation.gui.FrameAction;

import javax.swing.*;
import javax.swing.event.ListDataEvent;
import java.awt.event.ActionListener;

/**
* {@link ActionListener} that inserts the position list of a {@link PositionsModel} at
* the selected row of a {@link JTable} and removes it from the {@link FormatAndRoutesModel}.
*
* @author Christian Pesch
*/

public class MergePositionListAction extends FrameAction {
private final JTable table;
private final BaseRoute sourceRoute;
private final FormatAndRoutesModel formatAndRoutesModel;

public MergePositionListAction(JTable table, BaseRoute sourceRoute, FormatAndRoutesModel formatAndRoutesModel) {
this.table = table;
this.sourceRoute = sourceRoute;
this.formatAndRoutesModel = formatAndRoutesModel;
initialize();
}

protected void initialize() {
setEnabled(!sourceRoute.equals(formatAndRoutesModel.getSelectedRoute()));
formatAndRoutesModel.addListDataListener(new AbstractListDataListener() {
public void process(ListDataEvent e) {
setEnabled(!sourceRoute.equals(formatAndRoutesModel.getSelectedRoute()));
}
});
}

@SuppressWarnings("unchecked")
public void run() {
int selectedRow = Math.min(table.getSelectedRow() + 1, table.getRowCount());
formatAndRoutesModel.getPositionsModel().add(selectedRow, sourceRoute.getPositions());
formatAndRoutesModel.removePositionList(sourceRoute);
}
}
@@ -52,7 +52,7 @@ public void run() {
BaseRoute route = format.createRoute((RouteCharacteristics) formatAndRoutesModel.getCharacteristicsModel().getSelectedItem(),
MessageFormat.format(RouteConverter.getBundle().getString("new-positionlist-name"), formatAndRoutesModel.getSize() + 1),
new ArrayList<BaseNavigationPosition>());
formatAndRoutesModel.addRoute(formatAndRoutesModel.getSize(), route);
formatAndRoutesModel.addPositionList(formatAndRoutesModel.getSize(), route);
formatAndRoutesModel.setSelectedItem(route);
}
}
@@ -0,0 +1,61 @@
/*
This file is part of RouteConverter.
RouteConverter is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
RouteConverter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RouteConverter; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Christian Pesch. All Rights Reserved.
*/

package slash.navigation.converter.gui.actions;

import slash.navigation.catalog.model.CategoryTreeNode;
import slash.navigation.converter.gui.RouteConverter;
import slash.navigation.converter.gui.helper.RouteServiceOperator;
import slash.navigation.converter.gui.models.CatalogModel;
import slash.navigation.gui.FrameAction;

import javax.swing.*;

import static java.text.MessageFormat.format;
import static javax.swing.JOptionPane.QUESTION_MESSAGE;
import static javax.swing.JOptionPane.showInputDialog;
import static slash.common.io.Transfer.trim;
import static slash.navigation.converter.gui.helper.JTreeHelper.getSelectedCategoryTreeNode;

/**
* {@link Action} that renames a category of the {@link RouteServiceOperator}.
*
* @author Christian Pesch
*/

public class RenameCategoryAction extends FrameAction {
private final JTree tree;

public RenameCategoryAction(JTree tree) {
this.tree = tree;
}

public void run() {
RouteConverter r = RouteConverter.getInstance();
CategoryTreeNode selected = getSelectedCategoryTreeNode(tree);
String name = (String) showInputDialog(r.getFrame(),
format(RouteConverter.getBundle().getString("rename-category-label"), selected.getName()),
r.getFrame().getTitle(), QUESTION_MESSAGE, null, null, selected.getName());
if (trim(name) == null)
return;

((CatalogModel) tree.getModel()).rename(selected, name);
}
}
@@ -1,85 +1,85 @@
/*
This file is part of RouteConverter.
RouteConverter is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
RouteConverter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RouteConverter; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Christian Pesch. All Rights Reserved.
*/

package slash.navigation.converter.gui.actions;

import slash.navigation.base.BaseNavigationFormat;
import slash.navigation.base.BaseNavigationPosition;
import slash.navigation.base.BaseRoute;
import slash.navigation.base.NavigationFormat;
import slash.navigation.converter.gui.models.FormatAndRoutesModel;
import slash.navigation.converter.gui.models.PositionsModel;
import slash.navigation.gui.FrameAction;

import javax.swing.*;
import java.awt.event.ActionListener;
import java.util.List;

/**
* {@link ActionListener} that splits the position list of a {@link PositionsModel} at
* the selected rows of a {@link JTable} and adds them as separate position lists to a
* {@link FormatAndRoutesModel}.
*
* @author Christian Pesch
*/

public class SplitPositionList extends FrameAction {
private final JTable table;
private final PositionsModel positionsModel;
private final FormatAndRoutesModel formatAndRoutesModel;

public SplitPositionList(JTable table, PositionsModel positionsModel, FormatAndRoutesModel formatAndRoutesModel) {
this.table = table;
this.positionsModel = positionsModel;
this.formatAndRoutesModel = formatAndRoutesModel;
}

public void run() {
int[] selectedRows = table.getSelectedRows();
if (selectedRows.length > 0) {
BaseRoute selectedRoute = formatAndRoutesModel.getSelectedRoute();
int routeInsertIndex = formatAndRoutesModel.getSize();

for (int i = selectedRows.length - 1; i >= 0; i--) {
int fromIndex = selectedRows[i];
fromIndex = Math.max(fromIndex, 0);
int toIndex = i + 1 < selectedRows.length ? selectedRows[i + 1] : positionsModel.getRowCount();
toIndex = Math.max(toIndex, 0);
if (fromIndex == 0 && toIndex == 0)
break;

List<BaseNavigationPosition> positions = positionsModel.getPositions(fromIndex, toIndex);
positionsModel.remove(fromIndex, toIndex);
NavigationFormat format = formatAndRoutesModel.getFormat();
@SuppressWarnings({"unchecked"})
BaseRoute<BaseNavigationPosition, BaseNavigationFormat> target =
format.createRoute(selectedRoute.getCharacteristics(), selectedRoute.getName() + "(" + (i + 1) + ")", positions);
formatAndRoutesModel.addRoute(routeInsertIndex, target);
}

final int selectedRow = Math.max(selectedRows[selectedRows.length - 1] - 1, 0);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
table.getSelectionModel().setSelectionInterval(selectedRow, selectedRow);
}
});
}
}
}
/*
This file is part of RouteConverter.
RouteConverter is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
RouteConverter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RouteConverter; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Christian Pesch. All Rights Reserved.
*/

package slash.navigation.converter.gui.actions;

import slash.navigation.base.BaseNavigationFormat;
import slash.navigation.base.BaseNavigationPosition;
import slash.navigation.base.BaseRoute;
import slash.navigation.base.NavigationFormat;
import slash.navigation.converter.gui.models.FormatAndRoutesModel;
import slash.navigation.converter.gui.models.PositionsModel;
import slash.navigation.gui.FrameAction;

import javax.swing.*;
import java.awt.event.ActionListener;
import java.util.List;

/**
* {@link ActionListener} that splits the position list of a {@link PositionsModel} at
* the selected rows of a {@link JTable} and adds them as separate position lists to a
* {@link FormatAndRoutesModel}.
*
* @author Christian Pesch
*/

public class SplitPositionListAction extends FrameAction {
private final JTable table;
private final PositionsModel positionsModel;
private final FormatAndRoutesModel formatAndRoutesModel;

public SplitPositionListAction(JTable table, PositionsModel positionsModel, FormatAndRoutesModel formatAndRoutesModel) {
this.table = table;
this.positionsModel = positionsModel;
this.formatAndRoutesModel = formatAndRoutesModel;
}

public void run() {
int[] selectedRows = table.getSelectedRows();
if (selectedRows.length > 0) {
BaseRoute selectedRoute = formatAndRoutesModel.getSelectedRoute();
int routeInsertIndex = formatAndRoutesModel.getSize();

for (int i = selectedRows.length - 1; i >= 0; i--) {
int fromIndex = selectedRows[i];
fromIndex = Math.max(fromIndex, 0);
int toIndex = i + 1 < selectedRows.length ? selectedRows[i + 1] : positionsModel.getRowCount();
toIndex = Math.max(toIndex, 0);
if (fromIndex == 0 && toIndex == 0)
break;

List<BaseNavigationPosition> positions = positionsModel.getPositions(fromIndex, toIndex);
positionsModel.remove(fromIndex, toIndex);
NavigationFormat format = formatAndRoutesModel.getFormat();
@SuppressWarnings({"unchecked"})
BaseRoute<BaseNavigationPosition, BaseNavigationFormat> target =
format.createRoute(selectedRoute.getCharacteristics(), selectedRoute.getName() + "(" + (i + 1) + ")", positions);
formatAndRoutesModel.addPositionList(routeInsertIndex, target);
}

final int selectedRow = Math.max(selectedRows[selectedRows.length - 1] - 1, 0);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
table.getSelectionModel().setSelectionInterval(selectedRow, selectedRow);
}
});
}
}
}
@@ -64,7 +64,7 @@ public void process(DocumentEvent e) {
boolean routeNameTooLong = textFieldName.getDocument().getLength() > targetFormat.getMaximumRouteNameLength();
textFieldName.setBackground(routeNameTooLong ? Color.RED : defaultBackground);
if (routeNameTooLong) {
labelResult.setText(MessageFormat.format(RouteConverter.getBundle().getString("rename-route-name-too-long"),
labelResult.setText(MessageFormat.format(RouteConverter.getBundle().getString("rename-position-list-name-too-long"),
targetFormat.getName(), targetFormat.getMaximumRouteNameLength()));
} else {
labelResult.setText("");
@@ -30,7 +30,6 @@
import slash.navigation.geonames.GeoNamesService;
import slash.navigation.googlemaps.GoogleMapsPosition;
import slash.navigation.googlemaps.GoogleMapsService;
import slash.navigation.gui.Constants;
import slash.navigation.util.NumberPattern;

import javax.swing.*;
@@ -39,7 +38,13 @@

import static java.lang.String.format;
import static javax.swing.JOptionPane.ERROR_MESSAGE;
import static slash.navigation.converter.gui.models.PositionColumns.*;
import static slash.navigation.converter.gui.models.PositionColumns.DESCRIPTION_COLUMN_INDEX;
import static slash.navigation.converter.gui.models.PositionColumns.ELEVATION_COLUMN_INDEX;
import static slash.navigation.converter.gui.models.PositionColumns.LATITUDE_COLUMN_INDEX;
import static slash.navigation.converter.gui.models.PositionColumns.LONGITUDE_COLUMN_INDEX;
import static slash.navigation.converter.gui.models.PositionColumns.SPEED_COLUMN_INDEX;
import static slash.navigation.gui.Constants.startWaitCursor;
import static slash.navigation.gui.Constants.stopWaitCursor;
import static slash.navigation.util.RouteComments.getNumberedPosition;

/**
@@ -52,8 +57,8 @@

public class BatchPositionAugmenter {
private static final Logger log = Logger.getLogger(BatchPositionAugmenter.class.getName());
private JFrame frame;
private static final Object mutex = new Object();
private final JFrame frame;
private boolean running = true;

public BatchPositionAugmenter(JFrame frame) {
@@ -102,7 +107,7 @@ private void executeOperation(final JTable positionsTable,
this.running = true;
}

Constants.startWaitCursor(frame.getRootPane());
startWaitCursor(frame.getRootPane());
final ProgressMonitor progress = new ProgressMonitor(frame, "", RouteConverter.getBundle().getString("progress-started"), 0, 100);
new Thread(new Runnable() {
public void run() {
@@ -164,7 +169,7 @@ public boolean isInterrupted() {

SwingUtilities.invokeLater(new Runnable() {
public void run() {
Constants.stopWaitCursor(frame.getRootPane());
stopWaitCursor(frame.getRootPane());
progress.setNote(RouteConverter.getBundle().getString("progress-finished"));
progress.setProgress(progress.getMaximum());
}
@@ -0,0 +1,47 @@
/*
This file is part of RouteConverter.
RouteConverter is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
RouteConverter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RouteConverter; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Christian Pesch. All Rights Reserved.
*/

package slash.navigation.converter.gui.helper;

import slash.navigation.catalog.model.CategoryTreeNode;

import javax.swing.*;
import javax.swing.event.TableModelEvent;
import javax.swing.tree.TreePath;
import java.awt.*;

/**
* A helper for simplified {@link JTree} operations.
*
* @author Christian Pesch
*/

public class JTreeHelper {
public static CategoryTreeNode getSelectedCategoryTreeNode(JTree tree) {
TreePath treePath = tree.getSelectionPath();
// if there is no selected root take the local root
Object treeNode = treePath != null ?
treePath.getLastPathComponent() :
tree.getModel().getChild(tree.getModel().getRoot(), 0);
if (!(treeNode instanceof CategoryTreeNode))
return null;
return (CategoryTreeNode) treeNode;
}
}
@@ -21,7 +21,7 @@
package slash.navigation.converter.gui.helper;

import slash.navigation.base.BaseRoute;
import slash.navigation.converter.gui.actions.MergePositionList;
import slash.navigation.converter.gui.actions.MergePositionListAction;
import slash.navigation.converter.gui.models.FormatAndRoutesModel;
import slash.navigation.converter.gui.models.PositionsTableColumnModel;
import slash.navigation.util.RouteComments;
@@ -51,7 +51,7 @@ private void initialize(final JTable table) {
public void intervalAdded(ListDataEvent e) {
for (int i = e.getIndex0(); i <= e.getIndex1(); i++) {
BaseRoute route = formatAndRoutesModel.getRoute(i);
JMenuItem menuItem = new JMenuItem(new MergePositionList(table, route, formatAndRoutesModel));
JMenuItem menuItem = new JMenuItem(new MergePositionListAction(table, route, formatAndRoutesModel));
menuItem.setText(RouteComments.shortenRouteName(route));
menu.add(menuItem, i);
}
@@ -23,7 +23,6 @@
import slash.navigation.converter.gui.RouteConverter;
import slash.navigation.converter.gui.dialogs.LoginDialog;
import slash.navigation.feedback.domain.RouteFeedback;
import slash.navigation.gui.Constants;
import slash.navigation.rest.exception.UnAuthorizedException;

import javax.swing.*;
@@ -32,6 +31,7 @@
import java.util.logging.Logger;

import static slash.navigation.gui.Constants.startWaitCursor;
import static slash.navigation.gui.Constants.stopWaitCursor;

/**
* Helps to interact with the RemoteCatalog and RouteFeedback service.
@@ -69,6 +69,52 @@ public void run() {
});
}

public interface NewOperation {
String getName();
void run() throws IOException;
}

public void executeOperation(final NewOperation operation) {
new Thread(new Runnable() {
public void run() {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
startWaitCursor(frame.getRootPane());
}
});

while (true) {
try {
try {
operation.run();
} catch (UnAuthorizedException uae) {
final boolean[] showedLogin = new boolean[1];
showedLogin[0] = false;

SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
showedLogin[0] = showLogin();
}
});

if (showedLogin[0])
continue;
}
} catch (Throwable t) {
handleServiceError(t);
} finally {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
stopWaitCursor(frame.getRootPane());
}
});
}
break;
}
}
}, operation.getName()).start();
}

public interface Operation {
void run() throws IOException;
}
@@ -108,7 +154,7 @@ public void run() {
} finally {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Constants.stopWaitCursor(frame.getRootPane());
stopWaitCursor(frame.getRootPane());
}
});
}
@@ -1,42 +1,36 @@
/*
This file is part of RouteConverter.
RouteConverter is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
RouteConverter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RouteConverter; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Christian Pesch. All Rights Reserved.
*/

package slash.navigation.catalog.model;

import javax.swing.tree.DefaultTreeModel;

/**
* Acts as a {@link javax.swing.tree.TreeModel} for {@link CategoryTreeNode}s.
*
* @author Christian Pesch
*/

public class CategoryTreeModel extends DefaultTreeModel {

public CategoryTreeModel(CategoryTreeNode root) {
super(root, true);
root.setTreeModel(this);
}

public boolean isLeaf(Object node) {
// this would go through the whole tree ((CategoryTreeNode) node).getChildCount() == 0;
return false;
}
}
/*
This file is part of RouteConverter.
RouteConverter is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
RouteConverter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RouteConverter; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Christian Pesch. All Rights Reserved.
*/

package slash.navigation.converter.gui.models;

import slash.navigation.catalog.domain.Catalog;
import slash.navigation.catalog.model.CategoryTreeNode;

import javax.swing.tree.TreeModel;

/**
* Acts as a {@link TreeModel} for the categories and routes of a {@link Catalog}.
*
* @author Christian Pesch
*/

public interface CatalogModel extends TreeModel {
void rename(CategoryTreeNode category, String name);
}
@@ -0,0 +1,73 @@
/*
This file is part of RouteConverter.
RouteConverter is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
RouteConverter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RouteConverter; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Christian Pesch. All Rights Reserved.
*/

package slash.navigation.converter.gui.models;

import slash.navigation.catalog.domain.Catalog;
import slash.navigation.catalog.model.CategoryTreeNode;
import slash.navigation.converter.gui.helper.RouteServiceOperator;

import javax.swing.*;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreeModel;
import java.io.IOException;

/**
* Acts as a {@link TreeModel} for the categories and routes of a {@link Catalog}.
*
* @author Christian Pesch
*/

public class CatalogModelImpl extends DefaultTreeModel implements CatalogModel {
private final RouteServiceOperator operator;

public CatalogModelImpl(CategoryTreeNode root, RouteServiceOperator operator) {
super(root);
root.setTreeModel(this);
this.operator = operator;
}

public boolean isLeaf(Object node) {
// this would go through the whole tree ((CategoryTreeNode) node).getChildCount() == 0;
return false;
}

// Undoable operations

public void rename(final CategoryTreeNode category, final String name) {
operator.executeOperation(new RouteServiceOperator.NewOperation() {
public String getName() {
return "RenameCategory";
}

public void run() throws IOException {
category.getCategory().update(null, name);

SwingUtilities.invokeLater(new Runnable() {
public void run() {
category.clearChildren();
nodeChanged(category);
// TODO nodeStructureChanged(category);
}
});
}
});
}
}
@@ -50,7 +50,7 @@ public interface FormatAndRoutesModel extends ComboBoxModel {
BaseRoute getRoute(int index);
int getIndex(BaseRoute route);

void renameRoute(String name);
void addRoute(int index, BaseRoute route);
void removeRoute(BaseRoute route);
void addPositionList(int index, BaseRoute route);
void renamePositionList(String name);
void removePositionList(BaseRoute route);
}
@@ -108,12 +108,19 @@ public void setFormat(NavigationFormat<BaseRoute> format) {
fireContentsChanged(this, -1, -1);
}

public void addRoute(int index, BaseRoute route) {
public void addPositionList(int index, BaseRoute route) {
getRoutes().add(index, route);
fireIntervalAdded(this, index, index);
}

public void removeRoute(BaseRoute route) {
public void renamePositionList(String name) {
BaseRoute route = getSelectedRoute();
route.setName(name);
int index = getRoutes().indexOf(route);
fireContentsChanged(this, index, index);
}

public void removePositionList(BaseRoute route) {
int index = getIndex(route);
if (index != -1) {
if (getElementAt(index) == getSelectedRoute()) {
@@ -128,13 +135,6 @@ public void removeRoute(BaseRoute route) {
}
}

public void renameRoute(String name) {
BaseRoute route = getSelectedRoute();
route.setName(name);
int index = getRoutes().indexOf(route);
fireContentsChanged(this, index, index);
}

public int getSize() {
return getRoutes() != null ? getRoutes().size() : 0;
}
@@ -32,23 +32,27 @@
import slash.navigation.catalog.domain.Catalog;
import slash.navigation.catalog.domain.Route;
import slash.navigation.catalog.local.LocalCatalog;
import slash.navigation.catalog.model.CategoryTreeModel;
import slash.navigation.catalog.model.CategoryTreeNode;
import slash.navigation.catalog.model.CategoryTreeNodeImpl;
import slash.navigation.catalog.model.RootTreeNode;
import slash.navigation.catalog.model.RoutesListModel;
import slash.navigation.catalog.remote.RemoteCatalog;
import slash.navigation.converter.gui.RouteConverter;
import slash.navigation.converter.gui.actions.RenameCategoryAction;
import slash.navigation.converter.gui.dialogs.AddFileDialog;
import slash.navigation.converter.gui.dialogs.AddUrlDialog;
import slash.navigation.converter.gui.dnd.CategorySelection;
import slash.navigation.converter.gui.dnd.DnDHelper;
import slash.navigation.converter.gui.dnd.RouteSelection;
import slash.navigation.converter.gui.helper.JTreeHelper;
import slash.navigation.converter.gui.helper.RouteServiceOperator;
import slash.navigation.converter.gui.helper.TreePathStringConversion;
import slash.navigation.converter.gui.models.CatalogModel;
import slash.navigation.converter.gui.renderer.CategoryTreeCellRenderer;
import slash.navigation.converter.gui.renderer.RoutesTableCellHeaderRenderer;
import slash.navigation.converter.gui.renderer.RoutesTableCellRenderer;
import slash.navigation.converter.gui.undo.UndoCatalogModel;
import slash.navigation.gui.ActionManager;
import slash.navigation.gui.Constants;
import slash.navigation.gui.FrameAction;
import slash.navigation.util.RouteComments;
@@ -93,6 +97,7 @@
import static slash.common.io.Transfer.trim;
import static slash.navigation.converter.gui.dnd.CategorySelection.categoryFlavor;
import static slash.navigation.converter.gui.dnd.RouteSelection.routeFlavor;
import static slash.navigation.converter.gui.helper.JMenuHelper.registerAction;

/**
* The browse panel of the route converter user interface.
@@ -118,6 +123,7 @@ public class BrowsePanel {
private JButton buttonDeleteRoute;
private JButton buttonLogin;

private CatalogModel catalogModel;
private final Catalog remoteCatalog = new RemoteCatalog(System.getProperty("catalog", "http://www.routeconverter.com/catalog/"), RouteConverter.getInstance().getCredentials());
private final Catalog localCatalog = new LocalCatalog(System.getProperty("root", createRootFolder()));

@@ -128,17 +134,21 @@ public BrowsePanel() {
private void initialize() {
final RouteConverter r = RouteConverter.getInstance();

CategoryTreeNode localRoot = new CategoryTreeNodeImpl(localCatalog.getRootCategory(), true, false);
CategoryTreeNodeImpl remoteRoot = new CategoryTreeNodeImpl(remoteCatalog.getRootCategory(), false, true);
final RootTreeNode root = new RootTreeNode(localRoot, remoteRoot);
catalogModel = new UndoCatalogModel(r.getContext().getUndoManager(), root, getOperator());

final ActionManager actionManager = r.getContext().getActionManager();
buttonAddCategory.addActionListener(new FrameAction() {
public void run() {
addCategory();
}
});

buttonRenameCategory.addActionListener(new FrameAction() {
public void run() {
renameCategory();
}
});
registerAction(buttonRenameCategory, "rename-category");

actionManager.register("rename-category", new RenameCategoryAction(treeCategories));

buttonDeleteCategory.addActionListener(new FrameAction() {
public void run() {
@@ -227,19 +237,20 @@ public void valueChanged(ListSelectionEvent e) {

new Thread(new Runnable() {
public void run() {
/* TODO remove me later
final CategoryTreeNode localRoot = new CategoryTreeNodeImpl(localCatalog.getRootCategory(), true, false);
final CategoryTreeNodeImpl remoteRoot = new CategoryTreeNodeImpl(remoteCatalog.getRootCategory(), false, true);
final RootTreeNode root = new RootTreeNode(localRoot, remoteRoot);
final CategoryTreeModel categoryTreeModel = new CategoryTreeModel(root);
// do the loading in a separate thread since treeCategories.setModel(categoryTreeModel)
// would do it in the AWT EventQueue
categoryTreeModel.getChildCount(remoteRoot);

*/
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Constants.startWaitCursor(r.getFrame().getRootPane());
try {
treeCategories.setModel(categoryTreeModel);
treeCategories.setModel(catalogModel);
// start with showing the folders below the roots
treeCategories.expandRow(0);
treeCategories.expandRow(1);
@@ -276,14 +287,8 @@ public JButton getDefaultButton() {
}

protected CategoryTreeNode getSelectedTreeNode() {
TreePath treePath = treeCategories.getSelectionPath();
// if there is no selected root take the local root
Object treeNode = treePath != null ?
treePath.getLastPathComponent() :
treeCategories.getModel().getChild(treeCategories.getModel().getRoot(), 0);
if (!(treeNode instanceof CategoryTreeNode))
return null;
return (CategoryTreeNode) treeNode;
// TODO remove this helper later
return JTreeHelper.getSelectedCategoryTreeNode(treeCategories);
}

protected List<CategoryTreeNode> getSelectedTreeNodes() {
@@ -354,22 +359,6 @@ public void run() {
});
}

private void renameCategory() {
RouteConverter r = RouteConverter.getInstance();
final CategoryTreeNode selected = getSelectedTreeNode();
final String name = (String) showInputDialog(r.getFrame(),
format(RouteConverter.getBundle().getString("rename-category-label"), selected.getName()),
r.getFrame().getTitle(), QUESTION_MESSAGE, null, null, selected.getName());
if (trim(name) == null)
return;

getOperator().executeOnRouteService(new RouteServiceOperator.Operation() {
public void run() throws IOException {
selected.rename(name);
}
});
}

private void deleteCategory() {
final List<CategoryTreeNode> categories = getSelectedTreeNodes();
StringBuilder categoryNames = new StringBuilder();
@@ -506,7 +495,7 @@ private void renameRoute() {
String description = null;
try {
description = (String) showInputDialog(RouteConverter.getInstance().getFrame(),
format(RouteConverter.getBundle().getString("rename-route-label"), selected.getName()),
format(RouteConverter.getBundle().getString("rename-position-list-label"), selected.getName()),
RouteConverter.getInstance().getFrame().getTitle(), QUESTION_MESSAGE, null, null, selected.getDescription());
} catch (IOException e) {
getOperator().handleServiceError(e);
@@ -37,18 +37,18 @@
import slash.navigation.base.NavigationFormats;
import slash.navigation.base.RouteCharacteristics;
import slash.navigation.converter.gui.RouteConverter;
import slash.navigation.converter.gui.actions.AddCoordinatesToPositions;
import slash.navigation.converter.gui.actions.AddElevationToPositions;
import slash.navigation.converter.gui.actions.AddNumberToPositions;
import slash.navigation.converter.gui.actions.AddPopulatedPlaceToPositions;
import slash.navigation.converter.gui.actions.AddPostalAddressToPositions;
import slash.navigation.converter.gui.actions.AddSpeedToPositions;
import slash.navigation.converter.gui.actions.AddCoordinatesToPositionsAction;
import slash.navigation.converter.gui.actions.AddElevationToPositionsAction;
import slash.navigation.converter.gui.actions.AddNumberToPositionsAction;
import slash.navigation.converter.gui.actions.AddPopulatedPlaceToPositionsAction;
import slash.navigation.converter.gui.actions.AddPostalAddressToPositionsAction;
import slash.navigation.converter.gui.actions.AddSpeedToPositionsAction;
import slash.navigation.converter.gui.actions.CopyAction;
import slash.navigation.converter.gui.actions.CutAction;
import slash.navigation.converter.gui.actions.DeleteAction;
import slash.navigation.converter.gui.actions.DeletePositionListAction;
import slash.navigation.converter.gui.actions.ExportPositionList;
import slash.navigation.converter.gui.actions.ImportPositionList;
import slash.navigation.converter.gui.actions.ExportPositionListAction;
import slash.navigation.converter.gui.actions.ImportPositionListAction;
import slash.navigation.converter.gui.actions.NewFileAction;
import slash.navigation.converter.gui.actions.NewPositionAction;
import slash.navigation.converter.gui.actions.NewPositionListAction;
@@ -58,7 +58,7 @@
import slash.navigation.converter.gui.actions.SaveAction;
import slash.navigation.converter.gui.actions.SaveAsAction;
import slash.navigation.converter.gui.actions.SelectAllAction;
import slash.navigation.converter.gui.actions.SplitPositionList;
import slash.navigation.converter.gui.actions.SplitPositionListAction;
import slash.navigation.converter.gui.dnd.ClipboardInteractor;
import slash.navigation.converter.gui.dnd.PanelDropHandler;
import slash.navigation.converter.gui.dnd.PositionSelection;
@@ -154,6 +154,7 @@
import static slash.navigation.base.RouteCharacteristics.Route;
import static slash.navigation.base.RouteCharacteristics.Track;
import static slash.navigation.converter.gui.dnd.PositionSelection.positionFlavor;
import static slash.navigation.converter.gui.helper.JMenuHelper.registerAction;
import static slash.navigation.gui.Constants.createJFileChooser;
import static slash.navigation.gui.Constants.startWaitCursor;
import static slash.navigation.gui.Constants.stopWaitCursor;
@@ -240,9 +241,9 @@ public boolean isInterrupted() {
new LengthToJLabelAdapter(getPositionsModel(), lengthCalculator, labelLength, labelDuration);
new ElevationToJLabelAdapter(getPositionsModel(), labelOverallAscend, labelOverallDescend);

JMenuHelper.registerAction(buttonNewPositionList, "new-positionlist");
JMenuHelper.registerAction(buttonRenamePositionList, "rename-positionlist");
JMenuHelper.registerAction(buttonDeletePositionList, "delete-positionlist");
registerAction(buttonNewPositionList, "new-positionlist");
registerAction(buttonRenamePositionList, "rename-positionlist");
registerAction(buttonDeletePositionList, "delete-positionlist");

buttonMovePositionToTop.addActionListener(new FrameAction() {
public void run() {
@@ -355,15 +356,15 @@ public void tableChanged(TableModelEvent e) {
actionManager.register("new-positionlist", new NewPositionListAction(getFormatAndRoutesModel()));
actionManager.register("rename-positionlist", new RenamePositionListAction(getFormatAndRoutesModel()));
actionManager.register("delete-positionlist", new DeletePositionListAction(getFormatAndRoutesModel()));
actionManager.register("add-coordinates", new AddCoordinatesToPositions(tablePositions, getPositionsModel(), positionAugmenter));
actionManager.register("add-elevation", new AddElevationToPositions(tablePositions, getPositionsModel(), positionAugmenter));
actionManager.register("add-postal-address", new AddPostalAddressToPositions(tablePositions, getPositionsModel(), positionAugmenter));
actionManager.register("add-populated-place", new AddPopulatedPlaceToPositions(tablePositions, getPositionsModel(), positionAugmenter));
actionManager.register("add-speed", new AddSpeedToPositions(tablePositions, getPositionsModel(), positionAugmenter));
actionManager.register("add-number", new AddNumberToPositions(tablePositions, getPositionsModel(), positionAugmenter));
actionManager.register("split-positionlist", new SplitPositionList(tablePositions, getPositionsModel(), formatAndRoutesModel));
actionManager.register("import-positionlist", new ImportPositionList(this));
actionManager.register("export-positionlist", new ExportPositionList(this));
actionManager.register("add-coordinates", new AddCoordinatesToPositionsAction(tablePositions, getPositionsModel(), positionAugmenter));
actionManager.register("add-elevation", new AddElevationToPositionsAction(tablePositions, getPositionsModel(), positionAugmenter));
actionManager.register("add-postal-address", new AddPostalAddressToPositionsAction(tablePositions, getPositionsModel(), positionAugmenter));
actionManager.register("add-populated-place", new AddPopulatedPlaceToPositionsAction(tablePositions, getPositionsModel(), positionAugmenter));
actionManager.register("add-speed", new AddSpeedToPositionsAction(tablePositions, getPositionsModel(), positionAugmenter));
actionManager.register("add-number", new AddNumberToPositionsAction(tablePositions, getPositionsModel(), positionAugmenter));
actionManager.register("split-positionlist", new SplitPositionListAction(tablePositions, getPositionsModel(), formatAndRoutesModel));
actionManager.register("import-positionlist", new ImportPositionListAction(this));
actionManager.register("export-positionlist", new ExportPositionListAction(this));

JMenuHelper.registerKeyStroke(tablePositions, "copy");
JMenuHelper.registerKeyStroke(tablePositions, "cut");
@@ -1020,7 +1021,7 @@ public void clearSelection() {
}

public void renameRoute(String name) {
formatAndRoutesModel.renameRoute(name);
formatAndRoutesModel.renamePositionList(name);
}

{
@@ -33,32 +33,32 @@
* @author Christian Pesch
*/

class AddRoute extends AbstractUndoableEdit {
class AddPositionList extends AbstractUndoableEdit {
private UndoFormatAndRoutesModel formatAndRoutesModel;
private int index;
private BaseRoute route;

public AddRoute(UndoFormatAndRoutesModel formatAndRoutesModel, int index, BaseRoute route) {
public AddPositionList(UndoFormatAndRoutesModel formatAndRoutesModel, int index, BaseRoute route) {
this.formatAndRoutesModel = formatAndRoutesModel;
this.index = index;
this.route = route;
}

public String getUndoPresentationName() {
return "add-route-undo";
return "add-position-list-undo";
}

public String getRedoPresentationName() {
return "add-route-redo";
return "add-position-list-redo";
}

public void undo() throws CannotUndoException {
super.undo();
formatAndRoutesModel.removeRoute(route, false);
formatAndRoutesModel.removePositionList(route, false);
}

public void redo() throws CannotRedoException {
super.redo();
formatAndRoutesModel.addRoute(index, route, false);
formatAndRoutesModel.addPositionList(index, route, false);
}
}
@@ -33,33 +33,33 @@
* @author Christian Pesch
*/

class RemoveRoute extends AbstractUndoableEdit {
private UndoFormatAndRoutesModel formatAndRoutesModel;
private int index;
private BaseRoute route;
class RemovePositionList extends AbstractUndoableEdit {
private final UndoFormatAndRoutesModel formatAndRoutesModel;
private final int index;
private final BaseRoute route;

public RemoveRoute(UndoFormatAndRoutesModel formatAndRoutesModel, int index, BaseRoute route) {
public RemovePositionList(UndoFormatAndRoutesModel formatAndRoutesModel, int index, BaseRoute route) {
this.formatAndRoutesModel = formatAndRoutesModel;
this.index = index;
this.route = route;
}

public String getUndoPresentationName() {
return "remove-route-undo";
return "remove-position-list-undo";
}

public String getRedoPresentationName() {
return "remove-route-redo";
return "remove-position-list-redo";
}

public void undo() throws CannotUndoException {
super.undo();
formatAndRoutesModel.addRoute(index, route, false);
formatAndRoutesModel.addPositionList(index, route, false);
formatAndRoutesModel.setSelectedRoute(route);
}

public void redo() throws CannotRedoException {
super.redo();
formatAndRoutesModel.removeRoute(route, false);
formatAndRoutesModel.removePositionList(route, false);
}
}
@@ -0,0 +1,65 @@
/*
This file is part of RouteConverter.
RouteConverter is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
RouteConverter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RouteConverter; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Christian Pesch. All Rights Reserved.
*/

package slash.navigation.converter.gui.undo;

import slash.navigation.catalog.model.CategoryTreeNode;

import javax.swing.undo.AbstractUndoableEdit;
import javax.swing.undo.CannotRedoException;
import javax.swing.undo.CannotUndoException;
import javax.swing.undo.UndoableEdit;

/**
* Acts as a {@link UndoableEdit} for renaming the category of a {@link UndoCatalogModel}.
*
* @author Christian Pesch
*/

class RenameCategory extends AbstractUndoableEdit {
private UndoCatalogModel catalogModel;
private CategoryTreeNode category;
private String oldName, newName;

public RenameCategory(UndoCatalogModel catalogModel, CategoryTreeNode category, String oldName, String newName) {
this.catalogModel = catalogModel;
this.category = category;
this.oldName = oldName;
this.newName = newName;
}

public String getUndoPresentationName() {
return "rename-category-undo";
}

public String getRedoPresentationName() {
return "rename-category-redo";
}

public void undo() throws CannotUndoException {
super.undo();
catalogModel.rename(category, oldName, false);
}

public void redo() throws CannotRedoException {
super.redo();
catalogModel.rename(category, newName, false);
}
}
@@ -31,22 +31,22 @@
* @author Christian Pesch
*/

class RenameRoute extends AbstractUndoableEdit {
class RenamePositionList extends AbstractUndoableEdit {
private UndoFormatAndRoutesModel formatAndRoutesModel;
private String previousName, nextName;

public RenameRoute(UndoFormatAndRoutesModel formatAndRoutesModel, String previousName, String nextName) {
public RenamePositionList(UndoFormatAndRoutesModel formatAndRoutesModel, String previousName, String nextName) {
this.formatAndRoutesModel = formatAndRoutesModel;
this.previousName = previousName;
this.nextName = nextName;
}

public String getUndoPresentationName() {
return "rename-route-undo";
return "rename-position-list-undo";
}

public String getRedoPresentationName() {
return "rename-route-redo";
return "rename-position-list-redo";
}

public void undo() throws CannotUndoException {
@@ -0,0 +1,95 @@
/*
This file is part of RouteConverter.
RouteConverter is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
RouteConverter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with RouteConverter; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Copyright (C) 2007 Christian Pesch. All Rights Reserved.
*/

package slash.navigation.converter.gui.undo;

import slash.navigation.catalog.domain.Catalog;
import slash.navigation.catalog.model.CategoryTreeNode;
import slash.navigation.converter.gui.helper.RouteServiceOperator;
import slash.navigation.converter.gui.models.CatalogModel;
import slash.navigation.converter.gui.models.CatalogModelImpl;
import slash.navigation.gui.UndoManager;

import javax.swing.event.TreeModelListener;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;

/**
* Acts as a {@link TreeModel} for the categories and routes of a {@link Catalog}.
*
* @author Christian Pesch
*/

public class UndoCatalogModel implements CatalogModel {
private final CatalogModelImpl delegate;
private final UndoManager undoManager;

public UndoCatalogModel(UndoManager undoManager, CategoryTreeNode root, RouteServiceOperator operator) {
this.delegate = new CatalogModelImpl(root, operator);
this.undoManager = undoManager;
}

// TreeModel

public Object getRoot() {
return delegate.getRoot();
}

public Object getChild(Object parent, int index) {
return delegate.getChild(parent, index);
}

public int getChildCount(Object parent) {
return delegate.getChildCount(parent);
}

public boolean isLeaf(Object node) {
return delegate.isLeaf(node);
}

public void valueForPathChanged(TreePath path, Object newValue) {
delegate.valueForPathChanged(path, newValue);
}

public int getIndexOfChild(Object parent, Object child) {
return delegate.getIndexOfChild(parent, child);
}

public void addTreeModelListener(TreeModelListener l) {
delegate.addTreeModelListener(l);
}

public void removeTreeModelListener(TreeModelListener l) {
delegate.removeTreeModelListener(l);
}

// Undoable operations

public void rename(CategoryTreeNode category, String name) {
rename(category, name, true);
}

void rename(CategoryTreeNode category, String newName, boolean trackUndo) {
String oldName = category.getName();
delegate.rename(category, newName);
if (trackUndo)
undoManager.addEdit(new RenameCategory(this, category, oldName, newName));
}
}
@@ -140,35 +140,35 @@ public int getIndex(BaseRoute route) {
return delegate.getIndex(route);
}

public void renameRoute(String name) {
public void renamePositionList(String name) {
renameRoute(name, true);
}

public void renameRoute(String name, boolean trackUndo) {
String previousName = getSelectedRoute().getName();
delegate.renameRoute(name);
delegate.renamePositionList(name);
if (trackUndo)
undoManager.addEdit(new RenameRoute(this, previousName, name));
undoManager.addEdit(new RenamePositionList(this, previousName, name));
}

public void addRoute(int index, BaseRoute route) {
addRoute(index, route, true);
public void addPositionList(int index, BaseRoute route) {
addPositionList(index, route, true);
}

public void addRoute(int index, BaseRoute route, boolean trackUndo) {
delegate.addRoute(index, route);
public void addPositionList(int index, BaseRoute route, boolean trackUndo) {
delegate.addPositionList(index, route);
if (trackUndo)
undoManager.addEdit(new AddRoute(this, index, route));
undoManager.addEdit(new AddPositionList(this, index, route));
}

public void removeRoute(BaseRoute route) {
removeRoute(route, true);
public void removePositionList(BaseRoute route) {
removePositionList(route, true);
}

public void removeRoute(BaseRoute route, boolean trackUndo) {
public void removePositionList(BaseRoute route, boolean trackUndo) {
int index = getIndex(route);
delegate.removeRoute(route);
delegate.removePositionList(route);
if (trackUndo)
undoManager.addEdit(new RemoveRoute(this, index, route));
undoManager.addEdit(new RemovePositionList(this, index, route));
}
}
@@ -270,16 +270,16 @@ overall-descend=Overall descend:
new-position-name=موق جديدة
add-position-undo=Remove new positions
add-position-redo=Add positions
add-route-undo=Remove new position list
add-route-redo=Add position list
add-position-list-undo=Remove new position list
add-position-list-redo=Add position list
edit-position-undo=Undo editing of position
edit-position-redo=Redo editing of position
rename-route-undo=Undo renaming of position list
rename-route-redo=Redo renaming of position list
rename-position-list-undo=Undo renaming of position list
rename-position-list-redo=Redo renaming of position list
remove-position-undo=Add deleted positions
remove-position-redo=Remove positions
remove-route-undo=Add deleted position list
remove-route-redo=Remove position list
remove-position-list-undo=Add deleted position list
remove-position-list-redo=Remove position list
revert-position-undo=Reverse reversed position list
revert-position-redo=Reverse position list
top-position-undo=Move positions back
@@ -335,7 +335,7 @@ delete-selected-positions=حذف الموقع المحدد
delete-selected-positions-mnemonic=D
rename-title=تغير الأسم
rename-route-name-too-long=The ''{0}'' format allows just {1} characters.
rename-position-list-name-too-long=The ''{0}'' format allows just {1} characters.
login-title=تسجيل الدخول RouteCatalog
please-login=Please login to the RouteCatalog:
@@ -358,7 +358,7 @@ route-service-error=Error while operating on RouteConverter service:\n{0}\n{1}
add-category-label=Please type the name of the new category below ''{0}'':
rename-category-label=Please type the new name for ''{0}'':
rename-route-label=Please type the new description for route ''{0}'':
rename-position-list-label=Please type the new description for route ''{0}'':
add-route-by-file=إضافة ملف
add-route-by-url=إضافة رابط
@@ -273,16 +273,16 @@ overall-descend=Celkový sestup:
new-position-name=Nová pozice
add-position-undo=Odstranit nové pozice
add-position-redo=Vložit dříve odstraněné pozice
add-route-undo=Odstranit nový seznam pozicí
add-route-redo=Vložit dříve odstraněný seznam pozicí
add-position-list-undo=Odstranit nový seznam pozicí
add-position-list-redo=Vložit dříve odstraněný seznam pozicí
edit-position-undo=Zrušit poslední úpravu pozice
edit-position-redo=Obnovit poslední úpravu pozice
rename-route-undo=Obnovit původní název seznamu pozicí
rename-route-redo=Obnovit změněný název seznamu pozicí
rename-position-list-undo=Obnovit původní název seznamu pozicí
rename-position-list-redo=Obnovit změněný název seznamu pozicí
remove-position-undo=Vložit smazané pozice
remove-position-redo=Odstranit pozice
remove-route-undo=Vložit smazaný seznam pozicí
remove-route-redo=Odstranit seznam pozicí
remove-position-list-undo=Vložit smazaný seznam pozicí
remove-position-list-redo=Odstranit seznam pozicí
revert-position-undo=Zrušit obrácení seznamu pozicí
revert-position-redo=Obrátit seznam pozicí
top-position-undo=Přesunutí pozice nahoru
@@ -338,7 +338,7 @@ delete-selected-positions=Vymazat označené pozice
delete-selected-positions-mnemonic=V

rename-title=Přejmenování seznamu pozic
rename-route-name-too-long=Formát ''{0}'' povoluje jen {1} znaků.
rename-position-list-name-too-long=Formát ''{0}'' povoluje jen {1} znaků.

login-title=Přihlásení do RouteCatalogu
please-login=Prosím, přihlašte se do RouteCatalogu:
@@ -361,7 +361,7 @@ route-service-error=Chyba při komunikaci se službou RouteConvertera:\n{0}\n{1}

add-category-label=Prosím, napište jméno nové kategorie pod ''{0}'':
rename-category-label=Prosím, napište nové jméno pro ''{0}'':
rename-route-label=Prosím, napište nový popis pro trasu ''{0}'':
rename-position-list-label=Prosím, napište nový popis pro trasu ''{0}'':

add-route-by-file=Přidát soubor
add-route-by-url=Přidát URL
@@ -271,16 +271,16 @@ overall-descend=Ukupan pad:
new-position-name=Nova pozicije
add-position-undo=Obrisati novu poziciju
add-position-redo=Dodati poziciju
add-route-undo=Ukloni novu listu pozicija
add-route-redo=Dodaj listu pozicija
add-position-list-undo=Ukloni novu listu pozicija
add-position-list-redo=Dodaj listu pozicija
edit-position-undo=Vratiti natrag izmene pozicija
edit-position-redo=Ponoviti izmene pozicija
rename-route-undo=Vrati promenu naziva liste pozicija
rename-route-redo=Ponovi promenu naziva liste pozicija
rename-position-list-undo=Vrati promenu naziva liste pozicija
rename-position-list-redo=Ponovi promenu naziva liste pozicija
remove-position-undo=Dodati obrisane pozicije
remove-position-redo=Obrisati pozicije
remove-route-undo=Dodaj obrisanu listu pozicija
remove-route-redo=Ukloni listu pozicija
remove-position-list-undo=Dodaj obrisanu listu pozicija
remove-position-list-redo=Ukloni listu pozicija
revert-position-undo=Vratiti izmenjen redosled liste pozicija
revert-position-redo=Izmeniti redosled liste pozicija
top-position-undo=Pomjeriti poziciju natrag
@@ -336,7 +336,7 @@ delete-selected-positions=Obriši označene pozicije
delete-selected-positions-mnemonic=O

rename-title=Preimenuj listu pozicija
rename-route-name-too-long=''{0}'' format dozvoljava samo {1} karaktere.
rename-position-list-name-too-long=''{0}'' format dozvoljava samo {1} karaktere.

login-title=Prijavi se na RouteCatalog
please-login=Molimo prijavite se na RouteCatalog:
@@ -359,7 +359,7 @@ route-service-error=Greška prilikom rada sa RouteConverter servisima:\n{0}\n{1}

add-category-label=Molimo unesite naziv nove kategorije ispod ''{0}'':
rename-category-label=Molimo unesite novi naziv za ''{0}'':
rename-route-label=Molimo unestie novi opis za rutu ''{0}'':
rename-position-list-label=Molimo unestie novi opis za rutu ''{0}'':

add-route-by-file=Dodaj datoteku
add-route-by-url=Dodaj URL
@@ -273,16 +273,16 @@ overall-descend=Celkový zostup:
new-position-name=Nová pozícia
add-position-undo=Odstráň nové pozície
add-position-redo=Vlož predtým odstránené pozície
add-route-undo=Odstráň nový zoznam pozícií
add-route-redo=Vlož predtým odstránený zoznam pozícií
add-position-list-undo=Odstráň nový zoznam pozícií
add-position-list-redo=Vlož predtým odstránený zoznam pozícií
edit-position-undo=Zruš poslednú úpravu pozície
edit-position-redo=Obnov poslednú úpravu pozície
rename-route-undo=Obnov pôvodný názov zoznamu pozícií
rename-route-redo=Obnov zmenený názov zoznamu pozícií
rename-position-list-undo=Obnov pôvodný názov zoznamu pozícií
rename-position-list-redo=Obnov zmenený názov zoznamu pozícií
remove-position-undo=Vlož vymazané pozície
remove-position-redo=Odstráň pozície
remove-route-undo=Vlož vymazaný zoznam pozícií
remove-route-redo=Odstráň zoznam pozícií
remove-position-list-undo=Vlož vymazaný zoznam pozícií
remove-position-list-redo=Odstráň zoznam pozícií
revert-position-undo=Zruš otočenie zoznamu pozícií
revert-position-redo=Otoč zoznam pozícií
top-position-undo=Presuň pozíciu nahor
@@ -338,7 +338,7 @@ delete-selected-positions=Vymaž označené pozície
delete-selected-positions-mnemonic=V

rename-title=Premenovanie zoznamu pozícií
rename-route-name-too-long=Formát ''{0}'' dovoľuje iba {1} znakov.
rename-position-list-name-too-long=Formát ''{0}'' dovoľuje iba {1} znakov.

login-title=Prihlásenie do RouteCatalogu
please-login=Prosím prihláste sa do RouteCatalogu:
@@ -361,7 +361,7 @@ route-service-error=Chyba pri komunikácii so službou RouteConvertera:\n{0}\n{1

add-category-label=Prosím napíšte meno novej kategórie pod ''{0}'':
rename-category-label=Prosím napíšte nové meno pre ''{0}'':
rename-route-label=Prosím napíšte nový popis pre trasu ''{0}'':
rename-position-list-label=Prosím napíšte nový popis pre trasu ''{0}'':

add-route-by-file=Pridaj súbor
add-route-by-url=Pridaj URL
@@ -271,16 +271,16 @@ overall-descend=Ukupan pad:
new-position-name=Nova pozicije
add-position-undo=Obrisati novu poziciju
add-position-redo=Dodati poziciju
add-route-undo=Ukloni novu listu pozicija
add-route-redo=Dodaj listu pozicija
add-position-list-undo=Ukloni novu listu pozicija
add-position-list-redo=Dodaj listu pozicija
edit-position-undo=Vratiti nazad izmene pozicija
edit-position-redo=Ponoviti izmene pozicija
rename-route-undo=Vrati promenu naziva liste pozicija
rename-route-redo=Ponovi promenu naziva liste pozicija
rename-position-list-undo=Vrati promenu naziva liste pozicija
rename-position-list-redo=Ponovi promenu naziva liste pozicija
remove-position-undo=Dodati obrisane pozicije
remove-position-redo=Obrisati pozicije
remove-route-undo=Dodaj obrisanu listu pozicija
remove-route-redo=Ukloni listu pozicija
remove-position-list-undo=Dodaj obrisanu listu pozicija
remove-position-list-redo=Ukloni listu pozicija
revert-position-undo=Vratiti izmenjen redosled liste pozicija
revert-position-redo=Izmeniti redosled liste pozicija
top-position-undo=Pomeriti poziciju nazad
@@ -336,7 +336,7 @@ delete-selected-positions=Obriši označene pozicije
delete-selected-positions-mnemonic=O

rename-title=Preimenuj listu pozicija
rename-route-name-too-long=''{0}'' format dozvoljava samo {1} karaktere.
rename-position-list-name-too-long=''{0}'' format dozvoljava samo {1} karaktere.

login-title=Prijavi se na RouteCatalog
please-login=Molimo prijavite se na RouteCatalog:
@@ -359,7 +359,7 @@ route-service-error=Greška prilikom rada sa RouteConverter servisima:\n{0}\n{1}

add-category-label=Molimo unesite naziv nove kategorije ispod ''{0}'':
rename-category-label=Molimo unesite novi naziv za ''{0}'':
rename-route-label=Molimo unestie novi opis za rutu ''{0}'':
rename-position-list-label=Molimo unestie novi opis za rutu ''{0}'':

add-route-by-file=Dodaj datoteku
add-route-by-url=Dodaj URL
@@ -282,16 +282,16 @@ overall-descend=总体下降:
new-position-name=新建点位
add-position-undo=删除新位置
add-position-redo=添加位置
add-route-undo=删除新的位置列表
add-route-redo=添加位置列表
add-position-list-undo=删除新的位置列表
add-position-list-redo=添加位置列表
edit-position-undo=撤消编辑的位置
edit-position-redo=重做编辑的位置
rename-route-undo=撤消重命名位置列表
rename-route-redo=重做重命名位置列表
rename-position-list-undo=撤消重命名位置列表
rename-position-list-redo=重做重命名位置列表
remove-position-undo=添加删除位置
remove-position-redo=删除位置
remove-route-undo=添加删除位置列表
remove-route-redo=删除位置列表
remove-position-list-undo=添加删除位置列表
remove-position-list-redo=删除位置列表
revert-position-undo=逆向反向的列表
revert-position-redo=逆向位置列表
top-position-undo=向后移动位置
@@ -347,7 +347,7 @@ delete-selected-positions=删除所选的位置
delete-selected-positions-mnemonic=D

rename-title=重命名位置列表
rename-route-name-too-long=The ''{0}'' format allows just {1} characters.
rename-position-list-name-too-long=The ''{0}'' format allows just {1} characters.

login-title=登录RouteConverter
please-login=请登陆到RouteConverter:
@@ -371,7 +371,7 @@ route-service-error=RouteConverter服务运行错误:\n{0}\n{1}

add-category-label=请输入下面的新的类别名称 ''{0}'':
rename-category-label=请输入新名称 ''{0}'':
rename-route-label=请输入新的路线说明 ''{0}'':
rename-position-list-label=请输入新的路线说明 ''{0}'':

add-route-by-file=添加文件
add-route-by-url=添加URL
@@ -308,16 +308,18 @@ overall-descend=Overall descend:
new-position-name=New position
add-position-undo=Remove new positions
add-position-redo=Add positions
add-route-undo=Remove new position list
add-route-redo=Add position list
add-position-list-undo=Remove new position list
add-position-list-redo=Add position list
edit-position-undo=Undo editing of position
edit-position-redo=Redo editing of position
rename-route-undo=Undo renaming of position list
rename-route-redo=Redo renaming of position list
rename-category-undo=Undo renaming of category
rename-category-redo=Redo renaming of category
rename-position-list-undo=Undo renaming of position list
rename-position-list-redo=Redo renaming of position list
remove-position-undo=Add deleted positions
remove-position-redo=Remove positions
remove-route-undo=Add deleted position list
remove-route-redo=Remove position list
remove-position-list-undo=Add deleted position list
remove-position-list-redo=Remove position list
revert-position-undo=Reverse reversed position list
revert-position-redo=Reverse position list
top-position-undo=Move positions back
@@ -373,7 +375,7 @@ delete-selected-positions=Delete selected positions
delete-selected-positions-mnemonic=D
rename-title=Rename position list
rename-route-name-too-long=The ''{0}'' format allows just {1} characters.
rename-position-list-name-too-long=The ''{0}'' format allows just {1} characters.
login-title=Login to RouteConverter service
please-login=Please login to the RouteConverter service:
@@ -398,7 +400,7 @@ route-service-error=Error while operating on RouteConverter service:\n{0}\n{1}
add-category-label=Please type the name of the new category below ''{0}'':
rename-category-label=Please type the new name for ''{0}'':
rename-route-label=Please type the new description for route ''{0}'':
rename-position-list-label=Please type the new description for route ''{0}'':
add-route-by-file=Add file
add-route-by-url=Add URL
@@ -277,16 +277,18 @@ overall-descend=Gesamtgef
new-position-name=Neue Position
add-position-undo=Entferne neue Positionen
add-position-redo=Füge Positionen hinzu
add-route-undo=Entferne neue Positionsliste
add-route-redo=Füge Positionsliste hinzu
add-position-list-undo=Entferne neue Positionsliste
add-position-list-redo=Füge Positionsliste hinzu
edit-position-undo=Bearbeiten der Position rückgängig
edit-position-redo=Stelle Bearbeiten der Position wieder her
rename-route-undo=Benennen der Positionsliste rückgängig
rename-route-redo=Stelle Benennen der Positionsliste wieder her
rename-category-undo=Benennen der Kategorie rückgängig
rename-category-redo=Stelle Benennen der Kategorie wieder her
rename-position-list-undo=Benennen der Positionsliste rückgängig
rename-position-list-redo=Stelle Benennen der Positionsliste wieder her
remove-position-undo=Füge gelöschte Positionen hinzu
remove-position-redo=Entferne Positionen
remove-route-undo=Füge gelöschte Positionsliste hinzu
remove-route-redo=Entferne Positionsliste
remove-position-list-undo=Füge gelöschte Positionsliste hinzu
remove-position-list-redo=Entferne Positionsliste
revert-position-undo=Kehre umgekehrte Positionsliste um
revert-position-redo=Kehre Positionsliste um
top-position-undo=Bewege Positionen zurück
@@ -342,7 +344,7 @@ delete-selected-positions=L
delete-selected-positions-mnemonic=L

rename-title=Benenne Positionsliste um
rename-route-name-too-long=Das ''{0}'' Format erlaubt nur {1} Zeichen.
rename-position-list-name-too-long=Das ''{0}'' Format erlaubt nur {1} Zeichen.

login-title=Anmelden beim RouteConverter Dienst
please-login=Bitte melde Dich beim RouteConverter Dienst an:
@@ -367,7 +369,7 @@ route-service-error=Fehler beim Zugriff auf den RouteConverter Dienst:\n{0}\n{1}

add-category-label=Bitte gib den Namen für die neue Kategorie unterhalb von ''{0}'' ein:
rename-category-label=Bitte gibt den neuen Namen für ''{0}'' ein:
rename-route-label=Bitte gib die neue Beschreibung für die Route ''{0}'' ein:
rename-position-list-label=Bitte gib die neue Beschreibung für die Route ''{0}'' ein:

add-route-by-file=Datei hinzufügen
add-route-by-url=URL hinzufügen
@@ -272,16 +272,16 @@ overall-descend=Descendente:
new-position-name=Nuevo punto
add-position-undo=Eliminar los puntos nuevos
add-position-redo=Añadir puntos nuevos
add-route-undo=Eliminar nueva lista de puntos
add-route-redo=Añadir lista de puntos
add-position-list-undo=Eliminar nueva lista de puntos
add-position-list-redo=Añadir lista de puntos
edit-position-undo=Deshacer la edición de punto
edit-position-redo=Rehacer la edición de punto
rename-route-undo=Deshacer renombrado de lista de puntos
rename-route-redo=Rehacer renombrado de lista de puntos
rename-position-list-undo=Deshacer renombrado de lista de puntos
rename-position-list-redo=Rehacer renombrado de lista de puntos
remove-position-undo=Añadir puntos eliminados
remove-position-redo=Eliminar puntos
remove-route-undo=Añadir lista de puntos eliminada
remove-route-redo=Eliminar lista de puntos
remove-position-list-undo=Añadir lista de puntos eliminada
remove-position-list-redo=Eliminar lista de puntos
revert-position-undo=Invertir la lista de puntos invertida
revert-position-redo=Invertir la lista de puntos
top-position-undo=Mover puntos al final
@@ -337,7 +337,7 @@ delete-selected-positions=Eliminar los puntos seleccionados
delete-selected-positions-mnemonic=E

rename-title=Renombrar la lista de puntos
rename-route-name-too-long=El formato ''{0}'' sólo permite {1} carácteres.
rename-position-list-name-too-long=El formato ''{0}'' sólo permite {1} carácteres.

login-title=Entrar en RouteCatalog
please-login=Por favor, identifíquese en RouteCatalog:
@@ -360,7 +360,7 @@ route-service-error=Error al operar en el servicio RouteConverter:\n{0}\n{1}

add-category-label=Por favor, indique el nombre de una nueva categoría en ''{0}'':
rename-category-label=Por favor, indique un nuevo nombre para ''{0}'':
rename-route-label=Por favor, indique una nueva descripción para la ruta ''{0}'':
rename-position-list-label=Por favor, indique una nueva descripción para la ruta ''{0}'':

add-route-by-file=Añadir archivo
add-route-by-url=Añadir URL
@@ -271,16 +271,16 @@ overall-descend=Descente:
new-position-name=Nouveau point
add-position-undo=Enlever les nouveaux points
add-position-redo=Ajouter les points enlevés
add-route-undo=Supprimer la nouvelle liste de points
add-route-redo=Ajouter une liste de points
add-position-list-undo=Supprimer la nouvelle liste de points
add-position-list-redo=Ajouter une liste de points
edit-position-undo=Annuler l'édition du point
edit-position-redo=Répéter l'édition du point
rename-route-undo=Annuler le renommage de la liste de points
rename-route-redo=Rétablir le renommage de la liste de points
rename-position-list-undo=Annuler le renommage de la liste de points
rename-position-list-redo=Rétablir le renommage de la liste de points
remove-position-undo=Ajouter les points supprimés
remove-position-redo=Enlever les points ajoutés
remove-route-undo=Annuler la suppression de la liste de points
remove-route-redo=Rétablir la suppression de la liste de points
remove-position-list-undo=Annuler la suppression de la liste de points
remove-position-list-redo=Rétablir la suppression de la liste de points
revert-position-undo=Inverser la liste de points inversés
revert-position-redo=Inverser la liste de points
top-position-undo=Remettre les points
@@ -336,7 +336,7 @@ delete-selected-positions=Supprimer les points s
delete-selected-positions-mnemonic=p
rename-title=Renommer la liste de points
rename-route-name-too-long=Le format ''{0}'' n'autorise que {1} caractères.
rename-position-list-name-too-long=Le format ''{0}'' n'autorise que {1} caractères.

please-select=Merci de sélectionner le service vers lequel l'itinéraire doit être uploadé:
routeservice-colon=Service:
@@ -365,7 +365,7 @@ route-service-error=Erreur de connexion au service RouteConverter:\n{0}\n{1}
add-category-label=SVP, entrez le nom de la nouvelle catégorie ci-dessous ''{0}'':
rename-category-label=SVP, entrez le nouveau nom pour ''{0}'':
rename-route-label=SVP, entrez la nouvelle description pour la route ''{0}'':
rename-position-list-label=SVP, entrez la nouvelle description pour la route ''{0}'':
add-route-by-file=Ajouter fichier
add-route-by-url=Ajouter URL
@@ -270,16 +270,16 @@ overall-descend=Discendente:
new-position-name=Nuovo punto
add-position-undo=Rimuovi punto
add-position-redo=Aggiungi punto
add-route-undo=Rimuovi nuova lista
add-route-redo=Aggiungi lista
add-position-list-undo=Rimuovi nuova lista
add-position-list-redo=Aggiungi lista
edit-position-undo=Modifica punto
edit-position-redo=Ripeti modifica del punto
rename-route-undo=Rinomina lista
rename-route-redo=Ripeti rinomina lista
rename-position-list-undo=Rinomina lista
rename-position-list-redo=Ripeti rinomina lista
remove-position-undo=Cancella punto
remove-position-redo=Rimuovi punto
remove-route-undo=Rimuovi percorso
remove-route-redo=Aggiungi percorso
remove-position-list-undo=Rimuovi percorso
remove-position-list-redo=Aggiungi percorso
revert-position-undo=Inverti lista
revert-position-redo=Inverti lista rovesciata
top-position-undo=Sposta indietro
@@ -335,7 +335,7 @@ delete-selected-positions=Elimina i punti selezionati
delete-selected-positions-mnemonic=D

rename-title=Rinomina lista
rename-route-name-too-long=Il ''{0}'' permette solo {1} caratteri.
rename-position-list-name-too-long=Il ''{0}'' permette solo {1} caratteri.

login-title=Accedi al servizio RouteConverter
please-login=Effettua il login per accedere al servizio RouteConverter:
@@ -358,7 +358,7 @@ route-service-error=Errore durante il funzionamento di RouteConverter:\n{0}\n{1}

add-category-label=Inserire il nome della nuova categoria ''{0}'':
rename-category-label=Digitare il nuovo nome per ''{0}'':
rename-route-label=digitare la nuova descrizione per il percorso ''{0}'':
rename-position-list-label=digitare la nuova descrizione per il percorso ''{0}'':

add-route-by-file=Aggiungi file
add-route-by-url=Aggiungi indirizzo
@@ -272,16 +272,16 @@ overall-descend=Totale daling:
new-position-name=Nieuwe positie
add-position-undo=Verwijder nieuwe posities
add-position-redo=Voeg posities toe
add-route-undo=Verwijder nieuwe positielijst
add-route-redo=Voeg positielijst toe
add-position-list-undo=Verwijder nieuwe positielijst
add-position-list-redo=Voeg positielijst toe
edit-position-undo=Maak positie wijzigingen ongedaan
edit-position-redo=Voer positie wijzigingen opnieuw door
rename-route-undo=Maak herbenoemen van positielijst ongedaan
rename-route-redo=Pas herbenoemen van positielijst opnieuw toe
rename-position-list-undo=Maak herbenoemen van positielijst ongedaan
rename-position-list-redo=Pas herbenoemen van positielijst opnieuw toe
remove-position-undo=Voeg gewiste posities toe
remove-position-redo=Verwijder posities
remove-route-undo=Voeg verwijderde positielijst opnieuw toe
remove-route-redo=Verwijder positielijst
remove-position-list-undo=Voeg verwijderde positielijst opnieuw toe
remove-position-list-redo=Verwijder positielijst
revert-position-undo=Herstel de omgekeerde positielijst
revert-position-redo=Keer de positielijst om
top-position-undo=Zet posities terug
@@ -337,7 +337,7 @@ delete-selected-positions=Verwijder de geselecteerde posities
delete-selected-positions-mnemonic=V
rename-title=Hernoem positielijst
rename-route-name-too-long=Het ''{0}'' formaat laat enkel {1} karakters toe.
rename-position-list-name-too-long=Het ''{0}'' formaat laat enkel {1} karakters toe.
login-title=Aanmelden bij RouteCatalog
please-login=Gelieve in de RouteCatalogus in te loggen:
@@ -360,7 +360,7 @@ route-service-error=Fout tijdens het werken met de RouteConverter service:\n{0}\
add-category-label=Geef de naam van de nieuwe categorie aub ''{0}'':
rename-category-label=Geef de nieuwe naam voor ''{0}'':
rename-route-label=Geef de nieuwe beschrijving voor de route ''{0}'':
rename-position-list-label=Geef de nieuwe beschrijving voor de route ''{0}'':
add-route-by-file=Voeg bestand toe
add-route-by-url=Voeg URL toe