Esempio n. 1
0
 public final void setGlowEnabled(final boolean GLOW_ENABLED) {
   if (null == glowEnabled) {
     _glowEnabled = GLOW_ENABLED;
   } else {
     glowEnabled.set(GLOW_ENABLED);
   }
 }
Esempio n. 2
0
 public final void setBackgroundVisible(final boolean BACKGROUND_VISIBLE) {
   if (null == backgroundVisible) {
     _backgroundVisible = BACKGROUND_VISIBLE;
   } else {
     backgroundVisible.set(BACKGROUND_VISIBLE);
   }
 }
Esempio n. 3
0
 public final void setHighlightsVisible(final boolean HIGHLIGHTS_VISIBLE) {
   if (null == highlightsVisible) {
     _highlightsVisible = HIGHLIGHTS_VISIBLE;
   } else {
     highlightsVisible.set(HIGHLIGHTS_VISIBLE);
   }
 }
Esempio n. 4
0
  private void initPendingTrades() {
    if (firstPeerAuthenticatedListener != null)
      p2PService.removeP2PServiceListener(firstPeerAuthenticatedListener);

    List<Trade> failedTrades = new ArrayList<>();
    for (Trade trade : trades) {
      // We continue an interrupted trade.
      // TODO if the peer has changed its IP address, we need to make another findPeer request. At
      // the moment we use the peer stored in trade to
      // continue the trade, but that might fail.

      // TODO
      /* if (trade.isFailedState()) {
          failedTrades.add(trade);
      }
      else {*/
      trade.setStorage(tradableListStorage);
      trade.updateDepositTxFromWallet(tradeWalletService);
      initTrade(trade);

      // after we are authenticated we remove mailbox messages.
      DecryptedMsgWithPubKey mailboxMessage = trade.getMailboxMessage();
      if (mailboxMessage != null) {
        log.trace("initPendingTrades/removeEntryFromMailbox mailboxMessage = " + mailboxMessage);
        p2PService.removeEntryFromMailbox(mailboxMessage);
        trade.setMailboxMessage(null);
      }
      // }
    }
    pendingTradesInitialized.set(true);

    failedTrades.stream().filter(Trade::isTakerFeePaid).forEach(this::addTradeToFailedTrades);
  }
Esempio n. 5
0
 private void registerStatements() {
   // FIXME this is registered multiple times
   try {
     database.get().createPreparedStatement(statementObject, statementFormat);
     alive.set(true);
   } catch (final Throwable t) {
     t.printStackTrace();
   }
 }
Esempio n. 6
0
 public void bind(final BooleanProperty property, final String propertyName) {
   String value = props.getProperty(propertyName);
   if (value != null) {
     property.set(Boolean.valueOf(value));
   }
   property.addListener(
       o -> {
         props.setProperty(propertyName, property.getValue().toString());
       });
 }
  @Override
  public void changed(
      ObservableValue<? extends List<BindingViolation>> observable,
      List<BindingViolation> oldValue,
      List<BindingViolation> newValue) {

    List<BindingViolation> allViolations = new ArrayList<BindingViolation>();

    for (Binding<?, ?> oneBinding : bindings) {
      allViolations.addAll(oneBinding.targetConstraintViolationsProperty().getValue());
    }

    allConstraintViolations.setValue(Collections.unmodifiableList(allViolations));
    isValidProperty.set(allViolations.isEmpty());

    System.out.println("BindingContext#isValid(): " + isValidProperty.getValue());
  }
Esempio n. 8
0
    //		Validator getValidator() { return validator; }
    void setValidator(Validator v) {
      if (valuePropertyListener != null) {
        valueProperty.removeListener(valuePropertyListener);
      }
      validator = v;

      if (validator != null) {
        valueProperty.addListener(
            new ChangeListener<String>() {
              @Override
              public void changed(
                  ObservableValue<? extends String> observable, String oldValue, String newValue) {
                statusProperty.set(validator.isValid());
              }
            });
        statusProperty.set(validator.isValid());
      }
    }
Esempio n. 9
0
 public NameDialog(final Stage stg, Maze maze) {
   width = 350;
   height = 80;
   this.maze = maze;
   stage = new Stage();
   stage.initModality(Modality.APPLICATION_MODAL);
   stage.initOwner(stg);
   stage.setTitle("Name:Press Enter Confirmed");
   Group root = new Group();
   AnchorPane anchorPane = new AnchorPane();
   okbtn = new Button("确定");
   field = new TextField();
   field.setFont(new Font(30));
   field.setPrefWidth(width);
   field.setPrefHeight(height);
   property.set(false);
   MyEvent myEvent = new MyEvent();
   field.setOnKeyPressed(
       new EventHandler<KeyEvent>() {
         @Override
         public void handle(KeyEvent event) {
           if (event.getCode() == KeyCode.ENTER) {
             maze.handleEvent(field.getText());
             stage.close();
           }
         }
       });
   okbtn.setOnMouseClicked(myEvent);
   Scene scene = new Scene(root, width, height + 20);
   anchorPane.getChildren().add(field);
   okbtn.setLayoutX(0);
   okbtn.setLayoutY(height);
   anchorPane.getChildren().add(okbtn);
   root.getChildren().add(anchorPane);
   stage.setScene(scene);
   stage.show();
 }
Esempio n. 10
0
  private Conf() {

    confDoc = DBUtils.getConfDoc();
    if (confDoc == null) {
      confDoc = new Document();
      confDoc
          .append("_id", "conf")
          .append("width", 400d)
          .append("height", 400d)
          .append("traductor", false)
          .append("lastDoc", lastDoc.get());
      DBUtils.getCollection().insertOne(confDoc);
    } else {
      System.out.println(confDoc.toJson());
      height.set(confDoc.getDouble("height"));
      width.set(confDoc.getDouble("width"));
      traductorVisible.set(confDoc.getBoolean("traductor", false));
      Document _ld = (Document) confDoc.get("lastDoc");
      if (_ld != null) {
        lastDoc.set(_ld);
      }
    }
    setListeners();
  }
 public void withdrawAddressFocusOut(String text) {
   withdrawalButtonDisable.set(!btcAddressValidator.validate(text).isValid);
 }
Esempio n. 12
0
 public final void setVisible(final boolean VISIBLE) {
   visible.set(VISIBLE);
 }
 public void setOn(boolean value) {
   on.set(value);
 }
 public void setEnabled(boolean value) {
   enabledProperty.set(value);
 }
  public ConfigurationPropertyEditor(ConfigurationEditor parent, Property collection) {
    this.parent = parent;
    this.parentCollection = collection;

    getStyleClass().add("configuration-property-editor");

    selected = new SimpleBooleanProperty(false);

    skinProperty()
        .addListener(
            (sp, o, n) -> {
              Node node = FXUtils.getTitledPaneTitleRegion(this);

              if (node != null) {
                node.addEventFilter(MouseEvent.MOUSE_RELEASED, eh -> eh.consume());
                node.addEventFilter(
                    MouseEvent.MOUSE_PRESSED,
                    eh -> {
                      eh.consume();
                      if (!selected.get()) {
                        selected.set(true);
                      } else {
                        setExpanded(!isExpanded());
                      }
                    });
              }
            });

    selected.addListener(
        (p, ov, nv) -> {
          if (nv && parent != null) {
            parent.select(this);
          }
        });

    infoContainer = new Label("");
    confEditor = new ConfigurationEditorInternal(parent, this);

    implementorsBorderPane = new BorderPane();
    implementorsBorderPane.getStyleClass().add("implementors");

    Label label = new Label("type :");
    label.setPadding(new Insets(0, LABEL_MARGING, 0, 0));
    BorderPane.setAlignment(label, Pos.CENTER_LEFT);
    implementorsBorderPane.setLeft(label);

    choiceBox = new ChoiceBox<>();
    //        choiceBox.setMaxWidth(Double.MAX_VALUE);
    choiceBox
        .valueProperty()
        .addListener(
            (ObservableValue<? extends String> p, String ov, String nv) -> {
              try {
                if (property != null) {
                  Configuration value = null;
                  if (!nv.equals("NULL")) {
                    value = Registery.get().getConfiguration(nv);
                  }
                  property.set(value == null ? null : new FromConfigurationPropertyValue(value));
                  setRepresentativeName();
                  confEditor.setModel(value, readOnly, filter);
                }
              } catch (ClassNotFoundException ex) {
                Logger.getLogger(ConfigurationPropertyEditor.class.getName())
                    .log(Level.SEVERE, null, ex);
              }
            });
    BorderPane.setAlignment(choiceBox, Pos.CENTER_LEFT);
    implementorsBorderPane.setCenter(choiceBox);

    editorVBox = new VBox();
    editorVBox.getChildren().addAll(implementorsBorderPane, confEditor);
    setContent(editorVBox);

    setGraphic(infoContainer);
    setExpanded(false);
  }