Package slash.navigation.base

Examples of slash.navigation.base.NavigationFormat


        File[] selected = chooser.getSelectedFiles();
        if (selected == null || selected.length == 0)
            return;

        NavigationFormat selectedFormat = getSelectedFormat(chooser.getFileFilter());
        setReadFormatFileFilterPreference(selectedFormat);
        prepareForNewPositionList();

        List<URL> urls = toUrls(selected);
        List<NavigationFormat> formats = selectedFormat != null ?
View Full Code Here


                    });

                    final ParserResult result = parser.read(url, formats);
                    if (result.isSuccessful()) {
                        log.info("Opened: " + path);
                        final NavigationFormat format = result.getFormat();
                        countRead(format);
                        if (!checkReadFormat(format))
                            return;
                        invokeLater(new Runnable() {
                            public void run() {
View Full Code Here

        File[] selected = chooser.getSelectedFiles();
        if (selected == null || selected.length == 0)
            return;

        NavigationFormat selectedFormat = getSelectedFormat(chooser.getFileFilter());
        setReadFormatFileFilterPreference(selectedFormat);

        appendPositionList(selectedRow, reverse(toUrls(selected)));
    }
View Full Code Here

        File selected = chooser.getSelectedFile();
        if (selected == null || selected.getName().length() == 0)
            return;

        NavigationFormat selectedFormat = getSelectedFormat(chooser.getFileFilter());
        if (selectedFormat == null)
            selectedFormat = formatAndRoutesModel.getFormat();
        setWriteFormatFileFilterPreference(selectedFormat);
        saveFile(selected, selectedFormat, true, true, !formatAndRoutesModel.getFormat().equals(selectedFormat));
    }
View Full Code Here

        File selected = chooser.getSelectedFile();
        if (selected == null || selected.getName().length() == 0)
            return;

        NavigationFormat selectedFormat = getSelectedFormat(chooser.getFileFilter());
        if (selectedFormat == null)
            selectedFormat = formatAndRoutesModel.getFormat();
        setWriteFormatFileFilterPreference(selectedFormat);
        saveFile(selected, selectedFormat, false, true, !formatAndRoutesModel.getFormat().equals(selectedFormat));
    }
View Full Code Here

        setWriteFormatFileFilterPreference(selectedFormat);
        saveFile(selected, selectedFormat, false, true, !formatAndRoutesModel.getFormat().equals(selectedFormat));
    }

    private NavigationFormat getSelectedFormat(FileFilter fileFilter) {
        NavigationFormat result = null;
        if (fileFilter instanceof NavigationFormatFileFilter)
            result = ((NavigationFormatFileFilter) fileFilter).getFormat();
        return result;
    }
View Full Code Here

        actionManager.enable("undo", undoManager.canUndo());
        actionManager.enable("redo", undoManager.canRedo());
    }

    private void handleRoutesUpdate() {
        NavigationFormat format = formatAndRoutesModel.getFormat();
        boolean supportsMultipleRoutes = format instanceof MultipleRoutesFormat;
        boolean existsARoute = formatAndRoutesModel.getSize() > 0;
        boolean existsMoreThanOneRoute = formatAndRoutesModel.getSize() > 1;
        boolean existsAPosition = getPositionsModel().getRowCount() > 0;
        boolean existsMoreThanOnePosition = getPositionsModel().getRowCount() > 1;
View Full Code Here

    }

    private File createSelectedTarget() {
        File target = new File(urlModel.getString());
        target = findExistingPath(target);
        NavigationFormat format = formatAndRoutesModel.getFormat();
        File path = target != null ? target : new File(preferences.get(WRITE_PATH_PREFERENCE + format.getClass().getName(), ""));
        path = findExistingPath(path);
        if (path == null)
            path = new File("");

        String fileName = path.getName();
        //noinspection ConstantConditions
        if (format instanceof GoPal3RouteFormat)
            fileName = createGoPalFileName(fileName);
        return new File(calculateConvertFileName(new File(path.getParentFile(), fileName), "", format.getMaximumFileNameLength()));
    }
View Full Code Here

                if (fromIndex == 0 && toIndex == 0)
                    break;

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

            final int selectedRow = max(selectedRows[selectedRows.length - 1] - 1, 0);
            invokeLater(new Runnable() {
View Full Code Here

        this.formatAndRoutesModel = formatAndRoutesModel;
    }

    @SuppressWarnings("unchecked")
    public void run() {
        NavigationFormat format = formatAndRoutesModel.getFormat();
        BaseRoute route = format.createRoute((RouteCharacteristics) formatAndRoutesModel.getCharacteristicsModel().getSelectedItem(),
                MessageFormat.format(RouteConverter.getBundle().getString("new-positionlist-name"), formatAndRoutesModel.getSize() + 1),
                new ArrayList<NavigationPosition>());
        formatAndRoutesModel.addPositionList(formatAndRoutesModel.getSize(), route);
        formatAndRoutesModel.setSelectedItem(route);
    }
View Full Code Here

TOP

Related Classes of slash.navigation.base.NavigationFormat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.