Package javafx.scene.text

Examples of javafx.scene.text.Text


  }

  public void error(String message) {
    Stage dialog = new Stage();
    dialog.initStyle(StageStyle.UTILITY);
    Scene scene = new Scene(new Group(new Text(25, 25, message)));
    dialog.setScene(scene);
    dialog.show();
  }
View Full Code Here


        final Project p = project.get();

        projectTitle.setText(p.getTitle());
        goalAmountLabel.setText(String.format(goalAmountFormatStr, p.getGoalAmount().toPlainString()));

        description.getChildren().setAll(new Text(project.get().getMemo()));

        noPledgesLabel.visibleProperty().bind(isEmpty(pledgesList.getItems()));

        // Load and set up the cover image.
        Image img = new Image(p.getCoverImage().newInput());
View Full Code Here

        loader.setRoot(this);
        loader.setController(this);
        uncheck(loader::load);

        titleLabel.setText(project.getTitle());
        Text text = new Text(project.getMemo());
        blurbFlow.getChildren().setAll(text);

        if (Main.wallet.isProjectMine(project)) {
            AwesomeDude.setIcon(ownershipIcon, AwesomeIcon.HOME, "25");
        } else {
View Full Code Here

   
    HBox root = new HBox();
    root.setFillHeight(true);
   
    left = new BorderPane();
    Text t = new Text("Left Area");
    t.setEffect(new DropShadow(2,3,3,Color.RED));
    t.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {
      @Override
      public void handle(MouseEvent event) {
        doIt();
      }
    });
    left.setCenter(t);
    HBox.setHgrow(left, Priority.ALWAYS);
//    left.setMinWidth(800);
//    left.setMinHeight(300);
//    front.setLayoutX(400);
//    front.setLayoutY(300);
   
    rect = new Rectangle(20, 80);
    rect.setOpacity(0.7);
    rect.setFill(Color.GREEN);
   
    left.getChildren().add(rect);

    right = new BorderPane();
    t = new Text("right\nside");
    t.setTextAlignment(TextAlignment.CENTER);
    t.setEffect(new DropShadow(2,3,3,Color.RED));
   
    right.setCenter(t);
    HBox.setHgrow(right, Priority.ALWAYS);
//    right.setMinWidth(800);
//    right.setMinHeight(600);
View Full Code Here

//    animations.add(new RotateOutAnimation());
    animations.add(new FlipAnimation());
   
    anim = animations.poll();
   
    label = new Text();
    label.setFont(new Font("Arial", 100));
    label.setEffect(new javafx.scene.effect.DropShadow(5, 3, 4, Color.RED));
    label.setX(20);
    label.setY(120);
   
View Full Code Here

    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;
            break;
          }
        }
       
        if( textNode != null ) {
          textNode.setImpl_caretPosition(relativePos);
          PathElement[] elements = textNode.getImpl_caretShape();
          double xShift = textNode.getLayoutX();
          System.err.println(textNode.getText() + " ====> " + xShift);
          for( PathElement e : elements ) {
            if( e instanceof MoveTo ) {
              xShift +=((MoveTo)e).getX();
            }
          }
View Full Code Here

        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;
            }
          }
         
          if( textNode != null ) {
            textNode.setImpl_caretPosition(relativePos);
           
            final Path p = (Path)container.getChildren().get(1);
           
            p.getElements().clear();
            p.getElements().addAll(textNode.getImpl_caretShape());
           
            p.setLayoutX(textNode.getLayoutX());
            p.setLayoutY(textNode.getBaselineOffset());
          }
         
          break;
        }
      }
View Full Code Here

          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();
View Full Code Here

         
          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());
//                System.err.println("Text-Offset: " + text.getUserData());
//                System.err.println("INSERT INDEX: " + info.getInsertionIndex());
                int offset = ((Integer)text.getUserData()).intValue()+info.getInsertionIndex();
//                System.err.println("NEW OFFSET AT: " + offset);
                getControl().setCaretOffset(offset);
                return;
              }
            }
View Full Code Here

TOP

Related Classes of javafx.scene.text.Text

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.