javafx.beans.NamedArg Java Examples

The following examples show how to use javafx.beans.NamedArg. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NodeEditionCodeArea.java    From pmd-designer with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public NodeEditionCodeArea(@NamedArg("designerRoot") DesignerRoot root) {
    super(StyleLayerIds.class);

    this.designerRoot = root;
    this.relatedNodesSelector =
        languageBindingsProperty()
            .map(DesignerBindings::getRelatedNodesSelector)
            .orElseConst(DesignerUtil.getDefaultRelatedNodesSelector());


    setParagraphGraphicFactory(defaultLineNumberFactory());

    currentRuleResultsProperty().values().map(this::highlightXPathResults).subscribe(this::updateStyling);
    currentErrorNodesProperty().values().map(this::highlightErrorNodes).subscribe(this::updateStyling);
    currentRelatedNodesProperty().values().map(this::highlightRelatedNodes).subscribe(this::updateStyling);

    initNodeSelectionHandling(designerRoot, selectionEvts, true);

    enableCtrlSelection();
}
 
Example #2
Source File: MutableTabPane.java    From pmd-designer with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public MutableTabPane(@NamedArg("tabFxmlContent") String tabFxmlContent) {
    this.tabFxmlResource = Objects.requireNonNull(tabFxmlContent);

    assert DesignerUtil.getFxml(tabFxmlContent) != null;

    AnchorPane.setRightAnchor(tabPane, 0d);
    AnchorPane.setLeftAnchor(tabPane, 0d);
    AnchorPane.setBottomAnchor(tabPane, 0d);
    AnchorPane.setTopAnchor(tabPane, 0d);

    tabPane.getStyleClass().addAll("mutable-tab-pane");

    getTabs().addListener((ListChangeListener<Tab>) change -> {
        final ObservableList<Tab> tabs = getTabs();
        tabs.get(0).setClosable(tabs.size() > 1);
    });

    getChildren().addAll(tabPane);

    initAddButton();
}
 
Example #3
Source File: StyledTextArea.java    From RichTextFX with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public StyledTextArea(@NamedArg("initialParagraphStyle") PS initialParagraphStyle,
                      @NamedArg("applyParagraphStyle")   BiConsumer<TextFlow, PS> applyParagraphStyle,
                      @NamedArg("initialTextStyle")      S initialTextStyle,
                      @NamedArg("applyStyle")            BiConsumer<? super TextExt, S> applyStyle,
                      @NamedArg("preserveStyle")         boolean preserveStyle) {
    this(
            initialParagraphStyle,
            applyParagraphStyle,
            initialTextStyle,
            applyStyle,
            new SimpleEditableStyledDocument<>(initialParagraphStyle, initialTextStyle),
            preserveStyle);
}
 
Example #4
Source File: StyleClassedTextArea.java    From RichTextFX with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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))
    );
}
 
Example #5
Source File: GlobalStatsPanelController.java    From trex-stateless-gui with Apache License 2.0 5 votes vote down vote up
public GlobalStatsPanelController(@NamedArg("title") String title, @NamedArg("threshold") Double threshold) {
    Initialization.initializeFXML(this, "/fxml/dashboard/global/GlobalStatsPanel.fxml");

    this.threshold = threshold;
    if (this.threshold != null) {
        valueLabel.getStyleClass().add("statsTableGreenValue");
    }
    titleLabel.setText(title);
}
 
Example #6
Source File: InlineCssTextArea.java    From RichTextFX with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * 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
    );

    setStyleCodecs(Codec.STRING_CODEC, styledTextCodec(Codec.STRING_CODEC));
}
 
Example #7
Source File: InlineCssTextArea.java    From RichTextFX with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * 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 InlineCssTextArea(@NamedArg("text") String text) {
    this();

    replace(0, 0, ReadOnlyStyledDocument.fromString(text, getInitialParagraphStyle(), getInitialTextStyle(), getSegOps()));
    getUndoManager().forgetHistory();
    getUndoManager().mark();

    // position the caret at the beginning
    selectRange(0, 0);
}
 
Example #8
Source File: GenericStyledArea.java    From RichTextFX with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * 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);

}
 
Example #9
Source File: CodeArea.java    From RichTextFX with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * 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);
}
 
Example #10
Source File: StyledTextArea.java    From RichTextFX with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public StyledTextArea(@NamedArg("initialParagraphStyle") PS initialParagraphStyle,
                      @NamedArg("applyParagraphStyle")   BiConsumer<TextFlow, PS> applyParagraphStyle,
                      @NamedArg("initialTextStyle")      S initialTextStyle,
                      @NamedArg("applyStyle")            BiConsumer<? super TextExt, S> applyStyle,
                      @NamedArg("document")              EditableStyledDocument<PS, String, S> document,
                      @NamedArg("segmentOps")            TextOps<String, S> segmentOps,
                      @NamedArg("preserveStyle")         boolean preserveStyle) {
    super(initialParagraphStyle, applyParagraphStyle,
            initialTextStyle, document, segmentOps, preserveStyle,
            seg -> createStyledTextNode(seg, applyStyle)
    );
}
 
Example #11
Source File: StyledTextArea.java    From RichTextFX with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public StyledTextArea(@NamedArg("initialParagraphStyle") PS initialParagraphStyle,
                      @NamedArg("applyParagraphStyle")   BiConsumer<TextFlow, PS> applyParagraphStyle,
                      @NamedArg("initialTextStyle")      S initialTextStyle,
                      @NamedArg("applyStyle")            BiConsumer<? super TextExt, S> applyStyle,
                      @NamedArg("document")              EditableStyledDocument<PS, String, S> document,
                      @NamedArg("preserveStyle")         boolean preserveStyle) {
    this(initialParagraphStyle, applyParagraphStyle,
          initialTextStyle, applyStyle,
          document, SegmentOps.styledTextOps(), preserveStyle);
}
 
Example #12
Source File: StyledTextArea.java    From RichTextFX with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public StyledTextArea(@NamedArg("initialParagraphStyle") PS initialParagraphStyle,
                      @NamedArg("applyParagraphStyle")   BiConsumer<TextFlow, PS> applyParagraphStyle,
                      @NamedArg("initialTextStyle")      S initialTextStyle,
                      @NamedArg("applyStyle")            BiConsumer<? super TextExt, S> applyStyle,
                      @NamedArg("document")              EditableStyledDocument<PS, String, S> document) {
    this(initialParagraphStyle, applyParagraphStyle,
         initialTextStyle, applyStyle, document, true);
}
 
Example #13
Source File: StyledTextArea.java    From RichTextFX with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public StyledTextArea(@NamedArg("initialParagraphStyle") PS initialParagraphStyle,
                      @NamedArg("applyParagraphStyle")   BiConsumer<TextFlow, PS> applyParagraphStyle,
                      @NamedArg("initialTextStyle")      S initialTextStyle,
                      @NamedArg("applyStyle")            BiConsumer<? super TextExt, S> applyStyle) {
    this(initialParagraphStyle, applyParagraphStyle,
         initialTextStyle, applyStyle, true);
}
 
Example #14
Source File: StatsInfoView.java    From trex-stateless-gui with Apache License 2.0 5 votes vote down vote up
/**
 *
 * @param title
 * @param isColored
 */
public StatsInfoView(@NamedArg("title") String title, @NamedArg("isColored") boolean isColored) {
    setTopAnchor(this, 0d);
    setLeftAnchor(this, 0d);
    setBottomAnchor(this, 0d);
    setRightAnchor(this, 0d);
    this.isColored = isColored;
    buildUI(title);
}
 
Example #15
Source File: PropertyCollectionView.java    From pmd-designer with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public PropertyCollectionView(@NamedArg("designerRoot") DesignerRoot root) {
    this.root = root;

    this.getStyleClass().addAll("property-collection-view");

    view = new ListView<>();
    initListView(view);
    setOwnerStageFactory(root.getMainStage()); // default

    AnchorPane footer = new AnchorPane();
    footer.setPrefHeight(30);
    footer.getStyleClass().addAll("footer");
    footer.getStylesheets().addAll(DesignerUtil.getCss("flat").toString());


    Button addProperty = new Button("Add property");

    ControlUtil.anchorFirmly(addProperty);

    addProperty.setOnAction(e -> {
        addNewProperty(getUniqueNewName());
        view.requestFocus();
    });
    footer.getChildren().addAll(addProperty);
    this.getChildren().addAll(view, footer);

    myEditPopover = new PopOverWrapper<>(this::rebindPopover);

    myEditPopover.rebind(new PropertyDescriptorSpec());
    myEditPopover.doFirstLoad(root.getMainStage());

}
 
Example #16
Source File: Clock.java    From Medusa with Apache License 2.0 5 votes vote down vote up
public Clock(@NamedArg("skinType") final ClockSkinType skinType, @NamedArg("time") final ZonedDateTime time) {
    setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT);
    this.skinType = skinType;
    getStyleClass().add("clock");

    init(time);
    registerListeners();
}
 
Example #17
Source File: HighlightLayerCodeArea.java    From pmd-designer with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Builds a new code area with the given enum type as layer id provider.
 * Constants of the enum will identify layers of the code area.
 *
 * @param idEnum Enum type
 */
// the annotation lets the value be passed from FXML
public HighlightLayerCodeArea(@NamedArg("idEnum") Class<K> idEnum) {
    super();

    this.layersById = EnumSet.allOf(idEnum)
                             .stream()
                             .collect(Collectors.toConcurrentMap(id -> id, id -> new StyleLayer()));
}
 
Example #18
Source File: FAIcon.java    From erlyberly with GNU General Public License v3.0 4 votes vote down vote up
public FAIcon(@NamedArg("awesomeIcon") String awesomeIcon, @NamedArg("size") String size, @NamedArg("style") String style, @NamedArg("styleClass") String styleClass) {
    this(AwesomeIcon.valueOf(awesomeIcon), size, style, styleClass);
}
 
Example #19
Source File: LSpinner.java    From latexdraw with GNU General Public License v3.0 4 votes vote down vote up
public LSpinner(@NamedArg("min") final int min, @NamedArg("max") final int max, @NamedArg("initialValue") final int initialValue, @NamedArg  //NON-NLS
	("amountToStepBy") final int amountToStepBy) {  //NON-NLS
	super(min, max, initialValue, amountToStepBy);
	configureSpinner();
}
 
Example #20
Source File: MapPoint.java    From maps with GNU General Public License v3.0 4 votes vote down vote up
public MapPoint(@NamedArg("latitude") double lat, @NamedArg("longitude") double lon) {
    this.latitude = lat;
    this.longitude = lon;
}
 
Example #21
Source File: CodeArea.java    From RichTextFX with BSD 2-Clause "Simplified" License 4 votes vote down vote up
/**
 * Creates an area that can render and edit the same {@link EditableStyledDocument} as another {@link CodeArea}.
 */
public CodeArea(@NamedArg("document") EditableStyledDocument<Collection<String>, String, Collection<String>> document) {
    super(document, false);
}
 
Example #22
Source File: LSpinner.java    From latexdraw with GNU General Public License v3.0 4 votes vote down vote up
public LSpinner(@NamedArg("min") final int min, @NamedArg("max") final int max, @NamedArg("initialValue") final int initialValue) {  //NON-NLS
	super(min, max, initialValue);
	configureSpinner();
}
 
Example #23
Source File: StyleableGauge.java    From medusademo with Apache License 2.0 4 votes vote down vote up
public StyleableGauge(@NamedArg("SKIN_TYPE") final SkinType SKIN_TYPE) {
    super(SKIN_TYPE);
    styleableTickmarkColor  = new SimpleStyleableObjectProperty<>(TICKMARK_COLOR, this, "tickmark-color");
    styleableTicklabelColor = new SimpleStyleableObjectProperty<>(TICKLABEL_COLOR, this, "ticklabel-color");
}
 
Example #24
Source File: LSpinner.java    From latexdraw with GNU General Public License v3.0 4 votes vote down vote up
public LSpinner(@NamedArg("min") final double min, @NamedArg("max") final double max, @NamedArg("initialValue") final double initialValue) {  //NON-NLS
	super(min, max, initialValue);
	configureSpinner();
}
 
Example #25
Source File: SVGGlyph.java    From JFoenix with Apache License 2.0 4 votes vote down vote up
public SVGGlyph(@NamedArg("svgPathContent") String svgPathContent, @NamedArg("fill") Paint fill) {
    this(-1, "UNNAMED", svgPathContent, fill);
}
 
Example #26
Source File: SVGGlyph.java    From JFoenix with Apache License 2.0 4 votes vote down vote up
public SVGGlyph(@NamedArg("svgPathContent") String svgPathContent) {
    this(-1, "UNNAMED", svgPathContent, Color.BLACK);
}
 
Example #27
Source File: BonusPickupEvent.java    From FXGLGames with MIT License 4 votes vote down vote up
public BonusPickupEvent(@NamedArg("eventType") EventType<? extends Event> eventType, BonusType type) {
    super(eventType);
    this.type = type;
}
 
Example #28
Source File: StyleClassedTextArea.java    From RichTextFX with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public StyleClassedTextArea(@NamedArg("preserveStyle") boolean preserveStyle) {
    this(
            new SimpleEditableStyledDocument<>(
                Collections.<String>emptyList(), Collections.<String>emptyList()
            ), preserveStyle);
}
 
Example #29
Source File: Clock.java    From Medusa with Apache License 2.0 4 votes vote down vote up
public Clock(@NamedArg(value="skinType", defaultValue="ClockSkinType.CLOCK") ClockSkinType skinType,
             @NamedArg(value="updateInterval", defaultValue="1000") int updateInterval,
             @NamedArg(value="checkSectionsForValue", defaultValue="false") boolean checkSectionsForValue,
             @NamedArg(value="checkAreasForValue", defaultValue="false") boolean checkAreasForValue,
             @NamedArg(value="sectionsVisible", defaultValue="false") boolean sectionsVisible,
             @NamedArg(value="highlightSections", defaultValue="false") boolean highlightSections,
             @NamedArg(value="areasVisible ", defaultValue="false") boolean areasVisible,
             @NamedArg(value="highlightAreas", defaultValue="false") boolean highlightAreas,
             @NamedArg(value="text", defaultValue="") String text,
             @NamedArg(value="discreteSeconds", defaultValue="true") boolean discreteSeconds,
             @NamedArg(value="discreteMinutes", defaultValue="true") boolean discreteMinutes,
             @NamedArg(value="discreteHours", defaultValue="false") boolean discreteHours,
             @NamedArg(value="secondsVisible", defaultValue="false") boolean secondsVisible,
             @NamedArg(value="titleVisible", defaultValue="false") boolean titleVisible,
             @NamedArg(value="textVisible", defaultValue="false") boolean textVisible,
             @NamedArg(value="dateVisible", defaultValue="false") boolean dateVisible,
             @NamedArg(value="dayVisible", defaultValue="false") boolean dayVisible,
             @NamedArg(value="nightMode", defaultValue="false") boolean nightMode,
             @NamedArg(value="running", defaultValue="false") boolean running,
             @NamedArg(value="autoNightMode", defaultValue="false") boolean autoNightMode,
             @NamedArg(value="backgroundPaint", defaultValue="#00000000") Color backgroundPaint,
             @NamedArg(value="borderPaint", defaultValue="#00000000") Color borderPaint,
             @NamedArg(value="borderWidth", defaultValue="1") double borderWidth,
             @NamedArg(value="foregroundPaint", defaultValue="#00000000") Color foregroundPaint,
             @NamedArg(value="titleColor", defaultValue="#242424") Color titleColor,
             @NamedArg(value="textColor", defaultValue="#242424") Color textColor,
             @NamedArg(value="dateColor", defaultValue="#242424") Color dateColor,
             @NamedArg(value="hourTickMarkColor", defaultValue="#242424") Color hourTickMarkColor,
             @NamedArg(value="minuteTickMarkColor", defaultValue="#242424") Color minuteTickMarkColor,
             @NamedArg(value="tickLabelColor", defaultValue="#242424") Color tickLabelColor,
             @NamedArg(value="alarmColor", defaultValue="#242424") Color alarmColor,
             @NamedArg(value="hourTickMarksVisible", defaultValue="true") boolean hourTickMarksVisible,
             @NamedArg(value="minuteTickMarksVisible", defaultValue="true") boolean minuteTickMarksVisible,
             @NamedArg(value="tickLabelsVisible", defaultValue="true") boolean tickLabelsVisible,
             @NamedArg(value="hourColor", defaultValue="#242424") Color hourColor,
             @NamedArg(value="minuteColor", defaultValue="#242424") Color minuteColor,
             @NamedArg(value="secondColor", defaultValue="#242424") Color secondColor,
             @NamedArg(value="knobColor", defaultValue="#242424") Color knobColor,
             @NamedArg(value="lcdDesign", defaultValue="LcdDesign.STANDARD") LcdDesign lcdDesign,
             @NamedArg(value="alarmsEnabled", defaultValue="false") boolean alarmsEnabled,
             @NamedArg(value="alarmsVisible", defaultValue="false") boolean alarmsVisible,
             @NamedArg(value="lcdCrystalEnabled", defaultValue="false") boolean lcdCrystalEnabled,
             @NamedArg(value="shadowsEnabled", defaultValue="false") boolean shadowsEnabled,
             @NamedArg(value="lcdFont", defaultValue="LcdFont.DIGITAL_BOLD") LcdFont lcdFont,
             @NamedArg(value="locale", defaultValue="Locale.US") Locale locale,
             @NamedArg(value="tickLabelLocation", defaultValue="TickLabelLocation.INSIDE") TickLabelLocation tickLabelLocation,
             @NamedArg(value="animated", defaultValue="false") boolean animated,
             @NamedArg(value="animationDuration", defaultValue="10000") long animationDuration,
             @NamedArg(value="customFontEnabled", defaultValue="false") boolean customFontEnabled,
             @NamedArg(value="customFont", defaultValue="Fonts.robotoRegular(12)") Font customFont) {
    setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT);
    this.skinType = skinType;
    getStyleClass().add("clock");

    init(ZonedDateTime.now());
    registerListeners();
}
 
Example #30
Source File: Clock.java    From Medusa with Apache License 2.0 4 votes vote down vote up
public Clock(@NamedArg("epochSeconds") final long epochSeconds) {
    this(ClockSkinType.CLOCK, ZonedDateTime.ofInstant(Instant.ofEpochSecond(epochSeconds), ZoneId.systemDefault()));
}