Skip to content

Commit

Permalink
Merge pull request #30 from salimkanoun/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
salimkanoun authored May 6, 2019
2 parents 814c4a8 + b6a0a75 commit 1b085da
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 17 deletions.
6 changes: 4 additions & 2 deletions src/org/petctviewer/orthanc/OTP/standalone/OTP_Tab.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public OTP_Tab(VueAnon anon) {
JButton btnImport = new JButton("Load Local DICOM");
btnImport.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
importFrame=new ImportDCM(anon.getOrthancApisConnexion(), anon);
importFrame=ImportDCM.getImportDcm(anon);
importFrame.setImportListener(guiOTP);
importFrame.setModal(true);
importFrame.setVisible(true);
Expand Down Expand Up @@ -386,8 +386,10 @@ private class MyTableCellRenderer extends DefaultTableCellRenderer {
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
TableOTPStudiesModel model = (TableOTPStudiesModel) table.getModel();
Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if(!model.getValueAt(row, 4).equals("")) {
if(!model.getValueAt(row, 4).equals("") ) {
c.setBackground(Color.GREEN);
}else {
c.setBackground(Color.RED);
}

return c;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static void main(String[] args) {

anon.setCTPaddress("https://petctviewer.com");
anon.setRunOrthanc(runOrthanc);
anon.setLocationRelativeTo(null);
anon.setVisible(true);


Expand Down
4 changes: 1 addition & 3 deletions src/org/petctviewer/orthanc/Orthanc_Tools.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ public static void writeCSV(String text, File file) {

//SK TO DO
//Tester envoie DICOM plateforme
//Debeuger sortie reste des thread non collectes=> Tracker update de ImageJ
//Query / Import passer en singeton + update interface au changement de serveur
//Impact du changement du serveur sur le monitoring
// pb Renderer envoie DICOM

//+Tard
//Faire detection des SC dans table export Series comme sur main Tab
Expand Down
10 changes: 5 additions & 5 deletions src/org/petctviewer/orthanc/anonymize/VueAnon.java
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ public void actionPerformed(ActionEvent e) {
SwingUtilities.invokeLater(new Runnable () {
@Override
public void run() {
VueQuery query=new VueQuery(restApis, gui);
VueQuery query=VueQuery.getVueQuery(gui);
query.pack();
query.setLocationRelativeTo(gui);
query.setVisible(true);
Expand All @@ -441,7 +441,7 @@ public void actionPerformed(ActionEvent e) {
SwingUtilities.invokeLater(new Runnable () {
@Override
public void run() {
ImportDCM importFrame=new ImportDCM(restApis,gui);
ImportDCM importFrame=ImportDCM.getImportDcm(gui);
importFrame.pack();
importFrame.setLocationRelativeTo(gui);
importFrame.setVisible(true);
Expand Down Expand Up @@ -2123,9 +2123,9 @@ public void refreshOrthancConnexion(){
getOrthancApisConnexion().refreshServerAddress();
refreshAets();
refreshPeers();

//SK RESTE A FERMER EVENTUELLE FENETRE QUERY ET IMPORT
//REPERCUSSION SUR LE MONITORING A VOIR
VueQuery.getVueQuery(gui).dispose();
ImportDCM.getImportDcm(gui).dispose();
this.monitoring.closeAllMonitoringServices();
}


Expand Down
15 changes: 12 additions & 3 deletions src/org/petctviewer/orthanc/importdicom/ImportDCM.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,19 @@ public class ImportDCM extends JDialog implements WindowListener{
private SwingWorker<Void,Void> importWorker;

private ImportListener listener;

private static ImportDCM importDcm=null;

public static ImportDCM getImportDcm(VueAnon vueAnon) {
if(importDcm==null) {
importDcm=new ImportDCM(vueAnon);
}
return importDcm;
}

public ImportDCM(OrthancRestApis connexion, JFrame parentJframe) {
private ImportDCM(VueAnon vueAnon) {
this.setTitle("Import DICOM files");
this.connexion=connexion;
this.connexion=vueAnon.getOrthancApisConnexion();
this.gui=this;
JPanel mainPanel = new JPanel(new GridBagLayout());
JLabel labelPath = new JLabel("DICOM files path");
Expand Down Expand Up @@ -169,7 +178,7 @@ protected void done() {
this.getContentPane().add(mainPanel);
addWindowListener(this);
pack();
setLocationRelativeTo(parentJframe);
setLocationRelativeTo(vueAnon);



Expand Down
1 change: 1 addition & 0 deletions src/org/petctviewer/orthanc/monitoring/Monitoring_GUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,7 @@ public void closeAllMonitoringServices() {
if (cdMonitoringStarted) cdBurner.stopCDMonitoring();
if(tagMonitoringStarted) tagMonitoring.stopTagMonitoring();
if(autoFetchStarted) autoFetch.stopAutoFecth();
updateStatusLabel();

}
/**
Expand Down
16 changes: 12 additions & 4 deletions src/org/petctviewer/orthanc/query/VueQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@
import org.petctviewer.orthanc.query.listeners.FilterAction;
import org.petctviewer.orthanc.query.listeners.Retrieve_Action;
import org.petctviewer.orthanc.query.listeners.TableStudyMouseListener;
import org.petctviewer.orthanc.setup.OrthancRestApis;

import com.michaelbaranov.microba.calendar.DatePicker;

public class VueQuery extends JFrame {
Expand Down Expand Up @@ -180,12 +178,22 @@ public class VueQuery extends JFrame {
//Last focused table
private JTable lastFocusMain;
private JTable lastFocusHistory;

/** Instance unique non préinitialisée */
private static VueQuery vueQuery = null;

public static VueQuery getVueQuery(VueAnon vueAnon) {
if(vueQuery==null) {
vueQuery=new VueQuery(vueAnon);
}
return vueQuery;
}

public VueQuery(OrthancRestApis http, VueAnon vueAnon) {
private VueQuery(VueAnon vueAnon) {

super("Orthanc queries");
this.vueAnon=vueAnon;
rest=new QueryRetrieve(http);
rest=new QueryRetrieve(vueAnon.getOrthancApisConnexion());
this.setResizable(true);
this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
this.addWindowListener(new WindowAdapter() {
Expand Down

0 comments on commit 1b085da

Please sign in to comment.