Package javafx.scene.control

Examples of javafx.scene.control.Button


     * @return a tool bar that will display the image name (using the label) and a zoom button
     */
    protected ToolBar createToolBar() {
      final ToolBar toolBar = new ToolBar();
      toolBar.setOpacity(toolBarPosition == TOOLBAR_POSITION_TOP ? 0.7 : 0.9);
      final Button zoomButton = createViewOriginalButton();
      if (zoomButton != null) {
        toolBar.getItems().addAll(zoomButton, label);
      } else {
        toolBar.getItems().add(label);
      }
View Full Code Here


     */
    protected Button createViewOriginalButton() {
      // TODO : handle image zoom when no file is specified
      if (file != null) {
        final Group btnGraphic = createButtonGraphic(0.2);
        final Button zoomButton = new Button();
        zoomButton.setTooltip(new Tooltip(imageFullSizeToolTip));
        zoomButton.setGraphic(btnGraphic);
        zoomButton.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent e) {
            Image image;
            try {
            image = new Image(new FileInputStream(file));
View Full Code Here

    // textField.setTooltip(new
    // Tooltip(RS.rbLabel("wireless.node.remote")));
    textField.setMaxWidth(100d);
    controlBar.addHelpTextTrigger(textField,
        RS.rbLabel(KEY.WIRELESS_NODE_REMOTE_ADDY_DESC));
    final Button addNodeButton = new FunctionButton(
        FunctionButton.Function.ADD, new Runnable() {
          @Override
          public void run() {
            add(textField.getText());
          }
        });
    controlBar.addHelpTextTrigger(addNodeButton,
        RS.rbLabel(KEY.WIRELESS_NODE_REMOTE_ADD_DESC));
    final Button removeNodeButton = new FunctionButton(
        FunctionButton.Function.REMOVE, new Runnable() {
          @Override
          public void run() {
            removeSelected();
          }
View Full Code Here

  public void removeSelected() {
    final String address = rnListView.getSelectionModel().getSelectedItem();
    if (address == null || address.isEmpty()) {
      return;
    }
    final Button closeBtn = ButtonBuilder.create().text(RS.rbLabel(KEY.CLOSE)).build();
    final GuiUtil.DialogService dialogService = GuiUtil.dialogService(null, KEY.APP_TITLE,
        RS.rbLabel(KEY.WIRELESS_NODE_REMOTE_REMOVE, address),
        KEY.SUBMIT, 550d, 300d, new Service<Void>() {
      @Override
      protected Task<Void> createTask() {
        return new Task<Void>() {
          @Override
          protected Void call() throws Exception {
            // if the dialog shouldn't be closed call super.cancel()
            try {
              log.info("Attempting to remove remote node at address: "
                  + address);
              if (controlBar.getActor().getHost().getRemoteNodes().size() > 1) {
                RemoteNode rnr = null;
                for (final RemoteNode rn : controlBar.getActor().getHost().getRemoteNodes()) {
                  if (address.equalsIgnoreCase(rn.getAddress())) {
                    rnr = rn;
                    break;
                  }
                }
                if (rnr != null) {
                  // remove node and persist changes (actual removal from view will
                  // occur when the removal has been committed)
                  controlBar.getActor().getHost().getRemoteNodes().remove(rnr);
                  ServiceProvider.IMPL.getCredentialService().mergeHost(
                      controlBar.getActor().getHost(), rnr);
                }
              }
            } catch (final Throwable t) {
              throw new RuntimeException();
            }
            return null;
          }
        };
      }
    }, Modality.APPLICATION_MODAL, closeBtn);
    if (closeBtn != null) {
      closeBtn.setOnMouseClicked(new EventHandler<MouseEvent>() {
        @Override
        public void handle(final MouseEvent event) {
          dialogService.hide();
        }
      })
View Full Code Here

        controlBar.getActorPA(), ActorType.MAIL_ON_AT_COM_STARTUP,
        null, null, RS.rbLabel(KEY.APP_SERVICE_STARTUP_AUTO),
        RS.rbLabel(KEY.APP_SERVICE_STARTUP_MANUAL));
    controlBar.addHelpTextTrigger(emailOnAtStartSwitch,
        RS.rbLabel(KEY.APP_SERVICE_HOST_STARTUP_DESC));
    emailConnectBtn = new Button(RS.rbLabel(KEY.MAIL_CONNECT));
    cb.addServiceBehavior(emailConnectBtn, null,
        ServiceProvider.Type.EMAIL, KEY.MAIL_CONNECT_DESC);
    emailBtnView.getChildren()
        .addAll(emailConnectBtn, emailOnAtStartSwitch);
View Full Code Here

   * @param webView
   *            the web view to reload
   * @return the created button
   */
  protected Button createReloadButton(final WebView webView) {
    final Button reloadBtn = new Button(RS.rbLabel(KEY.RELOAD));
    reloadBtn.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
      @Override
      public void handle(MouseEvent event) {
        webView.getEngine().reload();
      }
    });
View Full Code Here

    controlBar.addHelpTextTrigger(mwPanGauge, RS.rbLabel(KEY.MW_PAN_DESC));
    grid.add(mwPanGauge, 0, 5);
    // laser calibration
    final Label headerLaser = createLabel(KEY.LASER_CALIBRATION);
    grid.add(headerLaser, 1, 4);
      final Button laserCalibrate = new Button(); //new Button(RS.rbLabel("laser.calibration"));
      laserCalibrate.setGraphic(RS.imgView(RS.IMG_LASER_CALIBRATE));
      laserCalibrate.setMaxWidth(125d);
      laserCalibrate.setWrapText(true);
      laserCalibrate.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {
      @Override
      public void handle(final MouseEvent event) {
        if (GuiUtil.isPrimaryPress(event)) {
          controlBar.createCommandService(Command.SERVO_LASER_CALIBRATE, true);
        }
View Full Code Here

      // if (!newValue) {
      // closeNotification();
      // }
      // }
      // });
      final Button btn = new Button(message);
      btn.setPrefSize(NOTIFY_WINDOW_WIDTH, NOTIFY_WINDOW_HEIGHT);
      btn.setWrapText(true);
      if (mouseEventHandler != null) {
        btn.addEventHandler(MouseEvent.ANY, mouseEventHandler);
      }
      btn.addEventHandler(MouseEvent.ANY, new EventHandler<MouseEvent>() {
        @Override
        public void handle(final MouseEvent event) {
          if (event.getEventType() == MouseEvent.MOUSE_CLICKED) {
            closeNotification();
          } else if (event.getEventType() == MouseEvent.MOUSE_ENTERED) {
View Full Code Here

        dayCells[index++] = cell;
      }
      pickerBox.getChildren().add(row);
    }
   
    Button todayButton = new Button(RS.rbLabel(KEY.TODAY));
    todayButton.setId(DATEPICKER_TODAYBUTTON);
    todayButton.setOnAction(new EventHandler<ActionEvent>() {
     
      @Override
      public void handle(ActionEvent ae) {
        dateProperty.setValue((new GregorianCalendar(0, 0, 0)).getTime());
        dateProperty.setValue(
View Full Code Here

       
      }
    });
    popup.getContent().add(datePicker);

    final Button calenderButton = new Button();
    calenderButton.setId("CalenderButton");
    calenderButton.setOnAction(new EventHandler<ActionEvent>() {

      @Override
      public void handle(ActionEvent ae) {
        Parent parent = SimpleCalendar.this.getParent();
        // Popup will be shown at upper left corner of calenderbutton
        Point2D point = calenderButton.localToScene(0, 0);
        final double layoutX = parent.getScene().getWindow().getX() + parent.getScene().getX() + point.getX();
        final double layoutY = parent.getScene().getWindow().getY() + parent.getScene().getY() + point.getY();
        popup.show(SimpleCalendar.this, layoutX, layoutY);

      }
View Full Code Here

TOP

Related Classes of javafx.scene.control.Button

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.