/[fenfire]/fenfire/org/fenfire/modules/pp/Pp.java
ViewVC logotype

Diff of /fenfire/org/fenfire/modules/pp/Pp.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by mudyc, Mon Mar 31 12:37:47 2003 UTC revision 1.2 by mudyc, Fri Apr 4 23:25:06 2003 UTC
# Line 8  import org.fenfire.view.*; Line 8  import org.fenfire.view.*;
8  import org.fenfire.view.buoy.*;  import org.fenfire.view.buoy.*;
9    
10  import org.nongnu.libvob.*;  import org.nongnu.libvob.*;
11    import org.nongnu.libvob.impl.*;
12  import org.nongnu.libvob.buoy.*;  import org.nongnu.libvob.buoy.*;
13  import org.nongnu.libvob.impl.DefaultVobMatcher;  import org.nongnu.libvob.impl.DefaultVobMatcher;
14  import org.nongnu.libvob.vobs.*;  import org.nongnu.libvob.vobs.*;
# Line 56  public static final String rcsid = "$Id$ Line 57  public static final String rcsid = "$Id$
57    
58          String paper = ppAct.newPaper();          String paper = ppAct.newPaper();
59          String note = ppAct.newNote(paper, 0,0, "A test note");          String note = ppAct.newNote(paper, 0,0, "A test note");
60    
61          String paper2 = ppAct.newPaper();          String paper2 = ppAct.newPaper();
62          String note2 = ppAct.newNote(paper2, 0,0, "A test note");          String note2 = ppAct.newNote(paper2, 0,0, "A test note");
63          ppAct.assocNotes(note, 1, note2);          ppAct.assocNotes(note, 1, note2);
64    
65            note = ppAct.newNote(paper, 10,10, "10 10");
66            ppAct.assocNotes(note, 1, note2);
67            note = ppAct.newNote(paper, -10,10, "-10 10");
68            ppAct.assocNotes(note, 1, note2);
69            note = ppAct.newNote(paper, -10,-10, "-10 -10");
70            ppAct.assocNotes(note, 1, note2);
71            note = ppAct.newNote(paper, 10,-10, "10 -10");
72            ppAct.assocNotes(note, 1, note2);
73    
74    
75          accursed = space.getModel().getResource(note);          accursed = space.getModel().getResource(note);
76    
77    
# Line 112  public static final String rcsid = "$Id$ Line 124  public static final String rcsid = "$Id$
124                  pa("Mouse: " + m);                  pa("Mouse: " + m);
125    
126                  VobScene vs = screen.getVobSceneForEvents();                  VobScene vs = screen.getVobSceneForEvents();
127                  int cs = vs.coords.getCSAt(0, m.getX(), m.getY(),                  vs.map.dump();
                                            null);  
                 pa("CS: "+cs);  
                 if (cs < 0) return;  
   
128    
129                    int cs = vs.coords.getCSAt(0, m.getX(), m.getY(), null);
130                    pa("CS: "+cs+" at x: "+m.getX()+", y: "+m.getY() );
131                    if (cs < 0) return;
132    
133                    AbstractUpdateManager.setNoAnimation();
134                  AbstractUpdateManager.chg();                  AbstractUpdateManager.chg();
135              }              }
136              public void setScreen(Screen s) { this.screen = s; }              public void setScreen(Screen s) { this.screen = s; }
# Line 135  public static final String rcsid = "$Id$ Line 147  public static final String rcsid = "$Id$
147    
148      private float ctrX=0, ctrY=0;      private float ctrX=0, ctrY=0;
149      private VobScene curVs = null;      private VobScene curVs = null;
150        private int focusCtr = -1;
151      private void render(VobScene vs) {      private void render(VobScene vs) {
152          curVs = vs;          curVs = vs;
153          vs.map.put(new SolidBackdropVob(Color.lightGray));          vs.map.put(new SolidBackdropVob(Color.lightGray));
154    
155            int tmp = vs.orthoBoxCS(0, "Nothing", 100,0,0, 1,1,vs.size.width, vs.size.height);
156            vs.activate(tmp);
157                    
158          float width = (float)vs.size.getWidth() * 3.f/5;          float width = (float)vs.size.getWidth() * 3.f/5;
159          float height = (float)vs.size.getHeight() * 3.f/5;          float height = (float)vs.size.getHeight() * 3.f/5;
160    
161          ctrX = ((float)vs.size.width)/2;          ctrX = ((float)vs.size.width)/2;
162          ctrY = ((float)vs.size.height)/2;          ctrY = ((float)vs.size.height)/2;
163          int focusCtr = vs.translateCS(0, "FocusCtr", ctrX,ctrY);          focusCtr = vs.translateCS(0, "FocusCtr", ctrX,ctrY);
164            //vs.activate(focusCtr);
165    
166          float x = -width/2;          float x = -width/2;
167          int frameCS = vs.orthoBoxCS(focusCtr, "FocusFrame", 10,          int frameCS = vs.orthoBoxCS(focusCtr, "FocusFrame", 0,
168                                      x, -height/2, 1, 1,                                      x, -height/2, 1, 1,
169                                      width, height);                                      width, height);
170          vs.activate(frameCS);          vs.activate(frameCS);
171    
172            pa("frame: "+frameCS+", focus: "+focusCtr+", tmp: "+tmp);
173    
         if (focus == null) {  
             focus = adaptor.createMainNode(null, accursed, this);  
         }  
174          if (focus == null)          if (focus == null)
175              pa("Foo");              focus = adaptor.createMainNode(null, accursed, this);
176          focus.renderMain(vs, frameCS);          focus.renderMain(vs, frameCS);
   
177      }      }
178    
179      // ------------------------------------------------------------      // ------------------------------------------------------------
# Line 168  public static final String rcsid = "$Id$ Line 182  public static final String rcsid = "$Id$
182      public void link(int dir, int anchorCS, BuoyViewNodeType otherNode,      public void link(int dir, int anchorCS, BuoyViewNodeType otherNode,
183                       Object linkId, Object otherAnchor) {                       Object linkId, Object otherAnchor) {
184    
185            OrthoCoorder c = (OrthoCoorder)curVs.coords;
186          int anchorUnit = curVs.unitSqCS(anchorCS, "UN");          int anchorUnit = curVs.unitSqCS(anchorCS, "UN");
187          int anchorCenter = curVs.translateCS(anchorUnit, "TR55", 0.5f, 0.5f);          int anchorCenter = curVs.translateCS(anchorUnit, "TR55", 0.5f, 0.5f);
188          float r = ctrY * 0.9f;          float r = ctrY * 0.9f;
189    
190          int buoyCS;          int buoyCS;
191          /*  
192          if (dir < 0){          if (dir < 0){
193              buoyCS = curVs.coords.buoyOnCircle(0, anchorCenter,              buoyCS = c.buoyOnCircle(focusCtr, anchorCenter,
194                                                 ctrX, ctrY, r,                                      ctrX, ctrY, r,
195                                                 ctrX-r, ctrY,                                      ctrX-r, ctrY,
196                                                 .1);                                      50,50);
197          } else {          } else {
198              buoyCS = curVs.coords.buoyOnCircle(0, anchorCenter,              buoyCS = c.buoyOnCircle(focusCtr, anchorCenter,
199                                                 ctrX, ctrY, r,                                      ctrX, ctrY, r,
200                                                 ctrX+r, ctrY,                                      ctrX+r, ctrY,
201                                                 .1);                                      50,50);
202          }          }
203          */          float[] fl = new float[3];
204          pa("link!!!");          c.getSqSize(buoyCS, fl);
205                    pa("size: "+fl[0]+", "+fl[1]);
206                    fl = c.transformPoints3(buoyCS, new float[3], null);
207            pa("transform: "+ fl[0] + ", "+fl[1]+", "+fl[2]);
208    
209            curVs.put(new RectBgVob(), buoyCS);
210    
211            pa("link!!!");
212    
213      }      }
214    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26