Package org.fxmisc.richtext

Examples of org.fxmisc.richtext.TwoLevelNavigator$Pos


         globals           = world.globals;
         metaSig           = world.metaSig;
         metaField         = world.metaField;
      }
      this.path = path;
      if (filename!=null && filename.length()>0) this.modulePos=new Pos(filename,1,1);
   }
View Full Code Here


         ans.add(make("<b>"+x.size()+(x.size()>1?" facts</b>":" fact</b>"), x));
      }
      if (asserts.size()>0) {
         x = new ArrayList<Browsable>(asserts.size());
         for(Map.Entry<String,Expr> e: asserts.entrySet()) {
            Pos sp = e.getValue().span();
            x.add(make(sp, sp, "<b>assert</b> "+e.getKey(), e.getValue()));
         }
         ans.add(make("<b>"+x.size()+(x.size()>1?" asserts</b>":" assert</b>"), x));
      }
      return ans;
View Full Code Here

   //============================================================================================================================//

   /** Add a sig declaration. */
   Sig addSig(String name, ExprVar par, List<ExprVar> parents, List<Decl> fields, Expr fact, Attr... attributes) throws Err {
      Sig obj;
      Pos pos = Pos.UNKNOWN.merge(WHERE.find(attributes));
      status = 3;
      dup(pos, name, true);
      String full = (path.length()==0) ? "this/"+name : path+"/"+name;
      Pos subset=null, subsig=null;
      boolean exact = false;
      if (par!=null) {
         if (par.label.equals("extends")) { subsig=par.span().merge(parents.get(0).span()); }
         else { exact=!par.label.equals("in"); subset=par.span(); for(ExprVar p:parents) subset=p.span().merge(subset); }
      }
View Full Code Here

   /** The given Sig will now point to a nonnull Sig. */
   private static Sig resolveSig(CompModule res, Set<Object> topo, Sig oldS) throws Err {
      if (res.new2old.containsKey(oldS)) return oldS;
      Sig realSig;
      final Pos pos = oldS.pos;
      final CompModule u = res.sig2module.get(oldS);
      final String name = base(oldS);
      final String fullname = (u.path.length()==0) ? ("this/"+name) : (u.path+"/"+name);
      if (!topo.add(oldS)) throw new ErrorType(pos, "Sig "+oldS+" is involved in a cyclic inheritance.");
      if (oldS instanceof SubsetSig)  {
View Full Code Here

         m.new2old.put(ka, ka);
         m.sigs.put(base(ka), ka);
         hasMetaSig = true;
         Expr allfields = ExprConstant.EMPTYNESS;
         for(Field field: s.getFields()) {
            Pos priv = field.isPrivate; if (priv==null) priv = s.isPrivate;
            PrimSig kb = new PrimSig(s.label+"$"+field.label, root.metaField, Attr.ONE, PRIVATE.makenull(priv), Attr.META);
            field2meta.put(field, kb);
            m.new2old.put(kb, kb);
            m.sigs.put(base(kb), kb);
            hasMetaField = true;
View Full Code Here

                });

        // initialize navigator
        IntSupplier cellCount = () -> area.getParagraphs().size();
        IntUnaryOperator cellLength = i -> virtualFlow.getCell(i).getNode().getLineCount();
        navigator = new TwoLevelNavigator(cellCount, cellLength);

        // emits a value every time the area is done updating
        EventStream<?> areaDoneUpdating = area.beingUpdatedProperty().offs();

        // follow the caret every time the caret position or paragraphs change
View Full Code Here

        return getLines().length;
    }

    public int currentLineIndex() {
        TextLine[] lines = getLines();
        TwoLevelNavigator navigator = new TwoLevelNavigator(() -> lines.length, i -> lines[i].getLength());
        return navigator.offsetToPosition(clampedCaretPosition.intValue(), Forward).getMajor();
    }
View Full Code Here

TOP

Related Classes of org.fxmisc.richtext.TwoLevelNavigator$Pos

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.