Examples of TimeFormatter


Examples of org.jbehave.core.reporters.TemplateableViewGenerator.TimeFormatter

    @Test
    public void shouldFormatTimeDurantionInMillis(){
        long s = 1000;
        long m = 60 * s;
        long h = 60 * m;
        TimeFormatter timeFormatter = new TimeFormatter();
        assertThat(timeFormatter.formatMillis(0), equalTo("00:00:00.000"));
        assertThat(timeFormatter.formatMillis(1), equalTo("00:00:00.001"));
        assertThat(timeFormatter.formatMillis(10), equalTo("00:00:00.010"));
        assertThat(timeFormatter.formatMillis(100), equalTo("00:00:00.100"));
        assertThat(timeFormatter.formatMillis(2*s+1), equalTo("00:00:02.001"));
        assertThat(timeFormatter.formatMillis(3*m+20*s+1), equalTo("00:03:20.001"));
        assertThat(timeFormatter.formatMillis(44*h+33*m+22*s+1), equalTo("44:33:22.001"));
    }
View Full Code Here

Examples of org.jsmpp.util.TimeFormatter

       
        // this is how to write "house" in arabic
        String house = "\u0628" + "\u064e" + "\u064a" +
                        "\u0652" + "\u067a" + "\u064f";
       
        TimeFormatter timeFormatter = new RelativeTimeFormatter();
       
       
        // 4. Specify the data coding using UCS2
        DataCoding dataCoding = new GeneralDataCoding(Alphabet.ALPHA_UCS2, MessageClass.CLASS1, false);
       
        // 5. UTF-16BE is equals to UCS2
        byte[] data = house.getBytes("UTF-16BE");
       
        // 6. Submit the short message
        String messageId = session.submitShortMessage("CMT",
                TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN,
                "1616", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN,
                "628176504657", new ESMClass(), (byte)0, (byte)1
                timeFormatter.format(new Date()), null,
                new RegisteredDelivery(SMSCDeliveryReceipt.DEFAULT), (byte)0,
                dataCoding,
                (byte)0, data);
    }
View Full Code Here

Examples of org.jsmpp.util.TimeFormatter

    AbstractMessageChannel outputChannel = TestUtils.getPropertyValue(gateway, "outputChannel", AbstractMessageChannel.class);
    assertEquals("out", outputChannel.getComponentName());

    // this is not set, should be default value
    TimeFormatter timeFormatter = TestUtils.getPropertyValue(gateway, "timeFormatter", TimeFormatter.class);
    assertNotNull(timeFormatter);
  }
View Full Code Here

Examples of org.jsmpp.util.TimeFormatter

    String sourceAddress = TestUtils.getPropertyValue(gateway, "defaultSourceAddress", String.class);
    assertEquals("12345", sourceAddress);

    // this is not set, should be default value
    TimeFormatter timeFormatter = TestUtils.getPropertyValue(gateway, "timeFormatter", TimeFormatter.class);
    assertNotNull(timeFormatter);

    // I send message
    Message<String> message = MessageBuilder.withPayload("Yuhuu !!! i am connected using Spring Integration namespace")
        .setHeader(SmppConstants.SRC_ADDR, "pavel")
View Full Code Here

Examples of org.springframework.richclient.form.binding.swing.text.TimeFormatter

    private static final String INPUT_SEPARATORS = "[hHuU\\s\\.,+*-/]";

    public TimeTextField()
    {
        super(new TimeFormatter());
        this.setDocument(new TimeDocument());
        setFocusLostBehavior(JFormattedTextField.COMMIT_OR_REVERT);
        addFocusListener(new UpdateFocusListener());
    }
View Full Code Here

Examples of util.ui.TimeFormatter

    }
   
    private void createContent() {try {
      mGridPn.removeAll();
     
      TimeFormatter formatter = new TimeFormatter();
     
      int[] times = Settings.propTimeButtons.getIntArray();
     
      for (final int time : times) {
        int h = time/60;
        int m = time%60;
        JButton btn = new JButton(formatter.formatTime(h, m));
        mGridPn.add(btn);
        btn.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent arg0) {
            mParent.scrollToTime(time);
          }
View Full Code Here

Examples of util.ui.TimeFormatter

  private JComponent mTableWest;
  private TimeFormatter mFormatter;

  public TimeBlockBackPainter() {
    if (Settings.propTwelveHourFormat.getBoolean()) {
      mFormatter = new TimeFormatter("hh a");
    } else {
      mFormatter = new TimeFormatter("HH");
    }
    mBackgroundImage1 = ImageUtilities
        .createImageAsynchronous(Settings.propTimeBlockBackground1.getString());
    mBackgroundImage2 = ImageUtilities
        .createImageAsynchronous(Settings.propTimeBlockBackground2.getString());
View Full Code Here

Examples of util.ui.TimeFormatter

      data.add(TIMETEXT[i]);
    }
    ArrayList<Integer> separators = new ArrayList<Integer>();
    separators.add(data.size());

    TimeFormatter formatter = new TimeFormatter();

    for (int time : mTimes) {
      int h = time / 60;
      int m = time % 60;
      StringBuilder builder = new StringBuilder();
      builder.append(mLocalizer.msg("at", "at"));
      builder.append(' ');
      builder.append(formatter.formatTime(h, m));
      data.add(builder.toString());
    }
    separators.add(data.size());

    data.add(mLocalizer.ellipsisMsg("configureTimes","Configure Times"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.