/[gzz]/gzz/gzz/modules/pp/PPView2.java
ViewVC logotype

Diff of /gzz/gzz/modules/pp/PPView2.java

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

revision 1.25 by mudyc, Fri Dec 6 20:51:29 2002 UTC revision 1.26 by mudyc, Thu Dec 12 15:35:03 2002 UTC
# Line 165  public class PPView2 implements View { Line 165  public class PPView2 implements View {
165              final GLVobCoorder glc = (GLVobCoorder)vs.coords;              final GLVobCoorder glc = (GLVobCoorder)vs.coords;
166              float[] sqs = new float[2];              float[] sqs = new float[2];
167              glc.getSqSize(frameCS, sqs);              glc.getSqSize(frameCS, sqs);
168                if (sqs[1] < 5) return;
169              pa("Sqs frame: "+sqs[0]+" "+sqs[1]);              pa("Sqs frame: "+sqs[0]+" "+sqs[1]);
170    
171              // CS from center of frameCS to screen              // CS from center of frameCS to screen
# Line 178  public class PPView2 implements View { Line 178  public class PPView2 implements View {
178                                          bgscale, bgscale);                                          bgscale, bgscale);
179                            
180    
   
   
181              final Cell cursor = context.getAccursed();              final Cell cursor = context.getAccursed();
182              final Cell plane = cursor.h(d.contains);              final Cell plane = cursor.h(d.contains);
183    
# Line 251  public class PPView2 implements View { Line 249  public class PPView2 implements View {
249          int dir;          int dir;
250          VobScene vs;          VobScene vs;
251          Buoy4Floater floater;          Buoy4Floater floater;
252            
253            // Nadir CS
254            final int nadir_point_cs;
255    
256          BFloater(int dir, VobScene vs) {          BFloater(int dir, VobScene vs) {
257              this.dir = dir;              this.dir = dir;
258              this.vs = vs;              this.vs = vs;
259              floater = new CircleFloater4(vs, 0,              floater = new CircleFloater4(vs, 0,
260                  centerX(vs), buoyCenterY, buoyRadius,                  centerX(vs), buoyCenterY, buoyRadius,
261                  centerX(vs) - dir * buoyRadius, buoyCenterY);                  centerX(vs) - dir * buoyRadius, buoyCenterY);
262    
263                nadir_point_cs =  vs.orthoBoxCS(0, "nadir_frame"+dir, 0,
264                                               leftPanelRealWidth + 0.5f*mainWidth,
265                                               mainHeight*2.0f,
266                                               1, 1, 2, 2);
267          }          }
268          public void buoy(final int anchor, final Cell c, Cell connectedFrom) {          public void buoy(final int anchor, final Cell c, Cell connectedFrom) {
269              Object key ;              Object key ;
# Line 267  public class PPView2 implements View { Line 274  public class PPView2 implements View {
274              final int anchorUnit = vs.unitSqCS(anchor, "AUSQ");              final int anchorUnit = vs.unitSqCS(anchor, "AUSQ");
275              int actr = vs.translateCS(anchorUnit, "TR12", .5f, .5f);              int actr = vs.translateCS(anchorUnit, "TR12", .5f, .5f);
276              int buoycs = floater.buoyCoordsys(actr, key);              int buoycs = floater.buoyCoordsys(actr, key);
277    /*  BEGIN FROM HERE */            
278              //vs.matcher.add(buoycs, "buoycs");  
279                final int nadir_buoy = ((GLVobCoorder)vs.coords).nadirOrigin(buoycs, nadir_point_cs);
280                //vs.matcher.add(buoycs, nadir_buoy, "nadir_frameCS");
281                vs.matcher.add(nadir_buoy, "nadir_frameCS");
282    
             // Nadir CS  
             int nadir_point_cs = vs.orthoBoxCS(0, "nadir_frame", 0,  
                                                leftPanelRealWidth + 0.5f*mainWidth,  
                                                mainHeight*1.5f,  
                                                1, 1, 2, 2);  
             final int nadir = ((GLVobCoorder)vs.coords).nadirOrigin(buoycs, nadir_point_cs);  
             vs.matcher.add(nadir, "nadir_frameCS");  
   
    /* only one paper will be animated! */  
    /* if you enable this nothing animates */  
             //vs.matcher.add(buoycs, nadir,"B2N");  
283    
284              //final int frameCS = vs.orthoBoxCS(buoycs, "frame", 0,              final int frameCS = vs.orthoBoxCS(buoycs, "frame", 0,
285              final int frameCS = vs.orthoBoxCS(nadir, "frame", 0,              //final int frameCS = vs.orthoBoxCS(nadir_buoy, "frame", 0,
286                      -buoyVPWidth/2, -buoyVPHeight/2, 1, 1,                      -buoyVPWidth/2, -buoyVPHeight/2, 1, 1,
287                      buoyVPWidth, buoyVPHeight);                      buoyVPWidth, buoyVPHeight);
288              vs.activate(frameCS);              vs.activate(frameCS);
# Line 293  public class PPView2 implements View { Line 292  public class PPView2 implements View {
292              int[] pan = getCoords(c);              int[] pan = getCoords(c);
293              final int c2fCS = vs.coords.ortho(0, 0,              final int c2fCS = vs.coords.ortho(0, 0,
294                      -pan[0]*buoyZoom, -pan[1]*buoyZoom, buoyZoom, buoyZoom);                      -pan[0]*buoyZoom, -pan[1]*buoyZoom, buoyZoom, buoyZoom);
295              //vs.matcher.add(buoycs, c2fCS, "C2F");              vs.matcher.add(buoycs, c2fCS, "C2F");
296              vs.matcher.add(nadir, c2fCS, "C2F");              //vs.matcher.add(nadir_buoy, c2fCS, "C2F");
297   /*  END TO HERE */  
298    
299              buoyqueue.add(new Runnable() {              buoyqueue.add(new Runnable() {
300                  public void run() {                  public void run() {
# Line 464  public class PPView2 implements View { Line 463  public class PPView2 implements View {
463                  y += leftPanelObjectHeight) {                  y += leftPanelObjectHeight) {
464                  int ctr, fr;                  int ctr, fr;
465                  if (i==0) {                  if (i==0) {
466                      ctr = ((GLVobCoorder)vs.coords).affineCoordsys(0, 0,                      ctr = ((GLVobCoorder)vs.coords).affineCoordsys(0, 100,
467                                                                     x, y, 1, 0, 0, 1);                                                                     x, y, 1, 0, 0, 1);
468                      fr = vs.orthoBoxCS(ctr, "frame", 10,  
469                        //vs.matcher.add(ctr, new Pair(p, null));
470                        //vs.matcher.add(ctr, new Pair(p, p));
471    
472                        fr = vs.orthoBoxCS(ctr, "frame", 100,
473                                         -leftPanelRealWidth/2, -leftPanelRealHeight/2,                                         -leftPanelRealWidth/2, -leftPanelRealHeight/2,
474                                         1, 1, leftPanelRealWidth, leftPanelRealHeight);                                         1, 1, leftPanelRealWidth, leftPanelRealHeight);
475                  }                  }
476                  else {                  else {
477                      ctr = cs_gen.getNextCS(0);                      ctr = cs_gen.getNextCS(0);
478                        //vs.matcher.add(ctr, new Pair(p, p));
479                        //vs.matcher.add(ctr, new Pair(p, null));
480                      fr = cs_gen.getNextCS(1);                      fr = cs_gen.getNextCS(1);
481                        vs.matcher.add(ctr, fr, "frame");
482                  }                  }
483    
484                  vs.matcher.add(ctr, new Pair(p, null));                  ((DefaultVobMatcher)vs.matcher).dumpByParent(ctr);
485    
486    
487                    //vs.matcher.add(ctr, new Pair(p, null));
488                    vs.matcher.add(ctr, new Pair(p, p));
489                  vs.activate(fr);                  vs.activate(fr);
490    
491                  int c2f = vs.coords.ortho(0, 0, 0, 0,                  int c2f = vs.coords.ortho(0, 11, 0, 0,
492                                            leftPanelZoom, leftPanelZoom);                                            leftPanelZoom, leftPanelZoom);
493                  vs.matcher.add(ctr, c2f, "C2F"+ y);                  vs.matcher.add(ctr, c2f, "C2F");
494    
495                    pa(" ctr: "+ctr+
496                       " fr: "+fr+
497                       " c2f: "+c2f);
498    
499                  buoy_vc.setAccursed(p);                  buoy_vc.setAccursed(p);
500                  buoy_singlePlane.render(vs, fr, c2f);                  buoy_singlePlane.render(vs, fr, c2f);
501                  p = p.s(d.d1);                  p = p.s(d.d1);
502                    
503                  i++;                  i++;
504              }              }
505                pa("********************************************************");
506                //((DefaultVobMatcher)vs.matcher).dumbByParent();
507          }          }
508                    
509                    
510      }      }
511    
512    
513      int curlinkY = 0;      int curlinkY = 0;
514      // XXX more params!      // XXX more params!
515      private void placeLinkbuoys(VobScene vs, Cell otherNote) {      private void placeLinkbuoys(VobScene vs, Cell otherNote) {
# Line 505  public class PPView2 implements View { Line 522  public class PPView2 implements View {
522          else { curlinkY ++; curlinkY = -curlinkY; }          else { curlinkY ++; curlinkY = -curlinkY; }
523      }      }
524    
525    
526      private void placeLinkbuoy(VobScene vs, Cell otherNote,      private void placeLinkbuoy(VobScene vs, Cell otherNote,
527                                 int[] coords, Pair key, int dir) {                                 int[] coords, Pair key, int dir) {
   
528          int ctr = ((GLVobCoorder)vs.coords).affineCoordsys(0, 0,          int ctr = ((GLVobCoorder)vs.coords).affineCoordsys(0, 0,
529                                                             centerX(vs) + dir * buoyRadius,                                                             centerX(vs) + dir * buoyRadius,
530                                                             mainY + mainHeight/2 + curlinkY * linkbuoyVPHeight,                                                             mainY + mainHeight/2 + curlinkY * linkbuoyVPHeight,
# Line 529  public class PPView2 implements View { Line 546  public class PPView2 implements View {
546    
547      }      }
548    
549    
550    
551      /** Cause the changes to the zooming and panning variables      /** Cause the changes to the zooming and panning variables
552       * to be shown in the given vobscene.       * to be shown in the given vobscene.
553       * This changes the parameters of the coordinate systems created by render().       * This changes the parameters of the coordinate systems created by render().
# Line 612  public class PPView2 implements View { Line 631  public class PPView2 implements View {
631              return null;              return null;
632          }          }
633    
634    
635          if(!"frame".equals(vs.matcher.getKey(cs))) {          if(!"frame".equals(vs.matcher.getKey(cs))) {
636              try {              try {
637                  if ("new_paper_button_frame".equals(vs.matcher.getKey(cs)) ) {                  if ("new_paper_button_frame".equals(vs.matcher.getKey(cs)) ) {
# Line 629  public class PPView2 implements View { Line 649  public class PPView2 implements View {
649              } catch (Exception e) { pa(e.getMessage()); }              } catch (Exception e) { pa(e.getMessage()); }
650              return null;              return null;
651          }          }
652            
653          // Get its parent          // Get its parent
654          int vp = ((GLVobCoorder)vs.coords).getParent(cs);          int vp = ((GLVobCoorder)vs.coords).getParent(cs);
655          if ("Nadir".equals(((GLVobCoorder)vs.coords).getCoordSystemStr(vp))) {          if ("Nadir".equals(((GLVobCoorder)vs.coords).getCoordSystemStr(vp))) {

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

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