Skip to content

Commit

Permalink
Code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemmermann committed Jan 13, 2023
1 parent 6435654 commit 6d36614
Showing 1 changed file with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

package com.calendarfx.view;

import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;

import impl.com.calendarfx.view.WeekTimeScaleViewSkin;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.ReadOnlyObjectProperty;
Expand All @@ -27,15 +24,16 @@
import javafx.collections.MapChangeListener;
import javafx.scene.control.Skin;

import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;

/**
* A specialization of the regular {@link TimeScaleView} to support a reference
* to the {@link WeekView} where this scale is being used.
*/
public class WeekTimeScaleView extends TimeScaleView {

private final ObjectProperty<DateTimeFormatter> formatter = new SimpleObjectProperty<>(
this, "formatter",
DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT));
private final ObjectProperty<DateTimeFormatter> formatter = new SimpleObjectProperty<>(this, "formatter", DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT));

/**
* Constructs a new scale view.
Expand All @@ -44,8 +42,7 @@ public WeekTimeScaleView() {
MapChangeListener<? super Object, ? super Object> propertiesListener = change -> {
if (change.wasAdded()) {
if (change.getKey().equals("week.view")) {
detailedWeekView
.set((DetailedWeekView) change.getValueAdded());
detailedWeekView.set((DetailedWeekView) change.getValueAdded());
}
}
};
Expand All @@ -58,8 +55,7 @@ protected Skin<?> createDefaultSkin() {
return new WeekTimeScaleViewSkin(this);
}

private final ReadOnlyObjectWrapper<DetailedWeekView> detailedWeekView = new ReadOnlyObjectWrapper<>(
this, "detailedWeekView");
private final ReadOnlyObjectWrapper<DetailedWeekView> detailedWeekView = new ReadOnlyObjectWrapper<>(this, "detailedWeekView");

/**
* The week view where this scale is being used.
Expand Down Expand Up @@ -88,5 +84,4 @@ protected ObjectProperty<DateTimeFormatter> timeFormatterProperty() {
public void setTimeFormatter(DateTimeFormatter formatter) {
timeFormatterProperty().set(formatter);
}

}

0 comments on commit 6d36614

Please sign in to comment.