Example usage for javafx.scene.layout BorderWidths BorderWidths

List of usage examples for javafx.scene.layout BorderWidths BorderWidths

Introduction

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

Prototype

public BorderWidths(@NamedArg("width") double width) 

Source Link

Document

Creates a new BorderWidths using the given width for all four borders, and treating this width as a literal value, and not a percentage.

Usage

From source file:Main.java

/**
 * Utility method to temporarily add a visible border around a region.
 *
 * @param region//w w  w.jav a2  s  .  c  o  m
 *            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.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  w  w  . j a  va  2 s. com
    }

    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);
}