当前位置: 首页>>代码示例>>Java>>正文


Java OverrunStyle类代码示例

本文整理汇总了Java中javafx.scene.control.OverrunStyle的典型用法代码示例。如果您正苦于以下问题:Java OverrunStyle类的具体用法?Java OverrunStyle怎么用?Java OverrunStyle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OverrunStyle类属于javafx.scene.control包,在下文中一共展示了OverrunStyle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addState

import javafx.scene.control.OverrunStyle; //导入依赖的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);
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:20,代码来源:TimelineDiffViewerRenderer.java

示例2: paneFor

import javafx.scene.control.OverrunStyle; //导入依赖的package包/类
private Pane paneFor(Component component) {
  if (panes.containsKey(component)) {
    return panes.get(component);
  }

  BorderPane pane = new BorderPane(component.getView());
  ActionList.registerSupplier(pane, () -> actionsForComponent(component));
  pane.getStyleClass().add("layout-stack");
  EditableLabel label = new EditableLabel(component.titleProperty());
  label.getStyleClass().add("layout-label");
  ((Label) label.lookup(".label")).setTextOverrun(OverrunStyle.LEADING_ELLIPSIS);
  BorderPane.setAlignment(label, Pos.TOP_LEFT);
  pane.setBottom(label);

  panes.put(component, pane);
  return pane;
}
 
开发者ID:wpilibsuite,项目名称:shuffleboard,代码行数:18,代码来源:ListLayout.java

示例3: initGraphics

import javafx.scene.control.OverrunStyle; //导入依赖的package包/类
@Override protected void initGraphics() {
    super.initGraphics();

    final ZonedDateTime TIME = tile.getTime();

    titleText = new Text(DAY_FORMATTER.format(TIME));
    titleText.setFill(tile.getTitleColor());

    description = new Label(Integer.toString(TIME.getDayOfMonth()));
    description.setAlignment(Pos.CENTER);
    description.setTextAlignment(TextAlignment.CENTER);
    description.setWrapText(true);
    description.setTextOverrun(OverrunStyle.WORD_ELLIPSIS);
    description.setTextFill(tile.getTextColor());
    description.setPrefSize(PREFERRED_WIDTH * 0.9, PREFERRED_HEIGHT * 0.72);
    description.setFont(Fonts.latoLight(PREFERRED_HEIGHT * 0.65));

    text = new Text(MONTH_YEAR_FORMATTER.format(TIME));
    text.setFill(tile.getTextColor());

    getPane().getChildren().addAll(titleText, text, description);
}
 
开发者ID:HanSolo,项目名称:tilesfx,代码行数:23,代码来源:DateTileSkin.java

示例4: initGraphics

import javafx.scene.control.OverrunStyle; //导入依赖的package包/类
@Override protected void initGraphics() {
    super.initGraphics();

    titleText = new Text();
    titleText.setFill(tile.getTitleColor());
    Helper.enableNode(titleText, !tile.getTitle().isEmpty());

    description = new Label(tile.getDescription());
    description.setAlignment(tile.getDescriptionAlignment());
    description.setTextAlignment(TextAlignment.RIGHT);
    description.setWrapText(true);
    description.setTextOverrun(OverrunStyle.WORD_ELLIPSIS);
    description.setTextFill(tile.getTextColor());
    description.setPrefSize(PREFERRED_WIDTH * 0.9, PREFERRED_HEIGHT * 0.795);
    Helper.enableNode(description, tile.isTextVisible());

    text = new Text(tile.getText());
    text.setFill(tile.getUnitColor());
    Helper.enableNode(text, tile.isTextVisible());

    getPane().getChildren().addAll(titleText, text, description);
}
 
开发者ID:HanSolo,项目名称:tilesfx,代码行数:23,代码来源:TextTileSkin.java

示例5: initGraphics

import javafx.scene.control.OverrunStyle; //导入依赖的package包/类
@Override protected void initGraphics() {
    super.initGraphics();

    titleText = new Text();
    titleText.setFill(tile.getTitleColor());
    Helper.enableNode(titleText, !tile.getTitle().isEmpty());

    description = new Label(tile.getDescription());
    description.setAlignment(Pos.CENTER);
    description.setTextAlignment(TextAlignment.CENTER);
    description.setWrapText(true);
    description.setTextOverrun(OverrunStyle.WORD_ELLIPSIS);
    description.setTextFill(tile.getTextColor());
    description.setPrefSize(PREFERRED_WIDTH * 0.9, PREFERRED_HEIGHT * 0.795);
    Helper.enableNode(description, tile.isTextVisible());

    text = new Text(tile.getText());
    text.setFill(tile.getUnitColor());
    Helper.enableNode(text, tile.isTextVisible());

    getPane().getChildren().addAll(titleText, text, description);
}
 
开发者ID:HanSolo,项目名称:tilesfx,代码行数:23,代码来源:CharacterTileSkin.java

示例6: toValue

import javafx.scene.control.OverrunStyle; //导入依赖的package包/类
public static String toValue(OverrunStyle s)
{
	switch(s)
	{
	case CENTER_ELLIPSIS:
		return "center-ellipsis";
	case CENTER_WORD_ELLIPSIS:
		return "center-word-ellipsis";
	case CLIP:
		return "clip";
	case ELLIPSIS:
		return "ellipsis";
	case LEADING_ELLIPSIS:
		return "leading-ellipsis";
	case LEADING_WORD_ELLIPSIS:
		return "leading-word-ellipsis";
	case WORD_ELLIPSIS:
		return "word-ellipsis";
	}
	throw new Error("?" + s);
}
 
开发者ID:andy-goryachev,项目名称:FxEditor,代码行数:22,代码来源:CssTools.java

示例7: createTraceWidget

import javafx.scene.control.OverrunStyle; //导入依赖的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;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:37,代码来源:TraceSectionsDialog.java

示例8: btnOverRunAction

import javafx.scene.control.OverrunStyle; //导入依赖的package包/类
@FXML
private void btnOverRunAction()
{
	overrunStyleDeque.add(overrunStyle); // Recycle the last overrunStyle.
	overrunStyle = overrunStyleDeque.pop(); // 
		
	propertyList.forEach(prop -> prop.setValue(overrunStyle));
	
	if(overrunStyle == OverrunStyle.ELLIPSIS)
		btnOverRun.setText("...<<");
	else if(overrunStyle == OverrunStyle.CENTER_ELLIPSIS)
		btnOverRun.setText(">>...");
	else
		btnOverRun.setText(">...<");
}
 
开发者ID:tengai650,项目名称:SnapDup,代码行数:16,代码来源:MainDisplay.java

示例9: Tile

import javafx.scene.control.OverrunStyle; //导入依赖的package包/类
/**
 * Creates an empty tile. The content and size must be set with {@link #setContent(T)} and
 * {@link #setSize(TileSize)}.
 */
protected Tile() {
  try {
    FXMLLoader loader = new FXMLLoader(Tile.class.getResource("Tile.fxml"));
    loader.setRoot(this);
    loader.load();
  } catch (IOException e) {
    throw new RuntimeException("Could not load the widget tile FXML", e);
  }

  getStyleClass().addAll("tile", "card");
  PropertyUtils.bindWithConverter(idProperty(), contentProperty(), w -> "tile[" + w + "]");
  EditableLabel editableLabel = (EditableLabel) lookup("#titleLabel");
  editableLabel.textProperty().bindBidirectional(contentTitle);
  ((Label) lookup("#titleLabel").lookup(".label")).setTextOverrun(OverrunStyle.LEADING_ELLIPSIS);
  contentView.addListener((__, oldContent, newContent) -> {
    getContentPane()
        .map(Pane::getChildren)
        .ifPresent(c -> {
          if (newContent == null) {
            c.clear();
          } else {
            c.setAll(newContent);
          }
        });
  });
  contentTitle.addListener((__, prev, cur) -> editableLabel.setText(cur));
}
 
开发者ID:wpilibsuite,项目名称:shuffleboard,代码行数:32,代码来源:Tile.java

示例10: TimeScaleViewSkin

import javafx.scene.control.OverrunStyle; //导入依赖的package包/类
public TimeScaleViewSkin(T view) {
    super(view);

    LocalTime time = LocalTime.of(1, 0);

    for (int i = 1; i < 24; i++) {
        Label label = new Label(time.format(formatter));
        label.setManaged(false);
        label.setMaxWidth(Double.MAX_VALUE);
        label.setAlignment(Pos.CENTER_RIGHT);
        label.getStyleClass().add("time-label"); //$NON-NLS-1$
        label.setTextOverrun(OverrunStyle.CLIP);
        labels.add(label);
        getChildren().add(label);
        time = time.plusHours(1);
    }

    currentTimeLabel = new Label();
    currentTimeLabel.getStyleClass().add("current-time-label"); //$NON-NLS-1$
    currentTimeLabel.setManaged(false);
    currentTimeLabel.setMaxWidth(Double.MAX_VALUE);
    currentTimeLabel.setAlignment(Pos.CENTER_RIGHT);
    currentTimeLabel.setOpacity(0);
    currentTimeLabel.setTextOverrun(OverrunStyle.CLIP);
    currentTimeLabel.visibleProperty().bind(view.enableCurrentTimeMarkerProperty());

    getChildren().add(currentTimeLabel);

    updateCurrentTimeMarkerVisibility();
    view.showCurrentTimeMarkerProperty().addListener(
            it -> updateCurrentTimeMarkerVisibility());
    setupCurrentTimeMarkerSupport();
    updateShowMarkers();
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:35,代码来源:TimeScaleViewSkin.java

示例11: createLeftHandSide

import javafx.scene.control.OverrunStyle; //导入依赖的package包/类
protected Node createLeftHandSide() {
    DayPage dayPage = getSkinnable();

    // today label
    todayLabel = new Label();
    todayLabel.getStyleClass().add("today-label"); //$NON-NLS-1$
    todayLabel.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
    todayLabel.setAlignment(Pos.TOP_LEFT);
    todayLabel.setTextOverrun(OverrunStyle.CLIP);
    todayLabel.setMinWidth(Region.USE_PREF_SIZE);
    HBox.setHgrow(todayLabel, Priority.ALWAYS);

    // year month view
    yearMonthView = dayPage.getYearMonthView();
    yearMonthView.setSelectionMode(SelectionMode.SINGLE);
    yearMonthView.setShowMonth(false);
    yearMonthView.setShowYear(false);
    yearMonthView.setShowTodayButton(false);
    HBox.setHgrow(yearMonthView, Priority.NEVER);
    getSkinnable().bind(yearMonthView, true);

    HBox header = new HBox(10);
    header.setFillHeight(true);
    header.getChildren().addAll(todayLabel, yearMonthView);
    header.getStyleClass().add("header");

    AgendaView agendaView = dayPage.getAgendaView();
    getSkinnable().bind(agendaView, true);
    HBox.setMargin(agendaView, new Insets(10, 0, 0, 0));

    BorderPane leftHandSide = new BorderPane();
    leftHandSide.getStyleClass().add("left-side");
    leftHandSide.setTop(header);
    leftHandSide.setCenter(agendaView);
    HBox.setHgrow(leftHandSide, Priority.ALWAYS);
    return leftHandSide;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:38,代码来源:DayPageSkin.java

示例12: addTextAlignment

import javafx.scene.control.OverrunStyle; //导入依赖的package包/类
protected void addTextAlignment(List<Change<Labeled>> list, final Utils.LayoutSize layout, final boolean wrapped, final String text) {
    for (final OverrunStyle overrun : OverrunStyle.values()) {
        list.add(new Change<Labeled>(overrun.toString()) {
            public void apply(Labeled labeled) {
                layout.apply(labeled);
                labeled.setText(text);
                labeled.setTextOverrun(overrun);
                labeled.setWrapText(wrapped);
                if (labeled.getTextOverrun() != overrun) {
                    reportGetterFailure("labeled.overrun()");
                }
            }
        });
    }
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:16,代码来源:LabeledsAbstactApp.java

示例13: textOverrun

import javafx.scene.control.OverrunStyle; //导入依赖的package包/类
@ScreenshotCheck
@Test(timeout=300000)
public void textOverrun() throws Throwable {
    for (OverrunStyle display : OverrunStyle.values()) {
        textOverrun.as(Selectable.class).selector().select(display);
        show.mouse().move();
        checkScreenshot("Tooltip-text-overrun-" + display, testPane);
    }
    throwScreenshotError();
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:11,代码来源:TooltipTest.java

示例14: setColumnCellFactories

import javafx.scene.control.OverrunStyle; //导入依赖的package包/类
private void setColumnCellFactories()
{
	columnMsgText.setCellValueFactory(new PropertyValueFactory<PacketTypeToMatch, String>("messageText"));
	columnMsgOutputMethod.setCellValueFactory(new PropertyValueFactory<PacketTypeToMatch, String>("messageOutputMethod"));
	columnPacketDirection.setCellValueFactory(new PropertyValueFactory<PacketTypeToMatch, String>("packetDirection"));
	columnIP.setCellValueFactory(new PropertyValueFactory<PacketTypeToMatch, String>("ipAddress"));
	columnProtocol.setCellValueFactory(new PropertyValueFactory<>("protocol"));
	columnSrcPort.setCellValueFactory(new PropertyValueFactory<PacketTypeToMatch, String>("srcPort"));
	columnDstPort.setCellValueFactory(new PropertyValueFactory<PacketTypeToMatch, String>("dstPort"));
	columnPacketSize.setCellValueFactory(new PropertyValueFactory<PacketTypeToMatch, String>("packetSize"));

	columnIP.setCellFactory(new Callback<TableColumn<PacketTypeToMatch, String>, TableCell<PacketTypeToMatch, String>>()
	{
		@Override
		public TableCell<PacketTypeToMatch, String> call(TableColumn<PacketTypeToMatch, String> param)
		{
			return new TableCell<PacketTypeToMatch, String>()
			{
				@Override
				protected void updateItem(String item, boolean empty)
				{
					super.updateItem(item, empty);

					setText(item);
					setTextOverrun(OverrunStyle.CENTER_ELLIPSIS);
				}
			};
		}
	});
}
 
开发者ID:ck3ck3,项目名称:WhoWhatWhere,代码行数:31,代码来源:WatchdogController.java

示例15: setLabel

import javafx.scene.control.OverrunStyle; //导入依赖的package包/类
protected void setLabel(ITask task, Rectangle backgroundRectangle) {
    // Вешаем лэйбл с наименованием задачи
    Label taskLabel = new Label(task.getName());
    taskLabel.setTextOverrun(OverrunStyle.CLIP);
    taskLabel.setTextFill(Color.WHITE);
    taskLabel.setLayoutY(6);
    taskLabel.prefWidthProperty().bind(backgroundRectangle.widthProperty());
    taskLabel.onMousePressedProperty().bind(backgroundRectangle.onMousePressedProperty());
    taskLabel.onMouseDraggedProperty().bind(backgroundRectangle.onMouseDraggedProperty());
    this.getChildren().add(taskLabel);
}
 
开发者ID:khasang,项目名称:Cachoeira,代码行数:12,代码来源:TaskBar.java


注:本文中的javafx.scene.control.OverrunStyle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。