Top Description Fields Constructors Methods
com.calendarfx.view.print

public Class PrintView

extends ViewTypeControl
Class Inheritance
Imports
com.calendarfx.model.CalendarSource, com.calendarfx.util.LoggingDomain, com.calendarfx.view.CalendarView, .DateControl, .Messages, .SourceView, impl.com.calendarfx.view.print.PrintViewSkin, impl.com.calendarfx.view.util.Util, javafx.beans.InvalidationListener, javafx.beans.binding.Bindings, javafx.beans.property.ObjectProperty, .SimpleObjectProperty, javafx.collections.FXCollections, .ObservableList, javafx.event.ActionEvent, .EventHandler, javafx.print.JobSettings, .PageLayout, .PageOrientation, .Paper, .PrintColor, .Printer, .PrinterJob, javafx.scene.Scene, javafx.scene.control.Alert, .Alert.AlertType, .Skin, javafx.scene.image.Image, javafx.scene.transform.Scale, javafx.stage.Modality, .Stage, .Window, java.time.DayOfWeek, .LocalDate, .ZoneId, java.time.temporal.WeekFields

A print preview pane / dialog for CalendarFX. This view manages a PrintablePage and binds it to the settingsView / properties that are made available via the SettingsView. The default style class used by this view is "print-view". Print View

Field Summary

Modifier and TypeField and Description
private final ObservableList<CalendarSource>
private final ObjectProperty<LocalDate>
private static final String
private Stage
private final ObjectProperty<DateControl.Layout>
private static final Util.Converter<Boolean, DateControl.Layout>
private final ObjectProperty<EventHandler<ActionEvent>>
private final ObjectProperty<EventHandler<ActionEvent>>
private final PreviewPane
private final ObjectProperty<Image>
private final SettingsView
private final ObjectProperty<LocalDate>
private final ObjectProperty<WeekFields>
private final ObjectProperty<ZoneId>

Constructor Summary

AccessConstructor and Description
public
PrintView()

Constructs a new print view.

Method Summary

Modifier and TypeMethod and Description
protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

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

public final ObjectProperty<LocalDate>

Returns:

The Calendar date
dateProperty
()

Stores the Calendar selected date.

protected void
doPrint()

Performs the actual printing of the calendars.

public final ObservableList<CalendarSource>

Returns:

the calendar sources
getCalendarSources
()

The list of all calendar sources attached to this control.

public final LocalDate

Returns:

the date representing "Calendar date"
getDate
()

Returns the value of dateProperty().

public final DayOfWeek

Returns:

the first day of the week
getFirstDayOfWeek
()

A convenience method to lookup the first day of the week ("Monday" in Germany, "Sunday" in the US).

public final DateControl.Layout

Returns:

the layout strategy
getLayout
()

Returns the value of layoutProperty().

public final EventHandler<ActionEvent>

Returns:

the event handler invoked by the "continue" button.
getOnCancel
()

Returns the value of the onCancelProperty().

public final EventHandler<ActionEvent>

Returns:

the event handler invoked by the "continue" button.
getOnContinue
()

Returns the value of the onContinueProperty().

public final PreviewPane

Returns:

the preview pane control
getPreviewPane
()

Returns the preview pane sub control.

public final Image

Returns:

the icon of Print dialog if is set, null otherwise.
getPrintIcon
()

Returns the value of printIconProperty().

public final SettingsView

Returns:

the settings view
getSettingsView
()

Returns the settings view sub control.

public final LocalDate

Returns:

the date representing "today"
getToday
()

Returns the value of todayProperty().

public final WeekFields

Returns:

the week fields
getWeekFields
()

Returns the value of weekFieldsProperty().

public ZoneId
public final void
hide()

Hides the dialog.

public final ObjectProperty<DateControl.Layout>

Returns:

the layout strategy of the view
layoutProperty
()

Stores the strategy used by the view to layout the entries of several calendars at once.

public final void
public final ObjectProperty<EventHandler<ActionEvent>>

Returns:

the event handler used by the "cancel" button
onCancelProperty
()

Stores an event handler that will be invoked when the user clicks on the "cancel" button.

public final ObjectProperty<EventHandler<ActionEvent>>

Returns:

the event handler used by the "continue" button
onContinueProperty
()

Stores an event handler that will be invoked when the user clicks on the "continue" button.

public final ObjectProperty<Image>

Returns:

the date representing "today"
printIconProperty
()

Stores the image of Print dialog.

public final void
setLayout(DateControl.Layout
the layout
layout
)

Sets the value of layoutProperty().

public final void
setOnCancel(EventHandler<ActionEvent>
the event handler invoked by the "cancel" button.
handler
)

Sets the value of the onCancelProperty().

public final void
setOnContinue(EventHandler<ActionEvent>
the event handler invoked by the "continue" button.
handler
)

Sets the value of the onContinueProperty().

public final void
setPrintIcon(Image
will be the icon of window/dialog.
image
)

Sets the value of the printIconProperty().

public final void
setToday(LocalDate
the date representing "today"
date
)

Sets the value of todayProperty().

public final void
setWeekFields(WeekFields
the new week fields
weekFields
)

Sets the value of weekFieldsProperty().

public void
setZoneId(ZoneId zoneId)

public void
show(Window
the owner window of the dialog
owner
)

Creates an application-modal dialog and shows it after adding the print view to it.

public final ObjectProperty<LocalDate>

Returns:

the date representing "today"
todayProperty
()

Stores the date that is considered to represent "today".

public final ObjectProperty<WeekFields>

Returns:

the week fields
weekFieldsProperty
()

Week fields are used to determine the first day of a week (e.g. "Monday" in Germany or "Sunday" in the US).

public ObjectProperty<ZoneId>

Returns:

the time zone
zoneIdProperty
()

The time zone to use for the printing operation.

Inherited from com.calendarfx.view.print.ViewTypeControl:
getPropertySheetItemsgetViewTypesetViewTypeviewTypeProperty

Field Detail

calendarSourcesback to summary
private final ObservableList<CalendarSource> calendarSources
dateback to summary
private final ObjectProperty<LocalDate> date
DEFAULT_STYLEback to summary
private static final String DEFAULT_STYLE
dialogback to summary
private Stage dialog
layoutback to summary
private final ObjectProperty<DateControl.Layout> layout
LAYOUT_BOOLEAN_CONVERTERback to summary
private static final Util.Converter<Boolean, DateControl.Layout> LAYOUT_BOOLEAN_CONVERTER
onCancelback to summary
private final ObjectProperty<EventHandler<ActionEvent>> onCancel
onContinueback to summary
private final ObjectProperty<EventHandler<ActionEvent>> onContinue
previewPaneback to summary
private final PreviewPane previewPane
printIconback to summary
private final ObjectProperty<Image> printIcon
settingsViewback to summary
private final SettingsView settingsView
todayback to summary
private final ObjectProperty<LocalDate> today
weekFieldsback to summary
private final ObjectProperty<WeekFields> weekFields
zoneIdback to summary
private final ObjectProperty<ZoneId> zoneId

Constructor Detail

PrintViewback to summary
public PrintView()

Constructs a new print view.

Method Detail

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(...).

Returns:Skin<?>

new instance of default skin for this control. If null then the control will have no skin unless one is provided by css.

Annotations
@Override
datePropertyback to summary
public final ObjectProperty<LocalDate> dateProperty()

Stores the Calendar selected date. It's needed for some process in TimeRangeView. Initialized with LocalDate#now() but It wil be binded to dateProperty().

Returns:ObjectProperty<LocalDate>

The Calendar date

doPrintback to summary
protected void doPrint()

Performs the actual printing of the calendars.

getCalendarSourcesback to summary
public final ObservableList<CalendarSource> getCalendarSources()

The list of all calendar sources attached to this control.

Returns:ObservableList<CalendarSource>

the calendar sources

getDateback to summary
public final LocalDate getDate()

Returns the value of dateProperty().

Returns:LocalDate

the date representing "Calendar date"

getFirstDayOfWeekback to summary
public final DayOfWeek getFirstDayOfWeek()

A convenience method to lookup the first day of the week ("Monday" in Germany, "Sunday" in the US). This method delegates to WeekFields#getFirstDayOfWeek().

Returns:DayOfWeek

the first day of the week

See Also
weekFieldsProperty()
getLayoutback to summary
public final DateControl.Layout getLayout()

Returns the value of layoutProperty().

Returns:DateControl.Layout

the layout strategy

getOnCancelback to summary
public final EventHandler<ActionEvent> getOnCancel()

Returns the value of the onCancelProperty().

Returns:EventHandler<ActionEvent>

the event handler invoked by the "continue" button.

getOnContinueback to summary
public final EventHandler<ActionEvent> getOnContinue()

Returns the value of the onContinueProperty().

Returns:EventHandler<ActionEvent>

the event handler invoked by the "continue" button.

getPreviewPaneback to summary
public final PreviewPane getPreviewPane()

Returns the preview pane sub control.

Returns:PreviewPane

the preview pane control

getPrintIconback to summary
public final Image getPrintIcon()

Returns the value of printIconProperty().

Returns:Image

the icon of Print dialog if is set, null otherwise.

getSettingsViewback to summary
public final SettingsView getSettingsView()

Returns the settings view sub control.

Returns:SettingsView

the settings view

getTodayback to summary
public final LocalDate getToday()

Returns the value of todayProperty().

Returns:LocalDate

the date representing "today"

getWeekFieldsback to summary
public final WeekFields getWeekFields()

Returns the value of weekFieldsProperty().

Returns:WeekFields

the week fields

getZoneIdback to summary
public ZoneId getZoneId()
hideback to summary
public final void hide()

Hides the dialog.

layoutPropertyback to summary
public final ObjectProperty<DateControl.Layout> layoutProperty()

Stores the strategy used by the view to layout the entries of several calendars at once. The standard layout ignores the source calendar of an entry and finds the next available place in the UI that satisfies the time bounds of the entry. The DateControl.Layout#SWIMLANE strategy allocates a separate column for each calendar and resolves overlapping entry conflicts within that column. Swim lanes are especially useful for resource booking systems (rooms, people, trucks).

Returns:ObjectProperty<DateControl.Layout>

the layout strategy of the view

loadDropDownValuesback to summary
public final void loadDropDownValues(LocalDate date)
onCancelPropertyback to summary
public final ObjectProperty<EventHandler<ActionEvent>> onCancelProperty()

Stores an event handler that will be invoked when the user clicks on the "cancel" button. The default event handler invokes the hide() method.

Returns:ObjectProperty<EventHandler<ActionEvent>>

the event handler used by the "cancel" button

onContinuePropertyback to summary
public final ObjectProperty<EventHandler<ActionEvent>> onContinueProperty()

Stores an event handler that will be invoked when the user clicks on the "continue" button. The default event handler invokes the doPrint() method.

Returns:ObjectProperty<EventHandler<ActionEvent>>

the event handler used by the "continue" button

printIconPropertyback to summary
public final ObjectProperty<Image> printIconProperty()

Stores the image of Print dialog. This property is null by default, but if custom icon is required it will be saved here .

Returns:ObjectProperty<Image>

the date representing "today"

setLayoutback to summary
public final void setLayout(DateControl.Layout layout)

Sets the value of layoutProperty().

Parameters
layout:DateControl.Layout

the layout

setOnCancelback to summary
public final void setOnCancel(EventHandler<ActionEvent> handler)

Sets the value of the onCancelProperty().

Parameters
handler:EventHandler<ActionEvent>

the event handler invoked by the "cancel" button.

setOnContinueback to summary
public final void setOnContinue(EventHandler<ActionEvent> handler)

Sets the value of the onContinueProperty().

Parameters
handler:EventHandler<ActionEvent>

the event handler invoked by the "continue" button.

setPrintIconback to summary
public final void setPrintIcon(Image image)

Sets the value of the printIconProperty().

Parameters
image:Image

will be the icon of window/dialog.

setTodayback to summary
public final void setToday(LocalDate date)

Sets the value of todayProperty().

Parameters
date:LocalDate

the date representing "today"

setWeekFieldsback to summary
public final void setWeekFields(WeekFields weekFields)

Sets the value of weekFieldsProperty().

Parameters
weekFields:WeekFields

the new week fields

setZoneIdback to summary
public void setZoneId(ZoneId zoneId)
showback to summary
public void show(Window owner)

Creates an application-modal dialog and shows it after adding the print view to it.

Parameters
owner:Window

the owner window of the dialog

todayPropertyback to summary
public final ObjectProperty<LocalDate> todayProperty()

Stores the date that is considered to represent "today". This property is initialized with LocalDate#now() but can be any date.

Returns:ObjectProperty<LocalDate>

the date representing "today"

weekFieldsPropertyback to summary
public final ObjectProperty<WeekFields> weekFieldsProperty()

Week fields are used to determine the first day of a week (e.g. "Monday" in Germany or "Sunday" in the US). It is also used to calculate the week number as the week fields determine how many days are needed in the first week of a year. This property is initialized with WeekFields#ISO.

Returns:ObjectProperty<WeekFields>

the week fields

zoneIdPropertyback to summary
public ObjectProperty<ZoneId> zoneIdProperty()

The time zone to use for the printing operation.

Returns:ObjectProperty<ZoneId>

the time zone