|
@@ -24,34 +24,17 @@ public class CategoryController {
|
|
|
* init default category and objects
|
|
|
*/
|
|
|
public void initCategories() {
|
|
|
- Category energy = new Category("Energy");
|
|
|
- Category building = new Category("Building");
|
|
|
- Category component = new Category("Component");
|
|
|
|
|
|
- HolonObject powerp = new HolonObject("Power Plant");
|
|
|
- powerp.setImage("/Images/power-plant.png");
|
|
|
- powerp.setSav("Energy");
|
|
|
|
|
|
- HolonObject house = new HolonObject("House");
|
|
|
- house.setImage("/Images/home-2.png");
|
|
|
- house.setSav("Building");
|
|
|
-
|
|
|
- HolonTransformer transformer = new HolonTransformer("Transformer");
|
|
|
- transformer.setImage("/Images/transformer-1.png");
|
|
|
- transformer.setSav("Component");
|
|
|
+ addNewCategory("Energy");
|
|
|
+ addNewCategory("Building");
|
|
|
+ addNewCategory("Component");
|
|
|
+
|
|
|
+ addNewHolonObject(searchCatNode("Energy"), "Power Plant", new ArrayList<>(), "/Images/power-plant.png");
|
|
|
+ addNewHolonObject(searchCatNode("Building"), "House", new ArrayList<>(), "/Images/home-2.png");
|
|
|
+ addNewHolonTransformer(searchCatNode("Component"), "Transformer", "/Images/transformer-1.png");
|
|
|
+ addNewHolonSwitch(searchCatNode("Component"), "Switch", "/Images/switch-on.png");
|
|
|
|
|
|
- HolonSwitch sw = new HolonSwitch("Switch");
|
|
|
- sw.setImage("/Images/switch-on.png");
|
|
|
- sw.setSav("Component");
|
|
|
-
|
|
|
- addObject(energy, powerp);
|
|
|
- addObject(building, house);
|
|
|
- addObject(component, transformer);
|
|
|
- addObject(component, sw);
|
|
|
-
|
|
|
- addCategory(energy);
|
|
|
- addCategory(building);
|
|
|
- addCategory(component);
|
|
|
}
|
|
|
|
|
|
/**
|