1 /*****************************************************************************
2 * Virtual Mockup for Machine Vision
3 * Copyright (C) 2001-2003 Fabio R. de Miranda, João E. Kogler Jr.,
4 * Carlos S. Santos.
5 * Virtual Mockup for Machine Vision Project funded by SENAC-SP
6 *
7 * Permission is granted to redistribute and/or modify this
8 * software under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License (http://www.gnu.org/copyleft/lesser.html)
16 * for more details.
17 *
18 *****************************************************************************/
19
20 package camera3d.gui;
21
22 import javax.swing.*;
23 import camera3d.gui.*;
24 import java.awt.*;
25 import java.awt.event.*;
26 import camera3d.*;
27 import java.util.*;
28
29 /***
30 *
31 * @author Fábio Roberto de Miranda
32 */
33
34 public class TestEditionPane extends JFrame {
35 private EditionPane editionPane1;
36 private JButton addBtn = new JButton("add");
37 private JButton removeBtn = new JButton("remove");
38
39 public TestEditionPane() {
40 GUIControl guiControl = null;
41 editionPane1 = new EditionPane(guiControl);
42 try {
43 jbInit();
44 }
45 catch(Exception e) {
46 e.printStackTrace();
47 }
48 }
49
50 public static void main(String[] args) {
51 TestEditionPane testEditionPane1 = new TestEditionPane();
52 EditionPane editionPane = testEditionPane1.editionPane1;
53 VcView view = new VcView();
54 Vector v = new Vector();
55 editionPane.setSelectedObjects(v);
56 testEditionPane1.show();
57 }
58
59 private void jbInit() throws Exception {
60 this.setSize(new Dimension(250, 450));
61 this.getContentPane().add(editionPane1, BorderLayout.CENTER);
62 this.getContentPane().add(addBtn, BorderLayout.EAST);
63 this.getContentPane().add(removeBtn, BorderLayout.WEST);
64 addBtn.addActionListener(new ActionListener(){
65 public void actionPerformed(ActionEvent ac){
66 addBtn_action();
67 }
68 });
69 removeBtn.addActionListener(new ActionListener(){
70 public void actionPerformed(ActionEvent ac){
71 removeBtn_action();
72 }
73 });
74
75 }
76
77 public void addBtn_action(){
78 Vector v = new Vector();
79 VcView vCam = new VcView();
80 vCam.setLabel("Dummy1");
81 v.addElement(vCam);
82 editionPane1.setSelectedObjects(v);
83 }
84
85 public void removeBtn_action(){
86 Vector v = new Vector();
87 editionPane1.setSelectedObjects(v);
88 }
89
90 }
This page was automatically generated by Maven