Examples of BoxView


Examples of javax.swing.text.BoxView

            } 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 = new ComponentView(elem);
            } else if (kind.equals(StyleConstants.IconElementName)) {
                view = new IconView(elem);
            }
View Full Code Here

Examples of javax.swing.text.BoxView

                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);
                }
View Full Code Here

Examples of javax.swing.text.BoxView

                  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) {
View Full Code Here

Examples of javax.swing.text.BoxView

                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);
                }
View Full Code Here

Examples of javax.swing.text.BoxView

        assertEquals(0, bp.getInset(View.BOTTOM, view), 0f);
        assertEquals(0, bp.getInset(View.LEFT, view), 0f);
    }

    public void testGetInsetWithPaddingPercentWithParent() throws Exception {
        BoxView parent = new BoxView(doc.getDefaultRootElement(), View.Y_AXIS) {
            public int getWidth() {
                return 361;
            }
            public int getHeight() {
                return 257;
View Full Code Here

Examples of javax.swing.text.BoxView

            private static final long serialVersionUID = 0;
            @Override public final ViewFactory getViewFactory() {
                return new ViewFactory() {
                    public final View create(Element x) {
                        if (!AbstractDocument.SectionElementName.equals(x.getName())) return defaultFactory.create(x);
                        return new BoxView(x, View.Y_AXIS) {
                            @Override public final float getMinimumSpan(int axis) { return super.getPreferredSpan(axis); }
                            @Override public final void layout(int width,int height) { super.layout(30000, height); }
                        };
                    }
                };
View Full Code Here

Examples of javax.swing.text.BoxView

         @Override public Document createDefaultDocument() { return doc; }
         @Override public ViewFactory getViewFactory() {
            return new ViewFactory() {
               public View create(Element x) {
                  if (!AbstractDocument.SectionElementName.equals(x.getName())) return defaultFactory.create(x);
                  return new BoxView(x, View.Y_AXIS) { // 30000 is a good width to use here; value > 32767 appears to cause errors
                     @Override public final float getMinimumSpan(int axis) { return super.getPreferredSpan(axis); }
                     @Override public final void layout(int w, int h) { try {super.layout(30000, h);} catch(Throwable ex) {} }
                  };
               }
            };
View Full Code Here

Examples of javax.swing.text.BoxView

        {
          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);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.