} else {
hasNonlocal = true;
}
}
}
GPXSettingsPanel panel = new GPXSettingsPanel(layers.get(0).getName(), hasLocal, hasNonlocal);
JScrollPane scrollpane = GuiHelper.embedInVerticalScrollPane(panel);
scrollpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
int screenHeight = Toolkit.getDefaultToolkit().getScreenSize().height;
if (screenHeight < 700) {
// to fit on screen 800x600
scrollpane.setPreferredSize(new Dimension(panel.getPreferredSize().width, Math.min(panel.getPreferredSize().height, 450)));
}
int answer = JOptionPane.showConfirmDialog(Main.parent, scrollpane, tr("Customize track drawing"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
if (answer == JOptionPane.CANCEL_OPTION || answer == JOptionPane.CLOSED_OPTION) {
return;
}
for (Layer layer : layers) {
// save preferences for all layers
boolean f = false;
if (layer instanceof GpxLayer) {
f = ((GpxLayer) layer).isLocalFile();
}
panel.savePreferences(layer.getName(), f);
}
Main.map.repaint();
}