Package javafx.scene.text

Examples of javafx.scene.text.TextFlow


            if( listView.getSelectionModel().getSelectedItem() != c.domainElement ) {
              listView.getSelectionModel().select(lineObject);
            }
           
            RegionImpl container = (RegionImpl)c.getGraphic();
            TextFlow flow = (TextFlow)container.getChildren().get(0);
           
            flow.requestLayout();
           
            break;
          }
        }
      }
View Full Code Here


    int lineIndex = getSkinnable().getContent().getLineAtOffset(caretPosition);
    Line lineObject = lineList.get(lineIndex);
    for( LineCell c : visibleCells ) {
      if( c.domainElement == lineObject ) {
        RegionImpl container = (RegionImpl)c.getGraphic();
        TextFlow flow = (TextFlow)container.getChildren().get(0);
        System.err.println("STARTING SCAN");
        Text textNode = null;
        int relativePos = 0;
        for( int i = flow.getChildren().size()-1; i >= 0; i-- ) {
          Node n = flow.getChildren().get(i);
//          System.err.println(((Text)n).getText() + " => " + n.getLayoutX());
          int offset = ((Integer) n.getUserData()).intValue();
          if( offset <= caretPosition ) {
            relativePos = caretPosition - offset;
            textNode = (Text) n;
View Full Code Here

      int lineIndex = getSkinnable().getContent().getLineAtOffset(caretPosition);
      Line lineObject = lineList.get(lineIndex);
      for( LineCell c : visibleCells ) {
        if( c.domainElement == lineObject ) {
          RegionImpl container = (RegionImpl)c.getGraphic();
          TextFlow flow = (TextFlow)container.getChildren().get(0);
         
         
          Text textNode = null;
          int relativePos = 0;
          for( int i = flow.getChildren().size()-1; i >= 0; i-- ) {
            Node n = flow.getChildren().get(i);
            int offset = ((Integer) n.getUserData()).intValue();
            if( offset <= caretPosition ) {
              relativePos = caretPosition - offset;
              textNode = (Text) n;
              break;
View Full Code Here

      if( ! arg1 ) {
        domainElement = arg0;
        visibleCells.add(this);
       
        RegionImpl stack = (RegionImpl) getGraphic();
        TextFlow flow;
       
        if( stack == null ) {
          flow = new TextFlow() {
            @Override
            protected void layoutChildren() {
              super.layoutChildren();
              updateCaret();
            }
          };
          Path caretPath = new Path();
          caretPath.setManaged(false);
          caretPath.setStrokeWidth(1);
              caretPath.setFill((Color.BLACK));
              caretPath.setStroke((Color.BLACK));
              caretPath.visibleProperty().bind(caretVisible);
          stack = new RegionImpl(flow,caretPath);
          setGraphic(stack);
        } else {
          flow = (TextFlow) stack.getChildren().get(0);
        }
       
        List<Text> texts = new ArrayList<>();
        for( final Segment seg : arg0.getSegments() ) {
          final Text t = new Text(seg.text);
          t.setUserData(seg.style.start);
          if( seg.style.foreground != null ) {
            t.setFill(seg.style.foreground);
          }
          if( seg.style.font != null ) {
            t.setFont(seg.style.font);
          } else {
            t.setFont(getFontByStyle(seg.style.fontStyle));
          }
         
          if( seg.style.underline ) {
            System.err.println("=====================> UNDERLINEING");
          }
         
          texts.add(t);
        }
       
        if( texts.isEmpty() ) {
          Text t = new Text("");
          t.setUserData(arg0.getLineOffset());
          texts.add(t);
        }
       
        flow.getChildren().setAll(texts);
        stack.requestLayout();
      } else {
        setGraphic(null);
        domainElement = null;
        visibleCells.remove(this);
View Full Code Here

          // Calculate to cell relative
          p = p.subtract(cell.getLayoutX(), cell.getLayoutY());
          Region g = (Region) cell.getGraphic();
          p = p.subtract(g.getLayoutX(), g.getLayoutY());
         
          TextFlow flow = (TextFlow) g.getChildrenUnmodifiable().get(0);
          // Calculate to text flow
          p = p.subtract(flow.getLayoutX(), flow.getLayoutY());
          for( Node n : flow.getChildren() ) {
            Text text = (Text) n;
            if( text.getBoundsInParent().contains(p) ) {
              HitInfo info = text.impl_hitTestChar(new Point2D(p.getX()-text.getLayoutX(), 0 /* See RT-28485 text.getLayoutY()*/));
              if( info.getInsertionIndex() >= 0 ) {
//                System.err.println("Text: " + text.getText());
View Full Code Here

TOP

Related Classes of javafx.scene.text.TextFlow

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.