|
|
|
@ -251,7 +251,10 @@ public class Toolbar extends JPanel {
@@ -251,7 +251,10 @@ public class Toolbar extends JPanel {
|
|
|
|
|
date = new DateChooser(); |
|
|
|
|
Dimension dim = new Dimension(400, 250); |
|
|
|
|
date.setMaximumSize(dim); |
|
|
|
|
date.addActionListener(ev -> dateListeners.forEach(listener -> listener.setDate(date.getSelectedDate()))); |
|
|
|
|
date.addActionListener(ev -> { |
|
|
|
|
resetPage(); |
|
|
|
|
dateListeners.forEach(listener -> listener.setDate(date.getSelectedDate())); |
|
|
|
|
}); |
|
|
|
|
return date; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -353,6 +356,19 @@ public class Toolbar extends JPanel {
@@ -353,6 +356,19 @@ public class Toolbar extends JPanel {
|
|
|
|
|
return panel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Toolbar resetPage(){ |
|
|
|
|
var page = t("PAGE"); |
|
|
|
|
var panel = additonalComponents.get(page); |
|
|
|
|
if (panel == null) return this; |
|
|
|
|
for (var child : panel.getComponents()){ |
|
|
|
|
if (child instanceof SelectComboBox scb){ |
|
|
|
|
scb.setText("1"); |
|
|
|
|
fieldListeners.forEach(l -> l.setField(page,"1")); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Toolbar nextPage(){ |
|
|
|
|
var page = t("PAGE"); |
|
|
|
|
var panel = additonalComponents.get(page); |
|
|
|
@ -486,6 +502,7 @@ public class Toolbar extends JPanel {
@@ -486,6 +502,7 @@ public class Toolbar extends JPanel {
|
|
|
|
|
*/ |
|
|
|
|
private void updateCat(String newCat) { |
|
|
|
|
LOG.debug("updateCat({})",newCat); |
|
|
|
|
resetPage(); |
|
|
|
|
categoryListeners.forEach(l -> l.setCategory(newCat)); |
|
|
|
|
LOG.debug("Listeners notified."); |
|
|
|
|
if (!newCat.isEmpty()) { |
|
|
|
@ -515,7 +532,7 @@ public class Toolbar extends JPanel {
@@ -515,7 +532,7 @@ public class Toolbar extends JPanel {
|
|
|
|
|
LOG.debug("h: {}",h); |
|
|
|
|
height.setText(h == null ? Constants.DEFAULT_HEIGHT : h+""); |
|
|
|
|
updateDimensions(); |
|
|
|
|
} else LOG.debug("newCat is empty!"); |
|
|
|
|
} else LOG.debug("newCat is empty!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -553,6 +570,7 @@ public class Toolbar extends JPanel {
@@ -553,6 +570,7 @@ public class Toolbar extends JPanel {
|
|
|
|
|
*/ |
|
|
|
|
protected void updatePath(String newPath) { |
|
|
|
|
LOG.debug("updatePath({})",newPath); |
|
|
|
|
resetPage(); |
|
|
|
|
pathListeners.forEach(l -> l.setPath(newPath)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|