From 7ce8b83d16c076d80881f84355ee2b0598d35acf Mon Sep 17 00:00:00 2001 From: Luka Date: Sat, 26 Jan 2019 09:53:16 +0100 Subject: [PATCH] Fixed progress bar color changing --- src/main/java/alg/XML_processing.java | 4 +- src/main/java/data/Corpus.java | 2 +- src/main/java/data/StatisticsNew.java | 22 ++++++---- src/main/java/data/Tax.java | 10 ++--- src/main/java/data/Taxonomy.java | 22 ++++------ src/main/java/gui/CharacterAnalysisTab.java | 6 +-- src/main/java/gui/CorpusTab.java | 45 ++++++++++++++------ src/main/java/gui/OneWordAnalysisTab.java | 8 ++-- src/main/java/gui/StringAnalysisTabNew2.java | 36 ++++++++++++---- src/main/java/gui/WordLevelTab.java | 6 +-- 10 files changed, 99 insertions(+), 62 deletions(-) diff --git a/src/main/java/alg/XML_processing.java b/src/main/java/alg/XML_processing.java index 5d4ebcd..16c45b7 100755 --- a/src/main/java/alg/XML_processing.java +++ b/src/main/java/alg/XML_processing.java @@ -971,7 +971,7 @@ public class XML_processing { } // 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 // they differ by not having the attribute "ref", so test will equal null Attribute tax = startElement.getAttributeByName(QName.valueOf("ref")); @@ -983,7 +983,7 @@ public class XML_processing { // Tax taxonomy = new Tax(); // 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 Attribute tax = startElement.getAttributeByName(QName.valueOf("target")); diff --git a/src/main/java/data/Corpus.java b/src/main/java/data/Corpus.java index 95d2d48..3a3ff18 100755 --- a/src/main/java/data/Corpus.java +++ b/src/main/java/data/Corpus.java @@ -47,7 +47,7 @@ public class Corpus { } public void setCorpusName(String corpusName) { - System.out.println(corpusName); +// System.out.println(corpusName); this.corpusName = corpusName; logger.info("Corpus.set: ", corpusName); } diff --git a/src/main/java/data/StatisticsNew.java b/src/main/java/data/StatisticsNew.java index a47a59d..01a49eb 100755 --- a/src/main/java/data/StatisticsNew.java +++ b/src/main/java/data/StatisticsNew.java @@ -621,7 +621,7 @@ public class StatisticsNew { // String sep = ""; for (String s : tax) { - if (s == null) { + if (corpus.getTaxonomy().size() == 0 || s == null) { continue; } @@ -680,16 +680,20 @@ public class StatisticsNew { long sum_fwi =0L; long mul_fwi =1L; - for(MultipleHMKeys smallHmKey : hmKey.getSplittedMultipleHMKeys()){ +// 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()){ // System.out.println(smallHmKey.getK1()); - sum_fwi += oneWordTaxonomyResult.get(corpus.getTotal()).get(smallHmKey).longValue(); - mul_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(); + } // String t = hmKey.getK1(); -// if(hmKey.getK1().equals("v Slovenija")){ -// System.out.println("TEST"); -// -// } + if(mul_fwi < 0){ + mul_fwi = Long.MAX_VALUE; + } + double O = (double)taxonomyResult.get(corpus.getTotal()).get(hmKey).longValue(); double n = (double)filter.getNgramValue(); double E = (double)mul_fwi / Math.pow(N, n - 1); diff --git a/src/main/java/data/Tax.java b/src/main/java/data/Tax.java index 3e708e8..2687fd1 100755 --- a/src/main/java/data/Tax.java +++ b/src/main/java/data/Tax.java @@ -104,11 +104,11 @@ public class Tax { public static ObservableList getTaxonomyForComboBox(CorpusType corpusType, HashSet foundTax) { LinkedHashMap 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; } else if (corpusType == CorpusType.GOS) { 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 ArrayList sortedFoundTaxonomy = new ArrayList<>(foundTax); Collections.sort(sortedFoundTaxonomy); @@ -147,7 +147,7 @@ public class Tax { LinkedHashMap tax = new LinkedHashMap<>(); Set 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; } else if (corpus.getCorpusType() == CorpusType.GOS) { tax = GOS_TAXONOMY; @@ -264,11 +264,11 @@ public class Tax { LinkedHashMap tax = new LinkedHashMap<>(); ArrayList 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; } else if (corpusType == CorpusType.GOS) { tax = GOS_TAXONOMY; - } else if (corpusType == CorpusType.VERT) { + } else if (corpusType == CorpusType.VERT || corpusType == CorpusType.SSJ500K || corpusType == CorpusType.GIGAFIDA2) { for (Taxonomy t : taxonomy) { result.add(t.toLongNameString()); } diff --git a/src/main/java/data/Taxonomy.java b/src/main/java/data/Taxonomy.java index a4da582..b04f762 100755 --- a/src/main/java/data/Taxonomy.java +++ b/src/main/java/data/Taxonomy.java @@ -477,17 +477,13 @@ enum TaxonomyEnum { } } -// return new Taxonomy(tax, tax); - System.out.println("2."); - System.out.println(tax); - return null; } public static ArrayList taxonomySelected(TaxonomyEnum disjointTaxonomy) { ArrayList r = new ArrayList<>(); - System.out.println(disjointTaxonomy); +// System.out.println(disjointTaxonomy); if(disjointTaxonomy.equals(DISKURZ)){ r.add(DISKURZ_JAVNI); r.add(DISKURZ_INFORMATIVNO_IZOBRAZEVALNI); @@ -700,8 +696,8 @@ enum TaxonomyEnum { } public static ArrayList convertStringListToTaxonomyList(ObservableList stringList, Corpus corpus){ - System.out.println("1."); - System.out.println(stringList); +// System.out.println("1."); +// System.out.println(stringList); ArrayList taxonomyList = new ArrayList<>(); // System.out.println("INTERESTING STUFF"); @@ -720,10 +716,10 @@ enum TaxonomyEnum { public static void modifyingTaxonomy(ArrayList taxonomy, ArrayList checkedItemsTaxonomy, Corpus corpus){ // get taxonomies that were selected/deselected by user - System.out.println("Print here:"); - System.out.println(taxonomy); - System.out.println(checkedItemsTaxonomy); - System.out.println("-------------"); +// System.out.println("Print here:"); +// System.out.println(taxonomy); +// System.out.println(checkedItemsTaxonomy); +// System.out.println("-------------"); Set disjointTaxonomies = new HashSet<>(checkedItemsTaxonomy); if (taxonomy != null) { @@ -923,7 +919,7 @@ public class Taxonomy { } public static ArrayList taxonomyToTaxonomyEnum(ArrayList taxonomy){ - System.out.println(taxonomy); +// System.out.println(taxonomy); if (taxonomy == null) { return null; } @@ -958,7 +954,7 @@ public class Taxonomy { public static ArrayList modifyingTaxonomy(ArrayList taxonomy, ObservableList checkedItems, Corpus corpus){ ArrayList 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); return taxonomyEnumToTaxonomy(checkedItemsTaxonomy, corpus); } else { diff --git a/src/main/java/gui/CharacterAnalysisTab.java b/src/main/java/gui/CharacterAnalysisTab.java index 4e96fc1..c0ab38a 100755 --- a/src/main/java/gui/CharacterAnalysisTab.java +++ b/src/main/java/gui/CharacterAnalysisTab.java @@ -735,7 +735,7 @@ public class CharacterAnalysisTab { } ngramProgressBar.progressProperty().unbind(); - ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); +// ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); progressLabel.textProperty().unbind(); progressLabel.setText(""); cancel.setVisible(false); @@ -746,7 +746,7 @@ public class CharacterAnalysisTab { logger.error("Error while executing", e); ngramProgressBar.progressProperty().unbind(); ngramProgressBar.setProgress(0.0); - ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK); +// ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK); progressLabel.textProperty().unbind(); progressLabel.setText(""); cancel.setVisible(false); @@ -756,7 +756,7 @@ public class CharacterAnalysisTab { showAlert(Alert.AlertType.INFORMATION, I18N.get("message.NOTIFICATION_ANALYSIS_CANCELED")); ngramProgressBar.progressProperty().unbind(); ngramProgressBar.setProgress(0.0); - ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); +// ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); progressLabel.textProperty().unbind(); progressLabel.setText(""); cancel.setVisible(false); diff --git a/src/main/java/gui/CorpusTab.java b/src/main/java/gui/CorpusTab.java index 9fd3d7f..0255ee4 100755 --- a/src/main/java/gui/CorpusTab.java +++ b/src/main/java/gui/CorpusTab.java @@ -109,7 +109,7 @@ public class CorpusTab { @FXML public TextField outputNameTF; - public String outputName; + public String outputName = ""; @FXML public ComboBox selectReaderCB; @@ -144,7 +144,7 @@ public class CorpusTab { private String corpusLocation; 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 SELECT_READER = new ArrayList<>(Arrays.asList(SELECT_READER_ARRAY)); private Collection corpusFiles; private File selectedDirectory; @@ -207,7 +207,7 @@ public class CorpusTab { selectReader = newValue; selectReader(); if(corpus != null && corpus.getCorpusType() != null) { - changeCorpus(); + changeCorpus(false); } logger.info("calculateForCB:", newValue); }); @@ -226,6 +226,9 @@ public class CorpusTab { readHeaderInfoChB.selectedProperty().addListener((observable, oldValue, newValue) -> { readHeaderInfo = newValue; + if(corpusFiles != null) { + changeCorpus(false); + } logger.info("read headers: ", readHeaderInfo); }); // readHeaderInfoChB.setTooltip(new Tooltip(I18N.get("message.TOOLTIP_readHeaderInfoChB"))); @@ -337,12 +340,12 @@ public class CorpusTab { // scan for xml files 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 if (corpusFiles.size() == 0) { // try .vert @@ -381,6 +384,11 @@ public class CorpusTab { logger.debug(result); initNewCorpus(selectedDirectory, corpusFiles); + if(resetResultsLocation){ + chooseResultsLocation(selectedDirectory); + } else { + chooseResultsLocation(new File(chooseResultsLabelContent)); + } Messages.setChooseCorpusProperties(corpusLocation, corpusFilesSize, corpusType.toString()); corpus.setChosenCorpusLocation(selectedDirectory); @@ -399,7 +407,7 @@ public class CorpusTab { } } else { - System.out.println(corpusLocation); +// System.out.println(corpusLocation); corpusLocation = selectedDirectory.getAbsolutePath(); corpusFilesSize = String.valueOf(corpusFiles.size()); Messages.setChooseCorpusProperties(corpusLocation, corpusFilesSize, corpusType != null ? corpusType.toString() : null); @@ -422,6 +430,11 @@ public class CorpusTab { } else { initNewCorpus(selectedDirectory, corpusFiles); + if(resetResultsLocation){ + chooseResultsLocation(selectedDirectory); + } else { + chooseResultsLocation(new File(chooseResultsLabelContent)); + } Messages.setChooseCorpusProperties(corpusLocation, corpusFilesSize, corpusType.toString()); corpus.setChosenCorpusLocation(selectedDirectory); @@ -439,6 +452,7 @@ public class CorpusTab { } } } + System.out.println(outputName); corpus.setCorpusName(outputName); } @@ -453,7 +467,6 @@ public class CorpusTab { corpus.setCorpusType(corpusType); corpus.setDetectedCorpusFiles(corpusFiles); corpus.setChosenCorpusLocation(selectedDirectory); - chooseResultsLocation(selectedDirectory); } private void chooseResultsLocation(File dir) { @@ -521,7 +534,7 @@ public class CorpusTab { 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; final Task> task = new Task>() { @@ -557,6 +570,16 @@ public class CorpusTab { if (ValidationUtil.isEmpty(readTaxonomy)) { // 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."); GUIController.showAlert(Alert.AlertType.ERROR, I18N.get("message.WARNING_NO_TAXONOMY_FOUND")); } else { @@ -789,9 +812,6 @@ public class CorpusTab { case "Gigafida (old)": corpusType = GIGAFIDA; break; - case "Kres (old)": - corpusType = CCKRES; - break; default: logger.debug("No output detected!"); break; @@ -804,7 +824,6 @@ public class CorpusTab { File f = corpusFiles.iterator().next(); String title = XML_processing.readXMLHeaderTag(f.getAbsolutePath(), "title").toLowerCase(); String attrib = XML_processing.readXMLHeaderAttribute(f.getAbsolutePath(), "body", "base").toLowerCase(); - String test = CCKRES.getNameLowerCase(); String debug = ""; // check if XML file's title contains any of recognized corpus titles @@ -818,8 +837,6 @@ public class CorpusTab { } else { corpusType = GIGAFIDA2; } - } else if (title.contains(CCKRES.getNameLowerCase())) { - corpusType = CCKRES; } else if (title.contains(GOS.getNameLowerCase())) { corpusType = GOS; } else if (attrib.contains(SSJ500K.getNameLowerCase())) { diff --git a/src/main/java/gui/OneWordAnalysisTab.java b/src/main/java/gui/OneWordAnalysisTab.java index 0f00ae2..ce829ef 100755 --- a/src/main/java/gui/OneWordAnalysisTab.java +++ b/src/main/java/gui/OneWordAnalysisTab.java @@ -364,7 +364,7 @@ public class OneWordAnalysisTab { alsoVisualize = new ArrayList<>(); ObservableList checkedItems = alsoVisualizeCCB.getCheckModel().getCheckedItems(); alsoVisualize.addAll(checkedItems); - if (checkedItems.contains("oblikoskladenjska oznaka") || writeMsdAtTheEndEnableCalculateFor.get()) { + if (checkedItems.contains(CalculateFor.MORPHOSYNTACTIC_SPECS.toString()) || writeMsdAtTheEndEnableCalculateFor.get()) { writeMsdAtTheEndChB.setDisable(false); } else { writeMsdAtTheEnd = false; @@ -824,7 +824,7 @@ public class OneWordAnalysisTab { } ngramProgressBar.progressProperty().unbind(); - ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); +// ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); progressLabel.textProperty().unbind(); progressLabel.setText(""); cancel.setVisible(false); @@ -835,7 +835,7 @@ public class OneWordAnalysisTab { logger.error("Error while executing", e); ngramProgressBar.progressProperty().unbind(); ngramProgressBar.setProgress(0.0); - ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK); +// ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK); progressLabel.textProperty().unbind(); progressLabel.setText(""); cancel.setVisible(false); @@ -845,7 +845,7 @@ public class OneWordAnalysisTab { showAlert(Alert.AlertType.INFORMATION, I18N.get("message.NOTIFICATION_ANALYSIS_CANCELED")); ngramProgressBar.progressProperty().unbind(); ngramProgressBar.setProgress(0.0); - ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); +// ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); progressLabel.textProperty().unbind(); progressLabel.setText(""); cancel.setVisible(false); diff --git a/src/main/java/gui/StringAnalysisTabNew2.java b/src/main/java/gui/StringAnalysisTabNew2.java index df328d1..155ef32 100755 --- a/src/main/java/gui/StringAnalysisTabNew2.java +++ b/src/main/java/gui/StringAnalysisTabNew2.java @@ -305,10 +305,16 @@ public class StringAnalysisTabNew2 { // set notePunctuationsChB.selectedProperty().addListener((observable, oldValue, newValue) -> { notePunctuations = newValue; + if(skipValue > 0 || notePunctuations){ + collocabilityCCB.setDisable(true); + } else { + collocabilityCCB.setDisable(false); + } logger.info("note punctuations: ", notePunctuations); }); notePunctuationsChB.setSelected(false); notePunctuationsChB.setTooltip(new Tooltip(I18N.get("message.TOOLTIP_readNotePunctuationsChB"))); + notePunctuationsChB.setDisable(false); displayTaxonomy = false; displayTaxonomyChB.setSelected(false); @@ -439,6 +445,13 @@ public class StringAnalysisTabNew2 { checkedItems.add(Collocability.factory(el)); } 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(), ","))); } }; @@ -446,6 +459,7 @@ public class StringAnalysisTabNew2 { collocabilityCCB.getCheckModel().clearChecks(); collocabilityCCB.getItems().removeAll(); collocabilityCCB.getItems().setAll(FXCollections.observableArrayList(COLLOCABILITY_ITEMS)); + collocabilityCCB.setDisable(false); collocabilityCCB.getCheckModel().getCheckedItems().addListener(collocabilityListener); // collocabilityCCB.getCheckModel().getCheckedItems().addListener((ListChangeListener) c -> { @@ -566,9 +580,15 @@ public class StringAnalysisTabNew2 { // skip skipValueCB.valueProperty().addListener((observable, oldValue, newValue) -> { skipValue = Integer.valueOf(newValue); + if(skipValue > 0 || notePunctuations) { + collocabilityCCB.setDisable(true); + } else { + collocabilityCCB.setDisable(false); + } logger.info("Skip " + skipValue); }); + skipValueCB.setDisable(false); skipValueCB.getSelectionModel().select(0); skipValue = 0; @@ -973,7 +993,7 @@ public class StringAnalysisTabNew2 { } xml_processing.isCancelled = isCancelled(); 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.setStyle(Settings.FX_ACCENT_OK); +// ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); progressLabel.textProperty().unbind(); progressLabel.setText(""); cancel.setVisible(false); @@ -1048,7 +1068,7 @@ public class StringAnalysisTabNew2 { logger.error("Error while executing", e); ngramProgressBar.progressProperty().unbind(); ngramProgressBar.setProgress(0.0); - ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK); +// ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK); progressLabel.textProperty().unbind(); progressLabel.setText(""); cancel.setVisible(false); @@ -1058,7 +1078,7 @@ public class StringAnalysisTabNew2 { showAlert(Alert.AlertType.INFORMATION, I18N.get("message.NOTIFICATION_ANALYSIS_CANCELED")); ngramProgressBar.progressProperty().unbind(); ngramProgressBar.setProgress(0.0); - ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); +// ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); progressLabel.textProperty().unbind(); progressLabel.setText(""); cancel.setVisible(false); @@ -1135,7 +1155,7 @@ public class StringAnalysisTabNew2 { } xml_processing.isCancelled = isCancelled(); 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); } ngramProgressBar.progressProperty().unbind(); - ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); +// ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); progressLabel.textProperty().unbind(); progressLabel.setText(""); cancel.setVisible(false); @@ -1216,7 +1236,7 @@ public class StringAnalysisTabNew2 { logger.error("Error while executing", e); ngramProgressBar.progressProperty().unbind(); ngramProgressBar.setProgress(0.0); - ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK); +// ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK); progressLabel.textProperty().unbind(); progressLabel.setText(""); cancel.setVisible(false); @@ -1226,7 +1246,7 @@ public class StringAnalysisTabNew2 { showAlert(Alert.AlertType.INFORMATION, I18N.get("message.NOTIFICATION_ANALYSIS_CANCELED")); ngramProgressBar.progressProperty().unbind(); ngramProgressBar.setProgress(0.0); - ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); +// ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); progressLabel.textProperty().unbind(); progressLabel.setText(""); cancel.setVisible(false); diff --git a/src/main/java/gui/WordLevelTab.java b/src/main/java/gui/WordLevelTab.java index 4e2aeb8..a1f26c2 100755 --- a/src/main/java/gui/WordLevelTab.java +++ b/src/main/java/gui/WordLevelTab.java @@ -972,7 +972,7 @@ public class WordLevelTab { } ngramProgressBar.progressProperty().unbind(); - ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); +// ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); progressLabel.textProperty().unbind(); progressLabel.setText(""); cancel.setVisible(false); @@ -983,7 +983,7 @@ public class WordLevelTab { logger.error("Error while executing", e); ngramProgressBar.progressProperty().unbind(); ngramProgressBar.setProgress(0.0); - ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK); +// ngramProgressBar.setStyle(Settings.FX_ACCENT_NOK); progressLabel.textProperty().unbind(); progressLabel.setText(""); cancel.setVisible(false); @@ -993,7 +993,7 @@ public class WordLevelTab { showAlert(Alert.AlertType.INFORMATION, I18N.get("message.NOTIFICATION_ANALYSIS_CANCELED")); ngramProgressBar.progressProperty().unbind(); ngramProgressBar.setProgress(0.0); - ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); +// ngramProgressBar.setStyle(Settings.FX_ACCENT_OK); progressLabel.textProperty().unbind(); progressLabel.setText(""); cancel.setVisible(false);