private void setMode(Paint value) {
   if (value instanceof Color) {
     // make sure that a second click doesn't deselect the button
     if (colorToggleButton.isSelected() == false) {
       colorToggleButton.setSelected(true);
     }
     root_vbox.getChildren().remove(gradientPicker);
   } else if (value instanceof LinearGradient) {
     // make sure that a second click doesn't deselect the button
     if (linearToggleButton.isSelected() == false) {
       linearToggleButton.setSelected(true);
     }
     if (!root_vbox.getChildren().contains(gradientPicker)) {
       root_vbox.getChildren().add(gradientPicker);
     }
   } else if (value instanceof RadialGradient) {
     // make sure that a second click doesn't deselect the button
     if (radialToggleButton.isSelected() == false) {
       radialToggleButton.setSelected(true);
     }
     if (!root_vbox.getChildren().contains(gradientPicker)) {
       root_vbox.getChildren().add(gradientPicker);
     }
   } else {
     // Case not yet handled
     assert value instanceof ImagePattern;
   }
 }
  private void createNewStage(int level, Stage owner, boolean onTop) {
    Stage stage = new Stage();
    stage.initOwner(owner);
    stage.setTitle(level == 0 ? "Root" : "Child " + level);
    stage.setAlwaysOnTop(onTop);

    VBox root = new VBox(15);
    root.setPadding(new Insets(20));
    Scene scene = new Scene(root);
    stage.setScene(scene);

    ToggleButton onTopButton = new ToggleButton(onTop ? DISABLE_ON_TOP : ENABLE_ON_TOP);
    onTopButton.setSelected(onTop);

    stage
        .alwaysOnTopProperty()
        .addListener(
            (observable, oldValue, newValue) -> {
              onTopButton.setSelected(newValue);
              onTopButton.setText(newValue ? DISABLE_ON_TOP : ENABLE_ON_TOP);
            });

    onTopButton.setOnAction(event -> stage.setAlwaysOnTop(!stage.isAlwaysOnTop()));

    CheckBox box = new CheckBox("Child stage always on top");
    box.setSelected(true);
    Button newStageButton = new Button("Open child stage");

    newStageButton.setOnAction(event -> createNewStage(level + 1, stage, box.isSelected()));

    root.getChildren().addAll(onTopButton, box, newStageButton);

    stage.show();
  }
 private void setActiveButton() {
   switch (recording.getFileExistsAction()) {
     case OK:
       rename.setSelected(true);
       break;
     case REPLACE:
       replace.setSelected(true);
       break;
     case CANCEL:
       cancel.setSelected(true);
       break;
   }
 }
Exemple #4
0
  @Override
  public void init() {
    backgroundImage = new ImageView();
    heatMapImage = new ImageView();
    buttonLoadBackgroundImage = new Button("BackgroundImage");
    buttonLoadHeatMapImage = new Button("HeatmapImage");
    toggleButtonShowHeatMap = new ToggleButton("hide");
    toggleButtonShowHeatMap.setSelected(true);

    AnchorPane.setLeftAnchor(buttonLoadBackgroundImage, 10d);
    AnchorPane.setTopAnchor(buttonLoadBackgroundImage, 10d);

    AnchorPane.setRightAnchor(buttonLoadHeatMapImage, 10d);
    AnchorPane.setTopAnchor(buttonLoadHeatMapImage, 10d);

    AnchorPane.setRightAnchor(toggleButtonShowHeatMap, 10d);
    AnchorPane.setTopAnchor(toggleButtonShowHeatMap, 40d);

    pane =
        new AnchorPane(
            backgroundImage,
            heatMapImage,
            buttonLoadBackgroundImage,
            buttonLoadHeatMapImage,
            toggleButtonShowHeatMap);

    registerListeners();
  }
 private static void addHeader(String labelText, ToggleButton btn, Integer size, VBox content) {
   HBox headerRow = new HBox(size);
   Label lname = new Label(labelText);
   lname.getStyleClass().add("popover-label");
   btn.setPrefSize(50, 10);
   // this is so everytime user closes popover in edit, and when user
   // revisits it popover is
   // in edit mode
   btn.setSelected(false);
   headerRow.getChildren().addAll(lname, btn);
   content.getChildren().add(headerRow);
 }
  /** defines what happens, before the GUI is started */
  public void initialize(URL location, ResourceBundle resources) {

    // set the controller var in the Main class to this Controller
    Main.controller = this;

    updateList();
    log.debug("List updated");

    // Formatting of the listView
    listView.setFixedCellSize(60);
    listView.setItems(items);
    addButton.setSelected(true);
    log.debug("ListView cellSize changed, items assigned");

    // is activated if the text in the searchbox is changed
    searchBox
        .textProperty()
        .addListener(
            (observable, oldVal, newVal) -> {
              renewSearch(newVal);
            });

    // is called when the selected Search Radiobutton is changed
    searchToggle
        .selectedToggleProperty()
        .addListener(
            new ChangeListener<Toggle>() {
              public void changed(
                  ObservableValue<? extends Toggle> ov, Toggle old_toggle, Toggle new_toggle) {
                renewSearch(searchBox.getText());
              }
            });

    // gets called if an item in the listview is selected -> will load the
    // currently selected item
    // in the overview on the left
    listView
        .getSelectionModel()
        .getSelectedItems()
        .addListener(
            new ListChangeListener<ItemBox>() {
              @Override
              public void onChanged(
                  javafx.collections.ListChangeListener.Change<? extends ItemBox> c) {
                // Update the overview section on the left side of the GUI
                updateOverview();
              }
            });

    setupMenuItems();
  }
 public ReplaceOrRenameActionBar(Recording recording, UserPrefs userPrefs) {
   this.recording = recording;
   this.userPrefs = userPrefs;
   replace = new ToggleButton("Replace");
   replace.setSelected(true);
   rename = new ToggleButton("Rename");
   cancel = new ToggleButton("Don't Archive");
   toggleGroup = new ToggleGroup();
   toggleGroup.getToggles().setAll(replace, rename, cancel);
   this.getButtons().addAll(replace, rename, cancel);
   replace.setOnAction(event -> replace());
   rename.setOnAction(event -> renameDestination());
   cancel.setOnAction(event -> cancelArchive());
 }
 protected synchronized void updateFollowUpIcon() {
   if (file != null) {
     try {
       boolean hasFollowUp = hasFollowUp();
       Platform.runLater(
           () -> {
             followUpImageView.setImage(hasFollowUp ? followUpIcon : followUpGray);
             followUpToggle.setSelected(hasFollowUp);
           });
     } catch (TskCoreException ex) {
       LOGGER.log(Level.SEVERE, "Failed to get follow up status for file.", ex);
     }
   }
 }
Exemple #9
0
 private void handleControlPropertyChanged(final String PROPERTY) {
   if ("LOAD_BACKGROUND".equals(PROPERTY)) {
     Image image = getImage(buttonLoadBackgroundImage.getScene().getWindow());
     if (null == image) return;
     backgroundImage.setImage(image);
     backgroundImage.toBack();
   } else if ("LOAD_HEATMAP".equals(PROPERTY)) {
     Image image = getImage(buttonLoadHeatMapImage.getScene().getWindow());
     if (null == image) return;
     heatMapImage.setImage(image);
     toggleButtonShowHeatMap.setSelected(true);
   } else if ("TOGGLE_HEATMAP".equals(PROPERTY)) {
     toggleButtonShowHeatMap.setText(toggleButtonShowHeatMap.isSelected() ? "show" : "hide");
     heatMapImage.setVisible(!toggleButtonShowHeatMap.isSelected());
   }
 }
 @FXML
 private void handleLevelButtonAction(ActionEvent event) {
   ToggleButton tb = (ToggleButton) event.getSource();
   tb.setSelected(true);
   FileManager.saveLevel(Integer.parseInt(tb.getText()));
 }
 private void cancelArchive() {
   recording.setFileExistsAction(Recording.FileExistsAction.CANCEL);
   cancel.setSelected(true);
 }
 private void replace() {
   recording.setFileExistsAction(Recording.FileExistsAction.REPLACE);
   replace.setSelected(true);
 }