View Javadoc
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 /* 23 * Title: Câmera Virtual - LIVES 24 * Description: Câmera Virtual para Controle via LabVIEW 25 * Copyright: Copyright (c) 2001 26 * Company: Centro de Educação em Informática - SENAC - SP 27 */ 28 import javax.swing.*; 29 import java.awt.*; 30 import camera3d.*; 31 32 /*** 33 * Pane for editing spot light specific parameters. 34 * @author Fábio Roberto de Miranda 35 * @version 1.0 36 */ 37 class VcSpotLightEditionPane extends JPanel implements DoubleValueChangeListener{ 38 private JLabel jLabel1 = new JLabel(); 39 private GUIControl guiControl; 40 41 private VcSpotLight vcSpotLight; 42 43 private DoubleDigitalControl spreadAngleControl = new DoubleDigitalControl(); 44 private DoubleDigitalControl concentrationControl = new DoubleDigitalControl(); 45 private JLabel jLabel2 = new JLabel(); 46 private JLabel jLabel3 = new JLabel(); 47 48 /*** 49 * Creates new pane. 50 */ 51 VcSpotLightEditionPane() { 52 try { 53 jbInit(); 54 } 55 catch(Exception e) { 56 e.printStackTrace(); 57 } 58 } 59 60 61 62 private void jbInit() throws Exception { 63 jLabel1.setText("Spot Light"); 64 jLabel1.setBounds(new Rectangle(17, 14, 73, 17)); 65 this.setMinimumSize(new Dimension(150, 150)); 66 this.setPreferredSize(new Dimension(150, 150)); 67 this.setLayout(null); 68 spreadAngleControl.setBounds(new Rectangle(129, 65, 72, 35)); 69 concentrationControl.setBounds(new Rectangle(130, 104, 72, 35)); 70 jLabel2.setText("Spread angle"); 71 jLabel2.setBounds(new Rectangle(25, 72, 76, 17)); 72 jLabel3.setText("Concentration"); 73 jLabel3.setBounds(new Rectangle(25, 110, 85, 17)); 74 this.add(jLabel1, null); 75 this.add(jLabel2, null); 76 this.add(jLabel3, null); 77 this.add(spreadAngleControl, null); 78 this.add(concentrationControl, null); 79 spreadAngleControl.addValueChangeListener(this); 80 concentrationControl.addValueChangeListener(this); 81 } 82 83 void setVcSpotLight(VcSpotLight spotLight){ 84 this.vcSpotLight = spotLight; 85 updateData(); 86 } 87 88 void updateData(){ 89 //this.spreadAngleControl.setValue(vcSpotLight.getSpreadAngle()); 90 //this.concentrationControl.setValue(vcSpotLight.getConcentration()); 91 } 92 93 void setGUIControl(GUIControl guiControl){ 94 this.guiControl = guiControl; 95 } 96 97 public void valueChanged(DoubleChangeEvent ev){ 98 if (ev.getSource()==((Object)spreadAngleControl)){ 99 guiControl.changeSpotSpreadAngle(vcSpotLight, spreadAngleControl.getValue()); 100 } else if (ev.getSource()==((Object)concentrationControl)){ 101 guiControl.changeSpotConcentration(vcSpotLight, concentrationControl.getValue()); 102 } 103 } 104 }

This page was automatically generated by Maven