Package javafx.scene.text

Examples of javafx.scene.text.Text


      // history visualizer
      historicalVisualizer = new HistoricalVisualizer(this);
      getChildren().add(historicalVisualizer);
     
      // add the duration as text
      Text lTimeText = new Text(startAsString + "-" + endAsString);
      {
        lTimeText.getStyleClass().add("AppointmentTimeLabel");
        lTimeText.setX( padding );
        lTimeText.setY(lTimeText.prefHeight(0));
        Rectangle lClip = new Rectangle(0,0,0,0);
        lClip.widthProperty().bind(widthProperty().subtract(padding));
        lClip.heightProperty().bind(heightProperty());
        lTimeText.setClip(lClip);
        getChildren().add(lTimeText);
      }
      // add summary
      Text lSummaryText = new Text(appointment.getSummary());
      {
        lSummaryText.getStyleClass().add("AppointmentLabel");
        lSummaryText.setX( padding );
        lSummaryText.setY( lTimeText.getY() + textHeightProperty.get());
        lSummaryText.wrappingWidthProperty().bind(widthProperty().subtract(padding));
        Rectangle lClip = new Rectangle(0,0,0,0);
        lClip.widthProperty().bind(widthProperty());
        lClip.heightProperty().bind(heightProperty().subtract(padding));
        lSummaryText.setClip(lClip);
        getChildren().add(lSummaryText);     
      }
    }
View Full Code Here


      // history visualizer
      historicalVisualizer = new HistoricalVisualizer(this);
      getChildren().add(historicalVisualizer);
     
      // add the duration as text
      final Text lTimeText = new Text(startAsString + " " + appointment.getSummary());
      {
        lTimeText.getStyleClass().add("AppointmentTimeLabel");
        lTimeText.setX( menuIcon.getWidth() + padding );
        lTimeText.setY(lTimeText.prefHeight(0) / 2);
        lTimeText.wrappingWidthProperty().bind(widthProperty().subtract(padding));
        // add a clip to mask out all except the first line
        lTimeText.fontProperty().addListener( (observable) -> {
          Rectangle lClip = new Rectangle();
          lClip.widthProperty().bind(widthProperty().subtract(padding));
          lClip.heightProperty().set( lTimeText.fontProperty().getValue().getSize() );
          lTimeText.setClip(lClip);
        });
        getChildren().add(lTimeText);
      }
     
      // add the menu header
View Full Code Here

    // show the correct tab
    click("#defaultControl");
   
    // get the node
    CalendarTimePicker lCalendarTimePicker = (CalendarTimePicker)find(".CalendarTimePicker");
    Text lLabelText = (Text)find(".timeLabel");
   
    // default value is not null
    Assert.assertNotNull(lCalendarTimePicker.getCalendar());
    Assert.assertEquals(1, lCalendarTimePicker.getMinuteStep().intValue());
   
    // set time to 12:30:00
    TestUtil.runThenWaitForPaintPulse( () -> {
      lCalendarTimePicker.setCalendar(new GregorianCalendar(2013, 0, 1, 20, 30, 00));     
    });
   
    // assert notation
    Assert.assertEquals("8:30 PM", lLabelText.getText());
  }
View Full Code Here

    // show the correct tab
    click("#locale");
   
    // get the node
    CalendarTimePicker lCalendarTimePicker = (CalendarTimePicker)find(".CalendarTimePicker");
    Text lLabelText = (Text)find(".timeLabel");
   
    // set time to 12:30:00
    TestUtil.runThenWaitForPaintPulse( () -> {
      lCalendarTimePicker.setCalendar(new GregorianCalendar(2013, 0, 1, 20, 30, 00));     
    });
   
    // assert notation
    Assert.assertEquals("20:30", lLabelText.getText());
  }
View Full Code Here

    // show the correct tab
    click("#defaultControl");
   
    // get the node
    LocalTimePicker lLocalTimePicker = (LocalTimePicker)find("#id1"); // TODO: this should be accessible through .LocalTimePicker
    Text lLabelText = (Text)find(".timeLabel");
   
    // default value is not null
    Assert.assertNotNull(lLocalTimePicker.getLocalTime());
    Assert.assertEquals(1, lLocalTimePicker.getMinuteStep().intValue());
   
    // set time to 12:30:00
    TestUtil.runThenWaitForPaintPulse( () -> {
      lLocalTimePicker.setLocalTime(LocalTime.of(20, 30, 00));     
    });
   
    // assert notation
    Assert.assertEquals("8:30 PM", lLabelText.getText());
  }
View Full Code Here

    // show the correct tab
    click("#locale");
   
    // get the node
    LocalTimePicker lLocalTimePicker = (LocalTimePicker)find("#id3"); // TODO: this should be accessible through .LocalTimePicker
    Text lLabelText = (Text)find(".timeLabel");
   
    // set time to 12:30:00
    TestUtil.runThenWaitForPaintPulse( () -> {
      lLocalTimePicker.setLocalTime(LocalTime.of(20, 30, 00));     
    });
   
    // assert notation
    Assert.assertEquals("20:30", lLabelText.getText());
  }
View Full Code Here

    // set time to 12:30:00
    TestUtil.runThenWaitForPaintPulse( () -> {
      localTimePicker.setLocalTime(LocalTime.of(12, 30, 00));     
    });
   
    Text lLabelText = (Text)find(".timeLabel");

    // move the hour slider
    move("#hourSlider > .thumb");
    press(MouseButton.PRIMARY);
    moveBy(100,0);   
    release(MouseButton.PRIMARY);
    Assert.assertEquals("8:30 PM", lLabelText.getText());
    Assert.assertEquals("20:30", localTimePicker.getLocalTime().toString());
   
    // move the minute slider
    move("#minuteSlider > .thumb");
    press(MouseButton.PRIMARY);
    moveBy(-50,0);   
    release(MouseButton.PRIMARY);
    Assert.assertEquals("8:19 PM", lLabelText.getText());
    Assert.assertEquals("20:19", localTimePicker.getLocalTime().toString());
  }
View Full Code Here

      localTimePicker.setMinuteStep(15);
      localTimePicker.setSecondStep(15);
      localTimePicker.setStyle("-fxx-label-dateformat:\"HH:mm:ss\";");
    });
   
    Text lLabelText = (Text)find(".timeLabel");

    // move the hour slider
    move("#hourSlider > .thumb");
    press(MouseButton.PRIMARY);
    moveBy(100,0);   
    release(MouseButton.PRIMARY);
    Assert.assertEquals("20:30:00", lLabelText.getText());
    Assert.assertEquals("20:30", localTimePicker.getLocalTime().toString());

    // move the minute slider
    move("#minuteSlider > .thumb");
    press(MouseButton.PRIMARY);
    moveBy(-50,0);   
    release(MouseButton.PRIMARY);
    Assert.assertEquals("20:15:00", lLabelText.getText());
    Assert.assertEquals("20:15", localTimePicker.getLocalTime().toString());

    // move the second slider
    move("#secondSlider > .thumb");
    press(MouseButton.PRIMARY);
    moveBy(40,0);   
    release(MouseButton.PRIMARY);
    Assert.assertEquals("20:15:15", lLabelText.getText());
    Assert.assertEquals("20:15:15", localTimePicker.getLocalTime().toString());
  }
View Full Code Here

   *
   */
  @Test
  public void locale()
  {
    Text lLabelText = (Text)find(".timeLabel");
   
    // set time to 12:30:00
    TestUtil.runThenWaitForPaintPulse( () -> {
      localTimePicker.setLocalTime(LocalTime.of(20, 30, 00));     
    });
   
    // assert label
    Assert.assertEquals("8:30 PM", lLabelText.getText());
   
    // change locale
    TestUtil.runThenWaitForPaintPulse( () -> {
      localTimePicker.setLocale(Locale.GERMAN);     
    });
   
    // assert label
    Assert.assertEquals("20:30", lLabelText.getText());
  }
View Full Code Here

    // set time to 12:30:00
    TestUtil.runThenWaitForPaintPulse( () -> {
      calendarTimePicker.setCalendar(new GregorianCalendar(2013, 0, 1, 20, 30, 00));     
    });
   
    Text lLabelText = (Text)find(".timeLabel");
   
    // assert label
    Assert.assertEquals("8:30 PM", lLabelText.getText());
    Assert.assertEquals("20:30:00", TestUtil.quickFormatCalendarAsTime(calendarTimePicker.getCalendar()));
   
    // change locale
    TestUtil.runThenWaitForPaintPulse( () -> {
      calendarTimePicker.setLocale(Locale.GERMAN);     
    });
   
    // assert label
    Assert.assertEquals("20:30", lLabelText.getText());
    Assert.assertEquals("20:30:00", TestUtil.quickFormatCalendarAsTime(calendarTimePicker.getCalendar()));
  }
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.