コード例 #1
0
 public Long[] getTimestamps() {
   Long[] timestamps = new Long[data.length];
   int i = 0;
   for (SampleModel sm : data) {
     timestamps[i++] = sm.getTimestamp();
   }
   return timestamps;
 }
コード例 #2
0
  // 为控件设置数据
  @Override
  public void onBindViewHolder(ViewHolder viewHolder, int i) {
    //  获取当前item中显示的数据
    final SampleModel rowData = sampleData.get(i);

    //  设置要显示的数据
    viewHolder.textViewSample.setText(rowData.getSampleText());
    viewHolder.itemView.setTag(rowData);
  }
コード例 #3
0
  public SampleModelCollection timestamp(Long... timestamps) {
    if (data.length != timestamps.length) {
      throw new IllegalArgumentException(
          "The number of supplied values do not match the data to be timestamped");
    }
    int i = 0;
    for (SampleModel s : data) {
      s.setTimestamp(timestamps[i++]);
    }

    return this;
  }
コード例 #4
0
ファイル: Tab1View.java プロジェクト: guigarage/griffon
  @Override
  public void initUI() {
    AnchorPane anchorPane = new AnchorPane();
    anchorPane.setPrefHeight(90.0);
    anchorPane.setPrefWidth(384.0);

    Label label = new Label(getApplication().getMessageSource().getMessage("name.label"));
    TextField input = new TextField();
    input.setPrefWidth(200.0);

    Button button = new Button();
    button.setPrefWidth(200.0);
    JavaFXUtils.configure(
        button, (JavaFXAction) actionFor(controller, "sayHello").getToolkitAction());

    Label output = new Label();
    label.setPrefWidth(360.0);

    model.inputProperty().bindBidirectional(input.textProperty());
    model.outputProperty().bindBidirectional(output.textProperty());

    anchorPane.getChildren().addAll(label, input, button, output);

    setLeftAnchor(label, 14.0);
    setTopAnchor(label, 14.0);
    setLeftAnchor(input, 172.0);
    setTopAnchor(input, 11.0);
    setLeftAnchor(button, 172.0);
    setTopAnchor(button, 45.0);
    setLeftAnchor(output, 14.0);
    setTopAnchor(output, 80.0);

    Tab tab = new Tab("Java");
    tab.setGraphic(new FontAwesomeIcon(FontAwesome.FA_COFFEE));
    tab.setClosable(false);
    tab.setContent(anchorPane);
    parentView.getTabPane().getTabs().add(tab);
  }
コード例 #5
0
ファイル: SampleController.java プロジェクト: dmissoh/griffon
 @Threading(Threading.Policy.INSIDE_UITHREAD_ASYNC)
 public void interact() {
   model.setInteractionCount(model.getInteractionCount() + 1);
 }
コード例 #6
0
ファイル: SampleController.java プロジェクト: dmissoh/griffon
 @Threading(Threading.Policy.INSIDE_UITHREAD_ASYNC)
 public void click() {
   model.setClickCount(model.getClickCount() + 1);
 }