本文整理汇总了Java中javafx.scene.control.Label.setMouseTransparent方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setMouseTransparent方法的具体用法?Java Label.setMouseTransparent怎么用?Java Label.setMouseTransparent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.Label
的用法示例。
在下文中一共展示了Label.setMouseTransparent方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addState
import javafx.scene.control.Label; //导入方法依赖的package包/类
private void addState(State<?,?> state, HBox line, Color color, int stateIndex, String stateDescription) {
final Rectangle rectangle = new Rectangle(WIDTH, WIDTH, color);
rectangle.setArcHeight(WIDTH);
rectangle.setArcWidth(WIDTH);
rectangle.setUserData(state);
Label text = new Label(computeStateLabel(stateIndex));
text.setTextOverrun(OverrunStyle.ELLIPSIS);
text.setAlignment(Pos.CENTER);
text.setMouseTransparent(true);
text.setTextFill(Color.WHITE);
text.setFont(STATE_FONT);
text.setMaxWidth(WIDTH);
final Tooltip tooltip = new Tooltip(stateDescription);
Tooltip.install(rectangle, tooltip);
StackPane layout = new StackPane();
StackPane.setMargin(rectangle, MARGIN_INSETS);
layout.getChildren().addAll(rectangle, text);
line.getChildren().add(layout);
}
示例2: AllDayEntryViewSkin
import javafx.scene.control.Label; //导入方法依赖的package包/类
public AllDayEntryViewSkin(AllDayEntryView view) {
super(view);
titleLabel = new Label();
titleLabel.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
titleLabel.setMouseTransparent(true);
titleLabel.setManaged(false);
Entry<?> entry = view.getEntry();
entry.calendarProperty().addListener(weakUpdateViewListener);
entry.fullDayProperty().addListener(weakUpdateViewListener);
entry.titleProperty().addListener(weakUpdateViewListener);
entry.intervalProperty().addListener(weakUpdateViewListener);
updateView();
getChildren().addAll(titleLabel);
}
示例3: createTraceWidget
import javafx.scene.control.Label; //导入方法依赖的package包/类
private Pane createTraceWidget(ITraceExtractor<Step<?>, State<?,?>, TracedObject<?>, Dimension<?>, Value<?>> extractor, String label, ReadOnlyDoubleProperty width) {
final Pane pane = new Pane();
pane.setBackground(TRANSPARENT_BACKGROUND);
final Rectangle rectangle = new Rectangle(0, 0, 0, 12);
rectangle.setFill(Color.LIGHTGRAY);
rectangle.widthProperty().bind(width.subtract(10));
rectangle.setArcHeight(12);
rectangle.setArcWidth(12);
Label text = new Label(label);
text.setTextOverrun(OverrunStyle.ELLIPSIS);
text.setAlignment(Pos.CENTER);
text.setMouseTransparent(true);
text.setTextFill(Color.WHITE);
text.setFont(FONT);
text.setMaxWidth(0);
text.maxWidthProperty().bind(rectangle.widthProperty());
StackPane layout = new StackPane();
layout.getChildren().addAll(rectangle, text);
pane.getChildren().add(layout);
layout.setTranslateY(13);
layout.setTranslateX(5);
pane.setPrefHeight(25);
pane.setMinHeight(25);
pane.setMaxHeight(25);
final Shape arrow1 = createCursor();
final Shape arrow2 = createCursor();
arrow1.setTranslateX(5);
arrow1.setTranslateY(4);
arrow2.translateXProperty().bind(rectangle.widthProperty().add(5));
arrow2.setTranslateY(4);
pane.getChildren().add(arrow1);
pane.getChildren().add(arrow2);
return pane;
}
示例4: addWithLabelOverlaid
import javafx.scene.control.Label; //导入方法依赖的package包/类
private void addWithLabelOverlaid(String labelText, TextField textField) {
Label label = new Label(labelText);
label.setMouseTransparent(true);
StackPane.setAlignment(label, Pos.CENTER_LEFT);
StackPane container = new StackPane(textField, label);
rgbBox.getChildren().add(container);
}
示例5: VertexView
import javafx.scene.control.Label; //导入方法依赖的package包/类
public VertexView(final int stateIndex, StateVertex vertex) {
circle = new Circle(RADIUS);
circle.setFill(Color.SLATEBLUE);
this.stateIndex = stateIndex;
final String s = vertex.getTooltip();
final Tooltip t = new Tooltip(s);
Tooltip.install(this, t);
vertex.setOnTooltipUpdateCommand(text -> Platform.runLater(() -> t.setText(text)));
label = new Label(computeStateLabel(this.stateIndex));
label.setTextOverrun(OverrunStyle.ELLIPSIS);
label.setAlignment(Pos.CENTER);
label.setMouseTransparent(true);
label.setTextFill(Color.WHITE);
label.setFont(STATE_INDEX_FONT);
label.setMaxWidth(RADIUS * 2);
StackPane layout = new StackPane();
layout.getChildren().addAll(circle, label);
layout.setTranslateX(-RADIUS);
layout.setTranslateY(-RADIUS);
getChildren().add(layout);
setOnMousePressed(event -> {
circle.setCursor(Cursor.MOVE);
mouseX = event.getX();
mouseY = event.getY();
event.consume();
});
setOnMouseReleased(event -> {
setCursor(Cursor.DEFAULT);
});
setOnMouseDragged(event -> {
double deltaX = event.getX() - mouseX;
double deltaY = event.getY() - mouseY;
setTranslateX(getTranslateX() + deltaX);
setTranslateY(getTranslateY() + deltaY);
event.consume();
});
setOnMouseEntered(event -> circle.setEffect(GLOW));
setOnMouseExited(event -> circle.setEffect(null));
}
示例6: MonthEntryViewSkin
import javafx.scene.control.Label; //导入方法依赖的package包/类
public MonthEntryViewSkin(MonthEntryView view) {
super(view);
Entry<?> entry = view.getEntry();
if (entry.isRecurrence()) {
entry = entry.getRecurrenceSourceEntry();
}
Calendar calendar = entry.getCalendar();
colorDot = new Circle();
colorDot.setRadius(2.5);
colorDot.setMouseTransparent(true);
titleLabel = new Label();
titleLabel.setGraphic(colorDot);
titleLabel.setMinSize(0, 0);
titleLabel.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
titleLabel.setMouseTransparent(true);
timeLabel = new Label();
timeLabel.setMouseTransparent(true);
timeLabel.setMaxHeight(Double.MAX_VALUE);
timeLabel.setMouseTransparent(true);
// update in these cases
entry.titleProperty().addListener(weakUpdateViewListener);
entry.fullDayProperty().addListener(weakUpdateViewListener);
entry.intervalProperty().addListener(weakUpdateViewListener);
entry.calendarProperty().addListener(weakUpdateViewListener);
view.positionProperty().addListener(weakUpdateViewListener);
if (calendar != null) {
calendar.styleProperty().addListener(weakUpdateViewListener);
}
getChildren().addAll(titleLabel, timeLabel);
updateView();
}