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 java.awt.*;
23 import javax.swing.*;
24 import javax.swing.border.*;
25
26 /*
27 * Title: Câmera Virtual - LIVES
28 * Description: Câmera Virtual para Controle via LabVIEW
29 * Copyright: Copyright (c) 2001
30 * Company: Centro de Educação em Informática - SENAC - SP
31 */
32
33 /***
34 * Command bar that contains the switch button of a FrameSwitcherButton.
35 *
36 * @author Fábio Roberto de Miranda
37 * @version 1.0
38 */
39 class PanelCommandBar extends JPanel {
40 private JButton inOrOutButton = new JButton();
41 private ImageIcon iconPlus = new ImageIcon(PanelCommandBar.class.getResource("icons/paneliconplus.gif"));
42 private ImageIcon iconMinus = new ImageIcon(PanelCommandBar.class.getResource("icons/paneliconminus.gif"));
43 private TitledBorder titledBorder1; private GridBagLayout gridBagLayout1 = new GridBagLayout();
44 public PanelCommandBar() {
45 try {
46 jbInit();
47 }
48 catch(Exception e) {
49 e.printStackTrace();
50 }
51 }
52 private void jbInit() throws Exception {
53 titledBorder1 = new TitledBorder("");
54 inOrOutButton.setAlignmentX((float) 0.5);
55 inOrOutButton.setIcon(iconPlus);
56 this.setLayout(gridBagLayout1);
57 this.setBorder(titledBorder1);
58 this.setMaximumSize(new Dimension(191, 18));
59 this.setPreferredSize(new Dimension(191, 15));
60 this.add(inOrOutButton, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0
61 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(-3, 151, 0, 9), -22, -5));
62 }
63
64 public JButton getInOrOutButton(){
65 return this.inOrOutButton;
66 }
67
68 public void setIcon(int icon){
69 if (icon < 0){
70 inOrOutButton.setIcon(iconMinus);
71 } else if (icon > 0){
72 inOrOutButton.setIcon(iconPlus);
73 }
74
75 }
76 }
This page was automatically generated by Maven