Commit fd23a4b8 authored by lafabregue's avatar lafabregue

integration of cluster constraints

parent 645e82ae
No preview for this file type
......@@ -592,6 +592,7 @@ public class MainFrame extends JFrame {
}
});
ArffMenu.add(menuItemArff);
menuItemRaw = new JMenuItem("RawImage to Arff"); //$NON-NLS-1$
menuItemRaw.addActionListener(new ActionListener() {
@Override
......@@ -600,6 +601,7 @@ public class MainFrame extends JFrame {
}
});
ArffMenu.add(menuItemRaw);
menuItemLoadArff = new JMenuItem(Messages.getString("MainFrame.34")); //$NON-NLS-1$
menuItemLoadArff.addActionListener(new ActionListener() {
@Override
......@@ -618,6 +620,24 @@ public class MainFrame extends JFrame {
});
ArffMenu.add(menuItemArffImage);
menuItemArffData = new JMenuItem(Messages.getString("MainFrame.303")); //$NON-NLS-1$
menuItemArffData.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
toolsMenuDataToArff();
}
});
ArffMenu.add(menuItemArffData);
menuItemLoadArffToData = new JMenuItem(Messages.getString("MainFrame.302")); //$NON-NLS-1$
menuItemLoadArffToData.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
toolsMenuArffToData();
}
});
ArffMenu.add(menuItemLoadArffToData);
menuBar.add(ArffMenu);
// Preprocessing
......@@ -982,6 +1002,10 @@ public class MainFrame extends JFrame {
private Boolean actionRaw;
private JMenuItem menuItemLoadArff;
private Boolean actionLoadArff;
private JMenuItem menuItemLoadArffToData;
private Boolean actionLoadArffToData;
private JMenuItem menuItemArffData;
private Boolean actionArffData;
private JMenuItem menuItemArffImage;
private Boolean actionArffImage;
private JMenuItem menuItemVegetation;
......@@ -1070,6 +1094,8 @@ public class MainFrame extends JFrame {
this.actionConfig = true;
this.actionHelp = true;
this.actionLoadArff = true;
this.actionLoadArffToData = true;
this.actionArffData = true;
this.actionNew = true;
this.actionOpen = true;
this.actionOpenRes = true;
......@@ -1160,6 +1186,8 @@ public class MainFrame extends JFrame {
menuItemRaw.setEnabled(this.actionRaw);
menuItemLoadArff.setEnabled(this.actionLoadArff);
menuItemArffImage.setEnabled(this.actionArffImage);
menuItemArffData.setEnabled(this.actionArffData);
menuItemLoadArffToData.setEnabled(this.actionLoadArffToData);
menuZoomIn.setEnabled(this.actionZoomIn);
menuZoomOut.setEnabled(this.actionZoomOut);
menuBrightP.setEnabled(this.actionBrightP);
......@@ -2135,8 +2163,7 @@ public class MainFrame extends JFrame {
*/
protected void createConstraints() {
try {
ConstraintsSelectionDialog dialog = new ConstraintsSelectionDialog();
dialog.setImage(this.currentImageSession.getRawImage());
ConstraintsSelectionDialog dialog = new ConstraintsSelectionDialog(this.currentImageSession.getRawImage());
MainFrame.getInstance().getDesktop().addFrame(dialog);
} catch (Exception ex) {
JOptionPane.showMessageDialog(this, Messages.getString("MainFrame.128"), Messages.getString("MainFrame.129"), //$NON-NLS-1$ //$NON-NLS-2$
......@@ -3334,6 +3361,19 @@ public class MainFrame extends JFrame {
arff.toFront();
}
private void toolsMenuArffToData() {
DataToArffDialog dialog = new DataToArffDialog();
this.desktop.add(dialog);
dialog.toFront();
}
private void toolsMenuDataToArff() {
DataToArffDialog dialog = new DataToArffDialog();
this.desktop.add(dialog);
dialog.toFront();
}
private void toolsMenuClustering() throws Exception {
// MainFrame.getInstance().getDesktop().addFrame(ClassificationFrame.getInstance());
if (!ClassificationFrame.isCreated()) {
......
package mustic.gui.dialog;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFileChooser;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.JTextField;
import jcl.data.Data;
import mustic.gui.DataDesktopFrame;
import mustic.gui.MainFrame;
import mustic.utils.dataExchange.DataArffExchange;
/**
* Fenetre permettant de creer des fichier ARFF à partir d'un image
*
*/
public class DataToArffDialog extends JInternalFrame {
private static final long serialVersionUID = 1L;
/** liste des images ouvertes */
private JComboBox<String> comboData = new JComboBox<String>();
/** nombre de divisions */
private JSpinner spinner = new JSpinner();
/** chemin du fichier que l'on va créer */
private JTextField textSave = new JTextField();
private JTextField txtDate;
public DataToArffDialog() {
super();
JPanel mainPanel = new JPanel(new BorderLayout());
JPanel panelData = new JPanel(new GridLayout(4, 2));
panelData.add(new JLabel(Messages.getString("DataToArffDialog.0"))); //$NON-NLS-1$
DataDesktopFrame[] desktopFrames = MainFrame.getInstance().getDesktop()
.getAllDataDesktopFrames();
int nbSession = desktopFrames.length;
for (int i = 0; i < nbSession; i++) {
String name = desktopFrames[i].getDataSession().getTitle();
this.comboData.addItem(name);
}
if (nbSession == 0) {
JOptionPane.showMessageDialog(this, Messages.getString("DataToArffDialog.24"), //$NON-NLS-1$
Messages.getString("DataToArffDialog.23"), JOptionPane.WARNING_MESSAGE); //$NON-NLS-1$
return;
}
this.comboData.setPreferredSize(new Dimension(100, 30));
panelData.add(comboData);
panelData.add(new JLabel(Messages.getString("DataToArffDialog.12"))); //$NON-NLS-1$
JPanel panelSave = new JPanel(new BorderLayout());
JButton buttonBrowse = new JButton(Messages.getString("DataToArffDialog.13")); //$NON-NLS-1$
buttonBrowse.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JFileChooser fileChooser = new JFileChooser();
DataDesktopFrame[] desktopFrames = MainFrame.getInstance()
.getDesktop().getAllDataDesktopFrames();
int nbSessions = desktopFrames.length;
if (nbSessions > 0) {
String name = desktopFrames[comboData.getSelectedIndex()]
.getDataSession().getData().getDataName();
String path = "~/" + name + ".arff"; //$NON-NLS-1$
File f = new File(path);
fileChooser.setSelectedFile(f);
}
int returnVal = fileChooser
.showSaveDialog(DataToArffDialog.this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
String path = fileChooser.getSelectedFile().getPath();
textSave.setText(path);
}
}
});
panelSave.add(this.textSave, BorderLayout.CENTER);
panelSave.add(buttonBrowse, BorderLayout.EAST);
panelData.add(panelSave);
txtDate = new JTextField();
DateFormat formatDate=new SimpleDateFormat("ddMMyy");
txtDate.setText(formatDate.format(new Date()));
panelData.add(new JLabel(Messages.getString("DataToArffDialog.15"))); //$NON-NLS-1$
panelData.add(txtDate);
panelData.add(new JLabel(Messages.getString("DataToArffDialog.16"))); //$NON-NLS-1$
JSpinner.NumberEditor spinnerEditor = new JSpinner.NumberEditor(
this.spinner);
this.spinner.setEditor(spinnerEditor);
spinnerEditor.getModel().setMinimum(1);
spinnerEditor.getModel().setMaximum(256);
spinnerEditor.getModel().setStepSize(1);
spinnerEditor.getModel().setValue(10);
panelData.add(this.spinner);
JPanel panelOk = new JPanel();
JButton buttonOk = new JButton(Messages.getString("DataToArffDialog.17")); //$NON-NLS-1$
buttonOk.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
buttonOk_actionPerformed();
}
});
panelOk.add(buttonOk);
mainPanel.add(panelData, BorderLayout.NORTH);
mainPanel.add(panelOk, BorderLayout.SOUTH);
this.setContentPane(mainPanel);
this.setTitle(Messages.getString("DataToArffDialog.18")); //$NON-NLS-1$
this.setSize(350, 175);
this.setResizable(true);
this.setMaximizable(true);
this.setIconifiable(true);
this.setClosable(true);
this.setVisible(true);
}
/**
* lance la création du fichier arff
*/
protected void buttonOk_actionPerformed() {
DataDesktopFrame[] desktopFrames = MainFrame.getInstance().getDesktop()
.getAllDataDesktopFrames();
int nbSessions = desktopFrames.length;
if (nbSessions == 0) {
JOptionPane.showMessageDialog(this,
Messages.getString("DataToArffDialog.19"), Messages.getString("DataToArffDialog.20"), //$NON-NLS-1$ //$NON-NLS-2$
JOptionPane.WARNING_MESSAGE);
this.dispose();
} else if (this.textSave.getText().equals("")) { //$NON-NLS-1$
JOptionPane.showMessageDialog(this, Messages.getString("DataToArffDialog.22"), //$NON-NLS-1$
Messages.getString("DataToArffDialog.23"), JOptionPane.WARNING_MESSAGE); //$NON-NLS-1$
} else {
Data data = desktopFrames[this.comboData.getSelectedIndex()]
.getDataSession().getData();
DataArffExchange.dataToArff(this.textSave.getText(), data);
JOptionPane.showMessageDialog(this,
Messages.getString("DataToArffDialog.44"), Messages.getString("DataToArffDialog.45"), //$NON-NLS-1$ //$NON-NLS-2$
JOptionPane.INFORMATION_MESSAGE);
this.dispose();
}
}
}
......@@ -21,6 +21,7 @@ import javax.swing.JPanel;
import javax.swing.JTextField;
import mustic.gui.DesktopFrame;
import mustic.gui.ImageDesktopFrame;
import mustic.gui.MainFrame;
import mustic.io.RawImage;
......@@ -47,8 +48,8 @@ public class RawImageToArffDialog extends JInternalFrame {
JPanel panelData = new JPanel(new GridLayout(2, 2));
panelData.add(new JLabel(Messages.getString("ImageToArffDialog.0"))); //$NON-NLS-1$
DesktopFrame[] desktopFrames = MainFrame.getInstance().getDesktop()
.getAllDesktopFrames();
ImageDesktopFrame[] desktopFrames = MainFrame.getInstance().getDesktop()
.getAllImageDesktopFrames();
int nbSession = desktopFrames.length;
for (int i = 0; i < nbSession; i++) {
String path = desktopFrames[i].getImageSession().getRawImage()
......@@ -76,8 +77,8 @@ public class RawImageToArffDialog extends JInternalFrame {
.getString("ImageToArffDialog.6") //$NON-NLS-1$
+ nbSession);
MainFrame.getInstance().openNewFile();
DesktopFrame[] desktopFrames = MainFrame.getInstance()
.getDesktop().getAllDesktopFrames();
ImageDesktopFrame[] desktopFrames = MainFrame.getInstance()
.getDesktop().getAllImageDesktopFrames();
System.out.println(Messages
.getString("ImageToArffDialog.7") //$NON-NLS-1$
+ desktopFrames.length);
......@@ -121,8 +122,8 @@ public class RawImageToArffDialog extends JInternalFrame {
@Override
public void actionPerformed(ActionEvent e) {
JFileChooser fileChooser = new JFileChooser();
DesktopFrame[] desktopFrames = MainFrame.getInstance()
.getDesktop().getAllDesktopFrames();
ImageDesktopFrame[] desktopFrames = MainFrame.getInstance()
.getDesktop().getAllImageDesktopFrames();
int nbSessions = desktopFrames.length;
if (nbSessions > 0) {
String path = desktopFrames[comboImage.getSelectedIndex()]
......@@ -181,8 +182,8 @@ public class RawImageToArffDialog extends JInternalFrame {
* lance la création du fichier arff
*/
protected void buttonOk_actionPerformed() {// TODO
DesktopFrame[] desktopFrames = MainFrame.getInstance().getDesktop()
.getAllDesktopFrames();
ImageDesktopFrame[] desktopFrames = MainFrame.getInstance().getDesktop()
.getAllImageDesktopFrames();
int nbSessions = desktopFrames.length;
if (nbSessions == 0) {
JOptionPane
......
package mustic.gui.dialog.classifier;
import java.awt.BasicStroke;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
......@@ -7,9 +8,12 @@ import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseWheelEvent;
......@@ -29,87 +33,121 @@ import java.util.Vector;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFileChooser;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSlider;
import javax.swing.JSplitPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.l2fprod.common.swing.JTaskPane;
import com.l2fprod.common.swing.JTaskPaneGroup;
import jcl.clustering.constraints.CannotLinkConstraint;
import jcl.clustering.constraints.ClusterDiameterConstraint;
import jcl.clustering.constraints.Constraint;
import jcl.clustering.constraints.LabelConstraint;
import jcl.clustering.constraints.MustLinkConstraint;
import mustic.gui.panels.classifier.ClassifierPanel;
import jcl.clustering.constraints.NbClusterConstraint;
import jcl.data.Data;
import mustic.io.RawImage;
import mustic.utils.CSVUtils;
import mustic.utils.filters.CSVFileFilter;
/**
* Fenetre permettant de choisir les centres pour K-Means
* en les selectionnant dans l'image
* Dialog window that allow the user to generate a set of constraints
*
* @author Baptiste LAFABREGUE
*
*/
public class ConstraintsSelectionDialog extends JInternalFrame {
private static final long serialVersionUID = 1L;
private int width;
private static final long serialVersionUID = 1L;
/** data related fields */
private RawImage image = null;
private int width = -1;
private double minDistance = 0;
private double maxDistance = 100;
private RawImage image = null;
private BufferedImage imagePoints = null;
private BufferedImage imagePoints = null;
private BufferedImage imageSource = null;
private BufferedImage imageSource = null;
private JLabel labelImage;
public JPanel mainPanel;
private JTaskPane taskPane = new JTaskPane();
protected int labelClassesCount = 1;
/** inner panel of task groups per constraint types */
private JPanel mustLinkContainer = new JPanel();
private JPanel cannotLinkContainer = new JPanel();
private JPanel labelContainer = new JPanel();
private JPanel mustLinkContainer = new JPanel();
private JPanel cannotLinkContainer = new JPanel();
private JPanel labelContainer = new JPanel();
/** zoom level */
private float mZoomRate = 1.0f;
private float mZoomRate = 1.0f;
/** zoom step */
private float mZoomStep = 0.1f;
private float mZoomStep = 0.1f;
private JPanel panelImage = new JPanel(new BorderLayout());
private JPanel panelImage = new JPanel(new BorderLayout());
/** set of created constraints */
private Vector<Constraint> constraints = new Vector<Constraint>();
private Vector<Constraint> constraints = new Vector<Constraint>();
/** colours linked to each constraints */
private Vector<Color> constraintsColors = new Vector<Color>();
private Vector<Color> constraintsColors = new Vector<Color>();
/** panels linked to each constraints */
private Vector<JPanel> constraintsPanels = new Vector<JPanel>();
private Vector<JPanel> constraintsPanels = new Vector<JPanel>();
/** other components that must be disable or enabled */
private Vector<Component> otherComponentList = new Vector<Component>();
/** Cluster related components */
private JCheckBox nbClusterCheckBox;
private JTextField nbClusterMaxTextField;
private JTextField nbClusterMinTextField;
private JCheckBox clusterDiameterCheckBox;
private JTextField diameterTextField;
private Vector<Component> otherComponentList = new Vector<Component>();
/** Record steps of constraint construction */
private int currentStep = 0;
private int currentStep = 0;
static final private int MustLink_step1 = 1;
static final private int MustLink_step2 = 2;
static final private int CannotLink_step1 = 3;
static final private int CannotLink_step2 = 4;
static final private int Label_step1 = 5;
static final private int MustLink_step1 = 1;
static final private int MustLink_step2 = 2;
static final private int CannotLink_step1 = 3;
static final private int CannotLink_step2 = 4;
static final private int Label_step1 = 5;
private int previousIndex = -1;
private int previousIndex = -1;
public ConstraintsSelectionDialog() {
/**
* Constructor to a dialog window to visualise and build a set of constraints
*
* @param img
* the image on which the constraints have to be build
* @param data
* (optional) the data related to the constraints
*/
public ConstraintsSelectionDialog(RawImage img, Data data) {
super();
mainPanel = new JPanel(new BorderLayout());
// affichage de l'image
if (data != null) {
minDistance = data.getEstimatedMinDistance();
maxDistance = data.getEstimatedMaxDistance();
}
// display the image
this.labelImage = new JLabel();
this.labelImage.setHorizontalAlignment(SwingConstants.CENTER);
panelImage.add(this.labelImage, BorderLayout.CENTER);
......@@ -141,11 +179,13 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
// we don't refresh if not a valid step
return;
}
affichePixel();
displayPixels();
}
}
});
setImage(img);
JPanel panelButton = new JPanel();
JButton buttonOk = new JButton(Messages.getString("ConstraintsSelectionDialog.50")); //$NON-NLS-1$
buttonOk.addActionListener(new ActionListener() {
......@@ -179,8 +219,12 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
JScrollPane jpane = new JScrollPane(panelImage);
jpane.setBorder(BorderFactory.createTitledBorder(Messages.getString("ConstraintsSelectionDialog.7"))); //$NON-NLS-1$
mainPanel.add(buildInfoPanel(), BorderLayout.WEST);
mainPanel.add(jpane, BorderLayout.CENTER);
JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
new JScrollPane(buildInfoPanel()), jpane);
splitPane.setDividerLocation(390);
mainPanel.add(splitPane, BorderLayout.CENTER);
// mainPanel.add(buildInfoPanel(), BorderLayout.WEST);
// mainPanel.add(jpane, BorderLayout.CENTER);
mainPanel.add(panelButton, BorderLayout.SOUTH);
this.setContentPane(mainPanel);
......@@ -201,7 +245,7 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
filename += ".csv"; //$NON-NLS-1$
FileOutputStream out = new FileOutputStream(filename);
PrintWriter writer = new PrintWriter(out);
for(Constraint c : constraints) {
for(Constraint c : getConstraints()) {
writer.println(c);
}
writer.close();
......@@ -284,7 +328,7 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
e.printStackTrace();
}
break;
case Constraint.CANOT_LINK_TYPE :
case Constraint.CANNOT_LINK_TYPE :
try {
createCannotLinkConstraint();
constraints.add(new CannotLinkConstraint(Integer.parseInt(line.get(1)),
......@@ -319,12 +363,11 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
JPanel panelInfos = new JPanel(new BorderLayout());
panelInfos.setBorder(BorderFactory.createTitledBorder(Messages.getString("ConstraintsSelectionDialog.0"))); //$NON-NLS-1$
panelInfos.setPreferredSize(new Dimension(370, 300));
JTaskPane taskPane = new JTaskPane();
JTaskPaneGroup mustLinkPane = new JTaskPaneGroup();
mustLinkPane.setLayout(new BorderLayout());
mustLinkPane.setTitle("ggggggggggg"); //$NON-NLS-1$
mustLinkPane.setTitle(Messages.getString("ConstraintsSelectionDialog.10")); //$NON-NLS-1$
mustLinkPane.setTitle(Messages.getString("ConstraintsSelectionDialog.100")); //$NON-NLS-1$
JButton mlAddbutton = new JButton(Messages.getString("ConstraintsSelectionDialog.13"));
mlAddbutton.addActionListener(new ActionListener() {
@Override
......@@ -337,11 +380,11 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
mustLinkPane.add(mustLinkContainer, BorderLayout.CENTER);
mustLinkPane.add(mlAddbutton, BorderLayout.SOUTH);
mustLinkPane.setBackground(Color.green);
this.taskPane.add(mustLinkPane);
taskPane.add(mustLinkPane);
JTaskPaneGroup cannotLinkPane = new JTaskPaneGroup();
cannotLinkPane.setLayout(new BorderLayout());
cannotLinkPane.setTitle(Messages.getString("ConstraintsSelectionDialog.11")); //$NON-NLS-1$
cannotLinkPane.setTitle(Messages.getString("ConstraintsSelectionDialog.101")); //$NON-NLS-1$
JButton clAddbutton = new JButton(Messages.getString("ConstraintsSelectionDialog.13"));
clAddbutton.addActionListener(new ActionListener() {
@Override
......@@ -353,11 +396,11 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
cannotLinkContainer.setLayout(new GridLayout(0, 1));
cannotLinkPane.add(cannotLinkContainer, BorderLayout.CENTER);
cannotLinkPane.add(clAddbutton, BorderLayout.SOUTH);
this.taskPane.add(cannotLinkPane);
taskPane.add(cannotLinkPane);
JTaskPaneGroup labelPane = new JTaskPaneGroup();
labelPane.setLayout(new BorderLayout());
labelPane.setTitle(Messages.getString("ConstraintsSelectionDialog.12")); //$NON-NLS-1$
labelPane.setTitle(Messages.getString("ConstraintsSelectionDialog.102")); //$NON-NLS-1$
JButton laAddbutton = new JButton(Messages.getString("ConstraintsSelectionDialog.13"));
laAddbutton.addActionListener(new ActionListener() {
@Override
......@@ -369,16 +412,19 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
labelContainer.setLayout(new GridLayout(0, 1));
labelPane.add(labelContainer, BorderLayout.CENTER);
labelPane.add(laAddbutton, BorderLayout.SOUTH);
this.taskPane.add(labelPane);
taskPane.add(labelPane);
JScrollPane jpane = new JScrollPane(taskPane);
JTaskPaneGroup cluserRelatedPane = new JTaskPaneGroup();
cluserRelatedPane.setLayout(new BorderLayout());
cluserRelatedPane.setTitle(Messages.getString("ConstraintsSelectionDialog.103")); //$NON-NLS-1$
cluserRelatedPane.add(buildClusterRelatedPane(), BorderLayout.CENTER);
taskPane.add(cluserRelatedPane);
panelInfos.removeAll();
panelInfos.add(jpane, BorderLayout.CENTER);
panelInfos.add(taskPane, BorderLayout.CENTER);
JButton buttonApply = new JButton(Messages.getString("ConstraintsSelectionDialog.21")); //$NON-NLS-1$
JButton buttonClear = new JButton(Messages.getString("ConstraintsSelectionDialog.22")); //$NON-NLS-1$
JPanel paneBouton = new JPanel();
paneBouton.setPreferredSize(new Dimension(100,40));
paneBouton.add(buttonApply);
paneBouton.add(buttonClear);
......@@ -388,7 +434,121 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
return panelInfos;
}
public void setImage(RawImage img) {
private JPanel buildClusterRelatedPane() {
JPanel container = new JPanel();
container.setLayout(new GridLayout(0,1));
// add the nb cluster part
JPanel nbCLusterPane = new JPanel();
nbCLusterPane.setLayout(new GridLayout(0,1));
final JPanel ncInner = new JPanel();
ncInner.setLayout(new FlowLayout());
ncInner.add(new JLabel(Messages.getString("ConstraintsSelectionDialog.16")));