Example #1
0
  @Override
  public int hashCode() {
    int result = 17;
    result = 31 * result + id;
    result = 31 * result + (firstName.get() != null ? firstName.get().hashCode() : 0);
    result = 31 * result + (lastName.get() != null ? lastName.get().hashCode() : 0);
    result = 31 * result + age.get();
    result = 31 * result + salary.get();
    result = 31 * result + (hired.get() != null ? hired.get().hashCode() : 0);
    result = 31 * result + (dismissal.get() != null ? dismissal.get().hashCode() : 0);

    return result;
  }
Example #2
0
 @Override
 public String toString() {
   return "First name: "
       + firstName.get()
       + ", Last name: "
       + lastName.get()
       + ", Age: "
       + age.get()
       + ", Salary: "
       + salary.get()
       + ", Hired date: "
       + hired.get()
       + (dismissal.get() != null ? ", Dismissal date: " + dismissal.get() : "");
 }
Example #3
0
  private void createChart() {
    xAxis = new NumberAxis();
    xAxis.setForceZeroInRange(false);
    xAxis.setAutoRanging(true);
    xAxis.setLabel(priceColumnLabel.get());

    yAxis = new NumberAxis();
    yAxis.setForceZeroInRange(false);
    yAxis.setAutoRanging(true);
    yAxis.setLabel("Amount in BTC");
    yAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(yAxis, "", ""));

    seriesBuy = new XYChart.Series();
    seriesBuy.setName("Offers for  buy bitcoin  ");

    seriesSell = new XYChart.Series();
    seriesSell.setName("Offers for sell bitcoin");

    areaChart = new AreaChart<>(xAxis, yAxis);
    areaChart.setAnimated(false);
    areaChart.setId("charts");
    areaChart.setMinHeight(300);
    areaChart.setPadding(new Insets(0, 30, 10, 0));
    areaChart.getData().addAll(seriesBuy, seriesSell);
  }
Example #4
0
  @Override
  protected void activate() {
    currencyComboBox.setItems(model.getTradeCurrencies());
    currencyComboBox.getSelectionModel().select(model.getTradeCurrency());
    currencyComboBox.setVisibleRowCount(Math.min(currencyComboBox.getItems().size(), 25));
    currencyComboBox.setOnAction(
        e -> {
          model.onSetTradeCurrency(currencyComboBox.getSelectionModel().getSelectedItem());
          updateChartData();
        });

    model.getOfferBookListItems().addListener(changeListener);
    tradeCurrencySubscriber =
        EasyBind.subscribe(
            model.tradeCurrency,
            newValue -> {
              String code = newValue.getCode();
              areaChart.setTitle("Offer book for " + newValue.getName());
              priceColumnLabel.set("Price (" + code + "/BTC)");
              volumeColumnLabel.set("Volume (" + code + ")");
              xAxis.setLabel(priceColumnLabel.get());
              xAxis.setTickLabelFormatter(new NumberAxis.DefaultFormatter(xAxis, "", ""));
            });

    buyOfferTableView.setItems(model.getBuyOfferList());
    sellOfferTableView.setItems(model.getSellOfferList());

    updateChartData();
  }
Example #5
0
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    Task task = (Task) o;

    if (!shortName.get().equals(task.shortName.get())) return false;
    if (description.get() != null
        ? !description.get().equals(task.description.get())
        : task.description.get() != null) return false;
    if (estimate.get() != (task.estimate.get())) return false;
    return !(status.get() != null
        ? !status.get().equals(task.status.get())
        : task.status.get() != null);
  }
Example #6
0
  @Override
  public void bridgeEstablished() {
    /* Only rebuild launchers if the updater is not waiting for the bridge to come back,
     * as the GUI will be restarted shortly */
    if (updateScene == null
        || (!updateScene.isAwaitingBridgeEstablish() && !updateScene.isAwaitingGUIRestart())) {

      log.info(String.format("Bridge established, rebuilding all launchers"));
      rebuildAllLaunchers();
      if (context.getBridge().isServiceUpdating()) {
        setMode(Mode.UPDATE);
      } else {
        final StringProperty prop = Configuration.getDefault().temporaryOnStartConnectionProperty();
        String tmp = prop.get();
        if (!StringUtils.isBlank(tmp)) {
          try {
            Connection c =
                context.getBridge().getConnectionService().getConnection(Long.parseLong(tmp));
            if (c == null) throw new Exception("No connection with id of " + tmp);
            log.info(
                String.format(
                    "Using temporary 'on start' connection %d (%s)", c.getId(), c.getHostname()));
            context.getBridge().connect(c);
          } catch (Exception e) {
            log.error("Failed to start temporary 'on start' connection.", e);
          }
          prop.set("");
        }
      }
    }
  }
 @Override
 public String toString() {
   return "LuceneSearchTypeFilter [searchParameter="
       + searchParameter.get()
       + ", isValid="
       + isValid.get()
       + "]";
 }
Example #8
0
 @Override
 public String toString() {
   return "Pessoa{"
       + "id="
       + id.get()
       + ",\nnome="
       + nome.get()
       + ", \ndataNasc="
       + dataNasc.get()
       + ", \napelido="
       + apelido.get()
       + ", \nendereco="
       + endereco.get()
       + ", \nimg="
       + img.get()
       + '}';
 }
 /**
  * Creates a new ExerciseFilter domain object from the edited JavaFX properties.
  *
  * @return ExerciseFilter
  */
 public ExerciseFilter getExerciseFilter() {
   final ExerciseFilter exerciseFilter = new ExerciseFilter();
   exerciseFilter.setDateStart(dateStart.get());
   exerciseFilter.setDateEnd(dateEnd.get());
   exerciseFilter.setSportType(sportType.get());
   exerciseFilter.setSportSubType(sportSubtype.get());
   exerciseFilter.setIntensity(intensity.get().intensityType);
   exerciseFilter.setEquipment(equipment.get());
   exerciseFilter.setCommentSubString(StringUtils.getTrimmedTextOrNull(commentSubString.get()));
   exerciseFilter.setRegularExpressionMode(regularExpressionMode.get());
   return exerciseFilter;
 }
Example #10
0
  @Override
  public void start(Stage primaryStage) {
    primaryStage.setTitle("JavaFX TextField example");

    VBox mainLayout = new VBox();

    HBox fieldLayout = new HBox();

    TextField textField = new TextField();
    Button button = new Button("X");
    button.setDisable(true);
    textField
        .textProperty()
        .addListener(
            (obj, oldVal, newVal) -> {
              if (newVal.trim().isEmpty()) {
                button.setDisable(true);
              } else {
                button.setDisable(false);
              }
            });

    textField.textProperty().bindBidirectional(obs);

    fieldLayout.getChildren().addAll(textField, button);

    HBox buttons = new HBox();
    Button clear = new Button("Clear");
    clear.setOnAction(e -> obs.set(""));
    Button setVal = new Button("Set value");
    setVal.setOnAction(e -> obs.set("Hello"));
    Button dump = new Button("Dump");
    dump.setOnAction(e -> System.err.println("Current: " + obs.get()));
    buttons.getChildren().addAll(clear, setVal, dump);

    mainLayout.getChildren().addAll(fieldLayout, buttons);

    // show the generated scene graph
    Scene scene = new Scene(mainLayout);
    primaryStage.setScene(scene);
    primaryStage.show();
  }
 private void enableKeypad() {
   setTextProperty(tfAmountEntry.textProperty(), amountFormatter);
   btnClear.setOnMouseClicked(event -> rawAmount.set(""));
   btn00.setOnMouseClicked(event -> rawAmount.set(rawAmount.get() + "00"));
   btn0.setOnMouseClicked(event -> rawAmount.set(rawAmount.get() + "0"));
   btn1.setOnMouseClicked(event -> rawAmount.set(rawAmount.get() + "1"));
   btn2.setOnMouseClicked(event -> rawAmount.set(rawAmount.get() + "2"));
   btn3.setOnMouseClicked(event -> rawAmount.set(rawAmount.get() + "3"));
   btn4.setOnMouseClicked(event -> rawAmount.set(rawAmount.get() + "4"));
   btn5.setOnMouseClicked(event -> rawAmount.set(rawAmount.get() + "5"));
   btn6.setOnMouseClicked(event -> rawAmount.set(rawAmount.get() + "6"));
   btn7.setOnMouseClicked(event -> rawAmount.set(rawAmount.get() + "7"));
   btn8.setOnMouseClicked(event -> rawAmount.set(rawAmount.get() + "8"));
   btn9.setOnMouseClicked(event -> rawAmount.set(rawAmount.get() + "9"));
   btnCash.setOnMouseClicked(event -> addPaymentEntry(PaymentEntryType.CASH));
   btnCredit.setOnMouseClicked(event -> addPaymentEntry(PaymentEntryType.CREDIT));
   btnCheck.setOnMouseClicked(event -> addPaymentEntry(PaymentEntryType.CHECK));
   btnGiftCard.setOnMouseClicked(event -> addPaymentEntry(PaymentEntryType.GIFTCARD));
   btnEvenTender.setOnMouseClicked(
       event -> rawAmount.set(getItem().dueProperty().get().toString().replace(".", "")));
 }
 public void setInfo(String txt) {
   System.out.println("change infotext from " + info.get() + " to " + txt);
   info.set(txt);
 }
Example #13
0
 public static String getEncoding() {
   return encoding.get();
 }
Example #14
0
 public static String getLineSeparator() {
   return lineSeparator.get();
 }
Example #15
0
 public final String getText() {
   return text.get();
 }
Example #16
0
    public ProgressTU(String title, int timeout) {
      Group root = new Group();
      Scene scene = new Scene(root);
      setScene(scene);
      setTitle(title);
      initModality(Modality.NONE);
      initOwner(SingleObject.mainStage.getScene().getWindow());

      final Label label = new Label();
      label.textProperty().bind(pr);

      final ProgressIndicator pin = new ProgressIndicator();
      pin.setProgress(-1);

      final HBox hb = new HBox();
      hb.setSpacing(5);
      hb.setAlignment(Pos.CENTER);
      hb.getChildren().addAll(label, pin);

      final VBox vb = new VBox();
      vb.setPadding(new Insets(5, 5, 5, 5));
      vb.setSpacing(5);
      vb.getChildren().addAll(new Label(sendText), hb);
      scene.setRoot(vb);

      new Thread(
              () -> {
                while (isRun) {
                  Platform.runLater(
                      () -> {
                        int t = Integer.parseInt(pr.get()) + 1;
                        pr.set("" + t);

                        if (t >= timeout) {
                          isRun = false;
                        }
                        if (SingleFromDB.psClient.getSendOK(tuSignal.getIdsignal()) == 3) {
                          pin.setProgress(1);
                          isRun = false;
                        }
                      });
                  try {
                    Thread.sleep(1000);
                  } catch (Exception e) {
                    e.printStackTrace();
                  }
                }
              })
          .start();

      getScene()
          .addEventHandler(
              KeyEvent.KEY_PRESSED,
              t -> {
                if (t.getCode() == KeyCode.ESCAPE) {
                  LogFiles.log.log(Level.INFO, "Exit " + getTitle());
                  isRun = false;
                  close();
                }
              });
      setOnCloseRequest(wc -> isRun = false);
    }
 public String getViernes() {
   return Viernes.get();
 }
Example #18
0
 @Override
 public String getShortName() {
   return shortName.get();
 }
 public String getMiercoles() {
   return Miercoles.get();
 }
 public String getMartes() {
   return Martes.get();
 }
 public String getLunes() {
   return Lunes.get();
 }
Example #22
0
 public String getPlaca() {
   return placa.get();
 }
Example #23
0
 public String getItemName() {
   return itemName.get();
 }
Example #24
0
 public String getDescription() {
   return description.get();
 }
 public String getName() {
   return name.get();
 }
 public String getJueves() {
   return Jueves.get();
 }
Example #27
0
 public String getItemDescription() {
   return itemDescription.get();
 }
 public String getNome() {
   return nome.get();
 }
Example #29
0
 public String getModelo() {
   return modelo.get();
 }
 public String getHora() {
   return Hora.get();
 }