Package com.projity.graphic.configuration

Examples of com.projity.graphic.configuration.FormBoxLayout


    if (form==null) return;
    List boxes=form.getBoxes();
    if (boxes==null||boxes.size()==0){
      return;
    }
    FormBoxLayout formBoxLayout=form.getLayout(zoom);
    FormLayout layout = new FormLayout(
        formBoxLayout.getColumnGrid(),
        formBoxLayout.getRowGrid());
    DefaultFormBuilder builder = new DefaultFormBuilder(this,layout);
    if (formBoxLayout.getBorder()==null) builder.setDefaultDialogBorder();
    else builder.setBorder(Borders.createEmptyBorder(formBoxLayout.getBorder()));
    CellConstraints cc = new CellConstraints();
    for (Iterator i=boxes.iterator();i.hasNext();){
      FormBox box=(FormBox)i.next();
      if (zoom<box.getMinZoom()) return;
      JComponent component;
      if(box.getFieldId()==null) component=new JLabel(Messages.getString(box.getTextId()));
      else{
        if (editor&&!box.getField().isReadOnly()){
          component=new ChangeAwareTextField();
          component.setBorder(null);
          //component.setOpaque(false);
        }else component=new JLabel();
       
        //if (box.getRow()==1&&!editor) ((JLabel)component).setHorizontalAlignment(SwingConstants.CENTER);
        //bug workaround, not possible to center with classic method when rowSpan>1
       
        fieldComponents.put(box.getFieldId(),component);
      }
      Font font=formBoxLayout.getFont(box.getFont());
      if (font!=null) component.setFont(font);
      builder.add(component,(box.getAlignment()==null)?
          cc.xywh(box.getColumn(),box.getRow(),box.getColumnSpan(),box.getRowSpan()):
          cc.xywh(box.getColumn(),box.getRow(),box.getColumnSpan(),box.getRowSpan(),box.getAlignment()));
    }
View Full Code Here

TOP

Related Classes of com.projity.graphic.configuration.FormBoxLayout

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.