Example usage for javafx.scene.layout BorderStrokeStyle SOLID

List of usage examples for javafx.scene.layout BorderStrokeStyle SOLID

Introduction

In this page you can find the example usage for javafx.scene.layout BorderStrokeStyle SOLID.

Prototype

BorderStrokeStyle SOLID

To view the source code for javafx.scene.layout BorderStrokeStyle SOLID.

Click Source Link

Document

A predefined solid line to be used for stroking

Usage

From source file:Main.java

/**
 * Utility method to temporarily add a visible border around a region.
 *
 * @param region//from   w ww. j  ava 2 s .c  om
 *            The region getting the border.
 * @param color
 *            the color of the border.
 */
public static void addDummyBorder(final Region region, final Color color) {
    region.setBorder(new Border(new BorderStroke(color, BorderStrokeStyle.SOLID, null, new BorderWidths(5)))); // MAGIC_NUMBER
}

From source file:org.sleuthkit.autopsy.imagegallery.gui.drawableviews.GroupPane.java

/**
 * called automatically during constructor by FXMLConstructor.
 *
 * checks that FXML loading went ok and performs additional setup
 *//* w w w .j  a v  a2s. co m*/
@FXML
@NbBundle.Messages({ "GroupPane.gridViewContextMenuItem.extractFiles=Extract File(s)",
        "GroupPane.bottomLabel.displayText=Group Viewing History: ",
        "GroupPane.hederLabel.displayText=Tag Selected Files:",
        "GroupPane.catContainerLabel.displayText=Categorize Selected File:",
        "GroupPane.catHeadingLabel.displayText=Category:" })
void initialize() {
    assert cat0Toggle != null : "fx:id=\"cat0Toggle\" was not injected: check your FXML file 'SlideShowView.fxml'.";
    assert cat1Toggle != null : "fx:id=\"cat1Toggle\" was not injected: check your FXML file 'SlideShowView.fxml'.";
    assert cat2Toggle != null : "fx:id=\"cat2Toggle\" was not injected: check your FXML file 'SlideShowView.fxml'.";
    assert cat3Toggle != null : "fx:id=\"cat3Toggle\" was not injected: check your FXML file 'SlideShowView.fxml'.";
    assert cat4Toggle != null : "fx:id=\"cat4Toggle\" was not injected: check your FXML file 'SlideShowView.fxml'.";
    assert cat5Toggle != null : "fx:id=\"cat5Toggle\" was not injected: check your FXML file 'SlideShowView.fxml'.";
    assert gridView != null : "fx:id=\"tilePane\" was not injected: check your FXML file 'GroupPane.fxml'.";
    assert catSelectedSplitMenu != null : "fx:id=\"grpCatSplitMenu\" was not injected: check your FXML file 'GroupHeader.fxml'.";
    assert tagSelectedSplitMenu != null : "fx:id=\"grpTagSplitMenu\" was not injected: check your FXML file 'GroupHeader.fxml'.";
    assert headerToolBar != null : "fx:id=\"headerToolBar\" was not injected: check your FXML file 'GroupHeader.fxml'.";
    assert segButton != null : "fx:id=\"previewList\" was not injected: check your FXML file 'GroupHeader.fxml'.";
    assert slideShowToggle != null : "fx:id=\"segButton\" was not injected: check your FXML file 'GroupHeader.fxml'.";
    assert tileToggle != null : "fx:id=\"tileToggle\" was not injected: check your FXML file 'GroupHeader.fxml'.";

    for (Category cat : Category.values()) {
        ToggleButton toggleForCategory = getToggleForCategory(cat);
        toggleForCategory.setBorder(new Border(
                new BorderStroke(cat.getColor(), BorderStrokeStyle.SOLID, CORNER_RADII_2, BORDER_WIDTHS_2)));
        toggleForCategory.getStyleClass().remove("radio-button");
        toggleForCategory.getStyleClass().add("toggle-button");
        toggleForCategory.selectedProperty().addListener((ov, wasSelected, toggleSelected) -> {
            if (toggleSelected && slideShowPane != null) {
                slideShowPane.getFileID().ifPresent(fileID -> {
                    selectionModel.clearAndSelect(fileID);
                    new CategorizeAction(controller, cat, ImmutableSet.of(fileID)).handle(null);
                });
            }
        });
    }

    //configure flashing glow animation on next unseen group button
    flashAnimation.setCycleCount(Timeline.INDEFINITE);
    flashAnimation.setAutoReverse(true);

    //configure gridView cell properties
    DoubleBinding cellSize = controller.thumbnailSizeProperty().add(75);
    gridView.cellHeightProperty().bind(cellSize);
    gridView.cellWidthProperty().bind(cellSize);
    gridView.setCellFactory((GridView<Long> param) -> new DrawableCell());

    BooleanBinding isSelectionEmpty = Bindings.isEmpty(selectionModel.getSelected());
    catSelectedSplitMenu.disableProperty().bind(isSelectionEmpty);
    tagSelectedSplitMenu.disableProperty().bind(isSelectionEmpty);

    Platform.runLater(() -> {
        try {
            TagSelectedFilesAction followUpSelectedACtion = new TagSelectedFilesAction(
                    controller.getTagsManager().getFollowUpTagName(), controller);
            tagSelectedSplitMenu.setText(followUpSelectedACtion.getText());
            tagSelectedSplitMenu.setGraphic(followUpSelectedACtion.getGraphic());
            tagSelectedSplitMenu.setOnAction(followUpSelectedACtion);
        } catch (TskCoreException tskCoreException) {
            LOGGER.log(Level.WARNING, "failed to load FollowUpTagName", tskCoreException); //NON-NLS
        }
        tagSelectedSplitMenu.showingProperty().addListener(showing -> {
            if (tagSelectedSplitMenu.isShowing()) {
                List<MenuItem> selTagMenues = Lists.transform(
                        controller.getTagsManager().getNonCategoryTagNames(),
                        tagName -> GuiUtils.createAutoAssigningMenuItem(tagSelectedSplitMenu,
                                new TagSelectedFilesAction(tagName, controller)));
                tagSelectedSplitMenu.getItems().setAll(selTagMenues);
            }
        });

    });

    CategorizeSelectedFilesAction cat5SelectedAction = new CategorizeSelectedFilesAction(Category.FIVE,
            controller);
    catSelectedSplitMenu.setOnAction(cat5SelectedAction);
    catSelectedSplitMenu.setText(cat5SelectedAction.getText());
    catSelectedSplitMenu.setGraphic(cat5SelectedAction.getGraphic());
    catSelectedSplitMenu.showingProperty().addListener(showing -> {
        if (catSelectedSplitMenu.isShowing()) {
            List<MenuItem> categoryMenues = Lists.transform(Arrays.asList(Category.values()),
                    cat -> GuiUtils.createAutoAssigningMenuItem(catSelectedSplitMenu,
                            new CategorizeSelectedFilesAction(cat, controller)));
            catSelectedSplitMenu.getItems().setAll(categoryMenues);
        }
    });

    slideShowToggle.getStyleClass().remove("radio-button");
    slideShowToggle.getStyleClass().add("toggle-button");
    tileToggle.getStyleClass().remove("radio-button");
    tileToggle.getStyleClass().add("toggle-button");

    bottomLabel.setText(Bundle.GroupPane_bottomLabel_displayText());
    headerLabel.setText(Bundle.GroupPane_hederLabel_displayText());
    catContainerLabel.setText(Bundle.GroupPane_catContainerLabel_displayText());
    catHeadingLabel.setText(Bundle.GroupPane_catHeadingLabel_displayText());
    //show categorization controls depending on group view mode
    headerToolBar.getItems().remove(catSegmentedContainer);
    groupViewMode.addListener((ObservableValue<? extends GroupViewMode> observable, GroupViewMode oldValue,
            GroupViewMode newValue) -> {
        if (newValue == GroupViewMode.SLIDE_SHOW) {
            headerToolBar.getItems().remove(catSplitMenuContainer);
            headerToolBar.getItems().add(catSegmentedContainer);
        } else {
            headerToolBar.getItems().remove(catSegmentedContainer);
            headerToolBar.getItems().add(catSplitMenuContainer);
        }
    });

    //listen to toggles and update view state
    slideShowToggle
            .setOnAction(onAction -> activateSlideShowViewer(selectionModel.lastSelectedProperty().get()));
    tileToggle.setOnAction(onAction -> activateTileViewer());

    controller.viewState().addListener((observable, oldViewState, newViewState) -> setViewState(newViewState));

    addEventFilter(KeyEvent.KEY_PRESSED, tileKeyboardNavigationHandler);
    gridView.addEventHandler(MouseEvent.MOUSE_CLICKED, new MouseHandler());

    ActionUtils.configureButton(undoAction, undoButton);
    ActionUtils.configureButton(redoAction, redoButton);
    ActionUtils.configureButton(forwardAction, forwardButton);
    ActionUtils.configureButton(backAction, backButton);
    ActionUtils.configureButton(nextGroupAction, nextButton);
    /*
     * the next button does stuff in the GroupPane that next action does'nt
     * know about, so do that stuff and then delegate to nextGroupAction
     */
    final EventHandler<ActionEvent> onAction = nextButton.getOnAction();
    nextButton.setOnAction(actionEvent -> {
        flashAnimation.stop();
        nextButton.setEffect(null);
        onAction.handle(actionEvent);
    });

    nextGroupAction.disabledProperty().addListener((Observable observable) -> {
        boolean newValue = nextGroupAction.isDisabled();
        nextButton.setEffect(newValue ? null : DROP_SHADOW);
        if (newValue) {//stop on disabled
            flashAnimation.stop();
        } else { //play when enabled
            flashAnimation.play();
        }
    });

    //listen to tile selection and make sure it is visible in scroll area
    selectionModel.lastSelectedProperty().addListener((observable, oldFileID, newFileId) -> {
        if (groupViewMode.get() == GroupViewMode.SLIDE_SHOW && slideShowPane != null) {
            slideShowPane.setFile(newFileId);
        } else {
            scrollToFileID(newFileId);
        }
    });

    setViewState(controller.viewState().get());
}

From source file:org.sleuthkit.autopsy.timeline.ui.detailview.EventNodeBase.java

EventNodeBase(Type tlEvent, EventNodeBase<?> parent, DetailsChartLane<?> chartLane) {
    this.chartLane = chartLane;
    this.tlEvent = tlEvent;
    this.parentNode = parent;

    sleuthkitCase = chartLane.getController().getAutopsyCase().getSleuthkitCase();
    eventsModel = chartLane.getController().getEventsModel();
    eventTypeImageView.setImage(getEventType().getFXImage());

    if (tlEvent.getEventIDsWithHashHits().isEmpty()) {
        show(hashIV, false);//from w  ww.  j a va 2  s  .  c om
    }

    if (tlEvent.getEventIDsWithTags().isEmpty()) {
        show(tagIV, false);
    }

    if (chartLane.getController().getEventsModel().getEventTypeZoom() == EventTypeZoomLevel.SUB_TYPE) {
        evtColor = getEventType().getColor();
    } else {
        evtColor = getEventType().getBaseType().getColor();
    }
    SELECTION_BORDER = new Border(new BorderStroke(evtColor.darker().desaturate(), BorderStrokeStyle.SOLID,
            CORNER_RADII_3, new BorderWidths(2)));

    defaultBackground = new Background(
            new BackgroundFill(evtColor.deriveColor(0, 1, 1, .1), CORNER_RADII_3, Insets.EMPTY));
    highlightedBackground = new Background(
            new BackgroundFill(evtColor.deriveColor(0, 1.1, 1.1, .3), CORNER_RADII_3, Insets.EMPTY));
    setBackground(defaultBackground);

    Tooltip.install(this, this.tooltip);

    //set up mouse hover effect and tooltip
    setOnMouseEntered(mouseEntered -> {
        Tooltip.uninstall(chartLane, AbstractTimelineChart.getDefaultTooltip());
        showHoverControls(true);
        toFront();
    });
    setOnMouseExited(mouseExited -> {
        showHoverControls(false);
        if (parentNode != null) {
            parentNode.showHoverControls(true);
        } else {
            Tooltip.install(chartLane, AbstractTimelineChart.getDefaultTooltip());
        }
    });
    setOnMouseClicked(new ClickHandler());
    show(controlsHBox, false);
}