|
@@ -191,10 +191,10 @@ public class GUI implements CategoryListener {
|
|
|
private final JPanel panelHolonEl = new JPanel();
|
|
|
private final JComboBox comboBox = new JComboBox();
|
|
|
// Buttons
|
|
|
- private final JButton btnAdd = new JButton("+");
|
|
|
- private final JButton btnDel = new JButton("-");
|
|
|
- private final JButton btnAddHolEL = new JButton("+");
|
|
|
- private final JButton btnDelHolEL = new JButton("-");
|
|
|
+ private final JButton btnAdd = new JButton("New");
|
|
|
+ private final JButton btnDel = new JButton("Delete");
|
|
|
+ private final JButton btnAddHolEL = new JButton("New");
|
|
|
+ private final JButton btnDelHolEL = new JButton("Delete");
|
|
|
private final JButton resetGraphBtn = new JButton("Reset");
|
|
|
private final JToolBar toolBar = new JToolBar();
|
|
|
private final JToolBar toolBarHolonEl = new JToolBar();
|
|
@@ -1177,6 +1177,9 @@ public class GUI implements CategoryListener {
|
|
|
triggerUpdateController(null);
|
|
|
contentPane.updateUI();
|
|
|
}
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ JOptionPane.showMessageDialog(contentPane, "No object selected.\nPlease select a object first." , "Message" , JOptionPane.INFORMATION_MESSAGE);
|
|
|
}
|
|
|
});
|
|
|
/*
|
|
@@ -1188,6 +1191,10 @@ public class GUI implements CategoryListener {
|
|
|
if (model.getSelectedCpsObjects().size() == 1) {
|
|
|
if (updCon.getActualCps().getClass() == HolonObject.class) {
|
|
|
HolonObject obj = (HolonObject) updCon.getActualCps();
|
|
|
+ if(selectedElements.isEmpty())
|
|
|
+ {
|
|
|
+ JOptionPane.showMessageDialog(contentPane, "No element selectet.\nPlease select a element in the list first." , "Message" , JOptionPane.INFORMATION_MESSAGE);
|
|
|
+ }
|
|
|
for (HolonElement e : selectedElements) {
|
|
|
controller.deleteElementCanvas(obj.getId(),
|
|
|
e.getId());
|
|
@@ -1210,7 +1217,10 @@ public class GUI implements CategoryListener {
|
|
|
triggerUpdateController(null);
|
|
|
model.getEleToDelete().clear();
|
|
|
selectedElements.clear();
|
|
|
- }
|
|
|
+ }else
|
|
|
+ {
|
|
|
+ JOptionPane.showMessageDialog(contentPane, "No object selectet.\nPlease select a object first." , "No object selectet" , JOptionPane.INFORMATION_MESSAGE);
|
|
|
+ }
|
|
|
triggerUpdateController(null);
|
|
|
elementGraph.setText(Languages.getLanguage()[25]);
|
|
|
holonEleNamesDisplayed = Languages.getLanguage()[25];
|
|
@@ -1937,10 +1947,11 @@ public class GUI implements CategoryListener {
|
|
|
|
|
|
panel.add(toolBar);
|
|
|
comboBox.setMaximumSize(new Dimension(100, 20));
|
|
|
- toolBar.add(comboBox);
|
|
|
- comboBox.setModel(new DefaultComboBoxModel(comboBoxCat));
|
|
|
+ //toolBar.add(comboBox);
|
|
|
+ //comboBox.setModel(new DefaultComboBoxModel(comboBoxCat));
|
|
|
// Add Buttonnew DefaultComboBoxModel(comboBoxCat)
|
|
|
btnAdd.addActionListener(actionEvent -> {
|
|
|
+ /*
|
|
|
Object nodeInfo = tree.getLastSelectedPathComponent();
|
|
|
String selectedOption = comboBox.getSelectedItem().toString();
|
|
|
DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) nodeInfo;
|
|
@@ -1978,6 +1989,7 @@ public class GUI implements CategoryListener {
|
|
|
} catch (Exception e) {
|
|
|
}
|
|
|
tree.repaint();
|
|
|
+ */
|
|
|
});
|
|
|
|
|
|
/**
|