summaryrefslogtreecommitdiff
path: root/src/bjc/imgchain/ImgViewer.java
diff options
context:
space:
mode:
authorBen Culkin <scorpress@gmail.com>2020-10-06 19:15:51 -0400
committerBen Culkin <scorpress@gmail.com>2020-10-06 19:15:51 -0400
commitbdc3409184b28e2371c541a3d76b262d3f9f1f8e (patch)
treeeb3caf5c38326c668e4208b9d21129d03ebdb9ef /src/bjc/imgchain/ImgViewer.java
parentaa53ec99ef5a4ed95e010172975399e6a756c806 (diff)
Info cleanup
Diffstat (limited to 'src/bjc/imgchain/ImgViewer.java')
-rw-r--r--src/bjc/imgchain/ImgViewer.java39
1 files changed, 28 insertions, 11 deletions
diff --git a/src/bjc/imgchain/ImgViewer.java b/src/bjc/imgchain/ImgViewer.java
index e9e3278..fc5a944 100644
--- a/src/bjc/imgchain/ImgViewer.java
+++ b/src/bjc/imgchain/ImgViewer.java
@@ -24,20 +24,26 @@ import bjc.imgchain.pipeline.Pipeline;
import bjc.imgchain.pipeline.PipelinePicker;
import bjc.imgchain.utils.Utils;
+/**
+ * Image viewer panel.
+ *
+ * @author Ben Culkin
+ *
+ */
public class ImgViewer extends JInternalFrame {
private final class ReloadImageListener implements ActionListener {
- private final File img;
+ private final File imge;
ReloadImageListener(File img) {
- this.img = img;
+ this.imge = img;
}
@Override
public void actionPerformed(ActionEvent ev) {
try {
- icon.setImage(ImageIO.read(img));
+ icon.setImage(ImageIO.read(imge));
} catch (IOException e) {
- String msg = String.format("Error: Could not load image %s", img.getPath());
+ String msg = String.format("Error: Could not load image %s", imge.getPath());
System.out.printf("%s\n", msg);
@@ -51,7 +57,7 @@ public class ImgViewer extends JInternalFrame {
private final class ChangeImageListener implements ActionListener {
public ChangeImageListener() {
- // TODO Auto-generated constructor stub
+ // TODO Oct 5th, 2020 - Ben Culkin - Do I need to do something here?
}
@Override
@@ -98,6 +104,12 @@ public class ImgViewer extends JInternalFrame {
private JLabel lab;
+ /**
+ * Create a new image viewer.
+ *
+ * @param desk The desktop.
+ * @param img The image being viewed.
+ */
public ImgViewer(ImgChain desk, File img) {
super("Image Viewer - " + img.getName(), false, true, true, true);
initted = false;
@@ -243,19 +255,19 @@ public class ImgViewer extends JInternalFrame {
return bar;
}
- private JLabel loadLabel(File img) {
- JLabel lab = null;
+ private JLabel loadLabel(File imge) {
+ JLabel labl = null;
try {
- URL imgURL = img.toURI().toURL();
+ URL imgURL = imge.toURI().toURL();
icon = new ImageIcon(imgURL);
setSize(icon.getIconWidth(), icon.getIconHeight());
- lab = new JLabel(icon);
+ labl = new JLabel(icon);
} catch (MalformedURLException e) {
- String msg = String.format("Error: Could not load image %s", img.getPath());
+ String msg = String.format("Error: Could not load image %s", imge.getPath());
System.out.printf("%s\n", msg);
@@ -265,9 +277,14 @@ public class ImgViewer extends JInternalFrame {
JOptionPane.ERROR_MESSAGE);
}
- return lab;
+ return labl;
}
+ /**
+ * Has this image viewer been initialized?
+ *
+ * @return The viewer has been initialized.
+ */
public boolean isInitialized() {
return initted;
}