Is there a way to show only the (say) bottom and right borders of a rectangle? Is the rectangle width/height based on the centerlines of the border strokes? Am I conflating css border with the rectangle's strokes or are they in fact the same thing?
My bigger problem in context:
A partial screenshot:
In the lower half of of the picture there are two independent "week-lines"/"calendars". Each little square represents a day. There are 5 per column, representing Mo Tu We Th Fr of the same week. There are roughly four columns (representing weeks) per month.
I would like to introduce a small gap between months. If the month changes over a weekend, the corresponding gap would just be a thin vertical line. Otherwise it would have a "step" in it.
Each day's square is a Rectangle
on its own little StackPane
in its own cell of a GridPane
. (I can change the contents of the cells in the GridPane
if I really have to, as long as I can still color each cell's interior freely.) The Rectangle
sizes are set on construction. Here is a code fragment showing what I tried (This runs for each cell):
StringBuilder stylebuilder = new StringBuilder("-fx-border-width: 1; -fx-border-color: white; -fx-border-style: hidden;");
Month month = date.getMonth();
if(month != date.plusDays(1).getMonth()){
stylebuilder.append("-fx-border-bottom-style: solid;");
}
if(month != date.plusWeeks(1).getMonth()){
stylebuilder.append("-fx-border-right-style: solid;");
}
if(month != date.minusDays(1).getMonth()){
stylebuilder.append("-fx-border-top-style: solid;");
}
if(month != date.minusWeeks(1).getMonth()){
stylebuilder.append("-fx-border-left-style: solid;");
}
rectangle.setStyle(stylebuilder.toString());
Any advice would be appreciated.