|
1 | 1 | /* |
| 2 | + * Copyright (c) 1998-2025 John Caron and University Corporation for Atmospheric Research/Unidata |
| 3 | + * See LICENSE for license information. |
| 4 | + * |
2 | 5 | * Created by JFormDesigner on Thu Nov 15 14:02:02 MST 2012 |
3 | 6 | */ |
4 | 7 |
|
5 | 8 | package ucar.nc2.ui.dialog; |
6 | 9 |
|
7 | | -import ucar.nc2.NetcdfFileWriter; |
| 10 | +import java.util.Arrays; |
8 | 11 | import ucar.nc2.util.ListenerManager; |
9 | 12 | import ucar.nc2.write.Nc4Chunking; |
10 | 13 | import javax.swing.*; |
@@ -44,8 +47,8 @@ public void setOutputFilename(String filename) { |
44 | 47 | location = location.substring(0, pos); |
45 | 48 |
|
46 | 49 | // change suffix |
47 | | - NetcdfFileWriter.Version version = (NetcdfFileWriter.Version) netcdfVersion.getSelectedItem(); |
48 | | - String suffix = (version == null) ? ".nc" : version.getSuffix(); |
| 50 | + NetcdfFileFormat version = (NetcdfFileFormat) netcdfVersion.getSelectedItem(); |
| 51 | + String suffix = (version != null && version.isNetcdf4Format()) ? ".nc4" : ".nc"; |
49 | 52 | if (filename.endsWith(".nc") && suffix.equals(".nc")) |
50 | 53 | suffix = ".sub.nc"; |
51 | 54 | location += suffix; |
@@ -105,10 +108,11 @@ private void initComponents() { |
105 | 108 | label1 = new JLabel(); |
106 | 109 | outputFilename = new JTextField(); |
107 | 110 | label2 = new JLabel(); |
108 | | - netcdfVersion = new JComboBox(NetcdfFileWriter.Version.values()); |
| 111 | + netcdfVersion = new JComboBox<>( |
| 112 | + Arrays.stream(NetcdfFileFormat.values()).filter(format -> format != NetcdfFileFormat.INVALID).toArray()); |
109 | 113 | panel1 = new JPanel(); |
110 | 114 | label3 = new JLabel(); |
111 | | - chunking = new JComboBox(Nc4Chunking.Strategy.values()); |
| 115 | + chunking = new JComboBox<>(Nc4Chunking.Strategy.values()); |
112 | 116 | deflate = new JCheckBox(); |
113 | 117 | shuffle = new JCheckBox(); |
114 | 118 | buttonBar = new JPanel(); |
|
0 commit comments