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

Last change on this file since 7937 was 7937, checked in by bastiK, 9 years ago

add subversion property svn:eol=native

  • 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
33 protected JPanel buildControlPanel() {
34 JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
35 pnl.add(new JLabel("Num objects:"));
36 final JTextField tf;
37 pnl.add(tf = new JTextField(8));
38 tf.addActionListener(
39 new ActionListener() {
40 public void actionPerformed(ActionEvent arg0) {
41 int n = 0;
42 try {
43 n = Integer.parseInt(tf.getText());
44 } catch(NumberFormatException e) {
45 Main.error(e);
46 return;
47 }
48 uploadStrategySelectionPanel.setNumUploadedObjects(n);
49 }
50 }
51 );
52 return pnl;
53 }
54
55 /**
56 * Constructs a new {@code UploadStrategySelectionPanelTest}.
57 */
58 public UploadStrategySelectionPanelTest() {
59 build();
60 uploadStrategySelectionPanel.setNumUploadedObjects(51000);
61 }
62
63 public static void main(String args[]) throws OsmApiInitializationException, OsmTransferCanceledException{
64 OsmApi.getOsmApi().initialize(NullProgressMonitor.INSTANCE);
65 new UploadStrategySelectionPanelTest().setVisible(true);
66 }
67}
Note: See TracBrowser for help on using the repository browser.