List of usage examples for javafx.scene.layout BorderWidths BorderWidths
public BorderWidths(@NamedArg("width") double width)
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);
}