本文整理了Java中com.ait.lienzo.client.core.shape.Text.setFontStyle()
方法的一些代码示例,展示了Text.setFontStyle()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Text.setFontStyle()
方法的具体详情如下:
包路径:com.ait.lienzo.client.core.shape.Text
类名称:Text
方法名:setFontStyle
[英]Sets the Font Style.
[中]设置字体样式。
代码示例来源:origin: ahome-it/lienzo-core
/**
* Constructor. Creates an instance of text. Default no-wrap text wrapping.
*
* @param text
* @param family font family
* @param style font style (bold, italic, etc)
* @param size font size
*/
public Text(String text, String family, String style, double size)
{
super(ShapeType.TEXT);
final LienzoCore globals = LienzoCore.get();
if (null == text)
{
text = "";
}
if ((null == family) || ((family = family.trim()).isEmpty()))
{
family = globals.getDefaultFontFamily();
}
if ((null == style) || ((style = style.trim()).isEmpty()))
{
style = globals.getDefaultFontStyle();
}
if (size <= 0)
{
size = globals.getDefaultFontSize();
}
setText(text).setFontFamily(family).setFontStyle(style).setFontSize(size);
}
代码示例来源:origin: com.ahome-it/lienzo-core
/**
* Constructor. Creates an instance of text. Default no-wrap text wrapping.
*
* @param text
* @param family font family
* @param style font style (bold, italic, etc)
* @param size font size
*/
public Text(String text, String family, String style, double size)
{
super(ShapeType.TEXT);
final LienzoCore globals = LienzoCore.get();
if (null == text)
{
text = "";
}
if ((null == family) || ((family = family.trim()).isEmpty()))
{
family = globals.getDefaultFontFamily();
}
if ((null == style) || ((style = style.trim()).isEmpty()))
{
style = globals.getDefaultFontStyle();
}
if (size <= 0)
{
size = globals.getDefaultFontSize();
}
setText(text).setFontFamily(family).setFontStyle(style).setFontSize(size);
}
代码示例来源:origin: com.ahome-it/lienzo-core
/**
* Constructor. Creates an instance of text. Default no-wrap text wrapping.
*
* @param text
* @param family font family
* @param size font size
*/
public Text(String text, String family, double size)
{
super(ShapeType.TEXT);
final LienzoCore globals = LienzoCore.get();
if (null == text)
{
text = "";
}
if ((null == family) || ((family = family.trim()).isEmpty()))
{
family = globals.getDefaultFontFamily();
}
if (size <= 0)
{
size = globals.getDefaultFontSize();
}
setText(text).setFontFamily(family).setFontStyle(globals.getDefaultFontStyle()).setFontSize(size);
}
代码示例来源:origin: ahome-it/lienzo-core
/**
* Constructor. Creates an instance of text. Default no-wrap text wrapping.
*
* @param text
* @param family font family
* @param size font size
*/
public Text(String text, String family, double size)
{
super(ShapeType.TEXT);
final LienzoCore globals = LienzoCore.get();
if (null == text)
{
text = "";
}
if ((null == family) || ((family = family.trim()).isEmpty()))
{
family = globals.getDefaultFontFamily();
}
if (size <= 0)
{
size = globals.getDefaultFontSize();
}
setText(text).setFontFamily(family).setFontStyle(globals.getDefaultFontStyle()).setFontSize(size);
}
代码示例来源:origin: ahome-it/lienzo-core
/**
* Constructor. Creates an instance of text. Default no-wrap text wrapping.
*
* @param text
* @param family font family
* @param size font size
*/
public Text(String text, String family, double size)
{
super(ShapeType.TEXT);
final LienzoCore globals = LienzoCore.get();
if (null == text)
{
text = "";
}
if ((null == family) || ((family = family.trim()).isEmpty()))
{
family = globals.getDefaultFontFamily();
}
if (size <= 0)
{
size = globals.getDefaultFontSize();
}
setText(text).setFontFamily(family).setFontStyle(globals.getDefaultFontStyle()).setFontSize(size);
}
代码示例来源:origin: kiegroup/appformer
@Override
public Text getHeaderText() {
final Text t = new Text("")
.setFillColor(ColorName.DARKGREEN)
.setFontSize(12)
.setFontStyle("bold")
.setFontFamily("serif")
.setListening(false)
.setTextBaseLine(TextBaseLine.MIDDLE)
.setTextAlign(TextAlign.CENTER);
return t;
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-grids
@Override
public Text getHeaderText() {
final Text t = new Text("")
.setFillColor(ColorName.DARKRED)
.setFontSize(12)
.setFontStyle("bold")
.setFontFamily("serif")
.setListening(false)
.setTextBaseLine(TextBaseLine.MIDDLE)
.setTextAlign(TextAlign.CENTER);
return t;
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-grids
@Override
public Text getHeaderText() {
final Text t = new Text("")
.setFillColor(ColorName.DARKGOLDENROD)
.setFontSize(12)
.setFontStyle("bold")
.setFontFamily("serif")
.setListening(false)
.setTextBaseLine(TextBaseLine.MIDDLE)
.setTextAlign(TextAlign.CENTER);
return t;
}
代码示例来源:origin: kiegroup/appformer
@Override
public Text getHeaderText() {
final Text t = new Text("")
.setFillColor(ColorName.DARKRED)
.setFontSize(12)
.setFontStyle("bold")
.setFontFamily("serif")
.setListening(false)
.setTextBaseLine(TextBaseLine.MIDDLE)
.setTextAlign(TextAlign.CENTER);
return t;
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-grids
@Override
public Text getHeaderText() {
final Text t = new Text("")
.setFillColor(ColorName.DARKBLUE)
.setFontSize(12)
.setFontStyle("bold")
.setFontFamily("serif")
.setListening(false)
.setTextBaseLine(TextBaseLine.MIDDLE)
.setTextAlign(TextAlign.CENTER);
return t;
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-grids
@Override
public Text getHeaderText() {
final Text t = new Text("")
.setFillColor(ColorName.DARKGREEN)
.setFontSize(12)
.setFontStyle("bold")
.setFontFamily("serif")
.setListening(false)
.setTextBaseLine(TextBaseLine.MIDDLE)
.setTextAlign(TextAlign.CENTER);
return t;
}
代码示例来源:origin: kiegroup/appformer
@Override
public Text getHeaderText() {
final Text t = new Text("")
.setFillColor(ColorName.DARKGOLDENROD)
.setFontSize(12)
.setFontStyle("bold")
.setFontFamily("serif")
.setListening(false)
.setTextBaseLine(TextBaseLine.MIDDLE)
.setTextAlign(TextAlign.CENTER);
return t;
}
代码示例来源:origin: kiegroup/appformer
@Override
public Text getHeaderText() {
final Text t = new Text("")
.setFillColor(ColorName.DARKBLUE)
.setFontSize(12)
.setFontStyle("bold")
.setFontFamily("serif")
.setListening(false)
.setTextBaseLine(TextBaseLine.MIDDLE)
.setTextAlign(TextAlign.CENTER);
return t;
}
代码示例来源:origin: com.ahome-it/lienzo-core
/**
* Constructor. Creates an instance of text. Default no-wrap text wrapping.
*
* @param text
*/
public Text(String text)
{
super(ShapeType.TEXT);
final LienzoCore globals = LienzoCore.get();
if (null == text)
{
text = "";
}
setText(text).setFontFamily(globals.getDefaultFontFamily()).setFontStyle(globals.getDefaultFontStyle()).setFontSize(globals.getDefaultFontSize());
}
代码示例来源:origin: org.dashbuilder/dashbuilder-lienzo-core
/**
* Constructor. Creates an instance of text.
*
* @param text
*/
public Text(String text)
{
super(ShapeType.TEXT);
final LienzoCore globals = LienzoCore.get();
if (null == text)
{
text = "";
}
setText(text).setFontFamily(globals.getDefaultFontFamily()).setFontStyle(globals.getDefaultFontStyle()).setFontSize(globals.getDefaultFontSize());
}
代码示例来源:origin: ahome-it/lienzo-core
/**
* Constructor. Creates an instance of text. Default no-wrap text wrapping.
*
* @param text
*/
public Text(String text)
{
super(ShapeType.TEXT);
final LienzoCore globals = LienzoCore.get();
if (null == text)
{
text = "";
}
setText(text).setFontFamily(globals.getDefaultFontFamily()).setFontStyle(globals.getDefaultFontStyle()).setFontSize(globals.getDefaultFontSize());
}
代码示例来源:origin: ahome-it/lienzo-core
/**
* Constructor. Creates an instance of text. Default no-wrap text wrapping.
*
* @param text
*/
public Text(String text)
{
super(ShapeType.TEXT);
final LienzoCore globals = LienzoCore.get();
if (null == text)
{
text = "";
}
setText(text).setFontFamily(globals.getDefaultFontFamily()).setFontStyle(globals.getDefaultFontStyle()).setFontSize(globals.getDefaultFontSize());
}
代码示例来源:origin: kiegroup/appformer
/**
* Delegates the Body's Text to sub-classes.
* @return A {@link Text} used to render the placeholder in the body.
*/
default Text getPlaceholderText() {
return new Text("")
.setFillColor(KIEColours.PLACEHOLDER_COLOR)
.setFontSize(KIEStyles.FONT_SIZE)
.setFontFamily(KIEStyles.FONT_FAMILY_LABEL)
.setFontStyle(KIEStyles.FONT_STYLE_ITALIC)
.setTextUnit(TextUnit.PT)
.setListening(false)
.setTextBaseLine(TextBaseLine.MIDDLE)
.setTextAlign(TextAlign.CENTER);
}
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-grids
/**
* Delegates the Body's Text to sub-classes.
* @return A {@link Text} used to render the placeholder in the body.
*/
default Text getPlaceholderText() {
return new Text("")
.setFillColor(KIEColours.PLACEHOLDER_COLOR)
.setFontSize(KIEStyles.FONT_SIZE)
.setFontFamily(KIEStyles.FONT_FAMILY_LABEL)
.setFontStyle(KIEStyles.FONT_STYLE_ITALIC)
.setTextUnit(TextUnit.PT)
.setListening(false)
.setTextBaseLine(TextBaseLine.MIDDLE)
.setTextAlign(TextAlign.CENTER);
}
}
代码示例来源:origin: org.kie.workbench/kie-wb-common-dmn-client
private static Group getNameAndDataTypeText(final GridRendererTheme theme,
final String name,
final QName typeRef,
final double blockWidth,
final double blockHeight) {
final Group headerGroup = GWT.create(Group.class);
final Text tName = theme.getHeaderText();
tName.setText(name);
tName.setListening(false);
tName.setX(blockWidth / 2);
tName.setY(blockHeight / 2 - SPACING);
final Text tTypeRef = theme.getHeaderText();
tTypeRef.setFontStyle(FONT_STYLE_TYPE_REF);
tTypeRef.setFontSize(BaseExpressionGridTheme.FONT_SIZE - 2.0);
tTypeRef.setText("(" + typeRef.toString() + ")");
tTypeRef.setListening(false);
tTypeRef.setX(blockWidth / 2);
tTypeRef.setY(blockHeight / 2 + SPACING);
headerGroup.add(tName);
headerGroup.add(tTypeRef);
return headerGroup;
}
}
内容来源于网络,如有侵权,请联系作者删除!