/[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.10 by tjl, Mon Nov 4 13:45:47 2002 UTC revision 1.11 by tjl, Mon Nov 4 22:15:04 2002 UTC
# Line 80  public class PPView2 implements View { Line 80  public class PPView2 implements View {
80      public boolean useStencil = true;      public boolean useStencil = true;
81    
82      Space space;      Space space;
83      PPDims d;      public PPDims d;
84    
85      Vob black = GLCache.getCallList("Color 0 0 0\n");      Vob black = GLCache.getCallList("Color 0 0 0\n");
86    
# Line 209  public class PPView2 implements View { Line 209  public class PPView2 implements View {
209              int buoycs = floater.buoyCoordsys(actr, key);              int buoycs = floater.buoyCoordsys(actr, key);
210    
211              final int frameCS = vs.orthoBoxCS(buoycs, "frame", 0,              final int frameCS = vs.orthoBoxCS(buoycs, "frame", 0,
212                      -buoyVPWidth/2, -buoyVPHeight, 1, 1,                      -buoyVPWidth/2, -buoyVPHeight/2, 1, 1,
213                      buoyVPWidth, buoyVPHeight);                      buoyVPWidth, buoyVPHeight);
214              vs.activate(frameCS);              vs.activate(frameCS);
215              // XXX Pan              // XXX Pan
# Line 234  public class PPView2 implements View { Line 234  public class PPView2 implements View {
234          this.coordinatePlaneView = new CoordinatePlaneView(d.contains, d.pan);          this.coordinatePlaneView = new CoordinatePlaneView(d.contains, d.pan);
235      }      }
236    
237        TextStyle style = GraphicsAPI.getInstance().getTextStyle("Sans", 0, 20);
238        CellInBox cellview = new TextCellContentView(style);
239    
240      public void render(VobScene vs, int intoCS, ViewContext context) {      public void render(VobScene vs, int intoCS, ViewContext context) {
         TextStyle style = vs.gfxapi.getTextStyle("Sans", 0, 20);  
         CellInBox cellview = new TextCellContentView(style);  
241    
242          buoy_vc.setCellView(cellview);          buoy_vc.setCellView(cellview);
243    
# Line 248  public class PPView2 implements View { Line 249  public class PPView2 implements View {
249    
250          AbstractViewContext main_vc = new AbstractViewContext();          AbstractViewContext main_vc = new AbstractViewContext();
251          main_vc.setAccursed(context.getAccursed());          main_vc.setAccursed(context.getAccursed());
252            main_vc.setCursorOffset(context.getCursorOffset(context.getAccursed()));
253    
254          main_vc.setCellView(          main_vc.setCellView(
255                  new CellInBoxPlugin(cellview,                  new CellInBoxPlugin(cellview,
# Line 318  public class PPView2 implements View { Line 320  public class PPView2 implements View {
320          Object key = vs.matcher.getKey(vp);          Object key = vs.matcher.getKey(vp);
321          if("MAINVP".equals(key)) {          if("MAINVP".equals(key)) {
322              pa("Main viewport");              pa("Main viewport");
323              cs = vs.coords.getCSAt(cs, x, y, null);              float[] hit = new float[2];
324              Object k = vs.matcher.getKey(cs);              int vobcs = vs.coords.getCSAt(cs, x, y, hit);
325              pa("Hit: "+cs+" "+k);              if(vobcs < 0) {
326                    // No hit --> go to root paper cell, set pan
327                    context.setAccursed(context.getAccursed().h(d.contains));
328                    float[] pt = new float[] { x, y, 0 };
329                    vs.coords.inverseTransformPoints3(cs, pt, pt);
330                    panx = pt[0]; pany = pt[1];
331                    return null;
332                }
333                Object k = vs.matcher.getKey(vobcs);
334                pa("Hit: "+vobcs+" "+k+" "+hit[0]+" "+hit[1]);
335              if(!(k instanceof Cell)) {              if(!(k instanceof Cell)) {
336                  pa("Not a cell?!");                  pa("Not a cell?!");
337                  return null;                  return null;
338              }              }
339              context.setAccursed((Cell)k);              context.setAccursed((Cell)k);
340              context.setCursorOffset(1);              context.setCursorOffset(style.getOffsetInText(((Cell)k).t(), 1, hit[0]));
341              return null;              return null;
342          }          }
343          if(! (key instanceof Pair)) {          if(! (key instanceof Pair)) {

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

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