gpt4 book ai didi

com.ait.lienzo.client.core.shape.wires.WiresShape.getMagnets()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 11:57:05 29 4
gpt4 key购买 nike

本文整理了Java中com.ait.lienzo.client.core.shape.wires.WiresShape.getMagnets()方法的一些代码示例,展示了WiresShape.getMagnets()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WiresShape.getMagnets()方法的具体详情如下:
包路径:com.ait.lienzo.client.core.shape.wires.WiresShape
类名称:WiresShape
方法名:getMagnets

WiresShape.getMagnets介绍

暂无

代码示例

代码示例来源:origin: ahome-it/lienzo-core

private MagnetManager.Magnets getMagnets()
  {
    return shape.getMagnets();
  }
}

代码示例来源:origin: com.ahome-it/lienzo-core

private MagnetManager.Magnets getMagnets()
  {
    return shape.getMagnets();
  }
}

代码示例来源:origin: ahome-it/lienzo-core

private MagnetManager.Magnets getMagnets()
  {
    return shape.getMagnets();
  }
}

代码示例来源:origin: com.ahome-it/lienzo-core

public static WiresConnector[] collectionSpecialConnectors(final WiresShape shape)
{
  if (shape.getMagnets() == null)
  {
    return null;
  }
  final Map<String, WiresConnector> connectors = new HashMap<>();
  collectionSpecialConnectors(shape, connectors);
  return connectors.values().toArray(new WiresConnector[connectors.size()]);
}

代码示例来源:origin: ahome-it/lienzo-core

public static WiresConnector[] collectionSpecialConnectors(final WiresShape shape)
{
  if (shape.getMagnets() == null)
  {
    return null;
  }
  final Map<String, WiresConnector> connectors = new HashMap<>();
  collectionSpecialConnectors(shape, connectors);
  return connectors.values().toArray(new WiresConnector[connectors.size()]);
}

代码示例来源:origin: ahome-it/lienzo-core

public static WiresConnector[] collectionSpecialConnectors(final WiresShape shape)
{
  if (shape.getMagnets() == null)
  {
    return null;
  }
  final Map<String, WiresConnector> connectors = new HashMap<>();
  collectionSpecialConnectors(shape, connectors);
  return connectors.values().toArray(new WiresConnector[connectors.size()]);
}

代码示例来源:origin: ahome-it/lienzo-core

private WiresMagnet[] getMagnets(final WiresConnection connection, final WiresShape shape)
{
  WiresMagnet[] magnets;
  if (connection.isAutoConnection())
  {
    magnets = new WiresMagnet[shape.getMagnets().size()];
    for (int i = 0, size = shape.getMagnets().size(); i < size; i++)
    {
      magnets[i] = shape.getMagnets().getMagnet(i);
    }
  }
  else if (shape == null)
  {
    // set it to 2, as centre is first, which is skipped.
    magnets = new WiresMagnet[2];
  }
  else
  {
    // set it to 2, as centre is first, which is skipped. And only populate the second
    magnets = new WiresMagnet[] { null, connection.getMagnet() };
  }
  return magnets;
}

代码示例来源:origin: com.ahome-it/lienzo-core

@Override
  public void onShapeResizeStep(final WiresResizeStepEvent event)
  {
    final WiresMagnet currentMagnet = parentWireShape.getMagnets().getMagnet(magnet.getIndex());
    shape.setLocation(calculateAbsCandidateLocation(shape, currentMagnet));
    shape.shapeMoved();
  }
}));

代码示例来源:origin: ahome-it/lienzo-core

@Override
public void shapeMoved()
{
  super.shapeMoved();
  if (getMagnets() != null)
  {
    getControl().getMagnetsControl().shapeMoved();
  }
}

代码示例来源:origin: ahome-it/lienzo-core

@Override
  public void onShapeResizeStep(final WiresResizeStepEvent event)
  {
    final WiresMagnet currentMagnet = parentWireShape.getMagnets().getMagnet(magnet.getIndex());
    shape.setLocation(calculateAbsCandidateLocation(shape, currentMagnet));
    shape.shapeMoved();
  }
}));

代码示例来源:origin: com.ahome-it/lienzo-core

@Override
public void shapeMoved()
{
  super.shapeMoved();
  if (getMagnets() != null)
  {
    getControl().getMagnetsControl().shapeMoved();
  }
}

代码示例来源:origin: ahome-it/lienzo-core

@Override
public void shapeMoved()
{
  super.shapeMoved();
  if (getMagnets() != null)
  {
    getControl().getMagnetsControl().shapeMoved();
  }
}

代码示例来源:origin: ahome-it/lienzo-core

@Override
  public void onShapeResizeStep(final WiresResizeStepEvent event)
  {
    final WiresMagnet currentMagnet = parentWireShape.getMagnets().getMagnet(magnet.getIndex());
    shape.setLocation(calculateAbsCandidateLocation(shape, currentMagnet));
    shape.shapeMoved();
  }
}));

代码示例来源:origin: com.ahome-it/lienzo-core

private double[] resizeWhileDrag(final AbstractNodeDragEvent<?> dragEvent)
{
  if (m_wires_shape.isResizable())
  {
    // Ensure magnets hidden while resizing.
    final Magnets mags = m_wires_shape.getMagnets();
    if (null != mags)
    {
      mags.hide();
    }
    final double[] attrs = getBBAttributes(getControlPointsArray());
    resize(attrs[0], attrs[1], attrs[2], attrs[3], false);
    return attrs;
  }
  return null;
}

代码示例来源:origin: ahome-it/lienzo-core

private void showMagnets(final WiresShape prim)
{
  m_magnets = null != prim ? prim.getMagnets() : null;
  if (m_magnets != null)
  {
    m_magnets.show();
    final ScratchPad scratch = m_manager.getLayer().getLayer().getScratchPad();
    m_magnetsBacking = m_manager.getMagnetManager().drawMagnetsToBack(m_magnets, m_shape_color_map, m_magnet_color_map, scratch);
  }
}

代码示例来源:origin: ahome-it/lienzo-core

private double[] resizeWhileDrag(final AbstractNodeDragEvent<?> dragEvent)
{
  if (m_wires_shape.isResizable())
  {
    // Ensure magnets hidden while resizing.
    final Magnets mags = m_wires_shape.getMagnets();
    if (null != mags)
    {
      mags.hide();
    }
    final double[] attrs = getBBAttributes(getControlPointsArray());
    resize(attrs[0], attrs[1], attrs[2], attrs[3], false);
    return attrs;
  }
  return null;
}

代码示例来源:origin: com.ahome-it/lienzo-core

private void showMagnets(final WiresShape prim)
{
  m_magnets = null != prim ? prim.getMagnets() : null;
  if (m_magnets != null)
  {
    m_magnets.show();
    final ScratchPad scratch = m_manager.getLayer().getLayer().getScratchPad();
    m_magnetsBacking = m_manager.getMagnetManager().drawMagnetsToBack(m_magnets, m_shape_color_map, m_magnet_color_map, scratch);
  }
}

代码示例来源:origin: ahome-it/lienzo-core

private double[] resizeWhileDrag(final AbstractNodeDragEvent<?> dragEvent)
{
  if (m_wires_shape.isResizable())
  {
    // Ensure magnets hidden while resizing.
    final Magnets mags = m_wires_shape.getMagnets();
    if (null != mags)
    {
      mags.hide();
    }
    final double[] attrs = getBBAttributes(getControlPointsArray());
    resize(attrs[0], attrs[1], attrs[2], attrs[3], false);
    return attrs;
  }
  return null;
}

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

private void handleConnections(final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> commandBuilder,
                final Node<View<?>, Edge> node,
                final Supplier<Connection> connectionSupplier,
                final Supplier<CanvasCommand<AbstractCanvasHandler>> commandSupplier) {
  final Connection connection = connectionSupplier.get();
  if (Objects.isNull(connection) || !(connection instanceof MagnetConnection)) {
    return;
  }
  final MagnetConnection magnetConnection = (MagnetConnection) connection;
  magnetConnection.getMagnetIndex().ifPresent(index -> {
    final Shape shape = canvasHandler.getCanvas().getShape(node.getUUID());
    Optional.ofNullable(WiresUtils.isWiresShape(shape.getShapeView()) ? (WiresShape) shape.getShapeView() : null)
        .ifPresent(wiresShape -> {
          final WiresMagnet magnet = wiresShape.getMagnets().getMagnet(index);
          magnetConnection.setLocation(new Point2D(magnet.getX(), magnet.getY()));
          commandBuilder.addCommand(commandSupplier.get());
        });
  });
}

代码示例来源:origin: ahome-it/lienzo-core

private void showMagnets(final WiresShape prim)
{
  m_magnets = null != prim ? prim.getMagnets() : null;
  if (m_magnets != null)
  {
    m_magnets.show();
    final ScratchPad scratch = m_manager.getLayer().getLayer().getScratchPad();
    m_magnetsBacking = m_manager.getMagnetManager().drawMagnetsToBack(m_magnets, m_shape_color_map, m_magnet_color_map, scratch);
  }
}

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com