source: josm/trunk/test/functional/org/openstreetmap/josm/io/UploadStrategySelectionPanelTest.java@ 9704

Last change on this file since 9704 was 8514, checked in by Don-vip, 9 years ago

checkstyle: various checks

  • Property svn:eol-style set to native
File size: 2.2 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.io;
3
4import java.awt.BorderLayout;
5import java.awt.FlowLayout;
6import java.awt.event.ActionEvent;
7import java.awt.event.ActionListener;
8
9import javax.swing.JFrame;
10import javax.swing.JLabel;
11import javax.swing.JPanel;
12import javax.swing.JTextField;
13
14import org.junit.Ignore;
15import org.openstreetmap.josm.Main;
16import org.openstreetmap.josm.gui.io.UploadStrategySelectionPanel;
17import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
18
19@Ignore
20public class UploadStrategySelectionPanelTest extends JFrame {
21
22 private UploadStrategySelectionPanel uploadStrategySelectionPanel;
23
24 protected void build() {
25 getContentPane().setLayout(new BorderLayout());
26 uploadStrategySelectionPanel = new UploadStrategySelectionPanel();
27 getContentPane().add(uploadStrategySelectionPanel, BorderLayout.CENTER);
28 getContentPane().add(buildControlPanel(), BorderLayout.SOUTH);
29 setSize(400, 400);
30 }
31
32 protected JPanel buildControlPanel() {
33 JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
34 pnl.add(new JLabel("Num objects:"));
35 final JTextField tf;
36 pnl.add(tf = new JTextField(8));
37 tf.addActionListener(
38 new ActionListener() {
39 public void actionPerformed(ActionEvent arg0) {
40 int n = 0;
41 try {
42 n = Integer.parseInt(tf.getText());
43 } catch (NumberFormatException e) {
44 Main.error(e);
45 return;
46 }
47 uploadStrategySelectionPanel.setNumUploadedObjects(n);
48 }
49 }
50 );
51 return pnl;
52 }
53
54 /**
55 * Constructs a new {@code UploadStrategySelectionPanelTest}.
56 */
57 public UploadStrategySelectionPanelTest() {
58 build();
59 uploadStrategySelectionPanel.setNumUploadedObjects(51000);
60 }
61
62 public static void main(String[] args) throws OsmApiInitializationException, OsmTransferCanceledException {
63 OsmApi.getOsmApi().initialize(NullProgressMonitor.INSTANCE);
64 new UploadStrategySelectionPanelTest().setVisible(true);
65 }
66}
Note: See TracBrowser for help on using the repository browser.