| 1 | /** |
| 2 | * Copyright (C) 2015-2017 Paul Fretwell - aka 'Footleg' ([email protected]) |
| 3 | * |
| 4 | * This file is part of Cave Converter. |
| 5 | * |
| 6 | * Cave Converter is free software: you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation, either version 3 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * Cave Converter is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with Cave Converter. If not, see <http://www.gnu.org/licenses/>. |
| 18 | */ |
| 19 | package footleg.cavesurvey.gui.swing; |
| 20 | |
| 21 | import java.awt.Font; |
| 22 | |
| 23 | import footleg.cavesurvey.converter.CaveConverter; |
| 24 | import footleg.cavesurvey.converter.Logger; |
| 25 | import footleg.cavesurvey.converter.CaveConverter.SurveyDataOutputFormats; |
| 26 | |
| 27 | /** |
| 28 | * Component to display and hold cave survey data exported from the cave data model. |
| 29 | * |
| 30 | * @author Footleg |
| 31 | * @version 2017.01.10 (ISO 8601 YYYY.MM.DD) |
| 32 | * @since 1.7 (The Java version used) |
| 33 | * |
| 34 | * @to.do |
| 35 | * TODO Allow data to be reused as input data to build a new cave model. |
| 36 | */ |
| 37 | @SuppressWarnings("serial") |
| 38 | public class ExportDataComponent extends SurveyDatafileTabPane { |
| 39 | private CaveConverter.SurveyDataOutputFormats format; |
| 40 | |
| 41 | public ExportDataComponent(Font font, Logger logger, SurveyDataOutputFormats dataFormat) { |
| 42 | super(font, logger); |
| 43 | |
| 44 | format = dataFormat; |
| 45 | //Set file filter appropriate to file format |
| 46 | if ( format == SurveyDataOutputFormats.Survex ) { |
| 47 | fileSaveDialog.setFileFilter( survexFileFilter ); |
| 48 | } |
| 49 | else if ( format == SurveyDataOutputFormats.Toporobot ) { |
| 50 | fileSaveDialog.setFileFilter( toporobotFileFilter ); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * @return the format |
| 56 | */ |
| 57 | public CaveConverter.SurveyDataOutputFormats getFormat() { |
| 58 | return format; |
| 59 | } |
| 60 | |
| 61 | } |