Example usage for javafx.collections FXCollections observableArrayList

List of usage examples for javafx.collections FXCollections observableArrayList

Introduction

In this page you can find the example usage for javafx.collections FXCollections observableArrayList.

Prototype

public static <E> ObservableList<E> observableArrayList(Collection<? extends E> col) 

Source Link

Document

Creates a new observable array list and adds a content of collection col to it.

Usage

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXRelationPickerPane.java

public void setJavaFXDataCollection(Collection<ICFBamRelationObj> value) {
    final String S_ProcName = "setJavaFXDataCollection";
    javafxDataCollection = value;/*from w  ww  .  ja v  a  2 s .com*/
    observableListOfRelation = null;
    if (javafxDataCollection != null) {
        observableListOfRelation = FXCollections.observableArrayList(javafxDataCollection);
        observableListOfRelation.sort(compareRelationByQualName);
    } else {
        observableListOfRelation = FXCollections.observableArrayList();
    }
    if (dataTable != null) {
        dataTable.setItems(observableListOfRelation);
        // Hack from stackoverflow to fix JavaFX TableView refresh issue
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(false);
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTimestampDefPickerPane.java

public void setJavaFXDataCollection(Collection<ICFBamTimestampDefObj> value) {
    final String S_ProcName = "setJavaFXDataCollection";
    javafxDataCollection = value;/*from  w ww . ja  va 2  s  . c  om*/
    observableListOfTimestampDef = null;
    if (javafxDataCollection != null) {
        observableListOfTimestampDef = FXCollections.observableArrayList(javafxDataCollection);
        observableListOfTimestampDef.sort(compareTimestampDefByQualName);
    } else {
        observableListOfTimestampDef = FXCollections.observableArrayList();
    }
    if (dataTable != null) {
        dataTable.setItems(observableListOfTimestampDef);
        // Hack from stackoverflow to fix JavaFX TableView refresh issue
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(false);
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXTZTimestampDefPickerPane.java

public void setJavaFXDataCollection(Collection<ICFBamTZTimestampDefObj> value) {
    final String S_ProcName = "setJavaFXDataCollection";
    javafxDataCollection = value;/*from w w w.  ja v a 2s .  c  o m*/
    observableListOfTZTimestampDef = null;
    if (javafxDataCollection != null) {
        observableListOfTZTimestampDef = FXCollections.observableArrayList(javafxDataCollection);
        observableListOfTZTimestampDef.sort(compareTZTimestampDefByQualName);
    } else {
        observableListOfTZTimestampDef = FXCollections.observableArrayList();
    }
    if (dataTable != null) {
        dataTable.setItems(observableListOfTZTimestampDef);
        // Hack from stackoverflow to fix JavaFX TableView refresh issue
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(false);
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXNumberColPickerPane.java

public void setJavaFXDataCollection(Collection<ICFBamNumberColObj> value) {
    final String S_ProcName = "setJavaFXDataCollection";
    javafxDataCollection = value;/* w w  w  . j  a  va 2 s.  co m*/
    observableListOfNumberCol = null;
    if (javafxDataCollection != null) {
        observableListOfNumberCol = FXCollections.observableArrayList(javafxDataCollection);
        observableListOfNumberCol.sort(compareNumberColByQualName);
    } else {
        observableListOfNumberCol = FXCollections.observableArrayList();
    }
    if (dataTable != null) {
        dataTable.setItems(observableListOfNumberCol);
        // Hack from stackoverflow to fix JavaFX TableView refresh issue
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(false);
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXNumberTypePickerPane.java

public void setJavaFXDataCollection(Collection<ICFBamNumberTypeObj> value) {
    final String S_ProcName = "setJavaFXDataCollection";
    javafxDataCollection = value;/*from   w w  w  .  j  av a 2  s . c  o m*/
    observableListOfNumberType = null;
    if (javafxDataCollection != null) {
        observableListOfNumberType = FXCollections.observableArrayList(javafxDataCollection);
        observableListOfNumberType.sort(compareNumberTypeByQualName);
    } else {
        observableListOfNumberType = FXCollections.observableArrayList();
    }
    if (dataTable != null) {
        dataTable.setItems(observableListOfNumberType);
        // Hack from stackoverflow to fix JavaFX TableView refresh issue
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(false);
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXId64GenPickerPane.java

public void setJavaFXDataCollection(Collection<ICFBamId64GenObj> value) {
    final String S_ProcName = "setJavaFXDataCollection";
    javafxDataCollection = value;//from   w ww.  j av  a  2  s  . co  m
    observableListOfId64Gen = null;
    if (javafxDataCollection != null) {
        observableListOfId64Gen = FXCollections.observableArrayList(javafxDataCollection);
        observableListOfId64Gen.sort(compareId64GenByQualName);
    } else {
        observableListOfId64Gen = FXCollections.observableArrayList();
    }
    if (dataTable != null) {
        dataTable.setItems(observableListOfId64Gen);
        // Hack from stackoverflow to fix JavaFX TableView refresh issue
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(false);
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXId16GenPickerPane.java

public void setJavaFXDataCollection(Collection<ICFBamId16GenObj> value) {
    final String S_ProcName = "setJavaFXDataCollection";
    javafxDataCollection = value;//from  w  w w.  j  a  va2  s  . co m
    observableListOfId16Gen = null;
    if (javafxDataCollection != null) {
        observableListOfId16Gen = FXCollections.observableArrayList(javafxDataCollection);
        observableListOfId16Gen.sort(compareId16GenByQualName);
    } else {
        observableListOfId16Gen = FXCollections.observableArrayList();
    }
    if (dataTable != null) {
        dataTable.setItems(observableListOfId16Gen);
        // Hack from stackoverflow to fix JavaFX TableView refresh issue
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(false);
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXId32GenPickerPane.java

public void setJavaFXDataCollection(Collection<ICFBamId32GenObj> value) {
    final String S_ProcName = "setJavaFXDataCollection";
    javafxDataCollection = value;/*from w  w  w  .  j  ava2  s .  c  o  m*/
    observableListOfId32Gen = null;
    if (javafxDataCollection != null) {
        observableListOfId32Gen = FXCollections.observableArrayList(javafxDataCollection);
        observableListOfId32Gen.sort(compareId32GenByQualName);
    } else {
        observableListOfId32Gen = FXCollections.observableArrayList();
    }
    if (dataTable != null) {
        dataTable.setItems(observableListOfId32Gen);
        // Hack from stackoverflow to fix JavaFX TableView refresh issue
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(false);
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(true);
    }
}

From source file:net.sourceforge.msscodefactory.cfbam.v2_7.CFBamJavaFX.CFBamJavaFXNumberDefPickerPane.java

public void setJavaFXDataCollection(Collection<ICFBamNumberDefObj> value) {
    final String S_ProcName = "setJavaFXDataCollection";
    javafxDataCollection = value;//  w  ww .ja v  a2s  . com
    observableListOfNumberDef = null;
    if (javafxDataCollection != null) {
        observableListOfNumberDef = FXCollections.observableArrayList(javafxDataCollection);
        observableListOfNumberDef.sort(compareNumberDefByQualName);
    } else {
        observableListOfNumberDef = FXCollections.observableArrayList();
    }
    if (dataTable != null) {
        dataTable.setItems(observableListOfNumberDef);
        // Hack from stackoverflow to fix JavaFX TableView refresh issue
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(false);
        ((TableColumn) dataTable.getColumns().get(0)).setVisible(true);
    }
}

From source file:de.bayern.gdi.gui.Controller.java

private void chooseWFSType(ItemModel data, boolean datasetAvailable) {
    if (data instanceof FeatureModel || data instanceof OverallFeatureTypeModel
            || (!datasetAvailable && downloadConfig.getServiceType() == "WFS2_BASIC")) {
        boolean isSqlFilterType = false;
        if (data instanceof OverallFeatureTypeModel) {
            isSqlFilterType = true;//from  www . jav a2  s.  co  m
        }
        if (data instanceof FeatureModel) {
            FeatureModel.FilterType filterType = ((FeatureModel) data).getFilterType();
            isSqlFilterType = FILTER.equals(filterType);
        }

        this.simpleWFSContainer.setVisible(false);
        this.atomContainer.setVisible(false);
        this.referenceSystemChooser.setVisible(true);
        this.referenceSystemChooserLabel.setVisible(true);
        this.basicWFSContainer.setVisible(true);
        if (isSqlFilterType) {
            this.sqlWFSArea.setVisible(true);
            this.sqlWFSArea.setManaged(true);
            this.mapNodeWFS.setVisible(false);
            this.mapNodeWFS.setManaged(false);
        } else {
            this.sqlWFSArea.setVisible(false);
            this.sqlWFSArea.setManaged(false);
            this.mapNodeWFS.setVisible(true);
            this.mapNodeWFS.setManaged(true);
        }

        if (data.getItem() instanceof WFSMeta.Feature) {
            setCrsAndExtent((WFSMeta.Feature) data.getItem());
        } else if (data.getItem() instanceof List && !((List) data.getItem()).isEmpty()) {
            List items = (List) data.getItem();
            setCrsAndExtent((WFSMeta.Feature) items.get(items.size() - 1));
        }
        List<String> outputFormats = this.dataBean.getWFSService().findOperation("GetFeature")
                .getOutputFormats();

        if (outputFormats.isEmpty()) {
            outputFormats = this.dataBean.getWFSService().getOutputFormats();
        }
        List<OutputFormatModel> formatModels = new ArrayList<>();
        for (String s : outputFormats) {
            OutputFormatModel m = new OutputFormatModel();
            m.setItem(s);
            m.setAvailable(true);
            formatModels.add(m);
        }
        ObservableList<OutputFormatModel> formats = FXCollections.observableArrayList(formatModels);
        this.dataFormatChooser.setItems(formats);
        this.dataFormatChooser.getSelectionModel().selectFirst();
    } else if (data instanceof StoredQueryModel
            || (!datasetAvailable && downloadConfig.getServiceType().equals("WFS2_SIMPLE"))) {
        List<String> outputFormats = this.dataBean.getWFSService().findOperation("GetFeature")
                .getOutputFormats();
        if (outputFormats.isEmpty()) {
            outputFormats = this.dataBean.getWFSService().getOutputFormats();
        }
        List<OutputFormatModel> formatModels = new ArrayList<>();
        for (String i : outputFormats) {
            OutputFormatModel m = new OutputFormatModel();
            m.setItem(i);
            m.setAvailable(true);
            formatModels.add(m);
        }
        WFSMeta.StoredQuery storedQuery;
        if (datasetAvailable) {
            storedQuery = (WFSMeta.StoredQuery) data.getItem();
        } else {
            storedQuery = new WFSMeta.StoredQuery();
        }
        factory.fillSimpleWFS(this.simpleWFSContainer, storedQuery, formatModels);

        // XXX: This is a bit ugly. We need real MVC.
        Node df = this.simpleWFSContainer.lookup("#" + UIFactory.getDataFormatID());
        if (df instanceof ComboBox) {
            ((ComboBox) df).setOnAction(evt -> {
                ComboBox<OutputFormatModel> cb = (ComboBox<OutputFormatModel>) evt.getSource();
                handleDataformatSelect(cb);
            });
        }

    }
}