Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
3. SvgFileViewPanel with some log
  • Loading branch information
homebeaver committed Oct 12, 2022
1 parent 67b3bf0 commit 9d5eacc
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,19 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;

/**
* Panel that hosts SVG-based gallery buttons.
*
* @author Kirill Grouchnikov
* @author EUG https://github.com/homebeaver (to reproduce issue 413)
*/
@SuppressWarnings("serial")
public class SvgFileViewPanel extends JCommandButtonPanel {

private static final Logger LOG = Logger.getLogger(SvgFileViewPanel.class.getName());

/**
* Callback into the underlying breadcrumb bar.
*/
Expand Down Expand Up @@ -100,6 +106,7 @@ public SvgFileViewPanel(BreadcrumbBarContentProvider<File> callback, int startin
* @param leafs Information on the files to show in the panel.
*/
public void setFolder(final java.util.List<BreadcrumbItem<File>> leafs) {
LOG.info("List<BreadcrumbItem<File>> leafs:"+leafs + ", size="+leafs.size());
this.getProjection().getContentModel().removeAllCommandGroups();

List<Command> commands = new ArrayList<>();
Expand All @@ -110,7 +117,7 @@ public void setFolder(final java.util.List<BreadcrumbItem<File>> leafs) {
if (!fileName.endsWith(".svg") && !fileName.endsWith(".svgz")) {
continue;
}

System.out.println("fileName="+fileName);
Command svgCommand = Command.builder()
.setText(fileName.replace('-', ' '))
.setIconFactory(EmptyRadianceIcon.factory())
Expand Down Expand Up @@ -159,7 +166,7 @@ public void setFolder(final java.util.List<BreadcrumbItem<File>> leafs) {

this.getProjection().getContentModel().addCommandGroup(new CommandGroup(commands));

mainWorker = new SwingWorker<>() {
mainWorker = new SwingWorker<Void, KeyValuePair<String, InputStream>>() {
@Override
protected Void doInBackground() throws Exception {
for (final BreadcrumbItem<File> leaf : leafs) {
Expand Down

0 comments on commit 9d5eacc

Please sign in to comment.