Fixed progress bar color changing

This commit is contained in:
Luka 2019-01-26 09:53:16 +01:00
parent a5039f542f
commit 7ce8b83d16
10 changed files with 100 additions and 63 deletions

View File

@ -971,7 +971,7 @@ public class XML_processing {
} }
// taxonomy node // taxonomy node
else if (qName.equalsIgnoreCase("term")) { else if (stats.getCorpus().getTaxonomy().size() > 0 && qName.equalsIgnoreCase("term")) {
// there are some term nodes at the beginning that are of no interest to us // there are some term nodes at the beginning that are of no interest to us
// they differ by not having the attribute "ref", so test will equal null // they differ by not having the attribute "ref", so test will equal null
Attribute tax = startElement.getAttributeByName(QName.valueOf("ref")); Attribute tax = startElement.getAttributeByName(QName.valueOf("ref"));
@ -983,7 +983,7 @@ public class XML_processing {
// Tax taxonomy = new Tax(); // Tax taxonomy = new Tax();
// currentFiletaxonomyLong.add(taxonomy.getLongTaxonomyName(currentFiletaxonomyElement)); // currentFiletaxonomyLong.add(taxonomy.getLongTaxonomyName(currentFiletaxonomyElement));
} }
} else if (qName.equalsIgnoreCase("catRef")) { } else if (stats.getCorpus().getTaxonomy().size() > 0 && qName.equalsIgnoreCase("catRef")) {
// get value from attribute target // get value from attribute target
Attribute tax = startElement.getAttributeByName(QName.valueOf("target")); Attribute tax = startElement.getAttributeByName(QName.valueOf("target"));

View File

@ -47,7 +47,7 @@ public class Corpus {
} }
public void setCorpusName(String corpusName) { public void setCorpusName(String corpusName) {
System.out.println(corpusName); // System.out.println(corpusName);
this.corpusName = corpusName; this.corpusName = corpusName;
logger.info("Corpus.set: ", corpusName); logger.info("Corpus.set: ", corpusName);
} }

View File

@ -621,7 +621,7 @@ public class StatisticsNew {
// String sep = ""; // String sep = "";
for (String s : tax) { for (String s : tax) {
if (s == null) { if (corpus.getTaxonomy().size() == 0 || s == null) {
continue; continue;
} }
@ -680,16 +680,20 @@ public class StatisticsNew {
long sum_fwi =0L; long sum_fwi =0L;
long mul_fwi =1L; long mul_fwi =1L;
// if(hmKey.getK1().equals("ja ja ja ja ja") || hmKey.getK1().equals("ne ne ne ne ne")){
// System.out.println("TEST");
//
// }
for(MultipleHMKeys smallHmKey : hmKey.getSplittedMultipleHMKeys()){ for(MultipleHMKeys smallHmKey : hmKey.getSplittedMultipleHMKeys()){
// System.out.println(smallHmKey.getK1()); // System.out.println(smallHmKey.getK1());
sum_fwi += oneWordTaxonomyResult.get(corpus.getTotal()).get(smallHmKey).longValue(); sum_fwi += oneWordTaxonomyResult.get(corpus.getTotal()).get(smallHmKey).longValue();
mul_fwi *= oneWordTaxonomyResult.get(corpus.getTotal()).get(smallHmKey).longValue(); mul_fwi *= oneWordTaxonomyResult.get(corpus.getTotal()).get(smallHmKey).longValue();
} }
// String t = hmKey.getK1(); // String t = hmKey.getK1();
// if(hmKey.getK1().equals("v Slovenija")){ if(mul_fwi < 0){
// System.out.println("TEST"); mul_fwi = Long.MAX_VALUE;
// }
// }
double O = (double)taxonomyResult.get(corpus.getTotal()).get(hmKey).longValue(); double O = (double)taxonomyResult.get(corpus.getTotal()).get(hmKey).longValue();
double n = (double)filter.getNgramValue(); double n = (double)filter.getNgramValue();
double E = (double)mul_fwi / Math.pow(N, n - 1); double E = (double)mul_fwi / Math.pow(N, n - 1);

View File

@ -104,11 +104,11 @@ public class Tax {
public static ObservableList<String> getTaxonomyForComboBox(CorpusType corpusType, HashSet<String> foundTax) { public static ObservableList<String> getTaxonomyForComboBox(CorpusType corpusType, HashSet<String> foundTax) {
LinkedHashMap<String, String> tax = new LinkedHashMap<>(); LinkedHashMap<String, String> tax = new LinkedHashMap<>();
if (corpusType == CorpusType.GIGAFIDA || corpusType == CorpusType.CCKRES || corpusType == CorpusType.SSJ500K || corpusType == CorpusType.GIGAFIDA2) { if (corpusType == CorpusType.GIGAFIDA || corpusType == CorpusType.CCKRES) {
tax = GIGAFIDA_TAXONOMY; tax = GIGAFIDA_TAXONOMY;
} else if (corpusType == CorpusType.GOS) { } else if (corpusType == CorpusType.GOS) {
tax = GOS_TAXONOMY; tax = GOS_TAXONOMY;
} else if (corpusType == CorpusType.VERT){ } else if (corpusType == CorpusType.VERT || corpusType == CorpusType.SSJ500K || corpusType == CorpusType.GIGAFIDA2){
// if VERT only order taxonomy by alphabet // if VERT only order taxonomy by alphabet
ArrayList<String> sortedFoundTaxonomy = new ArrayList<>(foundTax); ArrayList<String> sortedFoundTaxonomy = new ArrayList<>(foundTax);
Collections.sort(sortedFoundTaxonomy); Collections.sort(sortedFoundTaxonomy);
@ -147,7 +147,7 @@ public class Tax {
LinkedHashMap<String, String> tax = new LinkedHashMap<>(); LinkedHashMap<String, String> tax = new LinkedHashMap<>();
Set<Taxonomy> foundTaxHS= new HashSet<>(foundTax); Set<Taxonomy> foundTaxHS= new HashSet<>(foundTax);
if (corpus.getCorpusType() == CorpusType.GIGAFIDA || corpus.getCorpusType() == CorpusType.CCKRES || corpus.getCorpusType() == CorpusType.SSJ500K || corpus.getCorpusType() == CorpusType.GIGAFIDA2) { if (corpus.getCorpusType() == CorpusType.GIGAFIDA || corpus.getCorpusType() == CorpusType.CCKRES) {
tax = GIGAFIDA_TAXONOMY; tax = GIGAFIDA_TAXONOMY;
} else if (corpus.getCorpusType() == CorpusType.GOS) { } else if (corpus.getCorpusType() == CorpusType.GOS) {
tax = GOS_TAXONOMY; tax = GOS_TAXONOMY;
@ -264,11 +264,11 @@ public class Tax {
LinkedHashMap<String, String> tax = new LinkedHashMap<>(); LinkedHashMap<String, String> tax = new LinkedHashMap<>();
ArrayList<String> result = new ArrayList<>(); ArrayList<String> result = new ArrayList<>();
if (corpusType == CorpusType.GIGAFIDA || corpusType == CorpusType.CCKRES || corpusType == CorpusType.SSJ500K || corpusType == CorpusType.GIGAFIDA2) { if (corpusType == CorpusType.GIGAFIDA || corpusType == CorpusType.CCKRES) {
tax = GIGAFIDA_TAXONOMY; tax = GIGAFIDA_TAXONOMY;
} else if (corpusType == CorpusType.GOS) { } else if (corpusType == CorpusType.GOS) {
tax = GOS_TAXONOMY; tax = GOS_TAXONOMY;
} else if (corpusType == CorpusType.VERT) { } else if (corpusType == CorpusType.VERT || corpusType == CorpusType.SSJ500K || corpusType == CorpusType.GIGAFIDA2) {
for (Taxonomy t : taxonomy) { for (Taxonomy t : taxonomy) {
result.add(t.toLongNameString()); result.add(t.toLongNameString());
} }

View File

@ -477,17 +477,13 @@ enum TaxonomyEnum {
} }
} }
// return new Taxonomy(tax, tax);
System.out.println("2.");
System.out.println(tax);
return null; return null;
} }
public static ArrayList<TaxonomyEnum> taxonomySelected(TaxonomyEnum disjointTaxonomy) { public static ArrayList<TaxonomyEnum> taxonomySelected(TaxonomyEnum disjointTaxonomy) {
ArrayList<TaxonomyEnum> r = new ArrayList<>(); ArrayList<TaxonomyEnum> r = new ArrayList<>();
System.out.println(disjointTaxonomy); // System.out.println(disjointTaxonomy);
if(disjointTaxonomy.equals(DISKURZ)){ if(disjointTaxonomy.equals(DISKURZ)){
r.add(DISKURZ_JAVNI); r.add(DISKURZ_JAVNI);
r.add(DISKURZ_INFORMATIVNO_IZOBRAZEVALNI); r.add(DISKURZ_INFORMATIVNO_IZOBRAZEVALNI);
@ -700,8 +696,8 @@ enum TaxonomyEnum {
} }
public static ArrayList<TaxonomyEnum> convertStringListToTaxonomyList(ObservableList<String> stringList, Corpus corpus){ public static ArrayList<TaxonomyEnum> convertStringListToTaxonomyList(ObservableList<String> stringList, Corpus corpus){
System.out.println("1."); // System.out.println("1.");
System.out.println(stringList); // System.out.println(stringList);
ArrayList<TaxonomyEnum> taxonomyList = new ArrayList<>(); ArrayList<TaxonomyEnum> taxonomyList = new ArrayList<>();
// System.out.println("INTERESTING STUFF"); // System.out.println("INTERESTING STUFF");
@ -720,10 +716,10 @@ enum TaxonomyEnum {
public static void modifyingTaxonomy(ArrayList<TaxonomyEnum> taxonomy, ArrayList<TaxonomyEnum> checkedItemsTaxonomy, Corpus corpus){ public static void modifyingTaxonomy(ArrayList<TaxonomyEnum> taxonomy, ArrayList<TaxonomyEnum> checkedItemsTaxonomy, Corpus corpus){
// get taxonomies that were selected/deselected by user // get taxonomies that were selected/deselected by user
System.out.println("Print here:"); // System.out.println("Print here:");
System.out.println(taxonomy); // System.out.println(taxonomy);
System.out.println(checkedItemsTaxonomy); // System.out.println(checkedItemsTaxonomy);
System.out.println("-------------"); // System.out.println("-------------");
Set<TaxonomyEnum> disjointTaxonomies = new HashSet<>(checkedItemsTaxonomy); Set<TaxonomyEnum> disjointTaxonomies = new HashSet<>(checkedItemsTaxonomy);
if (taxonomy != null) { if (taxonomy != null) {
@ -923,7 +919,7 @@ public class Taxonomy {
} }
public static ArrayList<TaxonomyEnum> taxonomyToTaxonomyEnum(ArrayList<Taxonomy> taxonomy){ public static ArrayList<TaxonomyEnum> taxonomyToTaxonomyEnum(ArrayList<Taxonomy> taxonomy){
System.out.println(taxonomy); // System.out.println(taxonomy);
if (taxonomy == null) { if (taxonomy == null) {
return null; return null;
} }
@ -958,7 +954,7 @@ public class Taxonomy {
public static ArrayList<Taxonomy> modifyingTaxonomy(ArrayList<Taxonomy> taxonomy, ObservableList<String> checkedItems, Corpus corpus){ public static ArrayList<Taxonomy> modifyingTaxonomy(ArrayList<Taxonomy> taxonomy, ObservableList<String> checkedItems, Corpus corpus){
ArrayList<TaxonomyEnum> checkedItemsTaxonomy = TaxonomyEnum.convertStringListToTaxonomyList(checkedItems, corpus); ArrayList<TaxonomyEnum> checkedItemsTaxonomy = TaxonomyEnum.convertStringListToTaxonomyList(checkedItems, corpus);
if (checkedItemsTaxonomy != null && corpus.getCorpusType() != CorpusType.VERT) { if (checkedItemsTaxonomy != null && corpus.getCorpusType() != CorpusType.VERT && corpus.getCorpusType() != CorpusType.SSJ500K && corpus.getCorpusType() != CorpusType.GIGAFIDA2) {
TaxonomyEnum.modifyingTaxonomy(Taxonomy.taxonomyToTaxonomyEnum(taxonomy), checkedItemsTaxonomy, corpus); TaxonomyEnum.modifyingTaxonomy(Taxonomy.taxonomyToTaxonomyEnum(taxonomy), checkedItemsTaxonomy, corpus);
return taxonomyEnumToTaxonomy(checkedItemsTaxonomy, corpus); return taxonomyEnumToTaxonomy(checkedItemsTaxonomy, corpus);
} else { } else {

View File

@ -735,7 +735,7 @@ public class CharacterAnalysisTab {
} }
ngramProgressBar.progressProperty().unbind(); ngramProgressBar.progressProperty().unbind();
ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); // ngramProgressBar.setStyle(Settings.FX_ACCENT_OK);
progressLabel.textProperty().unbind(); progressLabel.textProperty().unbind();
progressLabel.setText(""); progressLabel.setText("");
cancel.setVisible(false); cancel.setVisible(false);
@ -746,7 +746,7 @@ public class CharacterAnalysisTab {
logger.error("Error while executing", e); logger.error("Error while executing", e);
ngramProgressBar.progressProperty().unbind(); ngramProgressBar.progressProperty().unbind();
ngramProgressBar.setProgress(0.0); ngramProgressBar.setProgress(0.0);
ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK); // ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK);
progressLabel.textProperty().unbind(); progressLabel.textProperty().unbind();
progressLabel.setText(""); progressLabel.setText("");
cancel.setVisible(false); cancel.setVisible(false);
@ -756,7 +756,7 @@ public class CharacterAnalysisTab {
showAlert(Alert.AlertType.INFORMATION, I18N.get("message.NOTIFICATION_ANALYSIS_CANCELED")); showAlert(Alert.AlertType.INFORMATION, I18N.get("message.NOTIFICATION_ANALYSIS_CANCELED"));
ngramProgressBar.progressProperty().unbind(); ngramProgressBar.progressProperty().unbind();
ngramProgressBar.setProgress(0.0); ngramProgressBar.setProgress(0.0);
ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); // ngramProgressBar.setStyle(Settings.FX_ACCENT_OK);
progressLabel.textProperty().unbind(); progressLabel.textProperty().unbind();
progressLabel.setText(""); progressLabel.setText("");
cancel.setVisible(false); cancel.setVisible(false);

View File

@ -109,7 +109,7 @@ public class CorpusTab {
@FXML @FXML
public TextField outputNameTF; public TextField outputNameTF;
public String outputName; public String outputName = "";
@FXML @FXML
public ComboBox<String> selectReaderCB; public ComboBox<String> selectReaderCB;
@ -144,7 +144,7 @@ public class CorpusTab {
private String corpusLocation; private String corpusLocation;
private String corpusFilesSize; private String corpusFilesSize;
private static final String [] SELECT_READER_ARRAY = {"vert", "Solar", "GOS", "SSJ500K", "Gigafida", "Gigafida (old)", "Kres (old)"}; private static final String [] SELECT_READER_ARRAY = {"vert", "Solar", "GOS", "SSJ500K", "Gigafida", "Gigafida (old)"};
private static final ArrayList<String> SELECT_READER = new ArrayList<>(Arrays.asList(SELECT_READER_ARRAY)); private static final ArrayList<String> SELECT_READER = new ArrayList<>(Arrays.asList(SELECT_READER_ARRAY));
private Collection<File> corpusFiles; private Collection<File> corpusFiles;
private File selectedDirectory; private File selectedDirectory;
@ -207,7 +207,7 @@ public class CorpusTab {
selectReader = newValue; selectReader = newValue;
selectReader(); selectReader();
if(corpus != null && corpus.getCorpusType() != null) { if(corpus != null && corpus.getCorpusType() != null) {
changeCorpus(); changeCorpus(false);
} }
logger.info("calculateForCB:", newValue); logger.info("calculateForCB:", newValue);
}); });
@ -226,6 +226,9 @@ public class CorpusTab {
readHeaderInfoChB.selectedProperty().addListener((observable, oldValue, newValue) -> { readHeaderInfoChB.selectedProperty().addListener((observable, oldValue, newValue) -> {
readHeaderInfo = newValue; readHeaderInfo = newValue;
if(corpusFiles != null) {
changeCorpus(false);
}
logger.info("read headers: ", readHeaderInfo); logger.info("read headers: ", readHeaderInfo);
}); });
// readHeaderInfoChB.setTooltip(new Tooltip(I18N.get("message.TOOLTIP_readHeaderInfoChB"))); // readHeaderInfoChB.setTooltip(new Tooltip(I18N.get("message.TOOLTIP_readHeaderInfoChB")));
@ -337,12 +340,12 @@ public class CorpusTab {
// scan for xml files // scan for xml files
corpusFiles = FileUtils.listFiles(selectedDirectory, FileFilterUtils.suffixFileFilter("xml", IOCase.INSENSITIVE), TrueFileFilter.INSTANCE); corpusFiles = FileUtils.listFiles(selectedDirectory, FileFilterUtils.suffixFileFilter("xml", IOCase.INSENSITIVE), TrueFileFilter.INSTANCE);
changeCorpus(); changeCorpus(true);
} }
} }
private void changeCorpus(){ private void changeCorpus(boolean resetResultsLocation){
// make sure there are corpus files in selected directory or notify the user about it // make sure there are corpus files in selected directory or notify the user about it
if (corpusFiles.size() == 0) { if (corpusFiles.size() == 0) {
// try .vert // try .vert
@ -381,6 +384,11 @@ public class CorpusTab {
logger.debug(result); logger.debug(result);
initNewCorpus(selectedDirectory, corpusFiles); initNewCorpus(selectedDirectory, corpusFiles);
if(resetResultsLocation){
chooseResultsLocation(selectedDirectory);
} else {
chooseResultsLocation(new File(chooseResultsLabelContent));
}
Messages.setChooseCorpusProperties(corpusLocation, corpusFilesSize, corpusType.toString()); Messages.setChooseCorpusProperties(corpusLocation, corpusFilesSize, corpusType.toString());
corpus.setChosenCorpusLocation(selectedDirectory); corpus.setChosenCorpusLocation(selectedDirectory);
@ -399,7 +407,7 @@ public class CorpusTab {
} }
} else { } else {
System.out.println(corpusLocation); // System.out.println(corpusLocation);
corpusLocation = selectedDirectory.getAbsolutePath(); corpusLocation = selectedDirectory.getAbsolutePath();
corpusFilesSize = String.valueOf(corpusFiles.size()); corpusFilesSize = String.valueOf(corpusFiles.size());
Messages.setChooseCorpusProperties(corpusLocation, corpusFilesSize, corpusType != null ? corpusType.toString() : null); Messages.setChooseCorpusProperties(corpusLocation, corpusFilesSize, corpusType != null ? corpusType.toString() : null);
@ -422,6 +430,11 @@ public class CorpusTab {
} else { } else {
initNewCorpus(selectedDirectory, corpusFiles); initNewCorpus(selectedDirectory, corpusFiles);
if(resetResultsLocation){
chooseResultsLocation(selectedDirectory);
} else {
chooseResultsLocation(new File(chooseResultsLabelContent));
}
Messages.setChooseCorpusProperties(corpusLocation, corpusFilesSize, corpusType.toString()); Messages.setChooseCorpusProperties(corpusLocation, corpusFilesSize, corpusType.toString());
corpus.setChosenCorpusLocation(selectedDirectory); corpus.setChosenCorpusLocation(selectedDirectory);
@ -439,6 +452,7 @@ public class CorpusTab {
} }
} }
} }
System.out.println(outputName);
corpus.setCorpusName(outputName); corpus.setCorpusName(outputName);
} }
@ -453,7 +467,6 @@ public class CorpusTab {
corpus.setCorpusType(corpusType); corpus.setCorpusType(corpusType);
corpus.setDetectedCorpusFiles(corpusFiles); corpus.setDetectedCorpusFiles(corpusFiles);
corpus.setChosenCorpusLocation(selectedDirectory); corpus.setChosenCorpusLocation(selectedDirectory);
chooseResultsLocation(selectedDirectory);
} }
private void chooseResultsLocation(File dir) { private void chooseResultsLocation(File dir) {
@ -521,7 +534,7 @@ public class CorpusTab {
logger.info("reading header data for ", corpusType.toString()); logger.info("reading header data for ", corpusType.toString());
if (corpusType == CorpusType.GIGAFIDA || corpusType == CorpusType.GOS || corpusType == CorpusType.CCKRES || corpusType == CorpusType.SSJ500K || corpusType == CorpusType.GIGAFIDA2) { if (corpusType == CorpusType.GIGAFIDA || corpusType == CorpusType.GOS || corpusType == CorpusType.SSJ500K || corpusType == CorpusType.GIGAFIDA2) {
boolean corpusIsSplit = corpusFiles.size() > 1; boolean corpusIsSplit = corpusFiles.size() > 1;
final Task<HashSet<String>> task = new Task<HashSet<String>>() { final Task<HashSet<String>> task = new Task<HashSet<String>>() {
@ -557,6 +570,16 @@ public class CorpusTab {
if (ValidationUtil.isEmpty(readTaxonomy)) { if (ValidationUtil.isEmpty(readTaxonomy)) {
// if no taxonomy found alert the user and keep other tabs disabled // if no taxonomy found alert the user and keep other tabs disabled
stringLevelTabNew2.setDisable(true);
oneWordAnalysisTab.setDisable(true);
characterLevelTab.setDisable(true);
wordLevelTab.setDisable(true);
filterTab.setDisable(true);
// Messages.reload();
Messages.updateChooseCorpusL();
// chooseCorpusL.textProperty().bind(I18N.createStringBinding("message.LABEL_CORPUS_LOCATION_NOT_SET"));
// chooseResultsL.textProperty().bind(I18N.createStringBinding("message.LABEL_RESULTS_LOCATION_NOT_SET"));
logger.info("No taxonomy found in headers."); logger.info("No taxonomy found in headers.");
GUIController.showAlert(Alert.AlertType.ERROR, I18N.get("message.WARNING_NO_TAXONOMY_FOUND")); GUIController.showAlert(Alert.AlertType.ERROR, I18N.get("message.WARNING_NO_TAXONOMY_FOUND"));
} else { } else {
@ -789,9 +812,6 @@ public class CorpusTab {
case "Gigafida (old)": case "Gigafida (old)":
corpusType = GIGAFIDA; corpusType = GIGAFIDA;
break; break;
case "Kres (old)":
corpusType = CCKRES;
break;
default: default:
logger.debug("No output detected!"); logger.debug("No output detected!");
break; break;
@ -804,7 +824,6 @@ public class CorpusTab {
File f = corpusFiles.iterator().next(); File f = corpusFiles.iterator().next();
String title = XML_processing.readXMLHeaderTag(f.getAbsolutePath(), "title").toLowerCase(); String title = XML_processing.readXMLHeaderTag(f.getAbsolutePath(), "title").toLowerCase();
String attrib = XML_processing.readXMLHeaderAttribute(f.getAbsolutePath(), "body", "base").toLowerCase(); String attrib = XML_processing.readXMLHeaderAttribute(f.getAbsolutePath(), "body", "base").toLowerCase();
String test = CCKRES.getNameLowerCase();
String debug = ""; String debug = "";
// check if XML file's title contains any of recognized corpus titles // check if XML file's title contains any of recognized corpus titles
@ -818,8 +837,6 @@ public class CorpusTab {
} else { } else {
corpusType = GIGAFIDA2; corpusType = GIGAFIDA2;
} }
} else if (title.contains(CCKRES.getNameLowerCase())) {
corpusType = CCKRES;
} else if (title.contains(GOS.getNameLowerCase())) { } else if (title.contains(GOS.getNameLowerCase())) {
corpusType = GOS; corpusType = GOS;
} else if (attrib.contains(SSJ500K.getNameLowerCase())) { } else if (attrib.contains(SSJ500K.getNameLowerCase())) {

View File

@ -364,7 +364,7 @@ public class OneWordAnalysisTab {
alsoVisualize = new ArrayList<>(); alsoVisualize = new ArrayList<>();
ObservableList<String> checkedItems = alsoVisualizeCCB.getCheckModel().getCheckedItems(); ObservableList<String> checkedItems = alsoVisualizeCCB.getCheckModel().getCheckedItems();
alsoVisualize.addAll(checkedItems); alsoVisualize.addAll(checkedItems);
if (checkedItems.contains("oblikoskladenjska oznaka") || writeMsdAtTheEndEnableCalculateFor.get()) { if (checkedItems.contains(CalculateFor.MORPHOSYNTACTIC_SPECS.toString()) || writeMsdAtTheEndEnableCalculateFor.get()) {
writeMsdAtTheEndChB.setDisable(false); writeMsdAtTheEndChB.setDisable(false);
} else { } else {
writeMsdAtTheEnd = false; writeMsdAtTheEnd = false;
@ -824,7 +824,7 @@ public class OneWordAnalysisTab {
} }
ngramProgressBar.progressProperty().unbind(); ngramProgressBar.progressProperty().unbind();
ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); // ngramProgressBar.setStyle(Settings.FX_ACCENT_OK);
progressLabel.textProperty().unbind(); progressLabel.textProperty().unbind();
progressLabel.setText(""); progressLabel.setText("");
cancel.setVisible(false); cancel.setVisible(false);
@ -835,7 +835,7 @@ public class OneWordAnalysisTab {
logger.error("Error while executing", e); logger.error("Error while executing", e);
ngramProgressBar.progressProperty().unbind(); ngramProgressBar.progressProperty().unbind();
ngramProgressBar.setProgress(0.0); ngramProgressBar.setProgress(0.0);
ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK); // ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK);
progressLabel.textProperty().unbind(); progressLabel.textProperty().unbind();
progressLabel.setText(""); progressLabel.setText("");
cancel.setVisible(false); cancel.setVisible(false);
@ -845,7 +845,7 @@ public class OneWordAnalysisTab {
showAlert(Alert.AlertType.INFORMATION, I18N.get("message.NOTIFICATION_ANALYSIS_CANCELED")); showAlert(Alert.AlertType.INFORMATION, I18N.get("message.NOTIFICATION_ANALYSIS_CANCELED"));
ngramProgressBar.progressProperty().unbind(); ngramProgressBar.progressProperty().unbind();
ngramProgressBar.setProgress(0.0); ngramProgressBar.setProgress(0.0);
ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); // ngramProgressBar.setStyle(Settings.FX_ACCENT_OK);
progressLabel.textProperty().unbind(); progressLabel.textProperty().unbind();
progressLabel.setText(""); progressLabel.setText("");
cancel.setVisible(false); cancel.setVisible(false);

View File

@ -305,10 +305,16 @@ public class StringAnalysisTabNew2 {
// set // set
notePunctuationsChB.selectedProperty().addListener((observable, oldValue, newValue) -> { notePunctuationsChB.selectedProperty().addListener((observable, oldValue, newValue) -> {
notePunctuations = newValue; notePunctuations = newValue;
if(skipValue > 0 || notePunctuations){
collocabilityCCB.setDisable(true);
} else {
collocabilityCCB.setDisable(false);
}
logger.info("note punctuations: ", notePunctuations); logger.info("note punctuations: ", notePunctuations);
}); });
notePunctuationsChB.setSelected(false); notePunctuationsChB.setSelected(false);
notePunctuationsChB.setTooltip(new Tooltip(I18N.get("message.TOOLTIP_readNotePunctuationsChB"))); notePunctuationsChB.setTooltip(new Tooltip(I18N.get("message.TOOLTIP_readNotePunctuationsChB")));
notePunctuationsChB.setDisable(false);
displayTaxonomy = false; displayTaxonomy = false;
displayTaxonomyChB.setSelected(false); displayTaxonomyChB.setSelected(false);
@ -439,6 +445,13 @@ public class StringAnalysisTabNew2 {
checkedItems.add(Collocability.factory(el)); checkedItems.add(Collocability.factory(el));
} }
collocability.addAll(checkedItems); collocability.addAll(checkedItems);
if(collocability.size() > 0) {
notePunctuationsChB.setDisable(true);
skipValueCB.setDisable(true);
} else {
notePunctuationsChB.setDisable(false);
skipValueCB.setDisable(false);
}
logger.info(String.format("Selected collocabilities: %s", StringUtils.join(collocabilityCCB.getCheckModel().getCheckedItems(), ","))); logger.info(String.format("Selected collocabilities: %s", StringUtils.join(collocabilityCCB.getCheckModel().getCheckedItems(), ",")));
} }
}; };
@ -446,6 +459,7 @@ public class StringAnalysisTabNew2 {
collocabilityCCB.getCheckModel().clearChecks(); collocabilityCCB.getCheckModel().clearChecks();
collocabilityCCB.getItems().removeAll(); collocabilityCCB.getItems().removeAll();
collocabilityCCB.getItems().setAll(FXCollections.observableArrayList(COLLOCABILITY_ITEMS)); collocabilityCCB.getItems().setAll(FXCollections.observableArrayList(COLLOCABILITY_ITEMS));
collocabilityCCB.setDisable(false);
collocabilityCCB.getCheckModel().getCheckedItems().addListener(collocabilityListener); collocabilityCCB.getCheckModel().getCheckedItems().addListener(collocabilityListener);
// collocabilityCCB.getCheckModel().getCheckedItems().addListener((ListChangeListener<String>) c -> { // collocabilityCCB.getCheckModel().getCheckedItems().addListener((ListChangeListener<String>) c -> {
@ -566,9 +580,15 @@ public class StringAnalysisTabNew2 {
// skip // skip
skipValueCB.valueProperty().addListener((observable, oldValue, newValue) -> { skipValueCB.valueProperty().addListener((observable, oldValue, newValue) -> {
skipValue = Integer.valueOf(newValue); skipValue = Integer.valueOf(newValue);
if(skipValue > 0 || notePunctuations) {
collocabilityCCB.setDisable(true);
} else {
collocabilityCCB.setDisable(false);
}
logger.info("Skip " + skipValue); logger.info("Skip " + skipValue);
}); });
skipValueCB.setDisable(false);
skipValueCB.getSelectionModel().select(0); skipValueCB.getSelectionModel().select(0);
skipValue = 0; skipValue = 0;
@ -973,7 +993,7 @@ public class StringAnalysisTabNew2 {
} }
xml_processing.isCancelled = isCancelled(); xml_processing.isCancelled = isCancelled();
updateProgress((iFinal * 100) + ((ReadOnlyDoubleWrapper) observable).get() + 1, corpusSize * 100); updateProgress((iFinal * 100) + ((ReadOnlyDoubleWrapper) observable).get() + 1, corpusSize * 100);
updateMessage(String.format(I18N.get("message.ONGOING_NOTIFICATION_ANALYZING_FILE_X_OF_Y"), iFinal + 1, corpusSize, f.getName(), remainingSeconds)); updateMessage(String.format(I18N.get("message.ONGOING_NOTIFICATION_ANALYZING_FILE_X_OF_Y"), 1, 1, f.getName(), remainingSeconds));
} }
}; };
@ -1037,7 +1057,7 @@ public class StringAnalysisTabNew2 {
// } // }
// //
ngramProgressBar.progressProperty().unbind(); ngramProgressBar.progressProperty().unbind();
ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); // ngramProgressBar.setStyle(Settings.FX_ACCENT_OK);
progressLabel.textProperty().unbind(); progressLabel.textProperty().unbind();
progressLabel.setText(""); progressLabel.setText("");
cancel.setVisible(false); cancel.setVisible(false);
@ -1048,7 +1068,7 @@ public class StringAnalysisTabNew2 {
logger.error("Error while executing", e); logger.error("Error while executing", e);
ngramProgressBar.progressProperty().unbind(); ngramProgressBar.progressProperty().unbind();
ngramProgressBar.setProgress(0.0); ngramProgressBar.setProgress(0.0);
ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK); // ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK);
progressLabel.textProperty().unbind(); progressLabel.textProperty().unbind();
progressLabel.setText(""); progressLabel.setText("");
cancel.setVisible(false); cancel.setVisible(false);
@ -1058,7 +1078,7 @@ public class StringAnalysisTabNew2 {
showAlert(Alert.AlertType.INFORMATION, I18N.get("message.NOTIFICATION_ANALYSIS_CANCELED")); showAlert(Alert.AlertType.INFORMATION, I18N.get("message.NOTIFICATION_ANALYSIS_CANCELED"));
ngramProgressBar.progressProperty().unbind(); ngramProgressBar.progressProperty().unbind();
ngramProgressBar.setProgress(0.0); ngramProgressBar.setProgress(0.0);
ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); // ngramProgressBar.setStyle(Settings.FX_ACCENT_OK);
progressLabel.textProperty().unbind(); progressLabel.textProperty().unbind();
progressLabel.setText(""); progressLabel.setText("");
cancel.setVisible(false); cancel.setVisible(false);
@ -1135,7 +1155,7 @@ public class StringAnalysisTabNew2 {
} }
xml_processing.isCancelled = isCancelled(); xml_processing.isCancelled = isCancelled();
updateProgress((iFinal * 100) + ((ReadOnlyDoubleWrapper) observable).get() + 1, corpusSize * 100); updateProgress((iFinal * 100) + ((ReadOnlyDoubleWrapper) observable).get() + 1, corpusSize * 100);
updateMessage(String.format(I18N.get("message.ONGOING_NOTIFICATION_ANALYZING_FILE_X_OF_Y"), iFinal + 1, corpusSize, f.getName(), remainingSeconds)); updateMessage(String.format(I18N.get("message.ONGOING_NOTIFICATION_ANALYZING_FILE_X_OF_Y"), 1, 1, f.getName(), remainingSeconds));
} }
}; };
@ -1202,7 +1222,7 @@ public class StringAnalysisTabNew2 {
logger.error("Out of memory error", e1); logger.error("Out of memory error", e1);
} }
ngramProgressBar.progressProperty().unbind(); ngramProgressBar.progressProperty().unbind();
ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); // ngramProgressBar.setStyle(Settings.FX_ACCENT_OK);
progressLabel.textProperty().unbind(); progressLabel.textProperty().unbind();
progressLabel.setText(""); progressLabel.setText("");
cancel.setVisible(false); cancel.setVisible(false);
@ -1216,7 +1236,7 @@ public class StringAnalysisTabNew2 {
logger.error("Error while executing", e); logger.error("Error while executing", e);
ngramProgressBar.progressProperty().unbind(); ngramProgressBar.progressProperty().unbind();
ngramProgressBar.setProgress(0.0); ngramProgressBar.setProgress(0.0);
ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK); // ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK);
progressLabel.textProperty().unbind(); progressLabel.textProperty().unbind();
progressLabel.setText(""); progressLabel.setText("");
cancel.setVisible(false); cancel.setVisible(false);
@ -1226,7 +1246,7 @@ public class StringAnalysisTabNew2 {
showAlert(Alert.AlertType.INFORMATION, I18N.get("message.NOTIFICATION_ANALYSIS_CANCELED")); showAlert(Alert.AlertType.INFORMATION, I18N.get("message.NOTIFICATION_ANALYSIS_CANCELED"));
ngramProgressBar.progressProperty().unbind(); ngramProgressBar.progressProperty().unbind();
ngramProgressBar.setProgress(0.0); ngramProgressBar.setProgress(0.0);
ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); // ngramProgressBar.setStyle(Settings.FX_ACCENT_OK);
progressLabel.textProperty().unbind(); progressLabel.textProperty().unbind();
progressLabel.setText(""); progressLabel.setText("");
cancel.setVisible(false); cancel.setVisible(false);

View File

@ -972,7 +972,7 @@ public class WordLevelTab {
} }
ngramProgressBar.progressProperty().unbind(); ngramProgressBar.progressProperty().unbind();
ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); // ngramProgressBar.setStyle(Settings.FX_ACCENT_OK);
progressLabel.textProperty().unbind(); progressLabel.textProperty().unbind();
progressLabel.setText(""); progressLabel.setText("");
cancel.setVisible(false); cancel.setVisible(false);
@ -983,7 +983,7 @@ public class WordLevelTab {
logger.error("Error while executing", e); logger.error("Error while executing", e);
ngramProgressBar.progressProperty().unbind(); ngramProgressBar.progressProperty().unbind();
ngramProgressBar.setProgress(0.0); ngramProgressBar.setProgress(0.0);
ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK); // ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK);
progressLabel.textProperty().unbind(); progressLabel.textProperty().unbind();
progressLabel.setText(""); progressLabel.setText("");
cancel.setVisible(false); cancel.setVisible(false);
@ -993,7 +993,7 @@ public class WordLevelTab {
showAlert(Alert.AlertType.INFORMATION, I18N.get("message.NOTIFICATION_ANALYSIS_CANCELED")); showAlert(Alert.AlertType.INFORMATION, I18N.get("message.NOTIFICATION_ANALYSIS_CANCELED"));
ngramProgressBar.progressProperty().unbind(); ngramProgressBar.progressProperty().unbind();
ngramProgressBar.setProgress(0.0); ngramProgressBar.setProgress(0.0);
ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); // ngramProgressBar.setStyle(Settings.FX_ACCENT_OK);
progressLabel.textProperty().unbind(); progressLabel.textProperty().unbind();
progressLabel.setText(""); progressLabel.setText("");
cancel.setVisible(false); cancel.setVisible(false);