/[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.27 by mudyc, Thu Dec 19 16:06:20 2002 UTC revision 1.28 by mudyc, Fri Dec 20 18:23:57 2002 UTC
# Line 42  public class PPView2 implements View { Line 42  public class PPView2 implements View {
42      public static Object NEWPAPERKEY = new Object();      public static Object NEWPAPERKEY = new Object();
43    
44      private EventHandling ev_handler = EventHandling.i();      private EventHandling ev_handler = EventHandling.i();
45      public PPEvents pp_events;      public PPMouseEvents pp_events;
46    
47    
48      // Geometry      // Geometry
# Line 291  public class PPView2 implements View { Line 291  public class PPView2 implements View {
291                      -buoyVPWidth/2, -buoyVPHeight/2, 1, 1,                      -buoyVPWidth/2, -buoyVPHeight/2, 1, 1,
292                      buoyVPWidth, buoyVPHeight);                      buoyVPWidth, buoyVPHeight);
293              vs.activate(frameCS);              vs.activate(frameCS);
294                ev_handler.onClick(frameCS, "Link CLICK",
295                                   new Object[]{ c, connectedFrom});
             float[] bar = { 0,0,0 };  
             float [] foo= new float[3];  
             vs.coords.transformPoints3(frameCS, bar, foo);  
             for (int i=0; i<foo.length; i++) {  
                 pa("CS: "+foo[i]);  
             }  
   
             final GLVobCoorder glc = (GLVobCoorder)vs.coords;  
             float[] sqs = new float[2];  
             glc.getSqSize(frameCS, sqs);  
             if (sqs[1] < 5) return;  
             pa("size: Sqs frame: "+sqs[0]+" "+sqs[1]);  
   
   
296    
297              // XXX Pan              // XXX Pan
298              int[] pan = getCoords(c);              int[] pan = getCoords(c);
# Line 314  public class PPView2 implements View { Line 300  public class PPView2 implements View {
300                      -pan[0]*buoyZoom, -pan[1]*buoyZoom, buoyZoom, buoyZoom);                      -pan[0]*buoyZoom, -pan[1]*buoyZoom, buoyZoom, buoyZoom);
301              vs.matcher.add(buoycs, c2fCS, "C2F");              vs.matcher.add(buoycs, c2fCS, "C2F");
302    
   
303              buoyqueue.add(new Runnable() {              buoyqueue.add(new Runnable() {
304                  public void run() {                  public void run() {
305                      buoy_vc.setAccursed(c);                      buoy_vc.setAccursed(c);
# Line 336  public class PPView2 implements View { Line 321  public class PPView2 implements View {
321          this.window = w;          this.window = w;
322          this.coordinatePlaneView = new CoordinatePlaneView(d.contains, d.pan);          this.coordinatePlaneView = new CoordinatePlaneView(d.contains, d.pan);
323          this.ppactions = ppactions;          this.ppactions = ppactions;
324          pp_events = new PPEvents(ppactions);          pp_events = new PPMouseEvents(this, ppactions, space);
325      }      }
326    
327      TextStyle style = GraphicsAPI.getInstance().getTextStyle("Sans", 0, 20);      TextStyle style = GraphicsAPI.getInstance().getTextStyle("Sans", 0, 20);
# Line 351  public class PPView2 implements View { Line 336  public class PPView2 implements View {
336              "LineWidth 2\nColor 0 0 0\nEnable TEXTURE_2D");              "LineWidth 2\nColor 0 0 0\nEnable TEXTURE_2D");
337    
338      public void render(VobScene vs, int intoCS, ViewContext context) {      public void render(VobScene vs, int intoCS, ViewContext context) {
339            ev_handler.cleanCallers();
340    
341    
342          buoy_vc.setCellView(cellview);          buoy_vc.setCellView(cellview);
343    
# Line 386  public class PPView2 implements View { Line 373  public class PPView2 implements View {
373                  (-mainWidth)/2, -mainHeight/2, 1, 1,                  (-mainWidth)/2, -mainHeight/2, 1, 1,
374                  mainWidth, mainHeight);                  mainWidth, mainHeight);
375          vs.activate(frameCS);          vs.activate(frameCS);
376            ev_handler.onClick(frameCS, "Click MAINVP",
377                               new Object[]{ new Integer(mainctr), new Integer(frameCS)}
378                               );
379            ev_handler.onDrag(frameCS, "Drag MAINVP");
380    
381          // cell to frame CS          // cell to frame CS
382          int c2fCS = vs.coords.ortho(0, 0, 0, 0, 10, 10);          int c2fCS = vs.coords.ortho(0, 0, 0, 0, 10, 10);
# Line 438  public class PPView2 implements View { Line 429  public class PPView2 implements View {
429                        new_paper_button.getHeight(scale) + new_paper_button.getDepth(scale));                        new_paper_button.getHeight(scale) + new_paper_button.getDepth(scale));
430              vs.activate(new_paper_button_frame);              vs.activate(new_paper_button_frame);
431              vs.map.put(new_paper_button, new_paper_button_cs);              vs.map.put(new_paper_button, new_paper_button_cs);
432              ev_handler.onClick(new_paper_button_frame, "Add new paper", null);              ev_handler.onClick(new_paper_button_frame, "Add new paper");
433    
434              // put the "Delete paper" -text              // put the "Delete paper" -text
435              TextVob delete_paper_button = new TextVob(style, "Tuhoa paperi");              TextVob delete_paper_button = new TextVob(style, "Tuhoa paperi");
# Line 451  public class PPView2 implements View { Line 442  public class PPView2 implements View {
442                        delete_paper_button.getHeight(scale) + delete_paper_button.getDepth(scale));                        delete_paper_button.getHeight(scale) + delete_paper_button.getDepth(scale));
443              vs.activate(delete_paper_button_frame);              vs.activate(delete_paper_button_frame);
444              vs.map.put(delete_paper_button, delete_paper_button_cs);              vs.map.put(delete_paper_button, delete_paper_button_cs);
445              ev_handler.onClick(delete_paper_button_frame, "Delete paper", null);              ev_handler.onClick(delete_paper_button_frame, "Delete paper");
446    
447    
448    
# Line 497  public class PPView2 implements View { Line 488  public class PPView2 implements View {
488                      vs.matcher.add(ctr, fr, "frame");                      vs.matcher.add(ctr, fr, "frame");
489                  }                  }
490    
                 ((DefaultVobMatcher)vs.matcher).dumpByParent(ctr);  
   
491    
492                  //vs.matcher.add(ctr, new Pair(p, null));                  //vs.matcher.add(ctr, new Pair(p, null));
493                  vs.matcher.add(ctr, new Pair(p, p));                  vs.matcher.add(ctr, new Pair(p, p));
                 //vs.matcher.add(ctr, new Pair(p, new Cell(space, "dasfdsaffsa")));  
                 //vs.matcher.add(ctr, p);  
494                  vs.activate(fr);                  vs.activate(fr);
495                    ev_handler.onClick(fr, "Shortcut link", new Object[]{p});
496    
497    
498                  int c2f = vs.coords.ortho(0, 11, 0, 0,                  int c2f = vs.coords.ortho(0, 11, 0, 0,
499                                            leftPanelZoom, leftPanelZoom);                                            leftPanelZoom, leftPanelZoom);
500                  vs.matcher.add(ctr, c2f, "C2F");                  vs.matcher.add(ctr, c2f, "C2F");
501    
                 pa(" ctr: "+ctr+  
                    " fr: "+fr+  
                    " c2f: "+c2f);  
   
502                  buoy_vc.setAccursed(p);                  buoy_vc.setAccursed(p);
503                  buoy_singlePlane.render(vs, fr, c2f);                  buoy_singlePlane.render(vs, fr, c2f);
504                  p = p.s(d.d1);                  p = p.s(d.d1);
505                                    
506                  i++;                  i++;
507              }              }
             pa("********************************************************");  
508              //((DefaultVobMatcher)vs.matcher).dumbByParent();              //((DefaultVobMatcher)vs.matcher).dumbByParent();
509          }          }
510                    
# Line 553  public class PPView2 implements View { Line 537  public class PPView2 implements View {
537                                      (-linkbuoyVPWidth)/2, -linkbuoyVPHeight/2, 1, 1,                                      (-linkbuoyVPWidth)/2, -linkbuoyVPHeight/2, 1, 1,
538                                      linkbuoyVPWidth, linkbuoyVPHeight);                                      linkbuoyVPWidth, linkbuoyVPHeight);
539          vs.activate(frameCS);          vs.activate(frameCS);
540            ev_handler.onClick(frameCS, "Assoc link",
541                               new Object[]{otherNote, new Integer(dir)} );
542    
543          int c2f = vs.coords.ortho(0, 0,          int c2f = vs.coords.ortho(0, 0,
544                                    -linkbuoyZoom*coords[0], -linkbuoyZoom*coords[1],                                    -linkbuoyZoom*coords[0], -linkbuoyZoom*coords[1],
# Line 581  public class PPView2 implements View { Line 567  public class PPView2 implements View {
567       */       */
568      public void setCursorToMain(VobScene vs, float x, float y,      public void setCursorToMain(VobScene vs, float x, float y,
569                                  AbstractViewContext context, int cs, int vp) {                                  AbstractViewContext context, int cs, int vp) {
570            /*
571          float[] hit = new float[2];          float[] hit = new float[2];
572          int vobcs = vs.coords.getCSAt(cs, x, y, hit);          int vobcs = vs.coords.getCSAt(cs, x, y, hit);
573          if(vobcs < 0) {          if(vobcs < 0) {
# Line 606  public class PPView2 implements View { Line 593  public class PPView2 implements View {
593          }          }
594          context.setAccursed((Cell)k);          context.setAccursed((Cell)k);
595          context.setCursorOffset(style.getOffsetInText(((Cell)k).t(), 1, hit[0]));          context.setCursorOffset(style.getOffsetInText(((Cell)k).t(), 1, hit[0]));
596            */
597      }      }
598    
599      public Pair getMakeLinkOrSetCursor(VobScene vs, float x, float y, AbstractViewContext context) {      public Pair getMakeLinkOrSetCursor(VobScene vs, float x, float y, AbstractViewContext context) {
600            /*
601          // First, get the frame that was hit.          // First, get the frame that was hit.
602          // This gives the "frame" coordsys.          // This gives the "frame" coordsys.
603          int cs = vs.coords.getCSAt(0, x, y, null);          int cs = vs.coords.getCSAt(0, x, y, null);
# Line 633  public class PPView2 implements View { Line 622  public class PPView2 implements View {
622          }          }
623          Pair p = (Pair)key;          Pair p = (Pair)key;
624          return p;          return p;
625            */
626            return null;
627      }      }
628    
629      /** Set the cursor of the given view context to the clicked point.      /** Set the cursor of the given view context to the clicked point.
# Line 641  public class PPView2 implements View { Line 632  public class PPView2 implements View {
632       *          DefaultVobMatcher.setKeyMap() method.       *          DefaultVobMatcher.setKeyMap() method.
633       */       */
634      public Map setCursorTo(VobScene vs, float x, float y, AbstractViewContext context) {      public Map setCursorTo(VobScene vs, float x, float y, AbstractViewContext context) {
635            /*      
636          // First, get the frame that was hit.          // First, get the frame that was hit.
637          // This gives the "frame" coordsys.          // This gives the "frame" coordsys.
638          int cs = vs.coords.getCSAt(0, x, y, null);          int cs = vs.coords.getCSAt(0, x, y, null);
# Line 651  public class PPView2 implements View { Line 643  public class PPView2 implements View {
643    
644    
645          if(!"frame".equals(vs.matcher.getKey(cs))) {          if(!"frame".equals(vs.matcher.getKey(cs))) {
             /*  
646              try {              try {
647                  if ("new_paper_button_frame".equals(vs.matcher.getKey(cs)) ) {                  if ("new_paper_button_frame".equals(vs.matcher.getKey(cs)) ) {
648                      ppactions.newPaper();                      ppactions.newPaper();
# Line 666  public class PPView2 implements View { Line 657  public class PPView2 implements View {
657                      pa("WRONG KEY! "+vs.matcher.getKey(cs));                      pa("WRONG KEY! "+vs.matcher.getKey(cs));
658                  }                  }
659              } catch (Exception e) { pa(e.getMessage()); }              } catch (Exception e) { pa(e.getMessage()); }
             */  
   
660              return null;              return null;
661          }          }
662            
663    
664          // Get its parent          // Get its parent
665          int vp = ((GLVobCoorder)vs.coords).getParent(cs);          int vp = ((GLVobCoorder)vs.coords).getParent(cs);
666          Object key = vs.matcher.getKey(vp);          Object key = vs.matcher.getKey(vp);
# Line 737  public class PPView2 implements View { Line 727  public class PPView2 implements View {
727              return r;              return r;
728          }          }
729    
730          
731          if ("BuoyOnCircle".equals(((GLVobCoorder)vs.coords).getCoordSystemStr(vp))) {          if ("BuoyOnCircle".equals(((GLVobCoorder)vs.coords).getCoordSystemStr(vp))) {
732    
733              pa("Buoy!!!");              pa("Buoy!!!");
# Line 767  public class PPView2 implements View { Line 757  public class PPView2 implements View {
757              // Change to paper which has been selected from the left panel.              // Change to paper which has been selected from the left panel.
758              ((AbstractViewContext)context).setAccursed((Cell)p.first);              ((AbstractViewContext)context).setAccursed((Cell)p.first);
759          }          }
760          return r;  
761      }          return r;
762            */
763            return null;
764       }
765  }  }

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

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