org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.Width类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(9.2k)|赞(0)|评价(0)|浏览(119)

本文整理了Java中org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.Width类的一些代码示例,展示了Width类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Width类的具体详情如下:
包路径:org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.Width
类名称:Width

Width介绍

暂无

代码示例

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-api

public RectangleDimensionsSet(final Double width,
               final Double height) {
  this(new Width(width),
     new Height(height));
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-client

public SVGShapeView<?> newViewInstance(final Optional<Width> width,
                      final Optional<Height> height,
                      final SVGShapeViewResource viewResource
  ) {
    Optional<Double> widthValue = Optional.ofNullable(width.isPresent() ? width.get().getValue() : null);
    Optional<Double> heightValue = Optional.ofNullable(height.isPresent() ? height.get().getValue() : null);
    return viewResource.build(widthValue.orElse(null), heightValue.orElse(null), true);
  }
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-api

@Override
  public boolean equals(Object o) {
    if (o instanceof RectangleDimensionsSet) {
      RectangleDimensionsSet other = (RectangleDimensionsSet) o;
      return width.equals(other.width) &&
          height.equals(other.height);
    }
    return false;
  }
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-client

@Override
public void handle(final ServiceTask bean,
          final SVGShapeView<?> view) {
  // Obtain the work item's icon data url.
  final String itemIconData = workItemDefinitionRegistry
      .get()
      .get(bean.getName())
      .getIconDefinition()
      .getIconData();
  final String iconData = null != itemIconData ? itemIconData : WorkItemDefinitionClientUtils.getDefaultIconData();
  // Obtain the image element from the svg shape view.
  final SVGPrimitive svgPrimitive = SVGViewUtils.getPrimitive(view, WID_ICON_ID).get();
  // Load the icon data.
  final Picture icon = (Picture) svgPrimitive.get();
  if (hasDataChanged(iconData,
            icon.getURL())) {
    forceLoad(icon,
         iconData,
         () -> scaleViewIcon(view, icon));
  }
  if (Objects.equals(bean.getDimensionsSet().getHeight().getValue(), 0d)
      && Objects.equals(bean.getDimensionsSet().getWidth().getValue(), 0d)) {
    bean.getDimensionsSet().getHeight().setValue(view.getPrimitive().get().getAttributes().getHeight());
    bean.getDimensionsSet().getWidth().setValue(view.getPrimitive().get().getAttributes().getWidth());
  }
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-project-client

@Test
  @SuppressWarnings("unchecked")
  public void testHandle() {
    when(imageProxy.isLoaded()).thenReturn(true);
    when(icon.getBoundingBox()).thenReturn(new BoundingBox(0d,
                                0d,
                                ServiceTaskShapeViewHandler.WID_ICON_WIDTH * 2,
                                ServiceTaskShapeViewHandler.WID_ICON_HEIGHT * 2));
    tested.handle(task, view);
    ArgumentCaptor<ImageShapeLoadedHandler> loadedHandlerArgumentCaptor =
        ArgumentCaptor.forClass(ImageShapeLoadedHandler.class);
    verify(imageProxy, times(1)).setImageShapeLoadedHandler(loadedHandlerArgumentCaptor.capture());
    verify(imageProxy, times(1)).load(eq(WID_ICON_DATA));
    ImageShapeLoadedHandler loadedHandler = loadedHandlerArgumentCaptor.getValue();
    loadedHandler.onImageShapeLoaded(icon);
    verify(icon, times(1)).setScale(eq(0.5d), eq(0.5d));
    verify(width, times(1)).setValue(WIDTH);
    verify(height, times(1)).setValue(HEIGHT);
  }
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-api

@Override
public int hashCode() {
  return HashUtil.combineHashCodes(width.hashCode(),
                   height.hashCode());
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-project-client

@Before
@SuppressWarnings("unchecked")
public void init() throws Exception {
  this.task = new ServiceTask();
  task.getDimensionsSet().getWidth().setValue(WIDTH);
  task.getDimensionsSet().getHeight().setValue(HEIGHT);
  this.task.setName(WID_ID);
  when(node.getDefinition()).thenReturn(task);
  when(node.getBounds()).thenReturn(BOUNDS);
  when(registry.items()).thenReturn(Collections.singleton(DEF));
  when(registry.get(eq(WID_ID))).thenReturn(DEF);
  when(view.getChildren()).thenReturn(Collections.singletonList(imageSvgPrimitive));
  when(imageSvgPrimitive.getId()).thenReturn(ServiceTaskShapeViewHandler.WID_ICON_ID);
  when(imageSvgPrimitive.get()).thenReturn(imagePrimitive);
  when(imageSvgPrimitive.getPrimitiveId()).thenReturn(ServiceTaskShapeViewHandler.WID_ICON_ID);
  when(imagePrimitive.getID()).thenReturn(ServiceTaskShapeViewHandler.WID_ICON_ID);
  when(imagePrimitive.getImageProxy()).thenReturn(imageProxy);
  this.tested = new ServiceTaskShapeDef(() -> registry,
                     iconDataGlyphGenerator);
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-api

public RectangleDimensionsSet() {
  this(new Width(),
     new Height());
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-client

@Override
public SizeHandler<BPMNDiagramImpl, SVGShapeView> newSizeHandler() {
  return newSizeHandlerBuilder()
      .width(e -> e.getDimensionsSet().getWidth().getValue())
      .height(e -> e.getDimensionsSet().getHeight().getValue())
      .build();
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend

w.setValue(width);
if (h != null) {
  break;

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-client

@Override
public SVGShapeView<?> newViewInstance(final CaseManagementSVGViewFactory factory,
                    final BPMNViewDefinition bean) {
  return newViewInstance(Optional.of(new Width(0d)),
              Optional.of(new Height(0d)),
              factory.task());
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-client

@Override
public SizeHandler<CaseManagementDiagram, SVGShapeView> newSizeHandler() {
  return newSizeHandlerBuilder()
      .width(e -> e.getDimensionsSet().getWidth().getValue())
      .height(e -> e.getDimensionsSet().getHeight().getValue())
      .build();
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-project-client

@Before
@SuppressWarnings("unchecked")
public void init() {
  task = new ServiceTask();
  task.setName(WID_ID);
  task.setDimensionsSet(new RectangleDimensionsSet());
  width = spy(new Width(0d));
  height = spy(new Height(0d));
  task.getDimensionsSet().setWidth(width);
  task.getDimensionsSet().setHeight(height);
  when(registry.items()).thenReturn(Collections.singleton(DEF));
  when(registry.get(eq(WID_ID))).thenReturn(DEF);
  when(view.getChildren()).thenReturn(Collections.singletonList(iconSVGPrimiite));
  when(iconSVGPrimiite.getId()).thenReturn(ServiceTaskShapeViewHandler.WID_ICON_ID);
  when(iconSVGPrimiite.get()).thenReturn(icon);
  when(iconSVGPrimiite.getPrimitiveId()).thenReturn(ServiceTaskShapeViewHandler.WID_ICON_ID);
  when(icon.getID()).thenReturn(ServiceTaskShapeViewHandler.WID_ICON_ID);
  when(icon.getImageProxy()).thenReturn(imageProxy);
  when(view.getPrimitive()).thenReturn(iconSVGPrimiite);
  when(icon.getAttributes()).thenReturn(svgAttr);
  when(svgAttr.getHeight()).thenReturn(HEIGHT);
  when(svgAttr.getWidth()).thenReturn(WIDTH);
  this.tested = new ServiceTaskShapeViewHandler(() -> registry);
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-client

@Override
public SizeHandler<Lane, SVGShapeView> newSizeHandler() {
  return newSizeHandlerBuilder()
      .width(e -> e.getDimensionsSet().getWidth().getValue())
      .height(e -> e.getDimensionsSet().getHeight().getValue())
      .minWidth(task -> 200d)
      .minHeight(task -> 200d)
      .build();
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend

root.getDiagramSet().setName(new Name("Case"));
root.getDiagramSet().setId(new Id("New Case Management diagram"));
root.getDimensionsSet().setWidth(new Width(2800.0));
root.getDimensionsSet().setHeight(new Height(1400.0));
View<CaseManagementDiagram> rootContent = new ViewImpl<>(root, Bounds.create(0.0, 0.0, 2800.0, 1400.0));

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-client

@Override
public SizeHandler<BaseCaseManagementReusableSubprocess, SVGShapeView> newSizeHandler() {
  return newSizeHandlerBuilder()
      .width(e -> e.getDimensionsSet().getWidth().getValue())
      .height(e -> e.getDimensionsSet().getHeight().getValue())
      .minWidth(e -> 50d)
      .minHeight(e -> 50d)
      .build();
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend

root.getDiagramSet().setName(new Name("SubcaseTest"));
root.getDiagramSet().setId(new Id("SubcaseTest"));
root.getDimensionsSet().setWidth(new Width(2800.0));
root.getDimensionsSet().setHeight(new Height(1400.0));

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-client

@Override
public SizeHandler<AdHocSubprocess, SVGShapeView> newSizeHandler() {
  return newSizeHandlerBuilder()
      .width(e -> e.getDimensionsSet().getWidth().getValue())
      .height(e -> e.getDimensionsSet().getHeight().getValue())
      .minWidth(e -> 50d)
      .minHeight(e -> 50d)
      .build();
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend

root.getDiagramSet().setName(new Name("SubprocessTest"));
root.getDiagramSet().setId(new Id("SubprocessTest"));
root.getDimensionsSet().setWidth(new Width(2800.0));
root.getDimensionsSet().setHeight(new Height(1400.0));

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-client

@Override
public SizeHandler<BaseSubprocess, SVGShapeView> newSizeHandler() {
  return newSizeHandlerBuilder()
      .width(task -> task.getDimensionsSet().getWidth().getValue())
      .height(task -> task.getDimensionsSet().getHeight().getValue())
      .minWidth(task -> 50d)
      .minHeight(task -> 50d)
      .build();
}

相关文章