Commit 4242aa62 authored by lafabregue's avatar lafabregue

switched from Constraints window to ImageAddon

parent 7e1071e6
...@@ -19,6 +19,7 @@ import mustic.gui.panels.data.DataPanel; ...@@ -19,6 +19,7 @@ import mustic.gui.panels.data.DataPanel;
import mustic.io.ImageData; import mustic.io.ImageData;
import mustic.models.gui.ClassificationModel; import mustic.models.gui.ClassificationModel;
import mustic.models.gui.panels.ResultPanel; import mustic.models.gui.panels.ResultPanel;
import mustic.utils.image.ImageDisplayer;
import net.infonode.tabbedpanel.TabDragEvent; import net.infonode.tabbedpanel.TabDragEvent;
import net.infonode.tabbedpanel.TabEvent; import net.infonode.tabbedpanel.TabEvent;
import net.infonode.tabbedpanel.TabListener; import net.infonode.tabbedpanel.TabListener;
......
...@@ -15,6 +15,7 @@ import mustic.gui.panels.ImageInformationPanel; ...@@ -15,6 +15,7 @@ import mustic.gui.panels.ImageInformationPanel;
import mustic.gui.panels.ImagePanel; import mustic.gui.panels.ImagePanel;
import mustic.gui.segmentation.SegmentationPanel; import mustic.gui.segmentation.SegmentationPanel;
import mustic.io.RawImage; import mustic.io.RawImage;
import mustic.utils.image.ImageManager;
import net.infonode.tabbedpanel.TabFactory; import net.infonode.tabbedpanel.TabFactory;
import net.infonode.tabbedpanel.TabbedPanel; import net.infonode.tabbedpanel.TabbedPanel;
import net.infonode.tabbedpanel.titledtab.TitledTab; import net.infonode.tabbedpanel.titledtab.TitledTab;
...@@ -245,7 +246,7 @@ public class ImageSession extends ImageManager { ...@@ -245,7 +246,7 @@ public class ImageSession extends ImageManager {
if (displayEnable) { if (displayEnable) {
((ImagePanel) this.displayer).applyMask(this.rawImage.getMask()); ((ImagePanel) this.displayer).applyMask(this.rawImage.getMask());
((ImagePanel) this.displayer).refresh(); ((ImagePanel) this.displayer).refresh(true);
} }
} }
......
...@@ -131,7 +131,7 @@ public class MainFrame extends JFrame { ...@@ -131,7 +131,7 @@ public class MainFrame extends JFrame {
private JPanel infosPanel; private JPanel infosPanel;
/** boolean pour lier le birdview avec l'image active */ /** boolean pour lier le birdview avec l'image active */
private boolean linkToAllImages = true; private boolean linkToAllImages = false;
/** the project root for datas */ /** the project root for datas */
private DefaultMutableTreeNode mDataProjectNode; private DefaultMutableTreeNode mDataProjectNode;
...@@ -429,7 +429,8 @@ public class MainFrame extends JFrame { ...@@ -429,7 +429,8 @@ public class MainFrame extends JFrame {
openZip(); openZip();
} }
}); });
fileMenu.add(menuItemOpenZip); //TODO regenerate the result import same as imageResultPanel
//fileMenu.add(menuItemOpenZip);
menuItemSave = new JMenuItem(Messages.getString("MainFrame.10")); //$NON-NLS-1$ menuItemSave = new JMenuItem(Messages.getString("MainFrame.10")); //$NON-NLS-1$
menuItemSave.addActionListener(new ActionListener() { menuItemSave.addActionListener(new ActionListener() {
...@@ -493,7 +494,7 @@ public class MainFrame extends JFrame { ...@@ -493,7 +494,7 @@ public class MainFrame extends JFrame {
} }
} }
}); });
toolsMenu.add(menuItemClustering); // toolsMenu.add(menuItemClustering);
menuItemSegmentation = new JMenuItem(Messages.getString("MainFrame.17")); //$NON-NLS-1$ menuItemSegmentation = new JMenuItem(Messages.getString("MainFrame.17")); //$NON-NLS-1$
menuItemSegmentation.addActionListener(new ActionListener() { menuItemSegmentation.addActionListener(new ActionListener() {
...@@ -625,7 +626,7 @@ public class MainFrame extends JFrame { ...@@ -625,7 +626,7 @@ public class MainFrame extends JFrame {
createDistanceMatrix(); createDistanceMatrix();
} }
}); });
toolsMenu.add(menuDistanceMatrix); // toolsMenu.add(menuDistanceMatrix);
/** Menu to generate constraints from current image session */ /** Menu to generate constraints from current image session */
menuConstraints = new JMenuItem(Messages.getString("MainFrame.301")); menuConstraints = new JMenuItem(Messages.getString("MainFrame.301"));
...@@ -635,7 +636,7 @@ public class MainFrame extends JFrame { ...@@ -635,7 +636,7 @@ public class MainFrame extends JFrame {
createConstraints(); createConstraints();
} }
}); });
toolsMenu.add(menuConstraints); // toolsMenu.add(menuConstraints);
menuBar.add(toolsMenu); menuBar.add(toolsMenu);
...@@ -914,7 +915,8 @@ public class MainFrame extends JFrame { ...@@ -914,7 +915,8 @@ public class MainFrame extends JFrame {
} }
}); });
menuResult.add(menuOpenRes); //TODO regenerate the result import same as imageResultPanel
//menuResult.add(menuOpenRes);
menuResult.add(menuSaveRes); menuResult.add(menuSaveRes);
menuRoiEval = new JMenuItem(Messages.getString("MainFrame.52")); //$NON-NLS-1$ menuRoiEval = new JMenuItem(Messages.getString("MainFrame.52")); //$NON-NLS-1$
...@@ -1490,7 +1492,7 @@ public class MainFrame extends JFrame { ...@@ -1490,7 +1492,7 @@ public class MainFrame extends JFrame {
// =============== Creation of the Desktop ================ // =============== Creation of the Desktop ================
JPanel panel_desktop = new JPanel(new BorderLayout()); JPanel panel_desktop = new JPanel(new BorderLayout());
panel_desktop.setOpaque(false); panel_desktop.setOpaque(false);
panel_desktop.setBorder(Borders.DIALOG_BORDER); panel_desktop.setBorder(Borders.DIALOG);
panel_desktop.add(this.desktop); panel_desktop.add(this.desktop);
sif_desktop = new SimpleInternalFrame(Messages.getString("MainFrame.72")); //$NON-NLS-1$ sif_desktop = new SimpleInternalFrame(Messages.getString("MainFrame.72")); //$NON-NLS-1$
...@@ -1504,7 +1506,7 @@ public class MainFrame extends JFrame { ...@@ -1504,7 +1506,7 @@ public class MainFrame extends JFrame {
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
panel.setOpaque(false); panel.setOpaque(false);
panel.setBorder(Borders.DIALOG_BORDER); panel.setBorder(Borders.DIALOG);
panel.add(pane); panel.add(pane);
// =============== Creation of the Progress Panel => South // =============== Creation of the Progress Panel => South
...@@ -1625,7 +1627,7 @@ public class MainFrame extends JFrame { ...@@ -1625,7 +1627,7 @@ public class MainFrame extends JFrame {
// =============== Creation of the Desktop ================ // =============== Creation of the Desktop ================
JPanel panel_desktop = new JPanel(new BorderLayout()); JPanel panel_desktop = new JPanel(new BorderLayout());
panel_desktop.setOpaque(false); panel_desktop.setOpaque(false);
panel_desktop.setBorder(Borders.DIALOG_BORDER); panel_desktop.setBorder(Borders.DIALOG);
panel_desktop.add(this.desktop); panel_desktop.add(this.desktop);
sif_desktop = new SimpleInternalFrame(Messages.getString("MainFrame.72")); //$NON-NLS-1$ sif_desktop = new SimpleInternalFrame(Messages.getString("MainFrame.72")); //$NON-NLS-1$
...@@ -1639,7 +1641,7 @@ public class MainFrame extends JFrame { ...@@ -1639,7 +1641,7 @@ public class MainFrame extends JFrame {
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
panel.setOpaque(false); panel.setOpaque(false);
panel.setBorder(Borders.DIALOG_BORDER); panel.setBorder(Borders.DIALOG);
panel.add(pane); panel.add(pane);
// =============== Creation of the Progress Panel => South // =============== Creation of the Progress Panel => South
...@@ -2167,7 +2169,8 @@ public class MainFrame extends JFrame { ...@@ -2167,7 +2169,8 @@ public class MainFrame extends JFrame {
} }
}); });
toolBar.add(jbOpen); //TODO regenerate the result import same as imageResultPanel
//toolBar.add(jbOpen);
toolBar.add(jbSave); toolBar.add(jbSave);
JButton jbRoiEval = new JButton(new ImageIcon(getClass().getResource("/icons/icon_roi_eval.png"))); //$NON-NLS-1$ JButton jbRoiEval = new JButton(new ImageIcon(getClass().getResource("/icons/icon_roi_eval.png"))); //$NON-NLS-1$
...@@ -3007,44 +3010,44 @@ public class MainFrame extends JFrame { ...@@ -3007,44 +3010,44 @@ public class MainFrame extends JFrame {
// seg = segThread.getS(); // seg = segThread.getS();
// setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); // setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
Data data = MainFrame.this.currentImageSession.getImageData(); // Data data = MainFrame.this.currentImageSession.getImageData();
//
MainFrame.this.currentImageSession.setData(data); // MainFrame.this.currentImageSession.setData(data);
ClassificationImage ci = new ClassificationImage(data, Messages.getString("MainFrame.190") //$NON-NLS-1$ // ClassificationImage ci = new ClassificationImage(data, Messages.getString("MainFrame.190") //$NON-NLS-1$
+ ImageSession.nbClustering, true); // + DataSession.nbClustering, true);
//
SegmentationResultPanel srp = new SegmentationResultPanel(classif, ci, MainFrame.this.currentImageSession.getRawImage(), // SegmentationResultPanel srp = new SegmentationResultPanel(classif, ci, MainFrame.this.currentImageSession.getRawImage(),
seg, imageLabelisee, -1); // ImageSession.getSession(0).getImage(),ImageSession.getSession(0), // seg, imageLabelisee, -1); // ImageSession.getSession(0).getImage(),ImageSession.getSession(0),
// scene); // // scene);
//
Tab tabResult = ClassificationModel.createTab(Messages.getString("MainFrame.191") + ResultPanel.nbResult, //$NON-NLS-1$ // Tab tabResult = ClassificationModel.createTab(Messages.getString("MainFrame.191") + ResultPanel.nbResult, //$NON-NLS-1$
new ImageIcon(getClass() // new ImageIcon(getClass()
.getResource("/icons/actions/document-open-result.png")), //$NON-NLS-1$ // .getResource("/icons/actions/document-open-result.png")), //$NON-NLS-1$
srp, true); // srp, true);
ci.tabbedPane.addTab(tabResult); // ci.tabbedPane.addTab(tabResult);
tabResult.setSelected(true); // tabResult.setSelected(true);
//
SegmentationResultPanel irp = (SegmentationResultPanel) ci.tabbedPane.getTabAt(ci.tabbedPane.getTabCount() - 1) // SegmentationResultPanel irp = (SegmentationResultPanel) ci.tabbedPane.getTabAt(ci.tabbedPane.getTabCount() - 1)
.getContentComponent(); // .getContentComponent();
irp.historique.addInfosln("******** Classification apres segmentation *********"); //$NON-NLS-1$ // irp.historique.addInfosln("******** Classification apres segmentation *********"); //$NON-NLS-1$
//
irp.historique.addInfosln(Messages.getString("MainFrame.0") //$NON-NLS-1$ // irp.historique.addInfosln(Messages.getString("MainFrame.0") //$NON-NLS-1$
+ classif.getData().getDataName() + "\n"); //$NON-NLS-1$ // + classif.getData().getDataName() + "\n"); //$NON-NLS-1$
//
// irp.historique.addInfosln(ci.().getParameters().toString()); // // irp.historique.addInfosln(ci.().getParameters().toString());
//
final TitledTab tab = new TitledTab(Messages.getString("MainFrame.196") //$NON-NLS-1$ // final TitledTab tab = new TitledTab(Messages.getString("MainFrame.196") //$NON-NLS-1$
+ ImageSession.nbClustering++, null, ci.tabbedPane, new JPanel()); // + ImageSession.nbClustering++, null, ci.tabbedPane, new JPanel());
tab.setFocusableComponent(null); // tab.setFocusableComponent(null);
//
MainFrame.this.currentImageSession.getWorkSpace().addTab(tab); // MainFrame.this.currentImageSession.getWorkSpace().addTab(tab);
MainFrame.this.currentImageSession.getWorkSpace().setSelectedTab(tab); // MainFrame.this.currentImageSession.getWorkSpace().setSelectedTab(tab);
//
try { // try {
MainFrame.this.currentImageSession.associatedFrame.setMaximum(true); // MainFrame.this.currentImageSession.associatedFrame.setMaximum(true);
} catch (PropertyVetoException e1) {} // } catch (PropertyVetoException e1) {}
//
irp.updateImageColors(); // irp.updateImageColors();
} }
else { else {
...@@ -3736,8 +3739,8 @@ public class MainFrame extends JFrame { ...@@ -3736,8 +3739,8 @@ public class MainFrame extends JFrame {
String resultPath = "/home/baptiste/A2CNES/results/"; String resultPath = "/home/baptiste/A2CNES/results/";
String testResultPath = "/home/baptiste/A2CNES/Train_results/"; String testResultPath = "/home/baptiste/A2CNES/Train_results/";
Data dataTrain = getDataFromFile(dataPath+datasetPath+"/train/"+datasetName+".data", '\t', "train"); Data dataTrain = getDataFromFile(dataPath+datasetPath+"/train/"+datasetName+".data", '\t', "train", null);
Data dataTest = getDataFromFile(dataPath+datasetPath+"/test/"+datasetName+".data", '\t', "test"); Data dataTest = getDataFromFile(dataPath+datasetPath+"/test/"+datasetName+".data", '\t', "test", null);
// AttributeMultiDimSequence.setMode(AttributeMultiDimSequence.EUCLIDIEN); // AttributeMultiDimSequence.setMode(AttributeMultiDimSequence.EUCLIDIEN);
...@@ -3781,38 +3784,39 @@ public class MainFrame extends JFrame { ...@@ -3781,38 +3784,39 @@ public class MainFrame extends JFrame {
// we search for all constraints files // we search for all constraints files
// <<<< START FOR PARAM config // <<<< START FOR PARAM config
for (int i = 0 ; i < 10 ; i++) {
HybridClassification classif = (HybridClassification) classification.clone();
if (i % 2 == 1 ) {
classification.setParameters(nInf, nSup, minC, 0.4, 0.6, pcr);
}
if (i <= 5)
classif.addAgent(new ParametersKmeans(8, 10, weights), dataTrain);
if (i <= 7)
classif.addAgent(new ParametersKmeans(10, 10, weights), dataTrain);
classif.addAgent(new ParametersKmeans(13, 10, weights), dataTrain);
classif.addAgent(new ParametersKmeans(16, 10, weights), dataTrain);
if (i >= 2)
classif.addAgent(new ParametersKmeans(19, 10, weights), dataTrain);
if (i >= 4)
classif.addAgent(new ParametersKmeans(22, 10, weights), dataTrain);
// classif.addAgent(new ParametersKmeans(3, 10, weights), dataTest);
// classif.addAgent(new ParametersKmeans(4, 10, weights), dataTest);
// classif.addAgent(new ParametersKmeans(6, 10, weights), dataTest);
classif.setName(testResultPath+datasetName+"/clusteing"+i);
classif.setData(dataTrain);
//// >>>> END FOR PARAM config1
// for (int i = 0 ; i < 10 ; i++) { // for (int i = 0 ; i < 10 ; i++) {
// HybridClassification classif = (HybridClassification) classification.clone(); // HybridClassification classif = (HybridClassification) classification.clone();
//// classif.addAgent(new ParametersKmeans(10, 15, weights), dataTest); // if (i % 2 == 1 ) {
// classif.addAgent(new ParametersKmeans(13, 10, weights), dataTest); // classification.setParameters(nInf, nSup, minC, 0.4, 0.6, pcr);
// classif.addAgent(new ParametersKmeans(16, 10, weights), dataTest); // }
// classif.addAgent(new ParametersKmeans(19, 10, weights), dataTest); // if (i <= 5)
// // classif.addAgent(new ParametersKmeans(8, 25, weights), dataTrain);
// classif.setName(resultPath+datasetPath+"/clustering"+i); // if (i <= 7)
// classif.setData(dataTest); // classif.addAgent(new ParametersKmeans(10, 25, weights), dataTrain);
//// >>>> REPLACE PARAM // classif.addAgent(new ParametersKmeans(13, 25, weights), dataTrain);
// classif.addAgent(new ParametersKmeans(16, 25, weights), dataTrain);
// if (i >= 2)
// classif.addAgent(new ParametersKmeans(19, 25, weights), dataTrain);
// if (i >= 4)
// classif.addAgent(new ParametersKmeans(22, 25, weights), dataTrain);
//// classif.addAgent(new ParametersKmeans(3, 10, weights), dataTest);
//// classif.addAgent(new ParametersKmeans(4, 10, weights), dataTest);
//// classif.addAgent(new ParametersKmeans(6, 10, weights), dataTest);
//
// classif.setName(testResultPath+datasetName+"/clusteing"+i);
// classif.setData(dataTrain);
// >>>> END FOR PARAM config1
for (int i = 0 ; i < 10 ; i++) {
HybridClassification classif = (HybridClassification) classification.clone();
// classif.addAgent(new ParametersKmeans(10, 25, weights), dataTest);
classif.addAgent(new ParametersKmeans(13, 25, weights), dataTest);
classif.addAgent(new ParametersKmeans(16, 25, weights), dataTest);
classif.addAgent(new ParametersKmeans(19, 25, weights), dataTest);
// classif.addAgent(new ParametersKmeans(22, 25, weights), dataTest);
classif.setName(resultPath+datasetPath+"/clustering"+i);
classif.setData(dataTest);
// >>>> REPLACE PARAM
Thread t = null; Thread t = null;
ClassificationImage classificationImage = new ClassificationImage(testSession, ClassificationImage classificationImage = new ClassificationImage(testSession,
...@@ -3879,9 +3883,11 @@ public class MainFrame extends JFrame { ...@@ -3879,9 +3883,11 @@ public class MainFrame extends JFrame {
// Data currentData = (Data) dataTest.clone(); // Data currentData = (Data) dataTest.clone();
// currentData.updateAndSetConstraintsToSample(constraints); // currentData.updateAndSetConstraintsToSample(constraints);
// //
// classif.addAgent(new ParametersKmeans(4, 15, weights), currentData); // classif.addAgent(new ParametersKmeans(10, 25, weights), currentData);
// classif.addAgent(new ParametersKmeans(6, 15, weights), currentData); // classif.addAgent(new ParametersKmeans(13, 25, weights), currentData);
// classif.addAgent(new ParametersKmeans(8, 15, weights), currentData); // classif.addAgent(new ParametersKmeans(16, 25, weights), currentData);
// classif.addAgent(new ParametersKmeans(19, 25, weights), currentData);
// classif.addAgent(new ParametersKmeans(22, 25, weights), currentData);
// //
// classif.setName(resultPath+datasetName+"/"+ // classif.setName(resultPath+datasetName+"/"+
// ImageHelper.stripExtension(filename)+ // ImageHelper.stripExtension(filename)+
...@@ -3890,9 +3896,9 @@ public class MainFrame extends JFrame { ...@@ -3890,9 +3896,9 @@ public class MainFrame extends JFrame {
// //
// Thread t = null; // Thread t = null;
// //
// ClassificationImage classificationImage = new ClassificationImage(currentData, // ClassificationImage classificationImage = new ClassificationImage(testSession,
// Messages.getString("ClassifierPanel.73") + DataSession.nbClustering, //$NON-NLS-1$ // Messages.getString("ClassifierPanel.73") + DataSession.nbClustering, //$NON-NLS-1$
// true); // true);
// //
// //
// t = new ClassificationThread(classif, classificationImage.getProgressBar(), // t = new ClassificationThread(classif, classificationImage.getProgressBar(),
...@@ -3908,7 +3914,6 @@ public class MainFrame extends JFrame { ...@@ -3908,7 +3914,6 @@ public class MainFrame extends JFrame {
// } catch (PropertyVetoException e) { // } catch (PropertyVetoException e) {
// e.printStackTrace(); // e.printStackTrace();
// } // }
// classificationImage.toFront();
// classificationImage.setVisible(true); // classificationImage.setVisible(true);
// //
// threadList.add(t); // threadList.add(t);
...@@ -3946,7 +3951,7 @@ public class MainFrame extends JFrame { ...@@ -3946,7 +3951,7 @@ public class MainFrame extends JFrame {
ClassificationFrame.getInstance().dispose(); ClassificationFrame.getInstance().dispose();
} }
private Data getDataFromFile(String path, char separator, String name) { private Data getDataFromFile(String path, char separator, String name, String mask) {
Data data = null; Data data = null;
// we create the two data session // we create the two data session
...@@ -3955,12 +3960,20 @@ public class MainFrame extends JFrame { ...@@ -3955,12 +3960,20 @@ public class MainFrame extends JFrame {
List<DataObject> result = new ArrayList<DataObject>(); List<DataObject> result = new ArrayList<DataObject>();
CSVUtils reader = null; CSVUtils reader = null;
CSVUtils maskReader = null;
try { try {
File file = new File(path); File file = new File(path);
reader = new CSVUtils(file, separator); reader = new CSVUtils(file, separator);
List<String> line; List<String> line;
if (mask != null) {
maskReader = new CSVUtils(new File(mask), separator);
}
List<String> maskLine = null;
while((line = reader.readNext()) != null) { while((line = reader.readNext()) != null) {
extractObjectFromLine(result, line, 1); if (mask != null) {
maskLine = maskReader.readNext();
}
extractObjectFromLine(result, line, 3, maskLine);
} }
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
...@@ -3985,10 +3998,14 @@ public class MainFrame extends JFrame { ...@@ -3985,10 +3998,14 @@ public class MainFrame extends JFrame {
* @param line * @param line
* the line to interpret * the line to interpret
*/ */
private void extractObjectFromLine(List<DataObject> list, List<String> line, int featureNb) { private void extractObjectFromLine(List<DataObject> list, List<String> line, int featureNb, List<String> maskLine) {
DataObject obj = new DataObject(1); DataObject obj = new DataObject(1);
double[][] seq = new double[line.size()/featureNb][]; double[][] seq = new double[line.size()/featureNb][];
for (int i = 0 ; i < line.size()/featureNb ; i++) { for (int i = 0 ; i < line.size()/featureNb ; i++) {
if (maskLine != null) {
if(Integer.parseInt(maskLine.get(i)) == 0)
continue;
}
seq[i] = new double[featureNb]; seq[i] = new double[featureNb];
for (int j = 0 ; j < featureNb ; j++) { for (int j = 0 ; j < featureNb ; j++) {
seq[i][j] = Double.parseDouble(line.get(i*featureNb + j)); seq[i][j] = Double.parseDouble(line.get(i*featureNb + j));
......
...@@ -50,8 +50,8 @@ public class RgbBandChooserInternalFrame extends JInternalFrame { ...@@ -50,8 +50,8 @@ public class RgbBandChooserInternalFrame extends JInternalFrame {
public RgbBandChooserInternalFrame(final RawImage rawImage) { public RgbBandChooserInternalFrame(final RawImage rawImage) {
super(); super();
this.scaledMax = rawImage.getScaledMaxValues(); this.scaledMax = rawImage.getScaledMaxValues().clone();
this.scaledMin = rawImage.getScaledMinValues(); this.scaledMin = rawImage.getScaledMinValues().clone();
this.redComboBox = new JComboBox<String>(); this.redComboBox = new JComboBox<String>();
this.redMin = new JTextArea(); this.redMin = new JTextArea();
this.redMax = new JTextArea(); this.redMax = new JTextArea();
......
...@@ -301,10 +301,10 @@ public class SequenceDialog extends JDialog { ...@@ -301,10 +301,10 @@ public class SequenceDialog extends JDialog {
* @throws FormatException * @throws FormatException
* if the images don't have the same dimensions * if the images don't have the same dimensions
*/ */
public Vector<String> getSequenceData() throws FormatException { public Vector<RawImage> getSequenceData() throws FormatException {
int nb = this.dlmSeq.getSize(); int nb = this.dlmSeq.getSize();
Donnee donnee; Donnee donnee;
Vector<String> paths = new Vector<String>(); Vector<RawImage> paths = new Vector<RawImage>();
if (nb > 0) { if (nb > 0) {
ImageDesktopFrame[] desktopFrames = MainFrame.getInstance().getDesktop() ImageDesktopFrame[] desktopFrames = MainFrame.getInstance().getDesktop()
...@@ -314,7 +314,7 @@ public class SequenceDialog extends JDialog { ...@@ -314,7 +314,7 @@ public class SequenceDialog extends JDialog {
for (int i = 0; i < nb; i++) { for (int i = 0; i < nb; i++) {
donnee = (Donnee) this.dlmSeq.getElementAt(i); donnee = (Donnee) this.dlmSeq.getElementAt(i);
paths.add(desktopFrames[donnee.index].getImageSession() paths.add(desktopFrames[donnee.index].getImageSession()
.getRawImage().getPath()); .getRawImage());
} }
} }
......
...@@ -26,19 +26,19 @@ public class ConstraintsColor extends JDialog { ...@@ -26,19 +26,19 @@ public class ConstraintsColor extends JDialog {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** constraints colors */ /** constraints colors */
private Color mustLinkColor = new Color(124, 252, 0); private Color mustLinkColor = new Color(124, 252, 0);
private Color cannotLinkColor = new Color(255, 0, 255); private Color cannotLinkColor = new Color(255, 0, 255);
private Vector<Color> labelConstraintColor = new Vector<Color>(); private Vector<Color> labelConstraintColor = new Vector<Color>();
/** constraints buttons */ /** constraints buttons */
private JButton jb_mustLinkChooseColor = new JButton(); private JButton jb_mustLinkChooseColor = new JButton();
private JButton jb_cannotLinkChooseColor = new JButton(); private JButton jb_cannotLinkChooseColor = new JButton();
private Vector<JButton> jb_labelConstraintClassChooseColor = new Vector<JButton>(); private Vector<JButton> jb_labelConstraintClassChooseColor = new Vector<JButton>();
/** dynamic JPanel Colors of Label Constraints Classes*/ /** dynamic JPanel Colors of Label Constraints Classes*/
JPanel labelColorConstraintPanel = new JPanel(new GridLayout(0,1)); private JPanel labelColorConstraintPanel = new JPanel(new GridLayout(0,1));
private ConstraintsSelectionDialog dialog = null; private ConstraintsSelectionFrame dialog = null;
/** /**
* @brief Constructor dialog window that allows the user to change the color of the constraints * @brief Constructor dialog window that allows the user to change the color of the constraints
...@@ -47,7 +47,7 @@ public class ConstraintsColor extends JDialog { ...@@ -47,7 +47,7 @@ public class ConstraintsColor extends JDialog {
* @param colorCL * @param colorCL
* @param colorVectorLabel * @param colorVectorLabel
*/ */
public ConstraintsColor(ConstraintsSelectionDialog d, Color colorML, Color colorCL, Vector<Color> colorVectorLabel) { public ConstraintsColor(ConstraintsSelectionFrame d, Color colorML, Color colorCL, Vector<Color> colorVectorLabel) {
this.dialog = d; this.dialog = d;
this.mustLinkColor = colorML; this.mustLinkColor = colorML;
this.cannotLinkColor = colorCL; this.cannotLinkColor = colorCL;
......
...@@ -24,12 +24,12 @@ import mustic.utils.filters.CSVFileFilter; ...@@ -24,12 +24,12 @@ import mustic.utils.filters.CSVFileFilter;
*/ */
public class ExportConstraintsTask extends SwingWorker<Void, Void> public class ExportConstraintsTask extends SwingWorker<Void, Void>
{ {
ConstraintsSelectionDialog dialog = null; ConstraintsSelectionFrame dialog = null;
static final private int incrementation = 10; static final private int incrementation = 10;
static int progress = 0; static int progress = 0;
static int jalon = incrementation; // avoid too many progress update static int jalon = incrementation; // avoid too many progress update
public ExportConstraintsTask (ConstraintsSelectionDialog dialog) public ExportConstraintsTask (ConstraintsSelectionFrame dialog)
{ {
this.dialog = dialog; this.dialog = dialog;
} }
......
...@@ -21,12 +21,12 @@ import mustic.utils.io.CSVUtils; ...@@ -21,12 +21,12 @@ import mustic.utils.io.CSVUtils;
*/ */
public class ImportConstraintsTask extends SwingWorker<Void, Void> public class ImportConstraintsTask extends SwingWorker<Void, Void>
{ {
ConstraintsSelectionDialog dialog = null; ConstraintsSelectionFrame dialog = null;
static final private int incrementation = 10; static final private int incrementation = 10;
static int progress = 0; static int progress = 0;
static int jalon = incrementation; // avoid too many progress update static int jalon = incrementation; // avoid too many progress update
public ImportConstraintsTask (ConstraintsSelectionDialog dialog) public ImportConstraintsTask (ConstraintsSelectionFrame dialog)
{ {
this.dialog = dialog; this.dialog = dialog;
} }
...@@ -108,8 +108,7 @@ public class ImportConstraintsTask extends SwingWorker<Void, Void> ...@@ -108,8 +108,7 @@ public class ImportConstraintsTask extends SwingWorker<Void, Void>
}