Package com.scriptographer.adm.layout

Examples of com.scriptographer.adm.layout.HorizontalLayout


      String str = reader.readString();
      if (str != null) {
        // See if it's an available alignment for FlowLayout
        if (HorizontalLayout.getAlignment(str) != null) {
          // FlowLayout
          return new HorizontalLayout(
              str,
              reader.readInteger(0),
              reader.readInteger(0));
        } else {
          // TableLayout
          return new TableLayout(str,
              reader.readString(""),
              reader.readInteger(0),
              reader.readInteger(0));
        }
      } else {
        reader.revert();
        // Try if there's an array now:
        Object[] array = reader.readObject(Object[].class);
        if (array != null) {
          // TableLayout
          return new TableLayout(array,
              reader.readObject(Object[].class),
              reader.readInteger(0),
              reader.readInteger(0));
        } else {
          reader.revert();
          // BorderLayout
          return new BorderLayout(
              reader.readInteger(0),
              reader.readInteger(0));
        }
      }
    } else if (reader.isMap()) {
      if (reader.has("columns")) {
        // TableLayout
        String str = reader.readString("columns");
        if (str != null) {
          return new TableLayoutstr,
              reader.readString("rows", ""),
              reader.readInteger("", 0),
              reader.readInteger(0));
        } else {
          Object[] array = reader.readObject("columns",
              Object[].class);
          if (array != null) {
            return new TableLayout(array,
                reader.readObject("rows", Object[].class),
                reader.readInteger("hgap", 0),
                reader.readInteger("vgap", 0));
          } else {
            throw new RuntimeException(
                "Unsupported format for TableLayout");
          }
        }
      } else if (reader.has("alignment")) {
        // FlowLayout
        String alignment = reader.readString("alignment");
        if (HorizontalLayout.getAlignment(alignment) != null) {
          return new HorizontalLayout(
              alignment,
              reader.readInteger("hgap", 0),
              reader.readInteger("vgap", 0));
        } else {
          throw new RuntimeException(
View Full Code Here


    }
    // Add a gap between the components.
    if (options != null && options.contains(FontPopupListOption.VERTICAL)) {
      setLayout(new GridLayout(0, 1, 0, 3));
    } else {
      setLayout(new HorizontalLayout(HorizontalLayout.LEFT, 3, 0));
    }
    int width = familyItem.getTextSize(" ").width;
    familyItem.setWidth(width * 48);
    weightItem.setWidth(width * 32);
    add(familyItem);
 
View Full Code Here

TOP

Related Classes of com.scriptographer.adm.layout.HorizontalLayout

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.