本文整理汇总了Java中com.intellij.openapi.editor.markup.EffectType.WAVE_UNDERSCORE属性的典型用法代码示例。如果您正苦于以下问题:Java EffectType.WAVE_UNDERSCORE属性的具体用法?Java EffectType.WAVE_UNDERSCORE怎么用?Java EffectType.WAVE_UNDERSCORE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.openapi.editor.markup.EffectType
的用法示例。
在下文中一共展示了EffectType.WAVE_UNDERSCORE属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fromTextAttributes
@NotNull
public static SimpleTextAttributes fromTextAttributes(TextAttributes attributes) {
if (attributes == null) return REGULAR_ATTRIBUTES;
Color foregroundColor = attributes.getForegroundColor();
if (foregroundColor == null) foregroundColor = REGULAR_ATTRIBUTES.getFgColor();
int style = attributes.getFontType();
if (attributes.getEffectColor() != null) {
EffectType effectType = attributes.getEffectType();
if (effectType == EffectType.STRIKEOUT) {
style |= STYLE_STRIKEOUT;
}
else if (effectType == EffectType.WAVE_UNDERSCORE) {
style |= STYLE_WAVED;
}
else if (effectType == EffectType.LINE_UNDERSCORE ||
effectType == EffectType.BOLD_LINE_UNDERSCORE ||
effectType == EffectType.BOLD_DOTTED_LINE) {
style |= STYLE_UNDERLINE;
}
else if (effectType == EffectType.SEARCH_MATCH) {
style |= STYLE_SEARCH_MATCH;
}
else {
// not supported
}
}
return new SimpleTextAttributes(attributes.getBackgroundColor(), foregroundColor, attributes.getEffectColor(), style);
}
示例2: toTextAttributes
public TextAttributes toTextAttributes() {
Color effectColor;
EffectType effectType;
if (isWaved()) {
effectColor = myWaveColor;
effectType = EffectType.WAVE_UNDERSCORE;
}
else if (isStrikeout()) {
effectColor = myWaveColor;
effectType = EffectType.STRIKEOUT;
}
else if (isUnderline()) {
effectColor = myWaveColor;
effectType = EffectType.LINE_UNDERSCORE;
}
else if (isBoldDottedLine()) {
effectColor = myWaveColor;
effectType = EffectType.BOLD_DOTTED_LINE;
}
else if (isSearchMatch()) {
effectColor = myWaveColor;
effectType = EffectType.SEARCH_MATCH;
}
else {
effectColor = null;
effectType = null;
}
return new TextAttributes(myFgColor, null, effectColor, effectType, myStyle & FONT_MASK);
}
示例3: getPresentation
@NotNull
@Override
public UsagePresentation getPresentation() {
final UsagePresentation presentation = super.getPresentation();
return new UsagePresentation() {
@Override
@NotNull
public TextChunk[] getText() {
return new TextChunk[]{
new TextChunk(new TextAttributes(JBColor.RED, null, null, EffectType.WAVE_UNDERSCORE, Font.PLAIN), getTooltipText())
};
}
@Override
@NotNull
public String getPlainText() {
return presentation.getPlainText();
}
@Override
public Icon getIcon() {
return presentation.getIcon();
}
@Override
public String getTooltipText() {
return "Too complex to analyze, analysis stopped here";
}
};
}
示例4: fromTextAttributes
@Nonnull
public static SimpleTextAttributes fromTextAttributes(TextAttributes attributes) {
if (attributes == null) return REGULAR_ATTRIBUTES;
Color foregroundColor = attributes.getForegroundColor();
if (foregroundColor == null) foregroundColor = REGULAR_ATTRIBUTES.getFgColor();
int style = attributes.getFontType();
if (attributes.getEffectColor() != null) {
EffectType effectType = attributes.getEffectType();
if (effectType == EffectType.STRIKEOUT) {
style |= STYLE_STRIKEOUT;
}
else if (effectType == EffectType.WAVE_UNDERSCORE) {
style |= STYLE_WAVED;
}
else if (effectType == EffectType.LINE_UNDERSCORE ||
effectType == EffectType.BOLD_LINE_UNDERSCORE ||
effectType == EffectType.BOLD_DOTTED_LINE) {
style |= STYLE_UNDERLINE;
}
else if (effectType == EffectType.SEARCH_MATCH) {
style |= STYLE_SEARCH_MATCH;
}
else {
// not supported
}
}
return new SimpleTextAttributes(attributes.getBackgroundColor(), foregroundColor, attributes.getEffectColor(), style);
}
示例5: getEffectPainter
protected EffectPainter getEffectPainter(EffectType type) {
if (type == EffectType.STRIKEOUT) return EffectPainter.STRIKE_THROUGH;
if (type == EffectType.WAVE_UNDERSCORE) return EffectPainter.WAVE_UNDERSCORE;
if (type == EffectType.LINE_UNDERSCORE) return EffectPainter.LINE_UNDERSCORE;
if (type == EffectType.BOLD_LINE_UNDERSCORE) return EffectPainter.BOLD_LINE_UNDERSCORE;
if (type == EffectType.BOLD_DOTTED_LINE) return EffectPainter.BOLD_DOTTED_UNDERSCORE;
return null;
}
示例6: getPresentation
@NotNull
@Override
public UsagePresentation getPresentation()
{
final UsagePresentation presentation = super.getPresentation();
return new UsagePresentation()
{
@Override
@NotNull
public TextChunk[] getText()
{
return new TextChunk[]{
new TextChunk(new TextAttributes(JBColor.RED, null, null, EffectType.WAVE_UNDERSCORE, Font.PLAIN), getTooltipText())
};
}
@Override
@NotNull
public String getPlainText()
{
return presentation.getPlainText();
}
@Override
public Icon getIcon()
{
return presentation.getIcon();
}
@Override
public String getTooltipText()
{
return "Too complex to analyze, analysis stopped here";
}
};
}
示例7: reset
public void reset(ColorAndFontDescription description) {
if (description.isFontEnabled()) {
myLabelFont.setEnabled(true);
myCbBold.setEnabled(true);
myCbItalic.setEnabled(true);
int fontType = description.getFontType();
myCbBold.setSelected((fontType & Font.BOLD) != 0);
myCbItalic.setSelected((fontType & Font.ITALIC) != 0);
}
else {
myLabelFont.setEnabled(false);
myCbBold.setSelected(false);
myCbBold.setEnabled(false);
myCbItalic.setSelected(false);
myCbItalic.setEnabled(false);
}
updateColorChooser(myCbForeground, myForegroundChooser, description.isForegroundEnabled(),
description.isForegroundChecked(), description.getForegroundColor());
updateColorChooser(myCbBackground, myBackgroundChooser, description.isBackgroundEnabled(),
description.isBackgroundChecked(), description.getBackgroundColor());
updateColorChooser(myCbErrorStripe, myErrorStripeColorChooser, description.isErrorStripeEnabled(),
description.isErrorStripeChecked(), description.getErrorStripeColor());
EffectType effectType = description.getEffectType();
updateColorChooser(myCbEffects, myEffectsColorChooser, description.isEffectsColorEnabled(),
description.isEffectsColorChecked(), description.getEffectColor());
if (description.isEffectsColorEnabled() && description.isEffectsColorChecked()) {
myEffectsCombo.setEnabled(true);
updatingEffects = true;
if (effectType == EffectType.BOXED) {
myEffectsCombo.setSelectedItem(BORDERED_EFFECT);
}
else if (effectType == EffectType.LINE_UNDERSCORE) {
myEffectsCombo.setSelectedItem(UNDERSCORED_EFFECT);
}
else if (effectType == EffectType.WAVE_UNDERSCORE) {
myEffectsCombo.setSelectedItem(UNDERWAVED_EFFECT);
}
else if (effectType == EffectType.BOLD_LINE_UNDERSCORE) {
myEffectsCombo.setSelectedItem(BOLD_UNDERSCORED_EFFECT);
}
else if (effectType == EffectType.STRIKEOUT) {
myEffectsCombo.setSelectedItem(STRIKEOUT_EFFECT);
}
else if (effectType == EffectType.BOLD_DOTTED_LINE) {
myEffectsCombo.setSelectedItem(BOLD_DOTTED_LINE_EFFECT);
}
else {
myEffectsCombo.setSelectedItem(null);
}
updatingEffects = false;
}
else {
myEffectsCombo.setEnabled(false);
}
setInheritanceLabel(description);
}