re-ordered methods
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>BelegScanner</groupId>
|
||||
<artifactId>BelegScanner</artifactId>
|
||||
<version>0.0.13</version>
|
||||
<version>1.0.0</version>
|
||||
|
||||
<name>BelegScanner</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
@@ -123,7 +123,7 @@ public class MainFrame extends JFrame {
|
||||
};
|
||||
|
||||
private void checkScanButton() {
|
||||
toolbar.readyToScanX(!(isScanning || patchedPath==null || patchedPath.isBlank() || patchedPath.contains("$")));
|
||||
toolbar.readyToScan(!(isScanning || patchedPath==null || patchedPath.isBlank() || patchedPath.contains("$")));
|
||||
}
|
||||
|
||||
private void performScan(String path, Dimension dimension) {
|
||||
@@ -232,13 +232,6 @@ public class MainFrame extends JFrame {
|
||||
docTable.preview(path);
|
||||
}
|
||||
|
||||
private void setScanning(boolean scanning) {
|
||||
isScanning = scanning;
|
||||
checkScanButton();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private JPanel preview() {
|
||||
// https://stackoverflow.com/a/48248739/1285585
|
||||
JPanel pane = new JPanel(new BorderLayout());
|
||||
@@ -303,6 +296,12 @@ public class MainFrame extends JFrame {
|
||||
}
|
||||
|
||||
|
||||
private void setScanning(boolean scanning) {
|
||||
isScanning = scanning;
|
||||
checkScanButton();
|
||||
}
|
||||
|
||||
|
||||
private void updateConfig() {
|
||||
|
||||
String prefix = "app.categories."+category+".";
|
||||
|
||||
@@ -220,6 +220,16 @@ public class Toolbar extends JPanel {
|
||||
return date;
|
||||
}
|
||||
|
||||
private List<Object> deleteValue(JSONArray arr, String tx) {
|
||||
for (int i = 0; i<arr.length(); i++) {
|
||||
if (arr.get(i).equals(tx)) {
|
||||
arr.remove(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return arr.toList();
|
||||
}
|
||||
|
||||
private void dropCategory(String catName) {
|
||||
LOG.debug("dropCategory({})",catName);
|
||||
Object o = config.get("app.categories");
|
||||
@@ -234,6 +244,10 @@ public class Toolbar extends JPanel {
|
||||
return date.getSelectedDate();
|
||||
}
|
||||
|
||||
public int getResolution() {
|
||||
return resolution;
|
||||
}
|
||||
|
||||
|
||||
public SelectComboBox getSelector(JPanel panel) {
|
||||
if (panel != null && panel.getComponentCount()>1) {
|
||||
@@ -263,6 +277,10 @@ public class Toolbar extends JPanel {
|
||||
paths.add("$HOME/$JAHR/$MONAT-$TAG - $KATEGORIE");
|
||||
return new SelectComboBox(paths).onUpdateText(this::updatePath);
|
||||
}
|
||||
|
||||
public void readyToScan(boolean val) {
|
||||
scanButton.setEnabled(val);
|
||||
}
|
||||
|
||||
private Component scanButton() {
|
||||
scanButton = new JButton("scannen!");
|
||||
@@ -274,9 +292,7 @@ public class Toolbar extends JPanel {
|
||||
scanListeners.forEach(l->l.actionPerformed(evt));
|
||||
}
|
||||
|
||||
public void readyToScanX(boolean val) {
|
||||
scanButton.setEnabled(val);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void updateCat(String newCat) {
|
||||
@@ -313,15 +329,7 @@ public class Toolbar extends JPanel {
|
||||
} else LOG.debug("newCat is empty!");
|
||||
}
|
||||
|
||||
private List<Object> deleteValue(JSONArray arr, String tx) {
|
||||
for (int i = 0; i<arr.length(); i++) {
|
||||
if (arr.get(i).equals(tx)) {
|
||||
arr.remove(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return arr.toList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void updateDimensions() {
|
||||
@@ -348,7 +356,5 @@ public class Toolbar extends JPanel {
|
||||
}
|
||||
|
||||
|
||||
public int getResolution() {
|
||||
return resolution;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user