|
@@ -17,6 +17,8 @@ import javax.swing.JLabel;
|
|
import javax.swing.JPanel;
|
|
import javax.swing.JPanel;
|
|
import javax.swing.JTextField;
|
|
import javax.swing.JTextField;
|
|
|
|
|
|
|
|
+import classes.HolonBattery;
|
|
|
|
+import classes.HolonObject;
|
|
import javafx.scene.paint.Color;
|
|
import javafx.scene.paint.Color;
|
|
import ui.controller.Control;
|
|
import ui.controller.Control;
|
|
|
|
|
|
@@ -71,12 +73,15 @@ public class NewPopUp extends JDialog{
|
|
actualOption = Option.getEnumAtIndex(optionList.getSelectedIndex());
|
|
actualOption = Option.getEnumAtIndex(optionList.getSelectedIndex());
|
|
cl.show(cards, actualOption.name());
|
|
cl.show(cards, actualOption.name());
|
|
saveButton.setEnabled(actualOption != Option.None);
|
|
saveButton.setEnabled(actualOption != Option.None);
|
|
|
|
+ //TODO delete and make own iterface
|
|
|
|
+ saveButton.setVisible(actualOption != Option.Object);
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
contentPanel.add(makeBottemPanel(), BorderLayout.PAGE_END);
|
|
contentPanel.add(makeBottemPanel(), BorderLayout.PAGE_END);
|
|
addSaveButtonLogik();
|
|
addSaveButtonLogik();
|
|
- add(contentPanel);
|
|
|
|
|
|
+ add(contentPanel);
|
|
|
|
+ saveButton.setEnabled(false);
|
|
setMinimumSize(new Dimension(400,350));
|
|
setMinimumSize(new Dimension(400,350));
|
|
pack();
|
|
pack();
|
|
setLocationRelativeTo(parentFrame);
|
|
setLocationRelativeTo(parentFrame);
|
|
@@ -107,13 +112,15 @@ public class NewPopUp extends JDialog{
|
|
content = makeSwitchPanel();
|
|
content = makeSwitchPanel();
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
- content = new JPanel();
|
|
|
|
|
|
+ content = makeNothingPanel();
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
actualOption = aOption;
|
|
actualOption = aOption;
|
|
contentPanel.add(content, BorderLayout.CENTER);
|
|
contentPanel.add(content, BorderLayout.CENTER);
|
|
contentPanel.add(makeBottemPanel(), BorderLayout.PAGE_END);
|
|
contentPanel.add(makeBottemPanel(), BorderLayout.PAGE_END);
|
|
- addSaveButtonLogik();
|
|
|
|
|
|
+ addSaveButtonLogik();
|
|
|
|
+ //TODO delete and make own iterface
|
|
|
|
+ if(aOption == Option.Object) saveButton.setVisible(false);
|
|
add(contentPanel);
|
|
add(contentPanel);
|
|
setMinimumSize(new Dimension(400,350));
|
|
setMinimumSize(new Dimension(400,350));
|
|
pack();
|
|
pack();
|
|
@@ -132,9 +139,10 @@ public class NewPopUp extends JDialog{
|
|
private JPanel makeBottemPanel() {
|
|
private JPanel makeBottemPanel() {
|
|
JPanel bottomPanel = new JPanel();
|
|
JPanel bottomPanel = new JPanel();
|
|
bottomPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
|
|
bottomPanel.setLayout(new FlowLayout(FlowLayout.RIGHT));
|
|
- saveButton.setEnabled(false);
|
|
|
|
|
|
+
|
|
bottomPanel.add(saveButton);
|
|
bottomPanel.add(saveButton);
|
|
JButton cancelButton = new JButton("Cancel");
|
|
JButton cancelButton = new JButton("Cancel");
|
|
|
|
+ cancelButton.addActionListener(actionEvent -> dispose());
|
|
bottomPanel.add(cancelButton);
|
|
bottomPanel.add(cancelButton);
|
|
return bottomPanel;
|
|
return bottomPanel;
|
|
}
|
|
}
|
|
@@ -146,18 +154,49 @@ public class NewPopUp extends JDialog{
|
|
JComboBox<String> selectedCategory = new JComboBox<String>(actualController.getCategoriesStrings());
|
|
JComboBox<String> selectedCategory = new JComboBox<String>(actualController.getCategoriesStrings());
|
|
objectPanel.add(selectedCategory);
|
|
objectPanel.add(selectedCategory);
|
|
|
|
|
|
|
|
+
|
|
|
|
+ JButton nextButton = new JButton("Next");
|
|
|
|
+ objectPanel.add(nextButton);
|
|
|
|
+ nextButton.addActionListener(actionEvent -> {
|
|
|
|
+ makeOldObjectPopUp(selectedCategory.getSelectedItem().toString());
|
|
|
|
+ });
|
|
return objectPanel;
|
|
return objectPanel;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void makeOldObjectPopUp(String categoryName) {
|
|
|
|
+ //TODO: del and make own on
|
|
|
|
+
|
|
|
|
+ HolonObject hO = new HolonObject("");
|
|
|
|
+
|
|
|
|
+ AddObjectPopUp addObjectPopUP = new AddObjectPopUp(false,hO , "hei", null);
|
|
|
|
+ addObjectPopUP.setVisible(true);
|
|
|
|
+ addObjectPopUP.setController(actualController);
|
|
|
|
+ addObjectPopUP.setCategory(categoryName);
|
|
|
|
+ dispose();
|
|
|
|
+ }
|
|
|
|
+
|
|
private JPanel makeBatteryPanel() {
|
|
private JPanel makeBatteryPanel() {
|
|
- System.out.println("ssds222");
|
|
|
|
- return new JPanel();
|
|
|
|
|
|
+ JPanel objectPanel = new JPanel();
|
|
|
|
+ JLabel categoryText = new JLabel("In Category:");
|
|
|
|
+ objectPanel.add(categoryText);
|
|
|
|
+ JComboBox<String> selectedCategory = new JComboBox<String>(actualController.getCategoriesStrings());
|
|
|
|
+ objectPanel.add(selectedCategory);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ JButton nextButton = new JButton("Next");
|
|
|
|
+ objectPanel.add(nextButton);
|
|
|
|
+ nextButton.addActionListener(actionEvent -> {
|
|
|
|
+ makeOldBatteryPopUp(selectedCategory.getSelectedItem().toString());
|
|
|
|
+ });
|
|
|
|
+ return objectPanel;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private void makeOldBatteryPopUp(String string) {
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
private JPanel makeNothingPanel() {
|
|
private JPanel makeNothingPanel() {
|
|
- System.out.println("ssds");
|
|
|
|
return new JPanel();
|
|
return new JPanel();
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private JPanel makeCategoryPanel()
|
|
private JPanel makeCategoryPanel()
|
|
@@ -204,6 +243,7 @@ public class NewPopUp extends JDialog{
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
System.err.println("IOException addCategory");
|
|
System.err.println("IOException addCategory");
|
|
}
|
|
}
|
|
|
|
+ dispose();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|