Package javax.swing.text

Examples of javax.swing.text.LabelView


    public View create(Element elem) {
        String kind = elem.getName();
        // System.out.println("Kind: " + kind);
        if (kind != null) {
            if (kind.equals(AbstractDocument.ContentElementName)) {
                return new LabelView(elem);
            } else if (kind.equals(AbstractDocument.ParagraphElementName)) {
                return new NumberedParagraphView(elem, highlight);
            } else if (kind.equals(AbstractDocument.SectionElementName)) {
                return new NoWrapBoxView(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);
    }
View Full Code Here


            String kind = elem.getName();
            View view = null;
            if (kind == null) {
                // default to text display
                view = new LabelView(elem);
            } else if (kind.equals(AbstractDocument.ContentElementName)) {
                view = new LabelView(elem);
            } else if (kind.equals(AbstractDocument.ParagraphElementName)) {
                view = new ParagraphView(elem);
            } else if (kind.equals(AbstractDocument.SectionElementName)) {
                view = new BoxView(elem, View.Y_AXIS);
            } else if (kind.equals(StyleConstants.ComponentElementName)) {
View Full Code Here

                    return new IconView(elem);
                }
            }

            // default to text display
            return new LabelView(elem);
        }
View Full Code Here

          public View create(Element elem) {
            String kind = elem.getName();
            if (kind != null) {
              if (kind.equals(AbstractDocument.ContentElementName)) {
                return new LabelView(elem) {

                  @Override
                  public int getBreakWeight(int axis, float pos, float len) {
                    return 0;
                  }
                };
              } else if (kind.equals(AbstractDocument.ParagraphElementName)) {
                return new ParagraphView(elem) {

                  @Override
                  public int getBreakWeight(int axis, float pos, float len) {
                    return 0;
                  }
                };
              } else if (kind.equals(AbstractDocument.SectionElementName)) {
                return new BoxView(elem, View.Y_AXIS);
              } else if (kind.equals(StyleConstants.ComponentElementName)) {
                return new ComponentView(elem) {

                  @Override
                  public int getBreakWeight(int axis, float pos, float len) {
                    return 0;
                  }
                };
              } else if (kind.equals(StyleConstants.IconElementName)) {
                return new IconView(elem);
              }
            }
            return new LabelView(elem) {

              @Override
              public int getBreakWeight(int axis, float pos, float len) {
                return 0;
              }
View Full Code Here

                } else if (kind.equals(StyleConstants.IconElementName)) {
                    return new IconView(elem);
                }
            }
            // default to text display
            return new LabelView(elem);
        }
View Full Code Here

    }

    public void testCalculateMinorAxisRequirements03() throws Exception {
        factory = new ViewFactory() {
            public View create(Element element) {
                LabelView result = new LabelView(element);
                result.setGlyphPainter(BlockViewTest.InlineViewFactory.painter);
                return result;
            }
        };
        view = new ParagraphViewImpl(doc.getParagraphElement(10), factory);
        SizeRequirements sr =
View Full Code Here

    {
      String kind = elem.getName();
      if (kind != null)
        if (kind.equals(AbstractDocument.ContentElementName))
        {
          return new LabelView(elem);
        }
        else if (kind.equals(AbstractDocument.ParagraphElementName))
        {
          return new JPParagraphView(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);
    }
View Full Code Here

TOP

Related Classes of javax.swing.text.LabelView

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.