use of javafx.scene.layout.BorderWidths in project JFoenix by sshahine.
the class PromptLinesWrapper method updateDisabled.
public void updateDisabled() {
final boolean disabled = control.isDisable();
line.setBorder(!disabled ? Border.EMPTY : new Border(new BorderStroke(control.getUnFocusColor(), BorderStrokeStyle.DASHED, CornerRadii.EMPTY, new BorderWidths(1))));
line.setBackground(new Background(new BackgroundFill(disabled ? Color.TRANSPARENT : control.getUnFocusColor(), CornerRadii.EMPTY, Insets.EMPTY)));
}
use of javafx.scene.layout.BorderWidths in project Dayflower by macroing.
the class HBoxes method createBorderedPaddedAndSpacedHBox.
/**
* Returns a new bordered, padded and spaced {@code HBox} instance.
*
* @param borderWidthTop the top border width
* @param borderWidthRight the right border width
* @param borderWidthBottom the bottom border width
* @param borderWidthLeft the left border width
* @param padding the top, right, bottom and left padding
* @param spacing the spacing
* @return a new bordered, padded and spaced {@code HBox} instance
*/
public static HBox createBorderedPaddedAndSpacedHBox(final double borderWidthTop, final double borderWidthRight, final double borderWidthBottom, final double borderWidthLeft, final double padding, final double spacing) {
final HBox hBox = new HBox();
hBox.setBorder(new Border(new BorderStroke(Color.rgb(181, 181, 181), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(borderWidthTop, borderWidthRight, borderWidthBottom, borderWidthLeft))));
hBox.setPadding(new Insets(padding, padding, padding, padding));
hBox.setSpacing(spacing);
return hBox;
}
use of javafx.scene.layout.BorderWidths in project Dayflower by macroing.
the class VBoxes method createBorderedPaddedAndSpacedVBox.
/**
* Returns a new bordered, padded and spaced {@code VBox} instance.
*
* @param borderWidthTop the top border width
* @param borderWidthRight the right border width
* @param borderWidthBottom the bottom border width
* @param borderWidthLeft the left border width
* @param padding the top, right, bottom and left padding
* @param spacing the spacing
* @return a new bordered, padded and spaced {@code VBox} instance
*/
public static VBox createBorderedPaddedAndSpacedVBox(final double borderWidthTop, final double borderWidthRight, final double borderWidthBottom, final double borderWidthLeft, final double padding, final double spacing) {
final VBox vBox = new VBox();
vBox.setBorder(new Border(new BorderStroke(Color.rgb(181, 181, 181), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(borderWidthTop, borderWidthRight, borderWidthBottom, borderWidthLeft))));
vBox.setFillWidth(true);
vBox.setPadding(new Insets(padding, padding, padding, padding));
vBox.setSpacing(spacing);
return vBox;
}
use of javafx.scene.layout.BorderWidths in project mars-sim by mars-sim.
the class QualityGauge method initGraphics.
private void initGraphics() {
int noOfSections = model.getSections().size();
centerX = PREFERRED_WIDTH * 0.5;
centerY = PREFERRED_HEIGHT * 0.94736842;
sectionAngle = model.getAngleRange() / noOfSections;
sections = new ArrayList<>(noOfSections);
double radius = PREFERRED_WIDTH * 0.43831169;
double sinValue;
double cosValue;
for (int i = 0; i < noOfSections; i++) {
MoveTo moveTo = new MoveTo(centerX, centerY);
sinValue = Math.sin(Math.toRadians(-sectionAngle * i + model.getStartAngle() + 270));
cosValue = Math.cos(Math.toRadians(-sectionAngle * i + model.getStartAngle() + 270));
LineTo lineTo1 = new LineTo(centerX + radius * sinValue, centerY + radius * cosValue);
sinValue = Math.sin(Math.toRadians(-sectionAngle * (i + 1) + model.getStartAngle() + 270));
cosValue = Math.cos(Math.toRadians(-sectionAngle * (i + 1) + model.getStartAngle() + 270));
LineTo lineTo2 = new LineTo(centerX + radius * sinValue, centerY + radius * cosValue);
ClosePath closePath = new ClosePath();
sinValue = Math.sin(Math.toRadians(-sectionAngle * (i + 0.5) + model.getStartAngle() + 270));
cosValue = Math.cos(Math.toRadians(-sectionAngle * (i + 0.5) + model.getStartAngle() + 270));
LinearGradient secFill = new LinearGradient(centerX + radius * sinValue, centerY + radius * cosValue, centerX, centerY, false, CycleMethod.NO_CYCLE, new Stop(0.0, model.getSections().get(i).getColor()), new Stop(0.2, model.getSections().get(i).getColor()), new Stop(0.2, model.getSections().get(i).getColor().deriveColor(0, 0.8, 1.1, 1)), new Stop(1.0, model.getSections().get(i).getColor().deriveColor(0, 0.8, 1.1, 1)));
Path sec = new Path(moveTo, lineTo1, lineTo2, closePath);
sec.setFill(secFill);
sec.setStroke(Color.WHITE);
sec.setStrokeWidth(PREFERRED_HEIGHT * 0.01);
sections.add(i, sec);
}
moveTo = new MoveTo(42.5, 313);
lineTo1 = new LineTo(84.7373, 46.3241);
cubicCurveTo1 = new CubicCurveTo(84.7373, 46.3241, 85, 43.8221, 85, 42.5);
cubicCurveTo2 = new CubicCurveTo(85, 19.0276, 65.9724, 0, 42.5, 0);
cubicCurveTo3 = new CubicCurveTo(19.0276, 0, 0, 19.0276, 0, 42.5);
cubicCurveTo4 = new CubicCurveTo(0, 43.8221, 0.2627, 46.3241, 0.2627, 46.3241);
lineTo2 = new LineTo(42.5, 313);
closePath = new ClosePath();
currentQualityRotate = new Rotate(279);
currentQualityRotate.setPivotX(centerX);
currentQualityRotate.setPivotY(centerY);
currentQuality = new Path(moveTo, lineTo1, cubicCurveTo1, cubicCurveTo2, cubicCurveTo3, cubicCurveTo4, lineTo2, closePath);
currentQuality.setStrokeWidth(PREFERRED_HEIGHT * 0.01);
currentQuality.setStroke(Color.TRANSPARENT);
currentQuality.setFill(Color.TRANSPARENT);
currentQuality.setStrokeLineJoin(StrokeLineJoin.ROUND);
currentQuality.getTransforms().add(currentQualityRotate);
currentQualityText = new Text("");
currentQualityText.setTextOrigin(VPos.CENTER);
currentQualityText.setFont(Fonts.latoBold(PREFERRED_HEIGHT * 0.14860681));
currentQualityText.setFill(Color.TRANSPARENT);
knob = new Circle(centerX, centerY, PREFERRED_HEIGHT * 0.05572755);
knob.setFill(Color.web("#cccccc"));
knob.setStroke(Color.WHITE);
knob.setStrokeWidth(PREFERRED_HEIGHT * 0.01);
pane = new Pane();
pane.getChildren().addAll(sections);
pane.getChildren().addAll(currentQuality, currentQualityText, knob);
pane.setBackground(new Background(new BackgroundFill(backgroundPaint, new CornerRadii(1024), Insets.EMPTY)));
pane.setBorder(new Border(new BorderStroke(borderPaint, BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(borderWidth))));
// VBox box = new VBox();
// Label label = new Label(_title);
// box.getChildren().add(pane);
getChildren().setAll(pane);
}
use of javafx.scene.layout.BorderWidths in project jag3d by applied-geodesy.
the class ColumnImportDialog method selectColumns.
private void selectColumns(int startColumn, int endColumn) {
for (int columnIndex = 0; columnIndex < this.columns.size(); columnIndex++) {
VBox column = this.columns.get(columnIndex);
if (columnIndex >= startColumn && columnIndex <= endColumn) {
column.setBackground(new Background(new BackgroundFill(Color.LIGHTGRAY, CornerRadii.EMPTY, Insets.EMPTY)));
column.setBorder(new Border(new BorderStroke(Color.BLACK, columnIndex == endColumn ? Color.BLACK : Color.TRANSPARENT, Color.BLACK, columnIndex == startColumn ? Color.BLACK : Color.TRANSPARENT, BorderStrokeStyle.DOTTED, columnIndex == endColumn ? BorderStrokeStyle.DOTTED : BorderStrokeStyle.NONE, BorderStrokeStyle.DOTTED, columnIndex == startColumn ? BorderStrokeStyle.DOTTED : BorderStrokeStyle.NONE, CornerRadii.EMPTY, new BorderWidths(1), Insets.EMPTY)));
} else {
column.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, CornerRadii.EMPTY, Insets.EMPTY)));
column.setBorder(new Border(new BorderStroke(Color.TRANSPARENT, Color.TRANSPARENT, Color.TRANSPARENT, Color.TRANSPARENT, BorderStrokeStyle.NONE, BorderStrokeStyle.NONE, BorderStrokeStyle.NONE, BorderStrokeStyle.NONE, CornerRadii.EMPTY, new BorderWidths(1), Insets.EMPTY)));
}
}
}
Aggregations