org.kie.workbench.common.stunner.bpmn.definition.property.dimensions.Width.setValue()方法的使用及代码示例

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

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

Width.setValue介绍

暂无

代码示例

代码示例来源: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-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-backend

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

代码示例来源: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());
  }
}

相关文章