MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / LoaderTest

Method LoaderTest

src/test/LoaderTest.java:68–110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66 int progressInit = 0, progress_done = 100;
67
68 public LoaderTest(){
69 frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
70 panel.setLayout(new BorderLayout());
71 topPanel.setLayout(new FlowLayout());
72 enableDragAndDrop(textArea);
73 textArea.setEditable(true);
74
75 JLabel label = new JLabel("ComPADRE");
76 label.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
77
78 JButton getButton = new JButton();
79 getButton.setText("Open Browser");
80 JButton saveButton = new JButton();
81 saveButton.setText("Save Model");
82
83 getButton.addActionListener(new ActionListener(){
84
85 @Override
86 public void actionPerformed(ActionEvent e) {
87 libraryBrowser.setVisible(true);
88 }
89 });
90 saveButton.addActionListener(new ActionListener(){
91
92 @Override
93 public void actionPerformed(ActionEvent e) {
94 if (!saveNewZip()) {
95 String msg = "Failed to save file "+XML.getName(zipFilePath);
96 JOptionPane.showMessageDialog(frame, msg, "Error", JOptionPane.ERROR_MESSAGE);
97 }
98 }
99 });
100 topPanel.add(label);
101 topPanel.add(getButton);
102 topPanel.add(saveButton);
103 panel.add(scrollPane,BorderLayout.CENTER);
104 panel.add(topPanel,BorderLayout.NORTH);
105 frame.add(panel);
106 frame.setSize(450, 300);
107 frame.setLocationRelativeTo(null);
108 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
109 frame.setVisible(true);
110 }
111
112 private void setEditorText(String text) {
113 textArea.setText(text);

Callers

nothing calls this directly

Calls 9

enableDragAndDropMethod · 0.95
setBorderMethod · 0.80
setTextMethod · 0.65
addActionListenerMethod · 0.65
setSizeMethod · 0.65
setVisibleMethod · 0.65
setEditableMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected