summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2015-07-24 18:41:01 +0200
committerJonathan Bauer2015-07-24 18:41:01 +0200
commite2b15071c46e9a1d7f3199a069ebe07d4b339a67 (patch)
treeb908169e5eb6c4d378925682b9c8e4b3eeb21817
parentMerge branch 'v1.1' of git.openslx.org:openslx-ng/tutor-module into v1.1 (diff)
downloadtutor-module-e2b15071c46e9a1d7f3199a069ebe07d4b339a67.tar.gz
tutor-module-e2b15071c46e9a1d7f3199a069ebe07d4b339a67.tar.xz
tutor-module-e2b15071c46e9a1d7f3199a069ebe07d4b339a67.zip
[client] fix invocation exception
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java101
1 files changed, 51 insertions, 50 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java
index ec98ed6c..69e65e93 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java
@@ -55,6 +55,56 @@ public class ImageListWindow extends ImageListWindowLayout {
sorter.setSortKeys(list);
jtable.setRowSorter(sorter);
jtable.setModel(itm);
+ // SWING TABLE STUFF
+ jtable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
+
+ @Override
+ public void valueChanged(ListSelectionEvent e) {
+ ImageTableModel model = (ImageTableModel) jtable.getModel();
+ int rowIndex = jtable.getSelectedRow();
+ ImageSummaryRead image = null;
+ if (rowIndex != -1) {
+ image = model.get(jtable.convertRowIndexToModel(jtable.getSelectedRow()));
+ LOGGER.debug(image.toString());
+ } else {
+ LOGGER.error("No selection!");
+ }
+ final ImageSummaryRead finalImage = image;
+ if (image == null)
+ return;
+ Gui.asyncExec(new Runnable() {
+ public void run() {
+ updateDetailPane(finalImage);
+ }
+ });
+ }
+ });
+ jtable.addMouseListener(new MouseAdapter() {
+ public void mousePressed(MouseEvent me) {
+ if (me.getClickCount() == 2) {
+ // your valueChanged overridden method
+ ImageTableModel model = (ImageTableModel) jtable.getModel();
+ int rowIndex = jtable.getSelectedRow();
+ ImageSummaryRead image = null;
+ if (rowIndex != -1) {
+ image = model.get(jtable.convertRowIndexToModel(rowIndex));
+ LOGGER.debug(image.toString());
+ } else {
+ LOGGER.error("No selection!");
+ }
+ final ImageSummaryRead finalImage = image;
+ if (finalImage == null)
+ return;
+ Gui.asyncExec(new Runnable() {
+ public void run() {
+ ImageDetailsWindow popup = MainWindow.openPopup(ImageDetailsWindow.class, true, false);
+ if (popup != null)
+ popup.setImage(finalImage.getImageBaseId());
+ }
+ });
+ }
+ }
+ });
}
});
// filter the objects in the table depending on the search field
@@ -101,56 +151,7 @@ public class ImageListWindow extends ImageListWindowLayout {
}
});
- // SWING TABLE STUFF
- jtable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
-
- @Override
- public void valueChanged(ListSelectionEvent e) {
- ImageTableModel model = (ImageTableModel) jtable.getModel();
- int rowIndex = jtable.getSelectedRow();
- ImageSummaryRead image = null;
- if (rowIndex != -1) {
- image = model.get(jtable.convertRowIndexToModel(jtable.getSelectedRow()));
- LOGGER.debug(image.toString());
- } else {
- LOGGER.error("No selection!");
- }
- final ImageSummaryRead finalImage = image;
- if (image == null)
- return;
- Gui.asyncExec(new Runnable() {
- public void run() {
- updateDetailPane(finalImage);
- }
- });
- }
- });
- jtable.addMouseListener(new MouseAdapter() {
- public void mousePressed(MouseEvent me) {
- if (me.getClickCount() == 2) {
- // your valueChanged overridden method
- ImageTableModel model = (ImageTableModel) jtable.getModel();
- int rowIndex = jtable.getSelectedRow();
- ImageSummaryRead image = null;
- if (rowIndex != -1) {
- image = model.get(jtable.convertRowIndexToModel(rowIndex));
- LOGGER.debug(image.toString());
- } else {
- LOGGER.error("No selection!");
- }
- final ImageSummaryRead finalImage = image;
- if (finalImage == null)
- return;
- Gui.asyncExec(new Runnable() {
- public void run() {
- ImageDetailsWindow popup = MainWindow.openPopup(ImageDetailsWindow.class, true, false);
- if (popup != null)
- popup.setImage(finalImage.getImageBaseId());
- }
- });
- }
- }
- });
+
}