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


Java NamedArg类代码示例

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


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

示例1: makeChart

import javafx.beans.NamedArg; //导入依赖的package包/类
/**
 * @param category
 * @param selectedChart
 * @param type
 * @return a chart depending on the category chosen
 */
public ChartView makeChart(@NamedArg("category") SelectedCategory category,
                           @NamedArg("selectedChart") int selectedChart,
                           @NamedArg("type") ChartType type) {
    switch (category) {
        case RESERVATIONS:
            return reservationChart(selectedChart, type);
        case CLIENTS:
            return clientChart(selectedChart, type);
        case PURCHASES:
            return purchaseChart(selectedChart, type);
        case OTHERS:
            return otherChart(selectedChart, type);
        case NONE:
            break;
    }
    return null;
}
 
开发者ID:Moccko,项目名称:campingsimulator2017,代码行数:24,代码来源:StatisticsController.java

示例2: DecimalTextField

import javafx.beans.NamedArg; //导入依赖的package包/类
public DecimalTextField(@NamedArg("formatPattern") String formatPattern, @NamedArg("locale") Locale locale) {
    format = new DecimalFormat(formatPattern, new DecimalFormatSymbols(locale));
    DecimalFilter filter = new DecimalFilter(format);
    super.setTextFormatter(new TextFormatter<>(filter));
    new DecimalFilter().getFormat().getDecimalFormatSymbols().getDecimalSeparator();
    textProperty().addListener((observable, oldValue, newValue) -> {
        if (newValue.endsWith(String.valueOf(filter.getFormat().getDecimalFormatSymbols().getDecimalSeparator()))) {
            newValue = newValue.substring(0, newValue.length() - 1);
        }
        if (newValue.isEmpty()) {
            newValue = "0";
        }
        try {
            value.setValue(format.parse(newValue));
        } catch (ParseException e) {
            value.setValue(0);
        }
    });
}
 
开发者ID:m-krajcovic,项目名称:photometric-data-retriever,代码行数:20,代码来源:DecimalTextField.java

示例3: DraggableTabLayoutExtender

import javafx.beans.NamedArg; //导入依赖的package包/类
/**
 * Creates an extensible layout around the given component.
 *
 * @param component component that shall be wrapped
 */
public DraggableTabLayoutExtender(@NamedArg("center") Node component) {
	super(component);

	// offer drop areas in all directions when user is dragging a tab
	draggingTabListener = (observable, oldTab, newTab) -> {
		if (lastDraggingTab != newTab) {
			lastDraggingTab = newTab;

			if (!(getParent().getParent() instanceof SplitPane && getCenter() instanceof SplitPane) && newTab != null) {
				DraggableTabFactory factory = DraggableTabFactory.getFactory();
				setTop(factory.createInsertPane(this, Direction.UP));
				setBottom(factory.createInsertPane(this, Direction.DOWN));
				setLeft(factory.createInsertPane(this, Direction.LEFT));
				setRight(factory.createInsertPane(this, Direction.RIGHT));
			} else {
				setTop(null);
				setBottom(null);
				setLeft(null);
				setRight(null);
			}
		}
	};
	DraggableTab.draggingTab.addListener(draggingTabListener);
}
 
开发者ID:xylo,项目名称:DraggableTabs,代码行数:30,代码来源:DraggableTabLayoutExtender.java

示例4: purchaseChart

import javafx.beans.NamedArg; //导入依赖的package包/类
/**
 * @param selectedChart
 * @param type
 * @return return charts for the purchase category
 */
private ChartView purchaseChart(@NamedArg("selectedChart") int selectedChart, @NamedArg("type") ChartType type) {

    GenericDAO<Product, Integer> dao = new GenericDAO<>(Product.class);
    ArrayList<Product> products = (ArrayList<Product>) dao.findAll();
    ArrayList<String> objects = new ArrayList<>();
    ArrayList<Float> comparative = new ArrayList<>();
    String title = null;

    switch (selectedChart) {
        case 0: // produit le plus vendu
            products.sort((p1, p2) -> p2.getSumPurchases() - p1.getSumPurchases());
            comparative.sort((o1, o2) -> (int) (o2 - o1));
            title = "Produits les plus achetés";
            break;

        case 1: // produits les moins vendus
            products.sort(Comparator.comparingInt(Product::getSumPurchases));
            comparative.sort((o1, o2) -> (int) (o1 - o2));
            title = "Produits les moins achetés";
            break;

        default:
            break;
    }

    for (Product c : products) {
        int sum = c.getSumPurchases();
        objects.add(c.getName());
        comparative.add((float) sum);
    }

    ChartView chartView = new ChartView(ChartType.PIE, objects, comparative, title, "Nom", "Nombre de ventes");
    chartView.setLegendSide(Side.BOTTOM);
    return chartView;
}
 
开发者ID:Moccko,项目名称:campingsimulator2017,代码行数:41,代码来源:StatisticsController.java

示例5: otherChart

import javafx.beans.NamedArg; //导入依赖的package包/类
/**
 * @param selectedChart
 * @param type
 * @return return charts for the others category
 */
private ChartView otherChart(@NamedArg("selectedChart") int selectedChart,
                               @NamedArg("type") ChartType type) {
    GenericDAO<Employee, Integer> dao = new GenericDAO<>(Employee.class);
    ArrayList<Employee> employees = (ArrayList<Employee>) dao.findAll();
    ArrayList<String> objects = new ArrayList<>();
    ArrayList<Float> comparative = new ArrayList<>();
    ChartView chartView = null;

    switch (selectedChart) {
        case 0:
            employees.sort((o1, o2) -> o2.getLogs().size() - o1.getLogs().size());

            for (Employee e : employees) {
                objects.add(e.getFirstName() + " " + e.getLastName());
                comparative.add((float) e.getLogs().size());
            }
            comparative.sort((o1, o2) -> (int) (o2 - o1));

            chartView = new ChartView(ChartType.PIE, objects, comparative,"Employés se connectant le plus", "Nom", "Nombre de connections");
            chartView.setLegendSide(Side.BOTTOM);
            
            break;

        default:
            break;
    }
    return chartView;
}
 
开发者ID:Moccko,项目名称:campingsimulator2017,代码行数:34,代码来源:StatisticsController.java

示例6: OldFXCanvas

import javafx.beans.NamedArg; //导入依赖的package包/类
/**
 * @inheritDoc
 */
public OldFXCanvas(@NamedArg("parent") Composite parent, @NamedArg("style") int style) {
    super(parent, style | SWT.NO_BACKGROUND);
    initFx();
    hostContainer = new HostContainer();
    registerEventListeners();
    Display display = parent.getDisplay();
    display.addFilter(SWT.Move, moveFilter);
}
 
开发者ID:TRUEJASONFANS,项目名称:JavaFX-FrameRateMeter,代码行数:12,代码来源:OldFXCanvas.java

示例7: CheckYnColumn

import javafx.beans.NamedArg; //导入依赖的package包/类
/**
 * @param columnName
 */
public CheckYnColumn(@NamedArg("columnName") String columnName) {
	super();
	this.columnName = columnName;
	this.setCellFactory(defaultCellFactory);
	this.setCellValueFactory(defaultCellValueFactory);

}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:11,代码来源:CheckYnColumn.java

示例8: TextAreaInputDialog

import javafx.beans.NamedArg; //导入依赖的package包/类
/**
 * Creates a new TextInputDialog with the default value entered into the
 * dialog {@link TextField}.
 */
public TextAreaInputDialog(@NamedArg("defaultValue") String defaultValue) {
    final DialogPane dialogPane = getDialogPane();

    // -- textfield
    this.textField = new TextArea(defaultValue);
    this.textField.setMaxWidth(Double.MAX_VALUE);
    GridPane.setHgrow(textField, Priority.ALWAYS);
    GridPane.setFillWidth(textField, true);

    // -- label
    label = new Label(dialogPane.getContentText());
    label.setPrefWidth(Region.USE_COMPUTED_SIZE);
    label.textProperty().bind(dialogPane.contentTextProperty());

    this.defaultValue = defaultValue;

    this.grid = new GridPane();
    this.grid.setHgap(10);
    this.grid.setVgap(3);
    this.grid.setMaxWidth(Double.MAX_VALUE);
    this.grid.setAlignment(Pos.CENTER_LEFT);

    dialogPane.contentTextProperty().addListener(o -> updateGrid());

    setTitle(ControlResources.getString("Dialog.confirm.title"));
    dialogPane.setHeaderText(ControlResources.getString("Dialog.confirm.header"));
    dialogPane.getStyleClass().add("text-input-dialog");
    dialogPane.getButtonTypes().addAll(ButtonType.OK, ButtonType.CANCEL);

    updateGrid();

    setResultConverter((dialogButton) -> {
        ButtonBar.ButtonData data = dialogButton == null ? null : dialogButton.getButtonData();
        return data == ButtonBar.ButtonData.OK_DONE ? textField.getText() : null;
    });
}
 
开发者ID:iazarny,项目名称:gitember,代码行数:41,代码来源:TextAreaInputDialog.java

示例9: CustomSortedList

import javafx.beans.NamedArg; //导入依赖的package包/类
/**
 * Creates a new SortedList wrapped around the source list.
 * The source list will be sorted using the comparator provided. If null is provided, the list
 * stays unordered and is equal to the source list.
 * @param source a list to wrap
 * @param comparator a comparator to use or null for unordered List
 */
@SuppressWarnings("unchecked")
public CustomSortedList(@NamedArg("source") ObservableList<? extends E> source, @NamedArg("comparator") Comparator<? super E> comparator) {
    super(source);
    sorted = (Element<E>[]) new Element[source.size() *3/2 + 1];
    size = source.size();
    for (int i = 0; i < size; ++i) {
        sorted[i] = new Element<E>(source.get(i), i);
    }
    if (comparator != null) {
        setComparator(comparator);
    }

}
 
开发者ID:tortlepp,项目名称:SimpleTaskList,代码行数:21,代码来源:CustomSortedList.java

示例10: PhoenicisFilteredList

import javafx.beans.NamedArg; //导入依赖的package包/类
/**
 * Constructs a new FilteredList wrapper around the source list.
 * The provided predicate will match the elements in the source list that will be visible.
 * If the predicate is null, all elements will be matched and the list is equal to the source list.
 * @param source the source list
 * @param predicate the predicate to match the elements or null to match all elements.
 */
public PhoenicisFilteredList(@NamedArg("source") ObservableList<E> source,
        @NamedArg("predicate") Predicate<? super E> predicate) {
    super(source);
    filtered = new int[source.size() * 3 / 2 + 1];
    if (predicate != null) {
        setPredicate(predicate);
    } else {
        for (size = 0; size < source.size(); size++) {
            filtered[size] = size;
        }
    }
}
 
开发者ID:PhoenicisOrg,项目名称:POL-POM-5,代码行数:20,代码来源:PhoenicisFilteredList.java

示例11: FXCanvas

import javafx.beans.NamedArg; //导入依赖的package包/类
/**
 * @inheritDoc
 * @deprecated use {@link FXCanvas2} instead
 */
@Deprecated
public FXCanvas(@NamedArg("parent") Composite parent, @NamedArg("style") int style) {
    super(parent, style | SWT.NO_BACKGROUND);
    initFx();
    this.hostContainer = new HostContainer();
    this.registerEventListeners();
    Display display = parent.getDisplay();
    display.addFilter(SWT.Move, this.moveFilter);
}
 
开发者ID:SkyLandTW,项目名称:JXTN,代码行数:14,代码来源:FXCanvas.java

示例12: GenericStyledArea

import javafx.beans.NamedArg; //导入依赖的package包/类
/**
 * The same as {@link #GenericStyledArea(Object, BiConsumer, Object, TextOps, Function)} except that
 * this constructor can be used to create another {@code GenericStyledArea} that renders and edits the same
 * {@link EditableStyledDocument} or when one wants to use a custom {@link EditableStyledDocument} implementation.
 */
public GenericStyledArea(
        @NamedArg("initialParagraphStyle") PS initialParagraphStyle,
        @NamedArg("applyParagraphStyle")   BiConsumer<TextFlow, PS> applyParagraphStyle,
        @NamedArg("initialTextStyle")      S initialTextStyle,
        @NamedArg("document")              EditableStyledDocument<PS, SEG, S> document,
        @NamedArg("segmentOps")            TextOps<SEG, S> segmentOps,
        @NamedArg("nodeFactory")           Function<StyledSegment<SEG, S>, Node> nodeFactory) {
    this(initialParagraphStyle, applyParagraphStyle, initialTextStyle, document, segmentOps, true, nodeFactory);

}
 
开发者ID:FXMisc,项目名称:RichTextFX,代码行数:16,代码来源:GenericStyledArea.java

示例13: StyleClassedTextArea

import javafx.beans.NamedArg; //导入依赖的package包/类
public StyleClassedTextArea(@NamedArg("document") EditableStyledDocument<Collection<String>, String, Collection<String>> document,
                            @NamedArg("preserveStyle") boolean preserveStyle) {
    super(Collections.<String>emptyList(),
            (paragraph, styleClasses) -> paragraph.getStyleClass().addAll(styleClasses),
            Collections.<String>emptyList(),
            (text, styleClasses) -> text.getStyleClass().addAll(styleClasses),
            document, preserveStyle
    );

    setStyleCodecs(
            Codec.collectionCodec(Codec.STRING_CODEC),
            Codec.styledTextCodec(Codec.collectionCodec(Codec.STRING_CODEC))
    );
}
 
开发者ID:FXMisc,项目名称:RichTextFX,代码行数:15,代码来源:StyleClassedTextArea.java

示例14: InlineCssTextArea

import javafx.beans.NamedArg; //导入依赖的package包/类
/**
 * Creates an area that can render and edit another area's {@link EditableStyledDocument} or a developer's
 * custom implementation of {@link EditableStyledDocument}.
 */
public InlineCssTextArea(@NamedArg("document") EditableStyledDocument<String, String, String> document) {
    super(
            "", TextFlow::setStyle,
            "", TextExt::setStyle,
            document,
            true
    );
}
 
开发者ID:FXMisc,项目名称:RichTextFX,代码行数:13,代码来源:InlineCssTextArea.java

示例15: CodeArea

import javafx.beans.NamedArg; //导入依赖的package包/类
/**
 * Creates a text area with initial text content.
 * Initial caret position is set at the beginning of text content.
 *
 * @param text Initial text content.
 */
public CodeArea(@NamedArg("text") String text) {
    this();

    appendText(text);
    getUndoManager().forgetHistory();
    getUndoManager().mark();

    // position the caret at the beginning
    selectRange(0, 0);
}
 
开发者ID:FXMisc,项目名称:RichTextFX,代码行数:17,代码来源:CodeArea.java


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