|
@@ -168,8 +168,8 @@ public class AddObjectPopUp extends JDialog {
|
|
|
sourcePath.setText(filePath);
|
|
|
ImageIcon icon = new ImageIcon(
|
|
|
new ImageIcon(filePath).getImage().getScaledInstance(50, 50, Image.SCALE_SMOOTH));
|
|
|
- if(icon != null)
|
|
|
- lblImagePreview.setIcon(icon);
|
|
|
+ if (icon != null)
|
|
|
+ lblImagePreview.setIcon(icon);
|
|
|
}
|
|
|
sourcePath.setBounds(148, 77, 271, 20);
|
|
|
contentPanel.add(sourcePath);
|
|
@@ -183,7 +183,9 @@ public class AddObjectPopUp extends JDialog {
|
|
|
addElement.setActualCps(toEdit);
|
|
|
addElement.setVisible(true);
|
|
|
HolonElement hl = addElement.getElement();
|
|
|
- addElement(hl);
|
|
|
+ if (hl != null) {
|
|
|
+ addElement(hl);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -226,7 +228,7 @@ public class AddObjectPopUp extends JDialog {
|
|
|
btnNewButton.setBounds(270, 182, 142, 27);
|
|
|
contentPanel.add(btnNewButton);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
{
|
|
|
JPanel buttonPane = new JPanel();
|
|
|
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
|
|
@@ -239,8 +241,8 @@ public class AddObjectPopUp extends JDialog {
|
|
|
if (objectName.getText().length() > 0) {
|
|
|
if (sourcePath.getText().equals(filePath)) {
|
|
|
imagePath = filePath;
|
|
|
- if(imageChanged)
|
|
|
- copieFile();
|
|
|
+ if (imageChanged)
|
|
|
+ copieFile();
|
|
|
imageChanged = false;
|
|
|
// theObject = new
|
|
|
// HolonObject(objectName.getText());
|