本文整理汇总了Java中cz.vutbr.web.css.CSSProperty.TextDecoration类的典型用法代码示例。如果您正苦于以下问题:Java TextDecoration类的具体用法?Java TextDecoration怎么用?Java TextDecoration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextDecoration类属于cz.vutbr.web.css.CSSProperty包,在下文中一共展示了TextDecoration类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setPropertiesFromAttributes
import cz.vutbr.web.css.CSSProperty.TextDecoration; //导入依赖的package包/类
/**
* Sets the properties from the attributes.
*
* @param attr
* the new properties from attributes
*/
protected void setPropertiesFromAttributes(AttributeSet attr)
{
if (attr != null)
{
Font newFont = (Font) attr.getAttribute(Constants.ATTRIBUTE_FONT);
if (newFont != null)
{
setFont(newFont);
}
else
{
// the font is the most important for us
throw new IllegalStateException("Font can not be null !");
}
setForeground((Color) attr.getAttribute(Constants.ATTRIBUTE_FOREGROUND));
setFontVariant((String) attr.getAttribute(Constants.ATTRIBUTE_FONT_VARIANT));
@SuppressWarnings("unchecked")
List<TextDecoration> attribute = (List<TextDecoration>) attr.getAttribute(Constants.ATTRIBUTE_TEXT_DECORATION);
setTextDecoration(attribute);
}
}
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:30,代码来源:TextBoxView.java
示例2: setTextDecoration
import cz.vutbr.web.css.CSSProperty.TextDecoration; //导入依赖的package包/类
/**
* Sets the text decoration.
*
* @param newTextDecoration
* the new text decoration
*/
protected void setTextDecoration(List<TextDecoration> newTextDecoration)
{
if (textDecoration == null || !textDecoration.equals(newTextDecoration))
{
// TextDecoration val[] = TextDecoration.values();
// for (int i=0; i<val.length; i++) {
// if (val[i].toString().equals(newTextDecoration)) {
textDecoration = newTextDecoration;
reflectTextDecoration(textDecoration);
invalidateCache();
// return;
// }
// }
}
}
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:25,代码来源:TextBoxView.java
示例3: getTextDecorationString
import cz.vutbr.web.css.CSSProperty.TextDecoration; //导入依赖的package包/类
/**
* Returns the text decoration used for the box.
* @return <code>none</code> or a string of space separated keywords <code>underline</code>, <code>overline</code>, <code>line-through</code> or <code>blink</code>
*/
public String getTextDecorationString()
{
if (textDecoration.isEmpty())
return "none";
else
{
StringBuilder ret = new StringBuilder();
for (CSSProperty.TextDecoration dec : textDecoration)
{
if (ret.length() > 0)
ret.append(' ');
ret.append(dec.toString());
}
return ret.toString();
}
}
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:21,代码来源:VisualContext.java
示例4: VisualContext
import cz.vutbr.web.css.CSSProperty.TextDecoration; //导入依赖的package包/类
public VisualContext(VisualContext parent, BoxFactory factory)
{
this.parent = parent;
this.factory = factory;
rootContext = (parent == null) ? this : parent.rootContext;
em = CSSUnits.medium_font;
rem = em;
ex = 0.6 * em;
ch = 0.8 * ch; //just an initial guess, updated in updateForGraphics()
dpi = org.fit.cssbox.css.CSSUnits.dpi;
font = new Font(Font.SERIF, Font.PLAIN, (int) CSSUnits.medium_font);
fontSize = CSSUnits.points(CSSUnits.medium_font);
fontWeight = CSSProperty.FontWeight.NORMAL;
fontStyle = CSSProperty.FontStyle.NORMAL;
fontVariant = CSSProperty.FontVariant.NORMAL;
textDecoration = new ArrayList<CSSProperty.TextDecoration>(2); //it is not very probable to have more than two decorations
color = Color.BLACK;
}
开发者ID:radkovo,项目名称:CSSBox,代码行数:19,代码来源:VisualContext.java
示例5: create
import cz.vutbr.web.css.CSSProperty.TextDecoration; //导入依赖的package包/类
public VisualContext create()
{
VisualContext ret = new VisualContext(this, this.factory);
ret.viewport = viewport;
ret.rootContext = rootContext;
ret.em = em;
ret.rem = rem;
ret.ex = ex;
ret.ch = ch;
ret.dpi = dpi;
ret.font = font;
ret.fontSize = fontSize;
ret.fontWeight = fontWeight;
ret.fontStyle = fontStyle;
ret.fontVariant = fontVariant;
ret.textDecoration = new ArrayList<CSSProperty.TextDecoration>(textDecoration);
ret.color = color;
return ret;
}
开发者ID:radkovo,项目名称:CSSBox,代码行数:20,代码来源:VisualContext.java
示例6: VisualContext
import cz.vutbr.web.css.CSSProperty.TextDecoration; //导入依赖的package包/类
public VisualContext(VisualContext parent, BoxFactory factory)
{
this.parent = parent;
this.factory = factory;
rootContext = (parent == null) ? this : parent.rootContext;
em = CSSUnits.medium_font;
rem = em;
ex = 0.6 * em;
ch = 0.8 * ch; //just an initial guess, updated in updateForGraphics()
dpi = CSSUnits.dpi;
font = new Font(Font.SERIF, Font.PLAIN, (int) CSSUnits.medium_font);
fontSize = CSSUnits.points(CSSUnits.medium_font);
fontWeight = CSSProperty.FontWeight.NORMAL;
fontStyle = CSSProperty.FontStyle.NORMAL;
fontVariant = CSSProperty.FontVariant.NORMAL;
textDecoration = new ArrayList<CSSProperty.TextDecoration>(2); //it is not very probable to have more than two decorations
color = Color.BLACK;
}
开发者ID:chrimm,项目名称:cordovastudio,代码行数:19,代码来源:VisualContext.java
示例7: reflectTextDecoration
import cz.vutbr.web.css.CSSProperty.TextDecoration; //导入依赖的package包/类
private void reflectTextDecoration(List<TextDecoration> decor)
{
underline = false;
strike = false;
overline = false;
for (TextDecoration aDecor : decor)
{
if (TextDecoration.UNDERLINE == aDecor)
{
underline = true;
}
else if (TextDecoration.LINE_THROUGH == aDecor)
{
strike = true;
}
else if (TextDecoration.OVERLINE == aDecor)
{
overline = true;
}
}
}
开发者ID:radkovo,项目名称:SwingBox,代码行数:23,代码来源:TextBoxView.java
示例8: VisualContext
import cz.vutbr.web.css.CSSProperty.TextDecoration; //导入依赖的package包/类
public VisualContext(VisualContext parent, BoxFactory factory)
{
this.parent = parent;
this.factory = factory;
font = new Font(Font.SERIF, Font.PLAIN, (int)((CSSUnits.medium_font * 72) / dpi)); //convert medium font to pixels
fontWeight = CSSProperty.FontWeight.NORMAL;
fontStyle = CSSProperty.FontStyle.NORMAL;
fontVariant = CSSProperty.FontVariant.NORMAL;
textDecoration = new ArrayList<CSSProperty.TextDecoration>(2); //it is not very probable to have more than two decorations
em = CSSUnits.medium_font;
ex = 0.6 * em;
dpi = org.fit.cssbox.css.CSSUnits.dpi;
color = Color.BLACK;
}
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:15,代码来源:VisualContext.java
示例9: create
import cz.vutbr.web.css.CSSProperty.TextDecoration; //导入依赖的package包/类
public VisualContext create()
{
VisualContext ret = new VisualContext(this, this.factory);
ret.em = em;
ret.ex = ex;
ret.dpi = dpi;
ret.font = font;
ret.fontWeight = fontWeight;
ret.fontStyle = fontStyle;
ret.fontVariant = fontVariant;
ret.textDecoration = new ArrayList<CSSProperty.TextDecoration>(textDecoration);
ret.color = color;
return ret;
}
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:15,代码来源:VisualContext.java
示例10: processTextDecoration
import cz.vutbr.web.css.CSSProperty.TextDecoration; //导入依赖的package包/类
@SuppressWarnings("unused")
private boolean processTextDecoration(Declaration d,
Map<String, CSSProperty> properties, Map<String, Term<?>> values) {
final Set<TextDecoration> availableDecorations = EnumSet.of(
TextDecoration.BLINK, TextDecoration.LINE_THROUGH,
TextDecoration.OVERLINE, TextDecoration.UNDERLINE);
// it one term
if (d.size() == 1) {
return genericOneIdent(TextDecoration.class, d, properties);
}
// there are more terms, we have to construct list
else {
TermList list = tf.createList();
TextDecoration dec = null;
for (Term<?> term : d.asList()) {
if (term instanceof TermIdent
&& (dec = genericPropertyRaw(TextDecoration.class,
availableDecorations, (TermIdent) term)) != null) {
// construct term with value of parsed decoration
list.add(tf.createTerm(dec));
} else
return false;
}
if (!list.isEmpty()) {
properties.put("text-decoration", TextDecoration.list_values);
values.put("text-decoration", list);
return true;
}
return false;
}
}
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:34,代码来源:DeclarationTransformer.java
示例11: setTextDecoration
import cz.vutbr.web.css.CSSProperty.TextDecoration; //导入依赖的package包/类
/**
* Sets the text decoration.
*
* @param newTextDecoration
* the new text decoration
*/
protected void setTextDecoration(List<TextDecoration> newTextDecoration)
{
if (textDecoration == null || !textDecoration.equals(newTextDecoration))
{
textDecoration = newTextDecoration;
reflectTextDecoration(textDecoration);
invalidateCache();
}
}
开发者ID:radkovo,项目名称:SwingBox,代码行数:17,代码来源:TextBoxView.java
示例12: reflectTextDecoration
import cz.vutbr.web.css.CSSProperty.TextDecoration; //导入依赖的package包/类
private void reflectTextDecoration(List<TextDecoration> decor)
{
/*
* list_values(""), UNDERLINE("underline"), OVERLINE("overline"), BLINK(
* "blink"), LINE_THROUGH("line-through"), NONE("none"), INHERIT(
* "inherit");
*/
underline = false;
strike = false;
overline = false;
blink = false;
blinking = false;
TextDecoration val;
for (int i = 0; i < decor.size(); i++)
{
val = decor.get(i);
if (TextDecoration.UNDERLINE == val)
{
underline = true;
}
else if (TextDecoration.LINE_THROUGH == val)
{
strike = true;
}
else if (TextDecoration.OVERLINE == val)
{
overline = true;
}
else if (TextDecoration.BLINK == val)
{
blink = true;
}
}
if (blink)
{
if (timerEvent == null)
{
timerEvent = new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
blinking = !blinking;
repaint(MAX_REPAINT_DELAY, box.getAbsoluteBounds());
}
};
}
if (timer == null)
{
timer = new Timer(TIMER_DELAY, timerEvent);
timer.setRepeats(true);
timer.start();
}
else
{
timer.restart();
}
}
else if (timer != null)
{
timer.stop();
}
}
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:69,代码来源:TextBoxView.java
示例13: getTextDecoration
import cz.vutbr.web.css.CSSProperty.TextDecoration; //导入依赖的package包/类
/**
* Gets the text decoration.
*
* @return the text decoration
*/
public List<TextDecoration> getTextDecoration()
{
syncProperties();
return textDecoration;
}
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:11,代码来源:TextBoxView.java
示例14: getTextDecoration
import cz.vutbr.web.css.CSSProperty.TextDecoration; //导入依赖的package包/类
/**
* Returns the text decoration used for the box.
* @return a list of TextDecoration values
*/
public List<CSSProperty.TextDecoration> getTextDecoration()
{
return textDecoration;
}
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:9,代码来源:VisualContext.java
注:本文中的cz.vutbr.web.css.CSSProperty.TextDecoration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论