From a390222aeb0c5bf6982108e6fc0b492e97e43b39 Mon Sep 17 00:00:00 2001 From: bjculkin Date: Thu, 26 Apr 2018 09:14:19 -0400 Subject: Fix stupid pipeline bug --- src/bjc/imgchain/ImgViewer.java | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/bjc/imgchain/ImgViewer.java') diff --git a/src/bjc/imgchain/ImgViewer.java b/src/bjc/imgchain/ImgViewer.java index 6876514..d632ef8 100644 --- a/src/bjc/imgchain/ImgViewer.java +++ b/src/bjc/imgchain/ImgViewer.java @@ -72,8 +72,7 @@ public class ImgViewer extends JInternalFrame { e.printStackTrace(); - JOptionPane.showInternalMessageDialog(null, msg, "Error loading image", - JOptionPane.ERROR_MESSAGE); + JOptionPane.showInternalMessageDialog(null, msg, "Error loading image", JOptionPane.ERROR_MESSAGE); } } } @@ -91,7 +90,7 @@ public class ImgViewer extends JInternalFrame { private JLabel lab; public ImgViewer(ImgChain desk, File img) { - super("Image Viewer - " + img.getName(), true, true, true, true); + super("Image Viewer - " + img.getName(), false, true, true, true); initted = false; this.img = img; @@ -155,11 +154,10 @@ public class ImgViewer extends JInternalFrame { e.printStackTrace(); - JOptionPane.showInternalMessageDialog(null, msg, "Error saving image", - JOptionPane.ERROR_MESSAGE); + JOptionPane.showInternalMessageDialog(null, msg, "Error saving image", JOptionPane.ERROR_MESSAGE); } }); - + JMenuItem storeImage = new JMenuItem("Stash Image to Memory"); storeImage.setMnemonic('T'); storeImage.addActionListener((ev) -> { @@ -219,8 +217,12 @@ public class ImgViewer extends JInternalFrame { Pipeline pipeline = ImgChain.chan.pipelineRepo.get(pick.pipeName); - icon.setImage(pipeline.process(Utils.toBuffered(icon.getImage()))); - lab.repaint(); + BufferedImage bufimg = Utils.toBuffered(icon.getImage()); + + Image processed = pipeline.process(bufimg); + + Utils.displayImage(processed, "Pipeline Results"); + }); editMenu.addSeparator(); @@ -250,8 +252,7 @@ public class ImgViewer extends JInternalFrame { e.printStackTrace(); - JOptionPane.showInternalMessageDialog(this, msg, "Error loading image", - JOptionPane.ERROR_MESSAGE); + JOptionPane.showInternalMessageDialog(this, msg, "Error loading image", JOptionPane.ERROR_MESSAGE); } return lab; -- cgit v1.2.3