Search in sources :

Example 1 with NaturalOrderComparator

use of retrospector.util.NaturalOrderComparator in project Retrospector by NonlinearFruit.

the class SearchTabController method initSearchTab.

private void initSearchTab() {
    searchEditMedia.setDisable(true);
    searchDeleteMedia.setDisable(true);
    // Table Double Click
    searchTable.setRowFactory(tv -> {
        TableRow<Media> row = new TableRow<>();
        row.setOnMouseClicked(event -> {
            if (event.getClickCount() == 2 && (!row.isEmpty())) {
                setMedia(row.getItem());
                setTab(TAB.MEDIA);
            }
        });
        return row;
    });
    // Table data setup
    searchTableData = DataManager.getMedia();
    FilteredList<Media> mediaFiltered = new FilteredList(searchTableData, x -> true);
    SortedList<Media> mediaSortable = new SortedList<>(mediaFiltered);
    searchTable.setItems(mediaSortable);
    mediaSortable.comparatorProperty().bind(searchTable.comparatorProperty());
    // Link to data properties
    searchTitleColumn.setCellValueFactory(new PropertyValueFactory<>("Title"));
    searchCreatorColumn.setCellValueFactory(new PropertyValueFactory<>("Creator"));
    searchSeasonColumn.setCellValueFactory(new PropertyValueFactory<>("SeasonId"));
    searchEpisodeColumn.setCellValueFactory(new PropertyValueFactory<>("EpisodeId"));
    searchCategoryColumn.setCellValueFactory(new PropertyValueFactory<>("Category"));
    // Values for special columns
    searchNumberColumn.setSortable(false);
    searchNumberColumn.setCellValueFactory(p -> new ReadOnlyObjectWrapper(1 + searchTable.getItems().indexOf(p.getValue())));
    searchReviewsColumn.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Media, Integer>, ObservableValue<Integer>>() {

        @Override
        public ObservableValue<Integer> call(TableColumn.CellDataFeatures<Media, Integer> p) {
            return new ReadOnlyObjectWrapper(p.getValue().getReviews().size());
        }
    });
    searchMeanRColumn.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Media, BigDecimal>, ObservableValue<BigDecimal>>() {

        @Override
        public ObservableValue<BigDecimal> call(TableColumn.CellDataFeatures<Media, BigDecimal> p) {
            return new ReadOnlyObjectWrapper(p.getValue().getAverageRating());
        }
    });
    searchCurrentRColumn.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Media, BigDecimal>, ObservableValue<BigDecimal>>() {

        @Override
        public ObservableValue<BigDecimal> call(TableColumn.CellDataFeatures<Media, BigDecimal> p) {
            return new ReadOnlyObjectWrapper(p.getValue().getCurrentRating());
        }
    });
    // Comparators for string columns
    searchTitleColumn.setComparator(new NaturalOrderComparator());
    searchCreatorColumn.setComparator(new NaturalOrderComparator());
    searchSeasonColumn.setComparator(new NaturalOrderComparator());
    searchEpisodeColumn.setComparator(new NaturalOrderComparator());
    searchCategoryColumn.setComparator(new NaturalOrderComparator());
    searchTable.getSelectionModel().selectedItemProperty().addListener((observe, old, neo) -> {
        setMedia(neo);
    });
    searchBox.textProperty().addListener((observa, old, neo) -> {
        String query = neo;
        if (query == null || query.equals(""))
            mediaFiltered.setPredicate(x -> true);
        else {
            String[] queries = query.split(":");
            mediaFiltered.setPredicate(x -> QueryProcessor.isMatchForMedia(query, x));
        }
        updateStats();
    });
    // Buttons
    searchNewMedia.setOnAction(e -> {
        Media neo = new Media();
        neo.setId(DataManager.createDB(neo));
        setMedia(neo);
        setTab(TAB.MEDIA);
    });
    searchQuickEntry.setOnAction(e -> {
        try {
            FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("QuickEntry.fxml"));
            Parent root1 = (Parent) fxmlLoader.load();
            QuickEntryController qec = fxmlLoader.getController();
            qec.setup(currentTab);
            Stage stage = new Stage();
            stage.setTitle("Quick Entry");
            stage.setScene(new Scene(root1));
            stage.show();
        } catch (Exception ex) {
        }
    });
    searchStandardEntry.setOnAction(e -> {
        Media neo = new Media();
        neo.setId(DataManager.createDB(neo));
        setMedia(neo);
        setTab(TAB.MEDIA);
    });
    searchBackup.setOnAction(e -> DataManager.makeBackup());
    searchCheatsheet.setOnAction(e -> {
        new Cheatsheet().start(new Stage());
    });
    searchEditMedia.setOnAction(e -> {
        setTab(TAB.MEDIA);
    });
    searchDeleteMedia.setOnAction(e -> {
        if (new Alert(Alert.AlertType.WARNING, "Are you sure you want to delete this?", ButtonType.NO, ButtonType.YES).showAndWait().get().equals(ButtonType.YES)) {
            DataManager.deleteDB(getMedia());
            updateSearchTab();
        }
    });
    // Init stuff
    updateStats();
}
Also used : Button(javafx.scene.control.Button) Scene(javafx.scene.Scene) Arrays(java.util.Arrays) Initializable(javafx.fxml.Initializable) URL(java.net.URL) ButtonType(javafx.scene.control.ButtonType) Factoid(retrospector.model.Factoid) ArrayList(java.util.ArrayList) TableColumn(javafx.scene.control.TableColumn) Media(retrospector.model.Media) Application(javafx.application.Application) BigDecimal(java.math.BigDecimal) Parent(javafx.scene.Parent) ResourceBundle(java.util.ResourceBundle) ReadOnlyObjectWrapper(javafx.beans.property.ReadOnlyObjectWrapper) FXMLLoader(javafx.fxml.FXMLLoader) QuickEntryController(retrospector.fxml.QuickEntryController) NaturalOrderComparator(retrospector.util.NaturalOrderComparator) TableView(javafx.scene.control.TableView) Callback(javafx.util.Callback) SortedList(javafx.collections.transformation.SortedList) Alert(javafx.scene.control.Alert) ObjectProperty(javafx.beans.property.ObjectProperty) TextField(javafx.scene.control.TextField) MenuItem(javafx.scene.control.MenuItem) Review(retrospector.model.Review) PropertyValueFactory(javafx.scene.control.cell.PropertyValueFactory) TableRow(javafx.scene.control.TableRow) FilteredList(javafx.collections.transformation.FilteredList) TAB(retrospector.fxml.CoreController.TAB) FXML(javafx.fxml.FXML) Text(javafx.scene.text.Text) List(java.util.List) Stage(javafx.stage.Stage) MenuButton(javafx.scene.control.MenuButton) ObservableValue(javafx.beans.value.ObservableValue) ObservableList(javafx.collections.ObservableList) DataManager(retrospector.model.DataManager) QuickEntryController(retrospector.fxml.QuickEntryController) Parent(javafx.scene.Parent) SortedList(javafx.collections.transformation.SortedList) ObservableValue(javafx.beans.value.ObservableValue) FXMLLoader(javafx.fxml.FXMLLoader) FilteredList(javafx.collections.transformation.FilteredList) Stage(javafx.stage.Stage) Media(retrospector.model.Media) Scene(javafx.scene.Scene) TableColumn(javafx.scene.control.TableColumn) BigDecimal(java.math.BigDecimal) NaturalOrderComparator(retrospector.util.NaturalOrderComparator) TableRow(javafx.scene.control.TableRow) Alert(javafx.scene.control.Alert) ReadOnlyObjectWrapper(javafx.beans.property.ReadOnlyObjectWrapper)

Example 2 with NaturalOrderComparator

use of retrospector.util.NaturalOrderComparator in project Retrospector by NonlinearFruit.

the class MediaSectionController method initialize.

/**
     * Initializes the controller class.
     */
@Override
public void initialize(URL url, ResourceBundle rb) {
    chartRatingOverTime.getData().add(new XYChart.Series(FXCollections.observableArrayList(new XYChart.Data(0, 0))));
    checkTitle.setSelected(true);
    checkCreator.setSelected(true);
    checkSeason.setSelected(true);
    checkEpisode.setSelected(true);
    checkCategory.setSelected(true);
    checkTitle.selectedProperty().addListener((observe, old, neo) -> updateMedia());
    checkCreator.selectedProperty().addListener((observe, old, neo) -> updateMedia());
    checkSeason.selectedProperty().addListener((observe, old, neo) -> updateMedia());
    checkEpisode.selectedProperty().addListener((observe, old, neo) -> updateMedia());
    checkCategory.selectedProperty().addListener((observe, old, neo) -> updateMedia());
    mediaTableFilter = new FilteredList(allMedia);
    SortedList<Media> mediaSortable = new SortedList<>(mediaTableFilter);
    mediaTable.setItems(mediaSortable);
    mediaSortable.comparatorProperty().bind(mediaTable.comparatorProperty());
    mediaColumnRowNumber.setSortable(false);
    mediaColumnRowNumber.setCellValueFactory(p -> new ReadOnlyObjectWrapper(1 + mediaTable.getItems().indexOf(p.getValue())));
    mediaColumnTitle.setComparator(new NaturalOrderComparator());
    mediaColumnCreator.setComparator(new NaturalOrderComparator());
    mediaColumnSeason.setComparator(new NaturalOrderComparator());
    mediaColumnEpisode.setComparator(new NaturalOrderComparator());
    mediaColumnCategory.setComparator(new NaturalOrderComparator());
    mediaColumnTitle.setCellValueFactory(new PropertyValueFactory<>("Title"));
    mediaColumnCreator.setCellValueFactory(new PropertyValueFactory<>("Creator"));
    mediaColumnSeason.setCellValueFactory(new PropertyValueFactory<>("SeasonId"));
    mediaColumnEpisode.setCellValueFactory(new PropertyValueFactory<>("EpisodeId"));
    mediaColumnCategory.setCellValueFactory(new PropertyValueFactory<>("Category"));
    chartRotY.setLabel("Reviews");
    chartRotY.setAutoRanging(false);
    chartRotY.setLowerBound(0);
    chartRotY.setUpperBound(10);
    chartRotY.setTickUnit(2);
    chartRotY.setMinorTickCount(2);
    chartRotX.setLabel("Time");
    chartRotX.setAutoRanging(false);
    chartRotX.setTickUnit(1);
    chartRotX.setMinorTickCount(4);
    chartRotX.setTickLabelFormatter(new StringConverter<Number>() {

        @Override
        public String toString(Number number) {
            double x = number.doubleValue();
            double decimal = x % 1;
            double year = x - decimal;
            double days = decimal * 365.25;
            if (days > 365 || days < 1) {
                return ((int) year) + "";
            }
            LocalDate date = LocalDate.ofYearDay((int) year, (int) days);
            return date.format(DateTimeFormatter.ofPattern("MMM uuuu"));
        }

        @Override
        public Number fromString(String string) {
            //To change body of generated methods, choose Tools | Templates.
            throw new UnsupportedOperationException("Not supported yet.");
        }
    });
}
Also used : SortedList(javafx.collections.transformation.SortedList) Media(retrospector.model.Media) LocalDate(java.time.LocalDate) FilteredList(javafx.collections.transformation.FilteredList) NaturalOrderComparator(retrospector.util.NaturalOrderComparator) XYChart(javafx.scene.chart.XYChart) ReadOnlyObjectWrapper(javafx.beans.property.ReadOnlyObjectWrapper)

Example 3 with NaturalOrderComparator

use of retrospector.util.NaturalOrderComparator in project Retrospector by NonlinearFruit.

the class StatsTabController method updateFactoid.

private void updateFactoid() {
    // Selector Values
    String factoidType = factoidSelector.getValue();
    String category = categorySelector.getValue();
    // Colors
    int index = Arrays.asList(DataManager.getFactiodTypes()).indexOf(factoidType);
    chartAverageFactRating.setStyle("CHART_COLOR_1: " + colors[(index >= 0 ? colors.length - index : 0) % colors.length] + ";");
    chartNumOfFacts.setStyle("CHART_COLOR_1: " + colors[(index >= 0 ? colors.length - index : 0) % colors.length] + ";");
    // Data Mining - Vars
    final Integer threshold = 5;
    final Integer maxLabelLen = 13;
    Map<String, Integer> ratingFactsMap = new HashMap<>();
    Map<String, Integer> countReviewFactsMap = new HashMap<>();
    Map<String, Integer> numberFactsMap = new HashMap<>();
    InfoBlipAccumulator info = new InfoBlipAccumulator();
    // Data Mining - Calcs
    for (Media m : allMedia) {
        List<Factoid> factoids = new ArrayList<>(m.getFactoids());
        factoids.add(new Factoid("Title", m.getTitle()));
        factoids.add(new Factoid("Creator", m.getCreator()));
        factoids.add(new Factoid("Season", m.getSeasonId()));
        factoids.add(new Factoid("Episode", m.getEpisodeId()));
        factoids.add(new Factoid("Category", m.getCategory()));
        if (category.equals(m.getCategory()) || category.equals(universalCategory)) {
            boolean user = false;
            boolean fact = false;
            for (Review r : m.getReviews()) if (strooleans.stream().anyMatch(x -> x.getString().equalsIgnoreCase(r.getUser()) && x.isBoolean()))
                user = true;
            for (Factoid factiod : factoids) if (factiod.getTitle().equals(factoidType))
                fact = true;
            if (user && fact) {
                Set<String> contentTypes = new HashSet<>();
                info.accumulate(m);
                SimpleIntegerProperty rating = new SimpleIntegerProperty(0);
                SimpleIntegerProperty count = new SimpleIntegerProperty(0);
                for (Review r : m.getReviews()) if (strooleans.stream().anyMatch(x -> x.getString().equalsIgnoreCase(r.getUser()) && x.isBoolean())) {
                    rating.set(rating.get() + r.getRating().intValueExact());
                    count.set(count.get() + 1);
                    info.accumulate(r);
                }
                for (Factoid factoid : factoids) if (factoid.getTitle().equals(factoidType)) {
                    String f = factoid.getContent();
                    if (f.length() > maxLabelLen)
                        f = f.substring(0, maxLabelLen);
                    contentTypes.add(f);
                    numberFactsMap.put(f, numberFactsMap.getOrDefault(f, 0) + 1);
                    info.accumulate(factoid);
                }
                contentTypes.stream().forEach(content -> {
                    ratingFactsMap.put(content, ratingFactsMap.getOrDefault(content, 0) + rating.get());
                    countReviewFactsMap.put(content, countReviewFactsMap.getOrDefault(content, 0) + count.get());
                });
            }
        }
    }
    if (mediaContainer.getChildren().size() > 3)
        mediaContainer.getChildren().remove(2);
    mediaContainer.getChildren().add(2, info.getInfo());
    // Chart - # of Facts
    chartNumOfFacts.getData().clear();
    XYChart.Series<String, Number> dataNum = new XYChart.Series<>();
    dataNum.setName(factoidType);
    numberFactsMap.keySet().stream().sorted(new NaturalOrderComparator()).forEachOrdered(factoid -> {
        if (numberFactsMap.get(factoid) > 1)
            dataNum.getData().add(new XYChart.Data<>(factoid, numberFactsMap.get(factoid)));
    });
    if (dataNum.getData().size() < 1)
        dataNum.getData().add(new XYChart.Data<>("", 0));
    chartNumOfFacts.getData().add(dataNum);
    // Chart - Average Fact Rating
    chartAverageFactRating.getData().clear();
    XYChart.Series<String, Number> dataAve = new XYChart.Series<>();
    dataAve.setName(factoidType);
    ratingFactsMap.keySet().stream().sorted(new NaturalOrderComparator()).forEachOrdered(factoid -> {
        if (countReviewFactsMap.get(factoid) >= threshold)
            dataAve.getData().add(new XYChart.Data<>(factoid, ratingFactsMap.get(factoid) * 1.0 / countReviewFactsMap.get(factoid)));
    });
    if (dataAve.getData().size() < 1)
        dataAve.getData().add(new XYChart.Data<>("", 0));
    chartAverageFactRating.getData().add(dataAve);
}
Also used : Arrays(java.util.Arrays) Initializable(javafx.fxml.Initializable) ListView(javafx.scene.control.ListView) StackedBarChart(javafx.scene.chart.StackedBarChart) URL(java.net.URL) CheckBoxListCell(javafx.scene.control.cell.CheckBoxListCell) FXCollections(javafx.collections.FXCollections) HashMap(java.util.HashMap) Factoid(retrospector.model.Factoid) XYChart(javafx.scene.chart.XYChart) VBox(javafx.scene.layout.VBox) ArrayList(java.util.ArrayList) Media(retrospector.model.Media) HashSet(java.util.HashSet) LineChart(javafx.scene.chart.LineChart) ResourceBundle(java.util.ResourceBundle) Map(java.util.Map) SimpleIntegerProperty(javafx.beans.property.SimpleIntegerProperty) NaturalOrderComparator(retrospector.util.NaturalOrderComparator) Circle(javafx.scene.shape.Circle) HBox(javafx.scene.layout.HBox) ObjectProperty(javafx.beans.property.ObjectProperty) Label(javafx.scene.control.Label) Review(retrospector.model.Review) Node(javafx.scene.Node) Set(java.util.Set) Rectangle(javafx.scene.shape.Rectangle) CategoryAxis(javafx.scene.chart.CategoryAxis) BarChart(javafx.scene.chart.BarChart) Collectors(java.util.stream.Collectors) ChoiceBox(javafx.scene.control.ChoiceBox) TAB(retrospector.fxml.CoreController.TAB) Platform(javafx.application.Platform) FXML(javafx.fxml.FXML) Text(javafx.scene.text.Text) PieChart(javafx.scene.chart.PieChart) Stroolean(retrospector.util.Stroolean) List(java.util.List) ChronoUnit(java.time.temporal.ChronoUnit) LocalDate(java.time.LocalDate) ObservableList(javafx.collections.ObservableList) NumberAxis(javafx.scene.chart.NumberAxis) DataManager(retrospector.model.DataManager) Shape(javafx.scene.shape.Shape) HashMap(java.util.HashMap) Media(retrospector.model.Media) ArrayList(java.util.ArrayList) Review(retrospector.model.Review) NaturalOrderComparator(retrospector.util.NaturalOrderComparator) XYChart(javafx.scene.chart.XYChart) Factoid(retrospector.model.Factoid) SimpleIntegerProperty(javafx.beans.property.SimpleIntegerProperty) HashSet(java.util.HashSet)

Example 4 with NaturalOrderComparator

use of retrospector.util.NaturalOrderComparator in project Retrospector by NonlinearFruit.

the class ListsTabController method initListTab.

private void initListTab() {
    // Include
    for (String category : DataManager.getCategories()) {
        Stroolean c = new Stroolean(category);
        c.booleanProperty().addListener((observe, old, neo) -> updateListTab());
        strooleans.add(c);
        listIncludeList.getItems().add(c);
    }
    listIncludeList.setCellFactory(CheckBoxListCell.forListView(Stroolean::booleanProperty));
    listIncludeList.setOnMouseClicked(e -> {
        if (e.getClickCount() == 2) {
            Stroolean me = listIncludeList.getSelectionModel().getSelectedItem();
            for (Stroolean stroolean : strooleans) {
                stroolean.setBoolean(false);
            }
            me.setBoolean(true);
        }
    });
    // Group By
    listGroupCreator.setSelected(true);
    listGroupCreator.selectedProperty().addListener((observe, old, neo) -> {
        if (neo) {
        // Nothing to select, top of the food chain
        } else {
            listGroupTitle.setSelected(false);
            listGroupSeason.setSelected(false);
            listGroupEpisode.setSelected(false);
        }
        updateListTab();
    });
    listGroupTitle.selectedProperty().addListener((observe, old, neo) -> {
        if (neo) {
            listGroupCreator.setSelected(true);
        } else {
            listGroupSeason.setSelected(false);
            listGroupEpisode.setSelected(false);
        }
        updateListTab();
    });
    listGroupSeason.selectedProperty().addListener((observe, old, neo) -> {
        if (neo) {
            listGroupCreator.setSelected(true);
            listGroupTitle.setSelected(true);
        } else {
            listGroupEpisode.setSelected(false);
        }
        updateListTab();
    });
    listGroupEpisode.selectedProperty().addListener((observe, old, neo) -> {
        if (neo) {
            listGroupCreator.setSelected(true);
            listGroupTitle.setSelected(true);
            listGroupSeason.setSelected(true);
        } else {
        // Nothing to deselect, bottom of the food chain
        }
        updateListTab();
    });
    // Top 10/0/0
    listTop10.setSelected(true);
    listTop10.selectedProperty().addListener((observe, old, neo) -> {
        updateListTab();
        if (neo) {
            listTop25.setSelected(false);
            listTop50.setSelected(false);
            listTop100.setSelected(false);
            listTop500.setSelected(false);
            listTop1000.setSelected(false);
        }
    });
    listTop25.selectedProperty().addListener((observe, old, neo) -> {
        updateListTab();
        if (neo) {
            listTop10.setSelected(false);
            listTop50.setSelected(false);
            listTop100.setSelected(false);
            listTop500.setSelected(false);
            listTop1000.setSelected(false);
        }
    });
    listTop50.selectedProperty().addListener((observe, old, neo) -> {
        updateListTab();
        if (neo) {
            listTop10.setSelected(false);
            listTop25.setSelected(false);
            listTop100.setSelected(false);
            listTop500.setSelected(false);
            listTop1000.setSelected(false);
        }
    });
    listTop100.selectedProperty().addListener((observe, old, neo) -> {
        updateListTab();
        if (neo) {
            listTop10.setSelected(false);
            listTop25.setSelected(false);
            listTop50.setSelected(false);
            listTop500.setSelected(false);
            listTop1000.setSelected(false);
        }
    });
    listTop500.selectedProperty().addListener((observe, old, neo) -> {
        updateListTab();
        if (neo) {
            listTop10.setSelected(false);
            listTop25.setSelected(false);
            listTop50.setSelected(false);
            listTop100.setSelected(false);
            listTop1000.setSelected(false);
        }
    });
    listTop1000.selectedProperty().addListener((observe, old, neo) -> {
        updateListTab();
        if (neo) {
            listTop10.setSelected(false);
            listTop25.setSelected(false);
            listTop50.setSelected(false);
            listTop100.setSelected(false);
            listTop500.setSelected(false);
        }
    });
    // Dates
    listYear.setText(String.valueOf(LocalDate.now().getYear()));
    listYear.setOnAction(e -> updateListTab());
    listStartDate.setValue(LocalDate.now().withMonth(1).withDayOfMonth(1));
    listStartDate.valueProperty().addListener((observe, old, neo) -> updateListTab());
    listEndDate.setValue(LocalDate.now().withMonth(12).withDayOfMonth(31));
    listEndDate.valueProperty().addListener((observe, old, neo) -> updateListTab());
    listUseAllTime.selectedProperty().addListener((observe, old, neo) -> updateListTab());
    listUseYear.selectedProperty().addListener((observe, old, neo) -> updateListTab());
    listCustomDateRange.selectedProperty().addListener((observe, old, neo) -> updateListTab());
    //  - Enable/Disble
    dateToggleGroup.getToggles().addAll(listUseYear, listUseAllTime, listCustomDateRange);
    dateToggleGroup.selectToggle(listUseAllTime);
    listYear.disableProperty().bind(Bindings.not(listUseYear.selectedProperty()));
    listStartDate.disableProperty().bind(Bindings.not(listCustomDateRange.selectedProperty()));
    listEndDate.disableProperty().bind(Bindings.not(listCustomDateRange.selectedProperty()));
    // User
    listUser.setText(DataManager.getDefaultUser());
    listUser.setOnAction(e -> updateListTab());
    // Table
    listTable.setItems(listTableData);
    // Link to Properties
    listTitleColumn.setCellValueFactory(new PropertyValueFactory<>("Title"));
    listCreatorColumn.setCellValueFactory(new PropertyValueFactory<>("Creator"));
    listSeasonColumn.setCellValueFactory(new PropertyValueFactory<>("SeasonId"));
    listEpisodeColumn.setCellValueFactory(new PropertyValueFactory<>("EpisodeId"));
    listCategoryColumn.setCellValueFactory(new PropertyValueFactory<>("Category"));
    // Special Table Cells
    listReviewsColumn.setCellValueFactory(p -> new ReadOnlyObjectWrapper(p.getValue().getReviews().size()));
    listRatingColumn.setCellValueFactory(p -> new ReadOnlyObjectWrapper(p.getValue().getAverageRating()));
    // Comparors for string columns
    listTitleColumn.setComparator(new NaturalOrderComparator());
    listCreatorColumn.setComparator(new NaturalOrderComparator());
    listSeasonColumn.setComparator(new NaturalOrderComparator());
    listEpisodeColumn.setComparator(new NaturalOrderComparator());
    listCategoryColumn.setComparator(new NaturalOrderComparator());
}
Also used : Stroolean(retrospector.util.Stroolean) ReadOnlyObjectWrapper(javafx.beans.property.ReadOnlyObjectWrapper) NaturalOrderComparator(retrospector.util.NaturalOrderComparator)

Aggregations

NaturalOrderComparator (retrospector.util.NaturalOrderComparator)4 ReadOnlyObjectWrapper (javafx.beans.property.ReadOnlyObjectWrapper)3 URL (java.net.URL)2 LocalDate (java.time.LocalDate)2 ArrayList (java.util.ArrayList)2 Arrays (java.util.Arrays)2 List (java.util.List)2 ResourceBundle (java.util.ResourceBundle)2 ObjectProperty (javafx.beans.property.ObjectProperty)2 ObservableList (javafx.collections.ObservableList)2 FilteredList (javafx.collections.transformation.FilteredList)2 SortedList (javafx.collections.transformation.SortedList)2 FXML (javafx.fxml.FXML)2 Initializable (javafx.fxml.Initializable)2 XYChart (javafx.scene.chart.XYChart)2 Text (javafx.scene.text.Text)2 Media (retrospector.model.Media)2 Stroolean (retrospector.util.Stroolean)2 BigDecimal (java.math.BigDecimal)1 ChronoUnit (java.time.temporal.ChronoUnit)1