本文整理了Java中com.ait.lienzo.client.core.shape.Text.measure()
方法的一些代码示例,展示了Text.measure()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Text.measure()
方法的具体详情如下:
包路径:com.ait.lienzo.client.core.shape.Text
类名称:Text
方法名:measure
[英]Returns TextMetrics, which includes an approximate value for height. As close as we can estimate it at this time.
[中]返回TextMetrics,其中包含高度的近似值。尽可能接近我们目前的估计。
代码示例来源:origin: com.ahome-it/lienzo-core
/**
* Returns TextMetrics, which includes an approximate value for
* height. As close as we can estimate it at this time.
*
* @param context
* @return TextMetric or null if the text is empty or null
*/
public TextMetrics measureWithIdentityTransform(final Context2D context)
{
context.save();
context.setToIdentityTransform();
final TextMetrics size = measure(context);
context.restore();
return size;
}
代码示例来源:origin: org.dashbuilder/dashbuilder-lienzo-core
/**
* Returns TextMetrics, which includes an approximate value for
* height. As close as we can estimate it at this time.
*
* @param context
* @return TextMetric or null if the text is empty or null
*/
public TextMetrics measureWithIdentityTransform(Context2D context)
{
context.save();
context.setToIdentityTransform();
TextMetrics size = measure(context);
context.restore();
return size;
}
代码示例来源:origin: ahome-it/lienzo-core
/**
* Returns TextMetrics, which includes an approximate value for
* height. As close as we can estimate it at this time.
*
* @param context
* @return TextMetric or null if the text is empty or null
*/
public TextMetrics measureWithIdentityTransform(final Context2D context)
{
context.save();
context.setToIdentityTransform();
final TextMetrics size = measure(context);
context.restore();
return size;
}
代码示例来源:origin: ahome-it/lienzo-core
/**
* Returns TextMetrics, which includes an approximate value for
* height. As close as we can estimate it at this time.
*
* @param context
* @return TextMetric or null if the text is empty or null
*/
public TextMetrics measureWithIdentityTransform(final Context2D context)
{
context.save();
context.setToIdentityTransform();
final TextMetrics size = measure(context);
context.restore();
return size;
}
代码示例来源:origin: kiegroup/drools-wb
private double getDragProxyWidth( final Text nodeLabel ) {
final LienzoPanel panel = new LienzoPanel( 100,
100 );
final Layer layer = new Layer();
panel.add( layer );
final TextMetrics tm = nodeLabel.measure( layer.getContext() );
return Math.max( getWidth(),
tm.getWidth() );
}
代码示例来源:origin: org.drools/drools-wb-guided-dtree-editor-client
private double getDragProxyWidth( final Text nodeLabel ) {
final LienzoPanel panel = new LienzoPanel( 100,
100 );
final Layer layer = new Layer();
panel.add( layer );
final TextMetrics tm = nodeLabel.measure( layer.getContext() );
return Math.max( getWidth(),
tm.getWidth() );
}
代码示例来源:origin: org.drools/drools-wb-guided-dtree-editor-client
private double getDragProxyHeight( final Text nodeLabel ) {
final LienzoPanel panel = new LienzoPanel( 100,
100 );
final Layer layer = new Layer();
panel.add( layer );
final TextMetrics tm = nodeLabel.measure( layer.getContext() );
return Math.max( getHeight(),
tm.getHeight() );
}
代码示例来源:origin: kiegroup/drools-wb
private double getDragProxyHeight( final Text nodeLabel ) {
final LienzoPanel panel = new LienzoPanel( 100,
100 );
final Layer layer = new Layer();
panel.add( layer );
final TextMetrics tm = nodeLabel.measure( layer.getContext() );
return Math.max( getHeight(),
tm.getHeight() );
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-scratchpad
public FixedTextFactory() {
final Text text = makeShape();
final LienzoPanel panel = new LienzoPanel(100,
100);
final Layer layer = new Layer();
panel.add(layer);
final TextMetrics tm = text.measure(layer.getContext());
TEXT_WIDTH = tm.getWidth();
TEXT_HEIGHT = tm.getHeight();
}
代码示例来源:origin: kiegroup/appformer
public FixedTextFactory() {
final Text text = makeShape();
final LienzoPanel panel = new LienzoPanel(100,
100);
final Layer layer = new Layer();
panel.add(layer);
final TextMetrics tm = text.measure(layer.getContext());
TEXT_WIDTH = tm.getWidth();
TEXT_HEIGHT = tm.getHeight();
}
代码示例来源:origin: kiegroup/drools-wb
public void setLabel( final String label ) {
final Layer scratchLayer = new Layer();
final LienzoPanel scratchPanel = new LienzoPanel( 100, 100 );
scratchPanel.add( scratchLayer );
text.setText( label );
final TextMetrics tm = text.measure( scratchLayer.getContext() );
final double cw = tm.getWidth() + 10;
final double ch = tm.getHeight() + 10;
container.setWidth( cw );
container.setHeight( ch );
container.setLocation( new Point2D( -cw / 2,
-ch / 2 ) );
}
代码示例来源:origin: org.drools/drools-wb-guided-dtree-editor-client
public void setLabel( final String label ) {
final Layer scratchLayer = new Layer();
final LienzoPanel scratchPanel = new LienzoPanel( 100, 100 );
scratchPanel.add( scratchLayer );
text.setText( label );
final TextMetrics tm = text.measure( scratchLayer.getContext() );
final double cw = tm.getWidth() + 10;
final double ch = tm.getHeight() + 10;
container.setWidth( cw );
container.setHeight( ch );
container.setLocation( new Point2D( -cw / 2,
-ch / 2 ) );
}
内容来源于网络,如有侵权,请联系作者删除!