Commit f1057248 authored by coman's avatar coman

Fixed display refresh after remove constraint action. Display first pixel for...

Fixed display refresh after remove constraint action. Display first pixel for ML and CL constraints. Fixed cancel action for label constraints.
parent 27e7b4f9
......@@ -186,7 +186,7 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
private int classID;
private int classIndex;
JPanel container;
/**
* Constructor to a dialog window to visualize and build a set of
......@@ -1125,7 +1125,7 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
Messages.getString("ConstraintsSelectionDialog.34"),
JOptionPane.PLAIN_MESSAGE, null, possibilities,
"1");
// If a string was returned, say so.
if ((s != null) && (s.length() > 0)) {
classIndex = 0;
......@@ -1163,7 +1163,17 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
((JTextArea) constraintsPanels.get(constraintsPanels.size() - 1).getComponent(3))
.setText("" + classIndex);
} else if(s == null){
int i = constraintsPanels.indexOf(container);
if (i < constraints.size()) {
constraints.remove(i);
}
constraintsPanels.remove(i);
labelContainer.remove(container);
doZoomedOp();
labelContainer.updateUI();
}
currentStep = -1;
enableAllComponents();
break;
......@@ -1171,7 +1181,8 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
return;
}
((JTextField) constraintsPanels.get(constraintsPanels.size() - 1).getComponent(1)).setText("" + index);
if(constraintsPanels.size() > 0)
((JTextField) constraintsPanels.get(constraintsPanels.size() - 1).getComponent(1)).setText("" + index);
}
......@@ -1207,13 +1218,12 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
this.labelImage.setIcon(new ImageIcon(mNew));
/*if (previousIndex > 0) {
// it matches the last colour added
// TODO remove line
drawPixel(previousIndex, constraintsColors.get(constraintsColors.size() - 1), "");
}*/
if (previousIndex > 0) {
if(currentStep == MustLink_step2)
drawPixel(previousIndex, mustLinkColor,imagePixelML);
else
drawPixel(previousIndex, cannotLinkColor,imagePixelCL);
}
//this.doZoomedOp();
}
......@@ -1392,12 +1402,10 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
int i = constraintsPanels.indexOf(container);
if (i < constraints.size()) {
constraints.remove(i);
}
// constraintsColors.remove(i);
}
constraintsPanels.remove(i);
mustLinkContainer.remove(container);
displayPixels();
doZoomedOp();
mustLinkContainer.updateUI();
}
});
......@@ -1424,10 +1432,9 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
if (i < constraints.size()) {
constraints.remove(i);
}
// constraintsColors.remove(i);
constraintsPanels.remove(i);
cannotLinkContainer.remove(container);
displayPixels();
doZoomedOp();
cannotLinkContainer.updateUI();
}
});
......@@ -1440,7 +1447,7 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
}
protected void createLabelConstraint() {
JPanel container = new JPanel();
container = new JPanel();
container.setLayout(new FlowLayout());
container.add(new JLabel(Messages.getString("ConstraintsSelectionDialog.32")));
container.add(new JTextField(6));
......@@ -1454,13 +1461,9 @@ public class ConstraintsSelectionDialog extends JInternalFrame {
if (i < constraints.size()) {
constraints.remove(i);
}
//TODO remove Color of a deleted Label Constraint Class
//from jd_colorsChooser
// constraintsColors.remove(i);
constraintsPanels.remove(i);
labelColorConstraintPanel.remove(i);
labelContainer.remove(container);
displayPixels();
doZoomedOp();
labelContainer.updateUI();
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment