Package com.scriptographer.adm

Examples of com.scriptographer.adm.TextPane


    ImagePane logo = new ImagePane(this);
    logo.setImage(AdmUiFactory.getImage("logo.png"));
    logo.setMargin(-4, 4, -4, -4);
    addToContent(logo, "0, 0, 0, 1, L, T");

    TextPane text = new TextPane(this);
    if (!Pattern.compile("[\n\r]").matcher(message).find()
        && getTextSize(message).width > 320)
      text.setMaximumSize(new Size(320, -1));
    text.setMinimumSize(240, -1);
    text.setText(message);
    text.setMarginBottom(8);
    addToContent(text, "1, 0, 2, 0, L, C");

    Button okButton = new Button(this);
    okButton.setText("  OK  ");
    addToContent(okButton, "1, 1, R, T");
View Full Code Here


    ImagePane logo = new ImagePane(this);
    logo.setImage(AdmUiFactory.getImage("logo.png"));
    logo.setMargin(-4, 4, -4, -4);
    this.addToContent(logo, "0, 0, 0, 1, L, T");

    TextPane text = new TextPane(this);
    if (!Pattern.compile("[\n\r]").matcher(message).find()
        && getTextSize(message).width > 320)
      text.setMaximumSize(new Size(320, -1));
    text.setMinimumSize(240, -1);
    text.setText(message);
    text.setMarginBottom(8);
    this.addToContent(text, "1, 0, 3, 0, L, C");
   
    Button cancelButton = new Button(this);
    cancelButton.setText("Cancel");
    cancelButton.setMarginRight(10);
View Full Code Here

        }
      };
    }
    break;
    case TEXT: {
      item = new TextPane(dialog);
      // Space a bit more to the top, to compensate the descender space.
      item.setMargin(new Border(1, 0, 0, 0));
    }
    break;
    case RULER: {
      // If the ruler has a label, add it to the left of it, using an
      // ItemGroup and a TableLayout. The ItemGroup needs to be created
      // before the frame, otherwise layouting issues arise...
      // Ideally this should be resolved, but as ADM is on its way out,
      // just work around it for now.
      ItemGroup group;
      String label = component.getLabel();
      if (label != null && !label.equals("")) {
        group = new ItemGroup(dialog);
        TextPane labelItem = new TextPane(dialog);
        labelItem.setText(label);
        // Use 3 rows, so the center one with the ruler gets centered,
        // then span the label across all three.
        double[][] sizes = {
          new double[] { TableLayout.PREFERRED, TableLayout.FILL },
          new double[] { TableLayout.FILL, TableLayout.PREFERRED,
View Full Code Here

    Item valueItem = createItem(dialog);
    String label = component.getLabel();
    boolean isRuler = component.getType() == ComponentType.RULER;
    boolean hasLabel = !isRuler && label != null && !"".equals(label);
    if (hasLabel) {
      TextPane labelItem = new TextPane(dialog);
      labelItem.setText(label + ":");
      // Adjust top margin of label to reflect the native margin
      // in the value item.
      Item marginItem = valueItem;
      // If this is an item group, use the first item in it instead
      // This is only needed for FontPopupList so far.
      if (marginItem instanceof ItemGroup)
        marginItem = (Item) ((ItemGroup) marginItem).getContent().get(0);
      Border margin = marginItem.getVisualMargin();
      // Also take into account any margins the component might have set
      if (valueItem != marginItem)
        margin = margin.add(valueItem.getMargin());
      labelItem.setMargin(margin.top + 3, 4, 0, 0);
      content.put(column + ", " + row + ", right, top", labelItem);
    }
    boolean fullSize = component.getFullSize();
    String justification = isRuler || component.getFullSize()
        ? "full, center" : "left, center";
View Full Code Here

TOP

Related Classes of com.scriptographer.adm.TextPane

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.