@Test public void testRegisterElement() { tested.init(canvasHandler); assertFalse(isRegistered(element)); tested.register(element); assertTrue(isRegistered(element)); }
@Override public void register(final Element element) { if (!itemsRegistered().test(element.getUUID()) && element.getContent() instanceof View) { items.put(element.getUUID(), false); } }
MapSelectionControl extends AbstractCanvasHandlerControl<H> implements SelectionControl<H, Element>,
                   CanvasRegistrationControl<H, Element> { @Override public void register(final Element element) { if (!itemsRegistered().test(element.getUUID()) && element.getContent() instanceof View) { items.put(element.getUUID(), false); } } }
MapSelectionControl extends AbstractCanvasHandlerControl<H> implements SelectionControl<H, Element>,
                   CanvasRegistrationControl<H, Element> { @Override public void register(final Element element) { if (!itemsRegistered().test(element.getUUID()) && element.getContent() instanceof View) { items.put(element.getUUID(), false); } } MapSelectionControl(final Consumer<CanvasSelectionEvent> selectionEventConsumer,
                        final Consumer<CanvasClearSelectionEvent> clearSelectionEventConsumer); }
MapSelectionControl extends AbstractCanvasHandlerControl<H> implements SelectionControl<H, Element>,
                   CanvasRegistrationControl<H, Element> { @Override public void register(final Element element) { if (!itemsRegistered().test(element.getUUID()) && element.getContent() instanceof View) { items.put(element.getUUID(), false); } } MapSelectionControl(final Consumer<CanvasSelectionEvent> selectionEventConsumer,
                        final Consumer<CanvasClearSelectionEvent> clearSelectionEventConsumer); static MapSelectionControl<H> build(final Consumer<CanvasSelectionEvent> selectionEventConsumer,
                                                                                 final Consumer<CanvasClearSelectionEvent> clearSelectionEventConsumer); @Override void clear(); @Override void register(final Element element); @Override void deregister(final Element element); @Override SelectionControl<H, Element> select(final String uuid); @Override SelectionControl<H, Element> deselect(final String uuid); @Override boolean isSelected(final Element element); @Override Collection<String> getSelectedItems(); @Override SelectionControl<H, Element> clearSelection(); @Override Optional<Object> getSelectedItemDefinition(); boolean isReadonly(); void setReadonly(boolean readonly); SelectionControl<H, Element> select(final Collection<String> uuids); SelectionControl<H, Element> deselect(final Collection<String> uuids); boolean isSelected(final String uuid); void onShapeRemoved(final CanvasShapeRemovedEvent shapeRemovedEvent); void onCanvasElementSelected(final CanvasSelectionEvent event); void onCanvasClearSelection(final CanvasClearSelectionEvent event); AbstractCanvasHandler getCanvasHandler(); Predicate<String> itemsRegistered(); AbstractCanvas getCanvas(); }
MapSelectionControl extends AbstractCanvasHandlerControl<H> implements SelectionControl<H, Element>,
                   CanvasRegistrationControl<H, Element> { @Override public void register(final Element element) { if (!itemsRegistered().test(element.getUUID()) && element.getContent() instanceof View) { items.put(element.getUUID(), false); } } MapSelectionControl(final Consumer<CanvasSelectionEvent> selectionEventConsumer,
                        final Consumer<CanvasClearSelectionEvent> clearSelectionEventConsumer); static MapSelectionControl<H> build(final Consumer<CanvasSelectionEvent> selectionEventConsumer,
                                                                                 final Consumer<CanvasClearSelectionEvent> clearSelectionEventConsumer); @Override void clear(); @Override void register(final Element element); @Override void deregister(final Element element); @Override SelectionControl<H, Element> select(final String uuid); @Override SelectionControl<H, Element> deselect(final String uuid); @Override boolean isSelected(final Element element); @Override Collection<String> getSelectedItems(); @Override SelectionControl<H, Element> clearSelection(); @Override Optional<Object> getSelectedItemDefinition(); boolean isReadonly(); void setReadonly(boolean readonly); SelectionControl<H, Element> select(final Collection<String> uuids); SelectionControl<H, Element> deselect(final Collection<String> uuids); boolean isSelected(final String uuid); void onShapeRemoved(final CanvasShapeRemovedEvent shapeRemovedEvent); void onCanvasElementSelected(final CanvasSelectionEvent event); void onCanvasClearSelection(final CanvasClearSelectionEvent event); AbstractCanvasHandler getCanvasHandler(); Predicate<String> itemsRegistered(); AbstractCanvas getCanvas();  }