Skip to content

Commit

Permalink
useless code changes for irreproducible stuff. issue #2570
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Oct 1, 2024
1 parent d5a9002 commit bf0d9de
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
}// </editor-fold>//GEN-END:initComponents

private void cmdForcePreviewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdForcePreviewActionPerformed
new Thread(new LoadDocumentPreviewThread(this.caseDto, this.docDto, this.readOnly, this.pnlPreview, true, this.saveCallback)).start();
new Thread(new LoadDocumentPreviewThread(null, this.caseDto, this.docDto, this.readOnly, this.pnlPreview, true, this.saveCallback)).start();
}//GEN-LAST:event_cmdForcePreviewActionPerformed

private void cmdPreviewSettingsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdPreviewSettingsActionPerformed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JSplitPane;
import javax.swing.SwingUtilities;
import org.apache.log4j.Logger;

Expand All @@ -694,20 +695,22 @@ public class LoadDocumentPreviewThread implements Runnable {

private static boolean running = false;

private JSplitPane previewContainer=null;
private JPanel pnlPreview = null;
private boolean readOnly = false;
private ArchiveFileBean caseDto=null;
ArchiveFileDocumentsBean docDto=null;
private boolean forceAnyDocumentSize=false;
private DocumentPreviewSaveCallback saveCallback=null;

public LoadDocumentPreviewThread(ArchiveFileBean caseDto, ArchiveFileDocumentsBean value, boolean readOnly, JPanel pnlPreview, boolean forceAnyDocumentSize, DocumentPreviewSaveCallback saveCallback) {
public LoadDocumentPreviewThread(JSplitPane previewContainer, ArchiveFileBean caseDto, ArchiveFileDocumentsBean value, boolean readOnly, JPanel pnlPreview, boolean forceAnyDocumentSize, DocumentPreviewSaveCallback saveCallback) {
this.docDto=value;
this.pnlPreview = pnlPreview;
this.readOnly = readOnly;
this.caseDto=caseDto;
this.forceAnyDocumentSize=forceAnyDocumentSize;
this.saveCallback=saveCallback;
this.previewContainer=previewContainer;
}

public static boolean isRunning() {
Expand Down Expand Up @@ -782,6 +785,14 @@ public void run() {
((GifJpegPngImageWithTextPanel) prev).intelligentScrolling();
});
}

// SwingUtilities.invokeLater(() -> {
// if (this.previewContainer != null) {
// ComponentUtils.bumpSplitPane(this.previewContainer);
// this.previewContainer.doLayout();
// }
// });

running = false;
} catch (Exception ex) {
running = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,7 @@ public class PdfImageScrollingPanel extends javax.swing.JPanel implements Previe
*
* @param fileName
* @param content
* @param saveCallback
*/
public PdfImageScrollingPanel(String fileName, byte[] content, DocumentPreviewSaveCallback saveCallback) {
initComponents();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4670,7 +4670,7 @@ public void updateDocumentPreview() {
} else {
ArchiveFileDocumentsBean value = selectedDocs.get(0);

new Thread(new LoadDocumentPreviewThread(this.dto, value, this.readOnly, this.pnlPreview, false, this)).start();
new Thread(new LoadDocumentPreviewThread(this.splitDocumentsMain, this.dto, value, this.readOnly, this.pnlPreview, false, this)).start();
}
}

Expand Down

0 comments on commit bf0d9de

Please sign in to comment.