本文整理汇总了Java中javafx.scene.shape.Line.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java Line.setVisible方法的具体用法?Java Line.setVisible怎么用?Java Line.setVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.shape.Line
的用法示例。
在下文中一共展示了Line.setVisible方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TextInput
import javafx.scene.shape.Line; //导入方法依赖的package包/类
public TextInput() {
super();
sceneProperty().addListener((observable, oldValue, newValue) -> {
if (newValue != null) {
if (!getScene().getStylesheets().contains(getClass().getResource("application.css").toExternalForm()))
getScene().getStylesheets().add(getClass().getResource("application.css").toExternalForm());
}
});
getStyleClass().add("material-text-input");
animationLine = new Line(0, 0, 0, 0);
baseLine = new Line(0, 0, 0, 0);
animationLine.setVisible(false);
g = new Group(baseLine, animationLine);
addEventHandler(MouseEvent.MOUSE_CLICKED, e -> {
if (isAnimationFinished) {
sizeAnimation = new Timeline(new KeyFrame(Duration.millis(7), ev -> {
animationLine.setStartX(5 + getWidth() / 2 - (animationVar));
animationLine.setEndX(getWidth() / 2 + (animationVar) - 5);
animationVar += 3;
isAnimationFinished = false;
}));
sizeAnimation.setOnFinished(ev -> {
animationLine.setVisible(false);
animationVar = 0;
isAnimationFinished = true;
});
sizeAnimation.setCycleCount((int) ((getWidth() / 2) / 3));
sizeAnimation.play();
animationLine.setVisible(true);
}
});
}
示例2: TrackerSnapConstraint
import javafx.scene.shape.Line; //导入方法依赖的package包/类
/** @param group Group where snap lines are added */
public TrackerSnapConstraint(final Group group)
{
horiz_guide = new Line();
horiz_guide.getStyleClass().add("guide_line");
horiz_guide.setVisible(false);
vert_guide = new Line();
vert_guide.getStyleClass().add("guide_line");
vert_guide.setVisible(false);
group.getChildren().addAll(horiz_guide, vert_guide);
}
示例3: updateLineStyling
import javafx.scene.shape.Line; //导入方法依赖的package包/类
private void updateLineStyling() {
T dayView = getSkinnable();
LocalTime startTime = dayView.getStartTime();
LocalTime endTime = dayView.getEndTime();
boolean showEarlyHoursRegion = startTime.isAfter(LocalTime.MIN);
boolean showLateHoursRegion = endTime.isBefore(LocalTime.MAX);
earlyHoursRegion.setVisible(showEarlyHoursRegion);
lateHoursRegion.setVisible(showLateHoursRegion);
int lineCount = lines.size();
for (int i = 0; i < lineCount; i++) {
Line line = lines.get(i);
line.getStyleClass().removeAll("early-hour-line", "late-hour-line"); //$NON-NLS-1$ //$NON-NLS-2$
int hour = (i + 1) / 2;
int minute = 0;
boolean halfHourLine = (i % 2 == 0);
if (halfHourLine) {
minute = 30;
}
LocalTime time = LocalTime.of(hour, minute);
if (time.isBefore(startTime)) {
if (!line.getStyleClass().contains("early-hour-line")) { //$NON-NLS-1$
line.getStyleClass().add("early-hour-line"); //$NON-NLS-1$
}
}
if (time.isAfter(endTime)) {
if (!line.getStyleClass().contains("late-hour-line")) { //$NON-NLS-1$
line.getStyleClass().add("late-hour-line"); //$NON-NLS-1$
}
}
switch (dayView.getEarlyLateHoursStrategy()) {
case HIDE:
/*
* We do not show ... a) lines before the start time and after
* the end time b) lines directly on the start time or end time
* because they make the UI look messy
*/
if (time.isBefore(startTime) || time.equals(startTime) || time.isAfter(endTime) || time.equals(endTime)) {
line.setVisible(false);
} else {
line.setVisible(true);
}
break;
case SHOW:
line.setVisible(true);
break;
case SHOW_COMPRESSED:
if (halfHourLine) {
line.setVisible(false);
} else {
line.setVisible(true);
}
break;
default:
break;
}
}
}
示例4: setGridVisible
import javafx.scene.shape.Line; //导入方法依赖的package包/类
void setGridVisible(boolean visible) {
for (Line line : grid) {
line.setVisible(visible);
}
isGridVisible = visible;
}
示例5: JFXCheckBoxOldSkin
import javafx.scene.shape.Line; //导入方法依赖的package包/类
public JFXCheckBoxOldSkin(JFXCheckBox control) {
super(control);
box.setMinSize(20, 20);
box.setPrefSize(20, 20);
box.setMaxSize(20, 20);
box.setBorder(new Border(new BorderStroke(control.getUnCheckedColor(),
BorderStrokeStyle.SOLID,
new CornerRadii(0),
new BorderWidths(lineThick))));
//
StackPane boxContainer = new StackPane();
boxContainer.getChildren().add(box);
boxContainer.setPadding(new Insets(padding));
rippler = new JFXRippler(boxContainer, RipplerMask.CIRCLE);
rippler.setRipplerFill(getSkinnable().isSelected() ? control.getUnCheckedColor() : control.getCheckedColor());
rightLine = new Line();
leftLine = new Line();
rightLine.setStroke(control.getCheckedColor());
rightLine.setStrokeWidth(lineThick);
leftLine.setStroke(control.getCheckedColor());
leftLine.setStrokeWidth(lineThick);
rightLine.setVisible(false);
leftLine.setVisible(false);
container.getChildren().add(rightLine);
container.getChildren().add(leftLine);
container.getChildren().add(rippler);
AnchorPane.setRightAnchor(rippler, labelOffset);
// add listeners
getSkinnable().selectedProperty().addListener((o, oldVal, newVal) -> {
rippler.setRipplerFill(newVal ? control.getUnCheckedColor() : control.getCheckedColor());
transition.setRate(newVal ? 1 : -1);
transition.play();
});
updateChildren();
}
示例6: createSeparator
import javafx.scene.shape.Line; //导入方法依赖的package包/类
private Line createSeparator(int width) {
Line sep = new Line();
sep.setEndX(width);
sep.setVisible(false);
return sep;
}