@Override public ColorMapBackedPicker get(WiresLayer layer) { return new CaseManagementColorMapBackedPicker(layer, getOptions()); } }
@Override protected ILayoutHandler createGhostLayoutHandler() { return new VerticalStackLayoutManager(); } }
private void restore(final CaseManagementShapeView ghost, final WiresContainer originalParent, final int originalIndex) { if (originalParent instanceof CaseManagementShapeView) { restore(ghost, (CaseManagementShapeView) originalParent, originalIndex); } else { restoreGhostParent(ghost); } }
@Override public void execute() { state.getGhost().ifPresent(ghost -> state.getOriginalParent().ifPresent(originalParent -> reparentDraggedShape(ghost, originalParent) ) ); clearState(); batch(); }
private void restore(final CaseManagementShapeView ghost) { state.getOriginalParent().ifPresent(originalParent -> state.getOriginalIndex().ifPresent(originalIndex -> restore(ghost, originalParent, originalIndex) ) ); }
public CaseManagementShapeControl(final WiresShape shape, final CaseManagementContainmentStateHolder state) { final ColorMapBackedPicker.PickerOptions pickerOptions = new ColorMapBackedPicker.PickerOptions(false, 0); final WiresParentPickerCachedControl parentPicker = new WiresParentPickerCachedControl(new CaseManagementShapeLocationControl(shape), new CaseManagementColorMapBackedPickerProvider(pickerOptions)); shapeControl = new WiresShapeControlImpl(parentPicker, new WiresMagnetsControlImpl(shape), null, new CaseManagementContainmentControl(parentPicker, state)); }
@Override public void reset() { state.getGhost().ifPresent(this::restore); clearState(); }
@Override protected ILayoutHandler createGhostLayoutHandler() { return new HorizontalStackLayoutManager(); } }
@Override public void add(final WiresShape shape, final WiresContainer container, final Point2D mouseRelativeLoc) { orderChildren(shape, container, mouseRelativeLoc); }
@Override public WiresShapeControl newShapeControl(WiresShape shape, WiresManager wiresManager) { return new CaseManagementShapeControl(shape, state); }
@Override //Override to make public for test public void drawShape(final String color, final double strokeWidth, final MultiPath multiPath, final PickerPart pickerPart, final boolean fill) { super.drawShape(color, strokeWidth, multiPath, pickerPart, fill); } }
@Override public void requestLayout(final WiresContainer container) { final WiresContainer root = findRoot(container); final List<WiresContainer> children = walker.getChildren(root); for (WiresContainer child : children) { child.getLayoutHandler().layout(child); } }
@Before public void setup() { this.state = new CaseManagementContainmentStateHolder(); this.factory = new CaseManagementControlFactory(state); }
@Override protected void addSupplementaryPaths(final WiresShape prim) { if (prim instanceof CaseManagementShapeView) { addDropZone((CaseManagementShapeView) prim); } }
@Override public void destroy() { clearState(); containmentControl.destroy(); }
private void reparentDraggedShape(final CaseManagementShapeView ghost, final WiresContainer originalParent) { if (!(originalParent instanceof CaseManagementShapeView)) { restoreGhostParent(ghost); } containmentControl.execute(); }
private void restore(final CaseManagementShapeView ghost, final CaseManagementShapeView parent, final int index) { ghost.removeFromParent(); parent.addShape(getShape(), index); }
@Before public void setup() { super.setup(); }
@Override protected AbstractNestedLayoutHandler getLayoutHandler() { return new VerticalStackLayoutManager(); }
@Override protected AbstractNestedLayoutHandler getLayoutHandler() { return new HorizontalStackLayoutManager(); }