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


Java ContentDisplay类代码示例

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


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

示例1: StackPaneSample

import javafx.scene.control.ContentDisplay; //导入依赖的package包/类
public StackPaneSample() {

       StackPane stackPane = new StackPane();

       Rectangle rectangle = new Rectangle(280, 70, Color.BISQUE);
       rectangle.setStroke(Color.BLACK);
       ImageView imageView = new ImageView(ICON_48);
       Label label = new Label("Your name could be here.", imageView);
       label.setContentDisplay(ContentDisplay.RIGHT);

       stackPane.getChildren().addAll(rectangle, label);

       getChildren().add(stackPane);
   }
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:15,代码来源:StackPaneSample.java

示例2: addIntegrationButtonsToVbox

import javafx.scene.control.ContentDisplay; //导入依赖的package包/类
private void addIntegrationButtonsToVbox(Integration integration, VBox vbox)
{
	for (String buttonKey : integration.getActions().keySet())
	{
		System.out.println("*" + buttonKey);
		final Action clickableButton = integration.getActions().get(buttonKey);
		if (clickableButton.isHiddenFromFrontend())
		{
			continue;
		}
		final Button jfxButton = new Button(clickableButton.getName());
		jfxButton.setPadding(new Insets(2, 4, 2, 4));
		jfxButton.setMinWidth(256);
		jfxButton.setMaxWidth(256);
		jfxButton.setAlignment(Pos.BASELINE_LEFT);
		jfxButton.setContentDisplay(ContentDisplay.RIGHT);
		jfxButton.setTooltip(new Tooltip(buttonKey + "\n" + clickableButton.getDescription())); // I tried it, but it looks a bit janky
		jfxButton.setOnAction(new EventHandler<ActionEvent>()
		{
			@Override
			public void handle(ActionEvent arg0)
			{
				try
				{
					triggerEvent("<" + clickableButton.getName() + "> from frontend", null);
					clickableButton.onAction(null);
				}
				catch (Exception e)
				{
					e.printStackTrace();
				}
			}
		});
		vbox.getChildren().add(jfxButton);
	}
}
 
开发者ID:PolyphasicDevTeam,项目名称:NoMoreOversleeps,代码行数:37,代码来源:MainDialog.java

示例3: CheckBoxListCell

import javafx.scene.control.ContentDisplay; //导入依赖的package包/类
public CheckBoxListCell(
        final Callback<T, ObservableValue<Boolean>> getSelectedProperty, 
        final BooleanProperty disableProperty,
        final StringConverter<T> converter
) {
    this.getStyleClass().add("check-box-list-cell");
    setSelectedStateCallback(getSelectedProperty);
    setConverter(converter);
    
    checkBox = new CheckBox();
    checkBox.disableProperty().bind(disableProperty);
    
    setAlignment(Pos.CENTER_LEFT);
    setContentDisplay(ContentDisplay.LEFT);

    // by default the graphic is null until the cell stops being empty
    setGraphic(null);
}
 
开发者ID:Naoghuman,项目名称:ABC-List,代码行数:19,代码来源:CheckBoxListCell.java

示例4: startEdit

import javafx.scene.control.ContentDisplay; //导入依赖的package包/类
@Override
public void startEdit()
{
    super.startEdit();
    if (textField == null)
    {
        createTextField();
    }
    setGraphic(textField);
    setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
    Platform.runLater(new Runnable()
    {
        @Override
        public void run()
        {
            textField.requestFocus();
            textField.selectAll();
        }
    });
}
 
开发者ID:pranavjindal999,项目名称:Hostel-Management-System,代码行数:21,代码来源:MessAccountantController.java

示例5: LogTooltip

import javafx.scene.control.ContentDisplay; //导入依赖的package包/类
public LogTooltip(List<GridEntry> gridEntries){
    super();

    this.gridEntries = gridEntries;
    GridPane grid = new GridPane();
    grid.setHgap(GRID_HGAP);

    for(int Cnt = 0; Cnt < gridEntries.size(); Cnt++){
        grid.add(new Rectangle(LABEL_RECT_SIZE, LABEL_RECT_SIZE, gridEntries.get(Cnt).getColor()), 0, Cnt);
        grid.add(gridEntries.get(Cnt).getLabel(), 1, Cnt);
        grid.add(gridEntries.get(Cnt).getContentLabel(), 2, Cnt);
    }

    this.setContentDisplay(ContentDisplay.BOTTOM);
    this.setGraphic(grid);
}
 
开发者ID:YaSuenag,项目名称:ulviewer,代码行数:17,代码来源:LogTooltip.java

示例6: IconButton

import javafx.scene.control.ContentDisplay; //导入依赖的package包/类
public IconButton(String buttonText, String imageLoc, String tooltipText, EventHandler<ActionEvent> actionEventHandler) {
    super(buttonText);

    setTooltip(new Tooltip(tooltipText));
    getStyleClass().add("icon-button");
    setMaxWidth(Double.MAX_VALUE);
    setAlignment(Pos.CENTER_LEFT);

    final ImageView imageView = new ImageView(ResourceUtil.getImage(imageLoc));
    imageView.setFitHeight(16);
    imageView.setPreserveRatio(true);
    setGraphic(imageView);

    setContentDisplay(ContentDisplay.LEFT);
    VBox.setMargin(this, new Insets(0, 5, 0, 5));

    setOnAction(actionEventHandler);
}
 
开发者ID:proofy,项目名称:willow-browser,代码行数:19,代码来源:IconButton.java

示例7: ColorPickerTableCell

import javafx.scene.control.ContentDisplay; //导入依赖的package包/类
public ColorPickerTableCell(TableColumn<T, Color> column , ColorCellFactory parent) {
	this.parent = parent;
	this.colorPicker = new ColorPicker();
	this.colorPicker.getStyleClass().add("button");
	this.colorPicker.setStyle("-fx-color-label-visible:false;");

	this.colorPicker.editableProperty().bind(column.editableProperty());
	this.colorPicker.disableProperty().bind(column.editableProperty().not());
	this.colorPicker.setOnShowing(event -> {
		final TableView<T> tableView = getTableView();
		tableView.getSelectionModel().clearSelection();
		tableView.getSelectionModel().select(getTableRow().getIndex());
		tableView.edit(getIndex(), column);
	});
	this.colorPicker.valueProperty().addListener((observable, oldValue, newValue) -> {
		if (isEditing()) {
			commitEdit(newValue);
			parent.chage(getIndex());
		}
	});
	// 텍스트는 화면에 보여주지않음.
	setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:24,代码来源:ColorPickerTableCell.java

示例8: BasicMacroItemCategory

import javafx.scene.control.ContentDisplay; //导入依赖的package包/类
public BasicMacroItemCategory() {
	final double height = 100;
	VBox vb = new VBox(10);
	categoryNode = vb;
	ResourceBundle bundle = Lang.ApplicationBundle();

	taComment.setPrefHeight(height);
	taComment.setEditable(false);
	Label lblComment = new Label(bundle.getString("Macros.comment"), taComment);
	lblComment.setContentDisplay(ContentDisplay.BOTTOM);
	taValue.setEditable(false);
	taValue.setPrefHeight(height);
	Label lblValue = new Label(bundle.getString("Macros.value"), taValue);
	lblValue.setContentDisplay(ContentDisplay.BOTTOM);

	lblMacroPropertyType = new Label(String.format(bundle.getString("Popups.ChooseMacro.property_type"), "?"));

	vb.getChildren().addAll(lblValue, lblComment, lblMacroPropertyType);
}
 
开发者ID:kayler-renslow,项目名称:arma-dialog-creator,代码行数:20,代码来源:ChooseMacroDialog.java

示例9: startEdit

import javafx.scene.control.ContentDisplay; //导入依赖的package包/类
@Override
public void startEdit() {
    super.startEdit();
    if (isEmpty()) {
        return;
    }

    if (textBox == null) {
        createTextBox();
    } else {
        textBox.setText(getItem());
    }

    setGraphic(textBox);
    setContentDisplay(ContentDisplay.TEXT_ONLY);

    textBox.requestFocus();
    textBox.selectAll();
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:20,代码来源:LayoutTableViewApp.java

示例10: setButtonImages

import javafx.scene.control.ContentDisplay; //导入依赖的package包/类
private void setButtonImages() {
	// new
	ImageView newView = new ImageView(new Image("images/New.png", 16, 16, true, true));
	btNew.setGraphic(newView);
	btNew.setContentDisplay(ContentDisplay.RIGHT);

	// save
	ImageView saveView = new ImageView(new Image("images/Save.png", 16, 16, true, true));
	btSave.setGraphic(saveView);
	btSave.setContentDisplay(ContentDisplay.RIGHT);

	// delete
	ImageView deleteView = new ImageView(new Image("images/Delete.png", 16, 16, true, true));
	btDelete.setGraphic(deleteView);
	btDelete.setContentDisplay(ContentDisplay.RIGHT);

	// refresh
	ImageView refreshView = new ImageView(new Image("images/Refresh.png", 16, 16, true, true));
	btRefresh.setGraphic(refreshView);
	btRefresh.setContentDisplay(ContentDisplay.RIGHT);
}
 
开发者ID:point85,项目名称:caliper,代码行数:22,代码来源:UnitOfMeasureController.java

示例11: updateItem

import javafx.scene.control.ContentDisplay; //导入依赖的package包/类
/**
 *
 * @param item
 * @param empty
 */
@Override
protected void updateItem(String item, boolean empty) {
    super.updateItem(item, empty);
    if (!empty) {
        // Show the Text Field
        this.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
        ObservableValue<String> ov = getTableColumn().getCellObservableValue(getIndex());
        SimpleStringProperty sp = (SimpleStringProperty) ov;
        
        if (this.boundToCurrently == null) {
            this.boundToCurrently = sp;
            this.textField.textProperty().bindBidirectional(sp);
        } else if (this.boundToCurrently != sp) {
            this.textField.textProperty().unbindBidirectional(this.boundToCurrently);
            this.boundToCurrently = sp;
            this.textField.textProperty().bindBidirectional(this.boundToCurrently);
        }
    } else {
        this.setContentDisplay(ContentDisplay.TEXT_ONLY);
    }
}
 
开发者ID:exalt-tech,项目名称:trex-stateless-gui,代码行数:27,代码来源:PacketHex.java

示例12: updateItem

import javafx.scene.control.ContentDisplay; //导入依赖的package包/类
@Override
public void updateItem(TMACoreObject item, boolean empty) {
	super.updateItem(item, empty);
	setWidth(150);
	setHeight(150);
	setMaxWidth(200);
	setMaxHeight(200);
	if (item == null || empty) {
		setText(null);
		setGraphic(null);
		setTooltip(null);
		return;
	}
	if (item.isMissing())
		setTextFill(ColorToolsFX.getCachedColor(PathPrefs.getTMACoreMissingColor()));
	else
		setTextFill(ColorToolsFX.getCachedColor(PathPrefs.getTMACoreColor()));
	
	setAlignment(Pos.CENTER);
	setTextAlignment(TextAlignment.CENTER);
	setContentDisplay(ContentDisplay.CENTER);
	setText(getDisplayString(item));
	tooltip.setText(getExtendedDescription(item));
	setTooltip(tooltip);
}
 
开发者ID:qupath,项目名称:qupath,代码行数:26,代码来源:TMAScoreImportCommand.java

示例13: RadialMenuSkinBase

import javafx.scene.control.ContentDisplay; //导入依赖的package包/类
/**
 * Constructor for all SkinBase instances.
 *
 * @param control The control for which this Skin should attach to.
 */
public RadialMenuSkinBase(C control, B button) {
    super(control);
    this.button = button;
    this.model = control;

    button.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);

    getChildren().add(button);

    bindSize();
    bindGraphic();
    bindTooltip();
    bindCoords();

    button.setVisible(false);
    updateVisibility();
}
 
开发者ID:dejv78,项目名称:j.commons,代码行数:23,代码来源:RadialMenuSkinBase.java

示例14: SelectableTitledPane

import javafx.scene.control.ContentDisplay; //导入依赖的package包/类
public SelectableTitledPane(String title, Node content) {
  super(title, content);
  checkBox = new CheckBox(title);
  checkBox.selectedProperty().
          bindBidirectional(this.expandedProperty());
  setExpanded(false);
  setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
  setGraphic(checkBox);
  setSkin(new TitledPaneSkin(this));
  lookup(".arrow").
          setVisible(false);
  lookup(".title").
          setStyle("-fx-padding: 0 0 4 -10;"
          		+ "-fx-font-color: white;"	            		
          + "-fx-background-color: black;");
  lookup(".content").
          setStyle("-fx-background-color: black;"
          		+ "-fx-font-color: white;"
          		+ "-fx-font-smoothing-type: lcd;"
          		+ "-fx-padding:  0.2em 0.2em 0.2em 1.316667em;");
}
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:22,代码来源:SelectableTitledPane.java

示例15: ItemTypePanes

import javafx.scene.control.ContentDisplay; //导入依赖的package包/类
public ItemTypePanes(Consumer<List<ItemType>> onChangeConsumer) {
   	this.onChangeConsumer = onChangeConsumer;
	itemTypesChkbxs = Arrays.asList(ItemType.values())
			.stream()
			.map(it -> {
				ToggleButton chbBx = new ToggleButton(it.displayName());
				chbBx.setUserData(it);
				chbBx.setMinWidth(PREF_TILE_WIDTH);
				chbBx.setMinHeight(PREF_TILE_HEIGHT);
				chbBx.setGraphic(new ImageView(ImageCache.getInstance().get(it.icon())));
				chbBx.setContentDisplay(ContentDisplay.RIGHT);
				chbBx.setOnAction(e -> checked());
				return chbBx;
			})
			.collect(Collectors.toList());
	
	itemTypePane1 = new ItemTypePane(itemTypesChkbxs.subList(0, 8));
	itemTypePane2 = new ItemTypePane(itemTypesChkbxs.subList(8, 17));
	itemTypePane3 = new ItemTypePane(itemTypesChkbxs.subList(17, 30));
}
 
开发者ID:thirdy,项目名称:blackmarket,代码行数:21,代码来源:ItemTypePanes.java


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