當前位置: 首頁>>代碼示例>>Java>>正文


Java Line.setVisible方法代碼示例

本文整理匯總了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);
        }
    });

}
 
開發者ID:Tareq-SiSalem,項目名稱:JFXMaterial,代碼行數:36,代碼來源:TextInput.java

示例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);
}
 
開發者ID:kasemir,項目名稱:org.csstudio.display.builder,代碼行數:14,代碼來源:TrackerSnapConstraint.java

示例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;

        }
    }
}
 
開發者ID:dlemmermann,項目名稱:CalendarFX,代碼行數:70,代碼來源:DayViewSkin.java

示例4: setGridVisible

import javafx.scene.shape.Line; //導入方法依賴的package包/類
void setGridVisible(boolean visible) {
    for (Line line : grid) {
        line.setVisible(visible);
    }
    isGridVisible = visible;
}
 
開發者ID:kaanburaksener,項目名稱:octoBubbles,代碼行數:7,代碼來源:GraphController.java

示例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();

}
 
開發者ID:jfoenixadmin,項目名稱:JFoenix,代碼行數:42,代碼來源:JFXCheckBoxOldSkin.java

示例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;
}
 
開發者ID:AlmasB,項目名稱:Consume,代碼行數:7,代碼來源:ConsumeGameMenu.java


注:本文中的javafx.scene.shape.Line.setVisible方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。