Top Description Fields Constructors Methods
com.dlsc.gemsfx

public Class YearView

extends Control
Class Inheritance
Imports
com.dlsc.gemsfx.skins.YearViewSkin, javafx.beans.binding.Bindings, javafx.beans.property.*, javafx.scene.control.Control, .Skin, java.time.Year, java.util.Objects

A view for selecting a year.

Field Summary

Modifier and TypeField and Description
private final IntegerProperty
private final ObjectProperty<Year>
private final ObjectProperty<Year>
private final IntegerProperty
private final ObjectProperty<Year>
private final ReadOnlyIntegerWrapper

Constructor Summary

AccessConstructor and Description
public
YearView()

Constructs a new instance.

Method Summary

Modifier and TypeMethod and Description
public final IntegerProperty

Returns:

the number of columns
colsProperty
()

Determines how many columns of years will be displayed.

protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control.

public final ObjectProperty<Year>

Returns:

the earliest year
earliestYearProperty
()

The earliest year that the user will be able to select in the view.

public final int
public final Year
public final Year
public final int
public String
getUserAgentStylesheet()

Overrides javafx.scene.layout.Region.getUserAgentStylesheet.

An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method.

public final Year
public final int
public final ObjectProperty<Year>

Returns:

the earliest year
latestYearProperty
()

The latest year that the user will be able to select in the view.

public final IntegerProperty

Returns:

the number of rows
rowsProperty
()

Determines how many rows of years will be displayed.

public final void
setCols(int cols)

public final void
setEarliestYear(Year earliestYear)

public final void
setLatestYear(Year latestYear)

public final void
setRows(int rows)

public final void
setValue(Year value)

public final ObjectProperty<Year>

Returns:

the currently selected value / year
valueProperty
()

The currently selected value / year.

public final ReadOnlyIntegerProperty

Returns:

the year as an integer value
yearProperty
()

A read-only integer representation of the current value / year.

Inherited from javafx.scene.control.Control:
computeMaxHeightcomputeMaxWidthcomputeMinHeightcomputeMinWidthcomputePrefHeightcomputePrefWidthcontextMenuPropertyexecuteAccessibleActiongetBaselineOffsetgetClassCssMetaDatagetContextMenugetControlCssMetaDatagetCssMetaDatagetInitialFocusTraversablegetSkingetTooltipisResizablelayoutChildrenqueryAccessibleAttributesetContextMenusetSkinsetTooltipskinPropertytooltipProperty

Field Detail

colsback to summary
private final IntegerProperty cols
earliestYearback to summary
private final ObjectProperty<Year> earliestYear
latestYearback to summary
private final ObjectProperty<Year> latestYear
rowsback to summary
private final IntegerProperty rows
valueback to summary
private final ObjectProperty<Year> value
yearback to summary
private final ReadOnlyIntegerWrapper year

Constructor Detail

YearViewback to summary
public YearView()

Constructs a new instance.

Method Detail

colsPropertyback to summary
public final IntegerProperty colsProperty()

Determines how many columns of years will be displayed. The number of columns multiplied with the number of rows determines the total number of years shown per "page".

Returns:IntegerProperty

the number of columns

See Also
rowsProperty()
createDefaultSkinback to summary
protected Skin<?> createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Doc from javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control. This is called to create a skin for the control if no skin is provided via CSS -fx-skin or set explicitly in a sub-class with setSkin(...).

Annotations
@Override
earliestYearPropertyback to summary
public final ObjectProperty<Year> earliestYearProperty()

The earliest year that the user will be able to select in the view.

Returns:ObjectProperty<Year>

the earliest year

getColsback to summary
public final int getCols()
getEarliestYearback to summary
public final Year getEarliestYear()
getLatestYearback to summary
public final Year getLatestYear()
getRowsback to summary
public final int getRows()
getUserAgentStylesheetback to summary
public String getUserAgentStylesheet()

Overrides javafx.scene.layout.Region.getUserAgentStylesheet.

Doc from javafx.scene.layout.Region.getUserAgentStylesheet.

An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method. These styles are used in addition to whatever user-agent stylesheets are in use. This provides a mechanism for third parties to introduce styles for custom controls.

The URL is a hierarchical URI of the form [scheme:][//authority][path]. If the URL does not have a [scheme:] component, the URL is considered to be the [path] component only. Any leading '/' character of the [path] is ignored and the [path] is treated as a path relative to the root of the application's classpath.

Subclasses overriding this method should not assume any particular implementation approach as to the number and frequency with which it is called. For this reason, attempting any kind of dynamic implementation (i.e. returning different user agent stylesheet values) based on some state change is highly discouraged, as there is no guarantee when, or even if, this method will be called. Some JavaFX CSS implementations may choose to cache this response for an indefinite period of time, and therefore there should be no expectation around when this method is called.



package com.example.javafx.app;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class MyApp extends Application {

    @Override public void start(Stage stage) {
        Scene scene = new Scene(new Group());
        scene.getStylesheets().add("/com/example/javafx/app/mystyles.css");
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
For additional information about using CSS with the scene graph, see the CSS Reference Guide.
Annotations
@Override
getValueback to summary
public final Year getValue()
getYearback to summary
public final int getYear()
latestYearPropertyback to summary
public final ObjectProperty<Year> latestYearProperty()

The latest year that the user will be able to select in the view.

Returns:ObjectProperty<Year>

the earliest year

rowsPropertyback to summary
public final IntegerProperty rowsProperty()

Determines how many rows of years will be displayed. The number of columns multiplied with the number of rows determines the total number of years shown per "page".

Returns:IntegerProperty

the number of rows

See Also
colsProperty()
setColsback to summary
public final void setCols(int cols)
setEarliestYearback to summary
public final void setEarliestYear(Year earliestYear)
setLatestYearback to summary
public final void setLatestYear(Year latestYear)
setRowsback to summary
public final void setRows(int rows)
setValueback to summary
public final void setValue(Year value)
valuePropertyback to summary
public final ObjectProperty<Year> valueProperty()

The currently selected value / year.

Returns:ObjectProperty<Year>

the currently selected value / year

yearPropertyback to summary
public final ReadOnlyIntegerProperty yearProperty()

A read-only integer representation of the current value / year.

Returns:ReadOnlyIntegerProperty

the year as an integer value