private void applyItemTypeMutators(Array<String> actionsSet) { // generic mutators if (sandbox.getSelector().getCurrentSelection().size() == 1) { if (sandbox.getSelector().selectionIsComposite()) { actionsSet.add(Sandbox.SHOW_ADD_LIBRARY_DIALOG); actionsSet.add(Sandbox.ACTION_CAMERA_CHANGE_COMPOSITE); } actionsSet.add(Sandbox.ACTION_SET_GRID_SIZE_FROM_ITEM); } // external plugin mutators PluginManager pluginManager = facade.retrieveProxy(PluginManager.NAME); pluginManager.dropDownActionSets(sandbox.getSelector().getCurrentSelection(), actionsSet); }
@Override public void handleNotification(Notification notification) { super.handleNotification(notification); switch (notification.getName()) { case Overlap2D.SCENE_RIGHT_CLICK: Vector2 stageCoords = notification.getBody(); showPopup(SCENE_ACTIONS_SET, stageCoords); break; case Overlap2D.ITEM_RIGHT_CLICK: Array<String> actionsSet = new Array<>(actionSets.get(ITEMS_ACTIONS_SET)); applyItemTypeMutators(actionsSet); showPopup(actionsSet, sandbox.getSelector().getSelectedItem()); break; case UIResourcesBoxMediator.IMAGE_RIGHT_CLICK: showPopup(IMAGE_RESOURCE_ACTION_SET, notification.getBody()); break; case UIResourcesBoxMediator.ANIMATION_RIGHT_CLICK: showPopup(RESOURCE_ACTION_SET, notification.getBody()); break; case UIResourcesBoxMediator.LIBRARY_ITEM_RIGHT_CLICK: showPopup(RESOURCE_ACTION_SET, notification.getBody()); break; case UIResourcesBoxMediator.PARTICLE_EFFECT_RIGHT_CLICK: showPopup(RESOURCE_ACTION_SET, notification.getBody()); break; case UIDropDownMenu.ITEM_CLICKED: facade.sendNotification(notification.getBody(), currentObservable); break; default: break; } }