private void CharCountSliderStateChanged( javax.swing.event.ChangeEvent evt) { // GEN-FIRST:event_CharCountSliderStateChanged if (CharCountSlider.getMinimum() == CharCountSlider.getValue()) { CharCount.setText("Any"); } else { CharCount.setText(CharCountSlider.getValue() + ((human == false) ? "+" : "")); } if (human == false) {} UPDATED(); } // GEN-LAST:event_CharCountSliderStateChanged
private void FilterKeyReleased(java.awt.event.KeyEvent evt) { // GEN-FIRST:event_FilterKeyReleased if (human == false) { if (CharCountSlider.getMinimum() <= Filter.getText().length()) { CharCountSlider.setValue(Filter.getText().length()); } } else { if (CharCountSlider.getMinimum() == CharCountSlider.getValue()) { human = false; CharCountSlider.setValue(Filter.getText().length()); } } UPDATED(); } // GEN-LAST:event_FilterKeyReleased
public void UPDATED() { int tI1 = 0; String[] AllLines = DICTIONARY.getText().toLowerCase().split("\r\n|\r|\n"); int[] sizes = CountMinMaxDictionarySizes(AllLines); CharCountSlider.setMinimum(sizes[0]); CharCountSlider.setMaximum(sizes[1]); int value = CharCountSlider.getValue(); if (CharCountSlider.getMinimum() == value) { value = 0; } boolean AnyValue = (value == 0) ? true : false; CountDictionary: { if (AnyValue) { tI1 = AllLines.length; break CountDictionary; } for (int i = 0; i < AllLines.length; i++) { if (AllLines[i].length() == value) { tI1++; } else if (human == false && AllLines[i].length() > value) { tI1++; } } } if (AnyValue || human == false) { tI1 = AllLines.length; } String[] newPOSS = new String[tI1]; int rI1 = 0; CountGoodies: { if (AnyValue) { newPOSS = AllLines; break CountGoodies; } for (int i = 0; i < AllLines.length; i++) { if (AllLines[i].length() == value) { newPOSS[rI1] = AllLines[i].toLowerCase(); rI1++; } else if (human == false && AllLines[i].length() > value) { newPOSS[rI1] = AllLines[i].toLowerCase(); rI1++; } } } segment: { if (SEGMENT.getText().length() == 0) { break segment; } int CI1 = 0; for (int i = 0; i < newPOSS.length; i++) { if (newPOSS[i].contains(SEGMENT.getText())) { CI1++; } } int RI1 = 0; String[] repPOSS = new String[CI1]; for (int i = 0; i < newPOSS.length; i++) { if (newPOSS[i].contains(SEGMENT.getText())) { repPOSS[RI1] = newPOSS[i]; RI1++; } } newPOSS = repPOSS; } Charact: { if (Characters.getText().length() >= 1) { } else { break Charact; } int CI1 = 0; for (int i = 0; i < newPOSS.length; i++) { if (DoesStringContainThese(newPOSS[i], Characters.getText())) { CI1++; } } int RI1 = 0; String[] repPOSS = new String[CI1]; for (int i = 0; i < newPOSS.length; i++) { if (DoesStringContainThese(newPOSS[i], Characters.getText())) { repPOSS[RI1] = newPOSS[i]; RI1++; } } newPOSS = repPOSS; } NotCharact: { int CI1 = 0; for (int i = 0; i < newPOSS.length; i++) { if (DoesStringNotContainThese(newPOSS[i], NEGCharacters.getText())) { CI1++; } } int RI1 = 0; String[] repPOSS = new String[CI1]; for (int i = 0; i < newPOSS.length; i++) { if (DoesStringNotContainThese(newPOSS[i], NEGCharacters.getText())) { repPOSS[RI1] = newPOSS[i]; RI1++; } } newPOSS = repPOSS; } filter: { if (Filter.getText().length() >= 1) { } else { break filter; } int CI1 = 0; for (int i = 0; i < newPOSS.length; i++) { if (DoesStringMatchFilter(newPOSS[i], Filter.getText())) { CI1++; } } int RI1 = 0; String[] repPOSS = new String[CI1]; for (int i = 0; i < newPOSS.length; i++) { if (DoesStringMatchFilter(newPOSS[i], Filter.getText())) { repPOSS[RI1] = newPOSS[i]; RI1++; } } newPOSS = repPOSS; } Finalize: { String finished = ""; for (int i = 0; i < newPOSS.length; i++) { finished = finished + newPOSS[i] + "\n"; } POSS.setText(finished); } }