Package com.eagerlogic.cubee.client.components.attributepanel

Source Code of com.eagerlogic.cubee.client.components.attributepanel.AttributesPanel

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.eagerlogic.cubee.client.components.attributepanel;

import com.eagerlogic.cubee.client.components.AUserControl;
import com.eagerlogic.cubee.client.components.ScrollPanel;
import com.eagerlogic.cubee.client.components.VBox;
import com.eagerlogic.cubee.client.properties.IntegerProperty;
import java.util.List;

/**
*
* @author dipacs
*/
public final class AttributesPanel extends AUserControl {
   
    private final List<AttributeGroup> groups;

    public AttributesPanel(List<AttributeGroup> groups) {
        this.groups = groups;
       
        this.widthProperty().set(250);
        this.heightProperty().set(300);
       
        ScrollPanel sp = new ScrollPanel();
        sp.widthProperty().bind(this.clientWidthProperty());
        sp.heightProperty().bind(this.clientHeightProperty());
        this.getChildren().add(sp);
       
        VBox root = new VBox();
        sp.setContent(root);
       
        boolean isFirst = true;
        for (AttributeGroup group : groups) {
            if (isFirst) {
                isFirst = false;
            } else {
                root.addEmptyCell(10);
            }
           
            AttributeGroupView agv = new AttributeGroupView(group);
            agv.widthProperty().bind(this.clientWidthProperty());
            root.getChildren().add(agv);
        }
    }
   
   

    @Override
    public IntegerProperty widthProperty() {
        return super.widthProperty();
    }

    @Override
    public IntegerProperty heightProperty() {
        return super.heightProperty();
    }
   
}
TOP

Related Classes of com.eagerlogic.cubee.client.components.attributepanel.AttributesPanel

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.