root/InOutExpositor/oTag.pde

Revision 5972babe7c40454704b75ea69ba2e12d80927eaa, 1.4 kB (checked in by Robin Gareus <robin@…>, 3 years ago)

fixed expositor to compile w/processing-1.0.9

  • Property mode set to 100644
Line 
1////////////////////////////////////////////////////////
2// actually, a Tag can be any value stored in a profile (see Client class definition for more infos)
3class Tag {
4  // TAG
5  String tag ; // word
6  int val ; // valeur
7
8  /////////////// shape
9  float l,h ; // size
10  float r, ang; // ang position
11  float nx, ny ; // new position
12  float nr, nang ; // new ang position
13  float t = 0 ; // time of move
14
15  ////////////// interaction
16  boolean selected = false ;
17  boolean highlighted = false ;
18
19  Tag( String inStr ) {
20    tag = inStr ;
21    val = 0 ;
22  }
23  Tag( String inStr, int inValue) { // constructor for Tags (with value)
24    if(!inStr.equals("")) {
25      if(inValue!=0) {
26        tag = inStr ;
27        val = inValue ;
28      }
29      else {
30        try{
31          String[] pel = split(inStr,aTag) ; // got "sfqdsfds" et "123"
32          String newTag = pel[0] ;
33          String newVal = pel[1] ;
34          tag = newTag ;
35          val = int(newVal) ;
36        }
37        catch(Exception e) {
38          tag = "nothing" ;
39          val = 666 ;
40          print("TAG: Parsing problem"+e+"\n") ;
41        }
42      }
43    }
44  }
45  String getString() { // sous la forme "montag.123" si tag, "mot" sinon
46    return tag + aTag + val ;
47  }
48  boolean isListedIn( Vector vect ) {
49    boolean res = false ;
50    for(int i=0;i<vect.size();i++) {
51      if( ((Tag)vect.elementAt(i)).tag.equals(tag) ) res = true ;
52    }
53    return res ;
54  }
55}
56
57
58
Note: See TracBrowser for help on using the browser.