本文整理了Java中com.ait.lienzo.client.core.shape.Layer.getScratchPad()
方法的一些代码示例,展示了Layer.getScratchPad()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Layer.getScratchPad()
方法的具体详情如下:
包路径:com.ait.lienzo.client.core.shape.Layer
类名称:Layer
方法名:getScratchPad
暂无
代码示例来源:origin: ahome-it/lienzo-core
@Override
public ColorMapBackedPicker get(final WiresLayer layer)
{
return new ColorMapBackedPicker(layer, layer.getChildShapes(), layer.getLayer().getScratchPad(), pickerOptions);
}
代码示例来源:origin: com.ahome-it/lienzo-core
@Override
public ColorMapBackedPicker get(final WiresLayer layer)
{
return new ColorMapBackedPicker(layer, layer.getChildShapes(), layer.getLayer().getScratchPad(), pickerOptions);
}
代码示例来源:origin: ahome-it/lienzo-core
@Override
public ColorMapBackedPicker get(final WiresLayer layer)
{
return new ColorMapBackedPicker(layer, layer.getChildShapes(), layer.getLayer().getScratchPad(), pickerOptions);
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-client
@Before
public void setup() {
when(shape.getWiresManager()).thenReturn(wiresManager);
when(wiresManager.getLayer()).thenReturn(wiresLayer);
when(wiresLayer.getLayer()).thenReturn(layer);
when(wiresLayer.getChildShapes()).thenReturn(new NFastArrayList<WiresShape>());
when(layer.getScratchPad()).thenReturn(scratchPad);
when(scratchPad.getContext()).thenReturn(context);
tested = new CaseManagementShapeControl(shape,
state);
}
代码示例来源: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 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 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: org.kie.workbench.stunner/kie-wb-common-stunner-lienzo
public static String layerToDataURL(final LienzoLayer lienzoLayer,
final DataURLType dataURLType,
final int x,
final int y,
final int width,
final int height,
final String bgColor) {
final com.ait.lienzo.client.core.shape.Layer layer = lienzoLayer.getLienzoLayer();
final ScratchPad scratchPad = layer.getScratchPad();
scratchPad.setPixelSize(width, height);
if (null != bgColor) {
scratchPad.getContext().setFillColor(bgColor);
scratchPad.getContext().fillRect(0,
0,
width,
height);
}
layer.drawWithTransforms(scratchPad.getContext(),
1,
new BoundingBox(x,
y,
width,
height));
final String data = scratchPad.toDataURL(dataURLType,
1);
scratchPad.clear();
return data;
}
代码示例来源:origin: ahome-it/lienzo-core
@Override
public void onMoveStart(final double x, final double y)
{
final Point2D points = getControlNode().getComputedLocation();
m_startX = points.getX();
m_startY = points.getY();
final ScratchPad scratch = m_manager.getLayer().getLayer().getScratchPad();
m_shapesBacking = BackingColorMapUtils.drawShapesToBacking(m_manager.getLayer().getChildShapes(), scratch, null, m_shape_color_map);
m_connector.getLine().getOverLayer().getContext().createImageData(m_shapesBacking);
final WiresConnection connection = getConnection();
m_initialAutoConnect = connection.isAutoConnection();
connection.setAutoConnection(false); // set it to false while dragging
m_initial_magnet = connection.getMagnet();
if (null != m_initial_magnet)
{
m_magnets = connection.getMagnet().getMagnets();
m_magnetsBacking = m_manager.getMagnetManager().drawMagnetsToBack(m_magnets, m_shape_color_map, m_magnet_color_map, scratch);
}
// always null when drag start and reset the offsets (they may already be 0)
connection.setMagnet(null);
connection.setXOffset(0);
connection.setYOffset(0);
final String colorKey = BackingColorMapUtils.findColorAtPoint(m_shapesBacking, (int) m_startX, (int) m_startY);
checkAllowAndShowMagnets(colorKey);
}
代码示例来源:origin: com.ahome-it/lienzo-core
@Override
public void onMoveStart(final double x, final double y)
{
final Point2D points = getControlNode().getComputedLocation();
m_startX = points.getX();
m_startY = points.getY();
final ScratchPad scratch = m_manager.getLayer().getLayer().getScratchPad();
m_shapesBacking = BackingColorMapUtils.drawShapesToBacking(m_manager.getLayer().getChildShapes(), scratch, null, m_shape_color_map);
m_connector.getLine().getOverLayer().getContext().createImageData(m_shapesBacking);
final WiresConnection connection = getConnection();
m_initialAutoConnect = connection.isAutoConnection();
connection.setAutoConnection(false); // set it to false while dragging
m_initial_magnet = connection.getMagnet();
if (null != m_initial_magnet)
{
m_magnets = connection.getMagnet().getMagnets();
m_magnetsBacking = m_manager.getMagnetManager().drawMagnetsToBack(m_magnets, m_shape_color_map, m_magnet_color_map, scratch);
}
// always null when drag start and reset the offsets (they may already be 0)
connection.setMagnet(null);
connection.setXOffset(0);
connection.setYOffset(0);
final String colorKey = BackingColorMapUtils.findColorAtPoint(m_shapesBacking, (int) m_startX, (int) m_startY);
checkAllowAndShowMagnets(colorKey);
}
代码示例来源:origin: ahome-it/lienzo-core
@Override
public void onMoveStart(final double x, final double y)
{
final Point2D points = getControlNode().getComputedLocation();
m_startX = points.getX();
m_startY = points.getY();
final ScratchPad scratch = m_manager.getLayer().getLayer().getScratchPad();
m_shapesBacking = BackingColorMapUtils.drawShapesToBacking(m_manager.getLayer().getChildShapes(), scratch, null, m_shape_color_map);
m_connector.getLine().getOverLayer().getContext().createImageData(m_shapesBacking);
final WiresConnection connection = getConnection();
m_initialAutoConnect = connection.isAutoConnection();
connection.setAutoConnection(false); // set it to false while dragging
m_initial_magnet = connection.getMagnet();
if (null != m_initial_magnet)
{
m_magnets = connection.getMagnet().getMagnets();
m_magnetsBacking = m_manager.getMagnetManager().drawMagnetsToBack(m_magnets, m_shape_color_map, m_magnet_color_map, scratch);
}
// always null when drag start and reset the offsets (they may already be 0)
connection.setMagnet(null);
connection.setXOffset(0);
connection.setYOffset(0);
final String colorKey = BackingColorMapUtils.findColorAtPoint(m_shapesBacking, (int) m_startX, (int) m_startY);
checkAllowAndShowMagnets(colorKey);
}
内容来源于网络,如有侵权,请联系作者删除!