MeshLabelApplet.java
Go to the documentation of this file.
00001 package edu.tum.cs.ias.knowrob;
00002 
00003 import java.awt.event.MouseListener;
00004 import java.awt.event.MouseMotionListener;
00005 import controlP5.ControlP5;
00006 import controlP5.Textfield;
00007 import controlP5.ControlEvent;
00008 import processing.core.*;
00009 
00010 
00011 public class MeshLabelApplet extends PApplet  implements MouseListener, MouseMotionListener {
00012 
00013         private static final long serialVersionUID = 8549782324368323084L;
00014         
00015         private ObjectLabelingCanvas objLabelCanvas;
00016         public ControlP5 controlP5;
00017 
00018         public void setup() {
00019 
00020                 size(700, 80);
00021                 frameRate(10);
00022 
00023                 initControlP5();
00024                 draw();
00025 
00026         }
00027 
00028         public void draw() {
00029                 background(20, 20, 20);
00030         }
00031 
00035         // 
00036         // USER INTERFACE
00037         // 
00038         
00039         private void initControlP5() {
00040 
00041                 controlP5 = new ControlP5(this);
00042 
00043                 controlP5.addTextlabel("label","ASSIGN CLASS LABEL:",150,10);
00044                 Textfield input = controlP5.addTextfield("", 150,25,400,20);
00045                 input.setId(23);
00046                 input.setColorBackground(0xFF000000);
00047 
00048                 input.setAutoClear(true);
00049                 input.setFocus(true);
00050                 input.keepFocus(true);
00051 
00052         }
00053 
00054 
00055         void controlEvent(ControlEvent theEvent) {
00056                 
00057                 if(theEvent.controller() instanceof Textfield) {
00058 
00059                         String label = theEvent.controller().stringValue()+"\n";
00060                         objLabelCanvas.setLabel(label);
00061                         objLabelCanvas.mesh_applet.clear();
00062 
00063                         
00064                 }
00065         }
00066 
00067 
00068         public void setObjectLabelingCanvas(ObjectLabelingCanvas parent) {
00069                 this.objLabelCanvas = parent;
00070         }
00071 
00072 
00073         public static void main(String args[]) {
00074                 PApplet.main(new String[] { "de.tum.in.fipm.kipm.gui.visualisation.applets.MeshLabelApplet" });
00075         }
00076 
00077         
00078 }
00079 
00080 


mesh_label_node
Author(s): Moritz Tenorth
autogenerated on Mon Oct 6 2014 09:19:55