Java 类javafx.scene.control.ContentDisplay 实例源码

项目:ABC-List    文件:CheckBoxListCell.java   
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);
}
项目:Hostel-Management-System    文件:MessAccountantController.java   
@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();
        }
    });
}
项目:ulviewer    文件:LogTooltip.java   
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);
}
项目:willow-browser    文件:IconButton.java   
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);
}
项目:Gargoyle    文件:ColorPickerTableCell.java   
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);
}
项目:arma-dialog-creator    文件:ChooseMacroDialog.java   
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);
}
项目:openjfx-8u-dev-tests    文件:LayoutTableViewApp.java   
@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();
}
项目:caliper    文件:UnitOfMeasureController.java   
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);
}
项目:trex-stateless-gui    文件:PacketHex.java   
/**
 *
 * @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);
    }
}
项目:qupath    文件:TMAScoreImportCommand.java   
@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);
}
项目:j.commons    文件:RadialMenuSkinBase.java   
/**
 * 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();
}
项目:mars-sim    文件:SelectableTitledPane.java   
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;");
}
项目:blackmarket    文件:ItemTypePanes.java   
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));
}
项目:FXImgurUploader    文件:MainWindow.java   
/**
 * 
 * @return 
 */
public Button getStartButton() {
    if (startButton == null) {
        startButton = GlyphsDude.createIconButton(FontAwesomeIcon.PLAY, "", "28", "0", ContentDisplay.CENTER);
        startButton.getStyleClass().addAll("toolbar-button-transparent", "start", "dropshadow-1-5");
        TooltipBuilder.create("Start Capture", startButton);
        startButton.setOnAction((ActionEvent event) -> {
            getStartButton().setDisable(true);
            getStopButton().setDisable(false);

            try {
                GlobalScreen.addNativeKeyListener(getPrintScreenListener());
                GlobalScreen.registerNativeHook();
            } catch (NativeHookException ex) {
                FxDialogs.showErrorDialog("There was a problem registering the native hook.");
                Logger.getLogger(Main.class.getName()).log(Level.SEVERE, "There was a problem registering the native hook.", ex);
            }

        });
    }
    return startButton;
}
项目:FXImgurUploader    文件:MainWindow.java   
/**
 * 
 * @return 
 */
public Button getStopButton() {
    if (stopButton == null) {
        stopButton = GlyphsDude.createIconButton(FontAwesomeIcon.STOP, "", "28", "0", ContentDisplay.CENTER);
        stopButton.getStyleClass().addAll("toolbar-button-transparent", "stop", "dropshadow-1-5");
        TooltipBuilder.create("Stop Capture", stopButton);
        stopButton.setDisable(true);
        stopButton.setOnAction((ActionEvent event) -> {
            getStopButton().setDisable(true);
            getStartButton().setDisable(false);

            try {
                GlobalScreen.removeNativeKeyListener(getPrintScreenListener());
                GlobalScreen.unregisterNativeHook();
            } catch (NativeHookException ex) {
                FxDialogs.showErrorDialog("There was a problem registering the native hook.");
                Logger.getLogger(Main.class.getName()).log(Level.SEVERE, "There was a problem registering the native hook.", ex);
            }
        });
    }
    return stopButton;
}
项目:FXImgurUploader    文件:MainWindow.java   
/**
     * 
     * @return 
     */
    public Button getUploadButton() {
        if (uploadButton == null) {
            uploadButton = GlyphsDude.createIconButton(FontAwesomeIcon.CLOUD_UPLOAD, "upload image", "24", "15", ContentDisplay.LEFT);
            uploadButton.getStyleClass().add("upload-button");
            uploadButton.setDisable(true);
//            uploadButton.disableProperty().bind(getImageTable().getSelectionModel().selectedItemProperty().isNull());
            uploadButton.setOnAction((ActionEvent event) -> {
                ImageEN image = getImageTable().getSelectionModel().getSelectedItem();
                if (image == null) {
                    return;
                }

                doImageUpload(image);
            });
        }
        return uploadButton;
    }
项目:WhoWhatWhere    文件:GUIController.java   
private VBox getAttributionLinksForAboutDialog()
{
    FlowPane iconsAttributionPane = generateLabelAndLinkPane("All icons (except for ", "http://icons8.com", Font.getDefault().getSize());
    Label labelToAdd = new Label(") are from");
    labelToAdd.setGraphic(new ImageView(new Image(applicationIcon16Location)));
    labelToAdd.setContentDisplay(ContentDisplay.LEFT);
    labelToAdd.setGraphicTextGap(2);
    iconsAttributionPane.getChildren().add(1, labelToAdd); //add the label in the middle of the message

    FlowPane softwareAttributionPane = generateLabelAndLinkPane("Click", Main.attributionHTMLLocation, Font.getDefault().getSize());
    Hyperlink tempLink = (Hyperlink) softwareAttributionPane.getChildren().get(1);
    tempLink.setText("here");
    softwareAttributionPane.getChildren().add(new Label("to see which software libraries are used in Who What Where."));

    VBox vbox = new VBox();
    vbox.getChildren().addAll(iconsAttributionPane, softwareAttributionPane);

    return vbox;
}
项目:WhoWhatWhere    文件:AppearanceCounterController.java   
private void setTooltipsAndGraphics()
{
    Tooltip wwwTooltip = new Tooltip("Who What Where listens to network traffic and analyzes IP packets. Analysis includes geographical location, latency and total amount of packets sent and received from each address.");
    ToolTipUtilities.setTooltipProperties(wwwTooltip, true, GUIController.defaultTooltipMaxWidth, GUIController.defaultFontSize, null);
    labelWWW.setTooltip(wwwTooltip);
    GUIController.setCommonGraphicOnLabeled(labelWWW, GUIController.CommonGraphicImages.TOOLTIP);

    Tooltip hotkeyTooltip = new Tooltip("The hotkey can be activated even while " + Main.appTitle + " isn't visible on the screen. "
            + "The table contents will be read out to you so you don't have to look at the screen. The text to speech voice can be configured from the Options menu.");
    ToolTipUtilities.setTooltipProperties(hotkeyTooltip, true, GUIController.defaultTooltipMaxWidth, GUIController.defaultFontSize, AnchorLocation.WINDOW_TOP_RIGHT); 
    chkboxUseTTS.setTooltip(hotkeyTooltip);
    GUIController.setCommonGraphicOnLabeled(chkboxUseTTS, GUIController.CommonGraphicImages.TOOLTIP);

    Tooltip geoIPTooltip = new Tooltip("For each IP address, gets the name of the organization that owns it and its location (country, region and city). GeoIP info isn't always accurate. Right click on any row to see more GeoIP results in the browser.");
    ToolTipUtilities.setTooltipProperties(geoIPTooltip, true, GUIController.defaultTooltipMaxWidth, GUIController.defaultFontSize, null);
    chkboxGetLocation.setTooltip(geoIPTooltip);     
    GUIController.setCommonGraphicOnLabeled(chkboxGetLocation, GUIController.CommonGraphicImages.TOOLTIP);

    GUIController.setCommonGraphicOnLabeled(btnConfigCaptureHotkey, GUIController.CommonGraphicImages.HOTKEY);
    GUIController.setGraphicForLabeledControl(btnStart, startWWWImageLocation, ContentDisplay.LEFT);
    GUIController.setCommonGraphicOnLabeled(btnStop, GUIController.CommonGraphicImages.STOP);
    GUIController.setGraphicForLabeledControl(btnExportTableToCSV, exportToCSVImageLocation, ContentDisplay.LEFT);      
}
项目:metastone    文件:MetaDeckView.java   
public void displayDecks(List<Deck> decks) {
    contentPane.getChildren().clear();
    for (Deck deck : decks) {
        if (deck.isMetaDeck()) {
            continue;
        }
        ImageView graphic = new ImageView(IconFactory.getClassIcon(deck.getHeroClass()));
        graphic.setFitWidth(48);
        graphic.setFitHeight(48);
        Button deckButton = new Button(deck.getName(), graphic);
        deckButton.setMaxWidth(160);
        deckButton.setMinWidth(160);
        deckButton.setMaxHeight(120);
        deckButton.setMinHeight(120);
        deckButton.setWrapText(true);
        deckButton.setContentDisplay(ContentDisplay.LEFT);
        deckButton.setOnAction(event -> NotificationProxy.sendNotification(GameNotification.ADD_DECK_TO_META_DECK, deck));
        deckButton.setUserData(deck);
        contentPane.getChildren().add(deckButton);
    }
}
项目:Visual-Programming-Environment-for-Coordinating-Appliances-and-Services-in-a-Smart-House    文件:Box.java   
public void itemOnOff() {
    if (itemFlag) {
        vbox.getChildren().remove(1);
        boxSizeY = boxSizeY - initBoxSizeY;
        setBoxSize();
        itemFlag = false;
    } else {
        Label itemlabel = new Label();
        itemlabel.setAlignment(Pos.BASELINE_CENTER);
        itemlabel.setText(itemStr);
        // 条件文とオブジェクト名の間に入れる線
        Line borderline = new Line(0, 0, initBoxSizeX, 0);
        borderline.setStroke(Color.web("#B3B3B3"));

        itemlabel.setGraphic(borderline);
        itemlabel.setContentDisplay(ContentDisplay.TOP);
        vbox.getChildren().add(1, itemlabel);
        boxSizeY = boxSizeY + initBoxSizeY;
        setBoxSize();
        itemFlag = true;
        reSetItem();
    }
}
项目:Visual-Programming-Environment-for-Coordinating-Appliances-and-Services-in-a-Smart-House    文件:Box.java   
public void itemOnOff() {
    if (itemFlag) {
        vbox.getChildren().remove(1);
        boxSizeY = boxSizeY - initBoxSizeY;
        setBoxSize();
        itemFlag = false;
    } else {
        Label itemlabel = new Label();
        itemlabel.setAlignment(Pos.BASELINE_CENTER);
        itemlabel.setText(itemStr);
        // 条件文とオブジェクト名の間に入れる線
        Line borderline = new Line(0, 0, initBoxSizeX, 0);
        borderline.setStroke(Color.web("#B3B3B3"));

        itemlabel.setGraphic(borderline);
        itemlabel.setContentDisplay(ContentDisplay.TOP);
        vbox.getChildren().add(1, itemlabel);
        boxSizeY = boxSizeY + initBoxSizeY;
        setBoxSize();
        itemFlag = true;
        reSetItem();
    }
}
项目:JVx.javafx    文件:LayoutUtil.java   
/**
 * Computes the preferred width of the given container based on the content
 * display.
 * <p>
 * This is a basically just an intermediate function which should have been
 * in a base class. But this is used with an already existing class
 * hierarchy, so it's not possible to directly inject it.
 *
 * @param pContainer the container.
 * @param pContentAlignable the content alignable.
 * @param pLayoutForwarding the forwarded layout.
 * @param pContentSelector the content selector.
 * @return the double.
 */
public static double computeContentPreferredWidth(Region pContainer, IFXContentAlignable pContentAlignable, IFXLayoutForwarding pLayoutForwarding, String pContentSelector)
{
    String styleClassName = pContainer.getStyleClass().get(0);

    if (pContentAlignable.getContentDisplay() == ContentDisplay.TOP || pContentAlignable.getContentDisplay() == ContentDisplay.BOTTOM
            || pContentAlignable.getContentDisplay() == ContentDisplay.CENTER)
    {
        Node imageView = pContainer.lookup("." + styleClassName + " *.image-view");

        if (imageView == null)
        {
            Node text = pContainer.lookup("." + styleClassName + " *.text");
            Node content = pContainer.lookup("." + styleClassName + " *." + pContentSelector);

            return Math.max(text.prefWidth(-1), content.prefWidth(-1));
        }
    }

    return pLayoutForwarding.calculatePreferredWidth(-1);
}
项目:mzmine3    文件:ColorTableCell.java   
public ColorTableCell(TableColumn<T, Color> column) {
  colorPicker = new ColorPicker();
  colorPicker.editableProperty().bind(column.editableProperty());
  colorPicker.disableProperty().bind(column.editableProperty().not());
  colorPicker.setOnShowing(event -> {
    final TableView<T> tableView = getTableView();
    tableView.getSelectionModel().select(getTableRow().getIndex());
    tableView.edit(tableView.getSelectionModel().getSelectedIndex(), column);
  });
  colorPicker.valueProperty().addListener((observable, oldValue, newValue) -> {
    if (isEditing()) {
      commitEdit(newValue);
    }
  });
  setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
}
项目:GRIP    文件:ExceptionWitnessResponderButton.java   
/**
 * @param origin The same origin that is passed to the
 * {@link edu.wpi.grip.core.util.ExceptionWitness}
 */
@Inject
ExceptionWitnessResponderButton(@Assisted Object origin, @Assisted String popOverTitle) {
  super();

  this.origin = checkNotNull(origin, "The origin can not be null");
  this.popOverTitle = checkNotNull(popOverTitle, "The pop over title can not be null");
  this.tooltip = new Tooltip();
  this.getStyleClass().add(STYLE_CLASS);

  final ImageView icon = new ImageView("/edu/wpi/grip/ui/icons/warning.png");

  setOnMouseClicked(event -> getPopover().show(this));
  setVisible(false);
  setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
  setGraphic(icon);
  icon.setFitWidth(DPIUtility.SMALL_ICON_SIZE);
  icon.setFitHeight(DPIUtility.SMALL_ICON_SIZE);

  FadeTransition ft = new FadeTransition(Duration.millis(750), icon);
  ft.setToValue(0.1);
  ft.setCycleCount(Transition.INDEFINITE);
  ft.setAutoReverse(true);
  ft.play();
}
项目:javafx-widgets    文件:AbstractAction.java   
/**
 * Constructs an {@link AbstractAction}.
 *
 * @param options
 *          the options of the new action.
 * @param id
 *          the id of the new action.
 */
public AbstractAction(@Nullable String id, int options) {
  this.options = options;
  this.id = id;
  buttonId = null;
  menuItemId = null;
  text = new SimpleStringProperty(this, "text");
  description = new SimpleStringProperty(this, "description");
  style = new SimpleStringProperty(this, "style");
  accelerator = new SimpleObjectProperty<KeyCombination>(this, "accelerator");
  graphic = new SimpleObjectProperty<Node>(this, "graphic");
  alignment = new SimpleObjectProperty<Pos>(this, "alignment", Pos.CENTER_LEFT);
  contentDisplay = new SimpleObjectProperty<ContentDisplay>(this, "contentDisplay", ContentDisplay.LEFT);
  graphicTextGap = new SimpleDoubleProperty(this, "graphicTextGap", -1);
  visible = new SimpleBooleanProperty(this, "visibles", true);
  managed = new SimpleBooleanProperty(this, "managed", true);
  mnemonicParsing = new SimpleBooleanProperty(this, "mnemonicParsing", true);
  selected = new SimpleBooleanProperty(this, "selected", false);
  allowIndeterminate = new SimpleBooleanProperty(this, "allowIndeterminate", false);
  indeterminate = new SimpleBooleanProperty(this, "indeterminate", false);
  visited = new SimpleBooleanProperty(this, "visited", false);
  styleClass = FXCollections.<String>observableArrayList();
  bindStyleClass = false;
}
项目:drive-uploader    文件:ErrorReportViewController.java   
@SuppressWarnings("rawtypes")
@Override
      public TableCell call(final TableColumn param) {
          final TableCell cell = new TableCell() {

              @SuppressWarnings("unchecked")
        @Override
              public void updateItem(Object item, boolean empty) {
                  super.updateItem(item, empty);
                  if (empty) {
                      setText(null);
                      setGraphic(null);
                  } else {
                      if (ErrorModel.ErrorLevel.ERROR.toString().equals(((String) item))) {
                        setGraphic(ErrorModel.newErrorIcon());
                      } else if (ErrorModel.ErrorLevel.WARNING.toString().equals(((String) item))) {
                        setGraphic(ErrorModel.newWarningIcon());
                      }
                      setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
                  }
              }
          };
          cell.setAlignment(Pos.CENTER);
          return cell;
      }
项目:RegexGolf2    文件:RequirementCellUI.java   
private void initLayout()
{
    _editLabel.editIconAppearsProperty().bind(this.hoverProperty());
    Node editLabelNode = _editLabel.getUINode();
    AnchorPane.setLeftAnchor(editLabelNode, 0.0);
    AnchorPane.setTopAnchor(editLabelNode, 0.0);
    AnchorPane.setBottomAnchor(editLabelNode, 0.0);

    _imageView.setFitHeight(25);
    _imageView.setFitWidth(25);

    AnchorPane.setTopAnchor(_imageView, 0.0);
    AnchorPane.setRightAnchor(_imageView, 0.0);

    _rootNode.getChildren().add(editLabelNode);
    _rootNode.getChildren().add(_imageView);

    //Setup correct scaling
    this.setPrefWidth(0);
    _rootNode.prefWidthProperty().bind(this.widthProperty());

    setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
}
项目:netentionj-desktop    文件:IconButton.java   
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);
}
项目:javafx-demos    文件:JavaFX_TableView_PieChart.java   
@Override
public void updateItem(Double item, boolean empty) {
    super.updateItem(item, empty);

    if (empty) {
        setText(null);
        setGraphic(null);
    } else {
        if (isEditing()) {
            if (textField != null) {
                textField.setText(getString());
            }
            setGraphic(textField);
            setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
        } else {
            setText(getString());
            setContentDisplay(ContentDisplay.TEXT_ONLY);
        }
    }
}
项目:pdfsam    文件:TooltippedTextFieldTableCell.java   
@Override
public void commitEdit(String item) {

    // This block is necessary to support commit on losing focus, because the baked-in mechanism
    // sets our editing state to false before we can intercept the loss of focus.
    // The default commitEdit(...) method simply bails if we are not editing...
    if (!isEditing() && !item.equals(getItem())) {
        TableView<SelectionTableRowData> table = getTableView();
        if (table != null) {
            TableColumn<SelectionTableRowData, String> column = getTableColumn();
            CellEditEvent<SelectionTableRowData, String> event = new CellEditEvent<>(table,
                    new TablePosition<>(table, getIndex(), column), TableColumn.editCommitEvent(), item);
            Event.fireEvent(column, event);
        }
    }

    super.commitEdit(item);
    setContentDisplay(ContentDisplay.TEXT_ONLY);
}
项目:closurefx-builder    文件:SelectClosureDialogController.java   
public void updateItem(ClosureLibrary item, boolean empty) {
    super.updateItem(item, empty);
    if (empty) {
        setText(null);
    }
    if (item != null) {
        if (!new File(item.getPath()).exists()) {
            setPrefHeight(0);
            setPrefWidth(0);
            setVisible(false);
            setText(null);
            setGraphic(null);
        } else {
            setPrefHeight(getMinHeight());
            setPrefWidth(getMaxWidth());
            setVisible(true);
            setText(item.getName());
            Label label = new Label(item.getPath());
            label.setTextFill(Color.GRAY);
            setGraphic(label);
            setContentDisplay(ContentDisplay.RIGHT);
        }
    }
}
项目:closurefx-builder    文件:SelectVariableDialogController.java   
public void updateItem(Variable item, boolean empty) {
    super.updateItem(item, empty);
    if (empty) {
        setText(null);
    }
    if (item != null) {
        if (!new File(item.getPath()).exists()) {
            setPrefHeight(0);
            setPrefWidth(0);
            setVisible(false);
            setText(null);
            setGraphic(null);
        } else {
            setPrefHeight(getMinHeight());
            setPrefWidth(getMaxWidth());
            setVisible(true);
            setText(item.getName());
            Label label = new Label(item.getPath());
            label.setTextFill(Color.GRAY);
            setGraphic(label);
            setContentDisplay(ContentDisplay.RIGHT);
        }
    }
}
项目:Omoikane    文件:VentaEspecialHandler.java   
@Override
public void updateItem(String item, boolean empty) {
    super.updateItem(item, empty);

    if (empty) {
        setText(null);
        setGraphic(null);
    } else {
        if (isEditing()) {
            if (textField != null) {
                textField.setText(getString());
            }
            setGraphic(textField);
            setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
        } else {
            setText(getString());
            setContentDisplay(ContentDisplay.TEXT_ONLY);
        }
    }
}
项目:Omoikane    文件:AbstractEditableTableCell.java   
@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.selectAll();
            textField.requestFocus();
        }
    });
}
项目:Omoikane    文件:AbstractEditableTableCell.java   
@Override
public void updateItem(T item, boolean empty) {
    super.updateItem(item, empty);
    if (empty) {
        setText(null);
        setGraphic(null);
    } else {
        if (isEditing()) {
            if (textField != null) {
                textField.setText(getString());
            }
            setGraphic(textField);
            setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
        } else {
            setText(getString());
            setContentDisplay(ContentDisplay.TEXT_ONLY);
        }
    }
}
项目:fwm    文件:RelationalField.java   
public void start(EntitiesToSearch t, EntitiesToSearch r, Node n, Saveable caller, List<Searchable> ourItems, boolean useButton, boolean removable, String title) {
    this.tabType = t;
    this.relationType = r;
    this.ourRoot = n;
    this.caller = caller;
    this.relationsRemovable = removable;
    addButton.setContentDisplay(ContentDisplay.RIGHT);

    // set reference to the object owned by the tab
    tabObject = caller.getThing();
    populateList(ourItems);
    updateList();
    setTitle(title);

}
项目:fwm    文件:RelationalListOriginal.java   
public void start(EntitiesToSearch t, EntitiesToSearch r, Node n, Saveable caller, List<Searchable> ourItems, boolean useButton, boolean removable, String title) {
    this.tabType = t;
    this.relationType = r;
    this.ourRoot = n;
    this.caller = caller;
    this.showButton = useButton;
    this.relationsRemovable = removable;
    this.titledPane = (TitledPane) n;
    addButton.setContentDisplay(ContentDisplay.RIGHT);
    listPane.setMouseTransparent(true);
    listPane.setVisible(false);

    if (!showButton) {
        addButton.setMouseTransparent(true);
        addButton.setVisible(false);
    }

    // set reference to the object owned by the tab
    tabObject = caller.getThing();
    populateList(ourItems);


    updateList();
    setTitle(title);
}
项目:fwm    文件:RelationalList.java   
public void start(EntitiesToSearch t, EntitiesToSearch r, Node n, Saveable caller, List<Searchable> ourItems, boolean useButton, boolean removable, String title) {
    this.tabType = t;
    this.relationType = r;
    this.ourRoot = n;
    this.caller = caller;
    this.showButton = useButton;
    this.relationsRemovable = removable;
    this.titledPane = (TitledPane) n;
    addButton.setContentDisplay(ContentDisplay.RIGHT);
    listPane.setMouseTransparent(true);
    listPane.setVisible(false);
    titledPane.setAnimated(false);
    if (!showButton) {
        addButton.setMouseTransparent(true);
        addButton.setVisible(false);
    }
    if (r == EntitiesToSearch.TEMPLATE) {
        this.isTemplate = true;
    }

    // set reference to the object owned by the tab
    tabObject = caller.getThing();
    populateList(ourItems);


    updateList();
    setTitle(title);


}
项目:marathonv5    文件:SeriesChartTableCellFactory.java   
@Override public void updateItem(List<Double> item, boolean empty) {
    super.updateItem(item, empty);

    if (empty) {
        setGraphic(null);
    } else {
        XYChart.Series<Number, Number> salesSeries = new XYChart.Series<Number, Number>();
        for (int i = 0; i < item.size(); i++) {
            salesSeries.getData().add(new XYChart.Data<Number, Number>(i, item.get(i)));
        }
        chart.getData().setAll(salesSeries);
        setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
    }
}
项目:marathonv5    文件:GraphicButton.java   
public GraphicButton() {
    super(400,100);
    ImageView imageView = new ImageView(ICON_48);
    Button button = new Button("button", imageView);
    button.setContentDisplay(ContentDisplay.LEFT);
    getChildren().add(button);
}