类javax.swing.text.ParagraphView源码实例Demo

下面列出了怎么用javax.swing.text.ParagraphView的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: mzmine3   文件: CustomTextPane.java
@Override
public View create(final Element element) {
  final String kind = element.getName();
  if (kind != null) {
    switch (kind) {
      case AbstractDocument.ContentElementName:
        return new WrapLabelView(element);
      case AbstractDocument.ParagraphElementName:
        return new ParagraphView(element);
      case AbstractDocument.SectionElementName:
        return new BoxView(element, View.Y_AXIS);
      case StyleConstants.ComponentElementName:
        return new ComponentView(element);
      case StyleConstants.IconElementName:
        return new IconView(element);
    }
  }

  // Default to text display.
  return new LabelView(element);
}
 
源代码2 项目: oim-fx   文件: JIMSendTextPane.java
public View create(Element elem) {
	String kind = elem.getName();
	if (kind != null) {
		if (kind.equals(AbstractDocument.ContentElementName)) {
			return new WarpLabelView(elem);
		} else if (kind.equals(AbstractDocument.ParagraphElementName)) {
			return new ParagraphView(elem);
		} else if (kind.equals(AbstractDocument.SectionElementName)) {
			return new BoxView(elem, View.Y_AXIS);
		} else if (kind.equals(StyleConstants.ComponentElementName)) {
			return new ComponentView(elem);
		} else if (kind.equals(StyleConstants.IconElementName)) {
			return new IconView(elem);
		}
	}

	// default to text display
	return new LabelView(elem);
}
 
源代码3 项目: stendhal   文件: KTextEdit.java
@Override
public View create(Element elem) {
	String kind = elem.getName();
	if (kind != null) {
		if (kind.equals(AbstractDocument.ContentElementName)) {
			return new WrapLabelView(elem);
		} else if (kind.equals(AbstractDocument.ParagraphElementName)) {
			return new ParagraphView(elem);
		} else if (kind.equals(AbstractDocument.SectionElementName)) {
			return new BoxView(elem, View.Y_AXIS);
		} else if (kind.equals(StyleConstants.ComponentElementName)) {
			return new ComponentView(elem);
		} else if (kind.equals(StyleConstants.IconElementName)) {
			return new IconView(elem);
		}
	}

	// default to text display
	return new LabelView(elem);
}
 
源代码4 项目: mzmine2   文件: CustomTextPane.java
@Override
public View create(final Element element) {
  final String kind = element.getName();
  if (kind != null) {
    switch (kind) {
      case AbstractDocument.ContentElementName:
        return new WrapLabelView(element);
      case AbstractDocument.ParagraphElementName:
        return new ParagraphView(element);
      case AbstractDocument.SectionElementName:
        return new BoxView(element, View.Y_AXIS);
      case StyleConstants.ComponentElementName:
        return new ComponentView(element);
      case StyleConstants.IconElementName:
        return new IconView(element);
    }
  }

  // Default to text display.
  return new LabelView(element);
}
 
源代码5 项目: java-swing-tips   文件: MainPanel.java
@Override public View create(Element elem) {
  switch (elem.getName()) {
    // case AbstractDocument.ContentElementName:
    //   return new LabelView(elem);
    case AbstractDocument.ParagraphElementName:
      return new ParagraphView(elem) {
        @Override protected short getBottomInset() {
          return 5;
        }
      };
    case AbstractDocument.SectionElementName:
      return new BoxView(elem, View.Y_AXIS);
    case StyleConstants.ComponentElementName:
      return new ComponentView(elem);
    case StyleConstants.IconElementName:
      return new IconView(elem);
    default:
      return new LabelView(elem);
  }
}
 
源代码6 项目: PolyGlot   文件: GlyphVectorEditorKit.java
public View create(Element elem) {
    String kind = elem.getName();
    if (kind != null) {
        if (kind.equals(AbstractDocument.ContentElementName)) {
            return new PainterLabelView(elem);
        }
        else if (kind.equals(AbstractDocument.ParagraphElementName)) {
            return new ParagraphView(elem);
        }
        else if (kind.equals(AbstractDocument.SectionElementName)) {
            return new BoxView(elem, View.Y_AXIS);
        }
        else if (kind.equals(StyleConstants.ComponentElementName)) {
            return new ComponentView(elem);
        }
        else if (kind.equals(StyleConstants.IconElementName)) {
            return new IconView(elem);
        }
    }

    // default to text display
    return new LabelView(elem);
}
 
源代码7 项目: hortonmachine   文件: WrapEditorKit.java
public View create( Element elem ) {
    String kind = elem.getName();
    if (kind != null) {
        if (kind.equals(AbstractDocument.ContentElementName)) {
            return new WrapLabelView(elem);
        } else if (kind.equals(AbstractDocument.ParagraphElementName)) {
            return new ParagraphView(elem);
        } else if (kind.equals(AbstractDocument.SectionElementName)) {
            return new BoxView(elem, View.Y_AXIS);
        } else if (kind.equals(StyleConstants.ComponentElementName)) {
            return new ComponentView(elem);
        } else if (kind.equals(StyleConstants.IconElementName)) {
            return new IconView(elem);
        }
    }

    // default to text display
    return new LabelView(elem);
}
 
源代码8 项目: desktopclient-java   文件: MessageList.java
@Override
public javax.swing.text.View create(Element elem) {
    String kind = elem.getName();
    if (kind != null) {
        switch (kind) {
            case AbstractDocument.ContentElementName:
                return new WrapLabelView(elem);
            case AbstractDocument.ParagraphElementName:
                return new ParagraphView(elem);
            case AbstractDocument.SectionElementName:
                return new BoxView(elem, javax.swing.text.View.Y_AXIS);
            case StyleConstants.ComponentElementName:
                return new ComponentView(elem);
            case StyleConstants.IconElementName:
                return new IconView(elem);
        }
    }
    // default to text display
    return new LabelView(elem);
}
 
源代码9 项目: xyTalk-pc   文件: JIMSendTextPane.java
public View create(Element elem)
{
    String kind = elem.getName();
    if (kind != null)
    {
        if (kind.equals(AbstractDocument.ContentElementName))
        {
            return new WarpLabelView(elem);
        }
        else if (kind.equals(AbstractDocument.ParagraphElementName))
        {
            return new ParagraphView(elem);
        }
        else if (kind.equals(AbstractDocument.SectionElementName))
        {
            return new BoxView(elem, View.Y_AXIS);
        }
        else if (kind.equals(StyleConstants.ComponentElementName))
        {
            return new ComponentView(elem);
        }
        else if (kind.equals(StyleConstants.IconElementName))
        {
            return new WarpIconView(elem);
        }
    }

    // default to text display
    return new LabelView(elem);
}
 
 类所在包
 类方法
 同包方法