当前位置: 首页>>代码示例>>Java>>正文


Java EffectType.WAVE_UNDERSCORE属性代码示例

本文整理汇总了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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:SimpleTextAttributes.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:SimpleTextAttributes.java

示例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";
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:SliceTooComplexDFAUsage.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:30,代码来源:SimpleTextAttributes.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:8,代码来源:Breadcrumbs.java

示例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";
		}
	};
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:36,代码来源:SliceTooComplexDFAUsage.java

示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:61,代码来源:ColorAndFontDescriptionPanel.java


注:本文中的com.intellij.openapi.editor.markup.EffectType.WAVE_UNDERSCORE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。