Esempio n. 1
0
  private void createDesignPanel() {

    // create main panel
    mainContainer = new LayoutContainer();
    final BorderLayout layout = new BorderLayout();
    mainContainer.setLayout(layout);
    mainContainer.setAutoWidth(true);
    mainContainer.setHeight(HEIGHT);
    mainContainer.addStyleName("design-main-panel");

    // north zone
    final BorderLayoutData upperLayoutData = new BorderLayoutData(LayoutRegion.NORTH);
    NorthPanel upperPanel = PmsFactory.getInstance().getNorthPanel();
    upperPanel.init(page, pageLayoutDto);
    upperLayoutData.setSize(UPPER_PANEL_HEIGHT);

    // west zone
    final BorderLayoutData leftLayoutData = new BorderLayoutData(LayoutRegion.WEST, 220, 150, 320);
    palettesPanel = PmsFactory.getInstance().getPalettesPanel();
    palettesPanel.init(pageLayoutDto);
    leftLayoutData.setSplit(true);
    leftLayoutData.setCollapsible(true);
    leftLayoutData.setSize(LEFT_PANEL_WIDTH);
    leftLayoutData.setMargins(new Margins(PANEL_MARGIN));

    // east zone
    final BorderLayoutData rightLayoutData = new BorderLayoutData(LayoutRegion.EAST);
    ComponentsTreePanel rightPanel = PmsFactory.getInstance().getRightPanel();
    rightPanel.init(page);
    rightLayoutData.setSplit(true);
    rightLayoutData.setCollapsible(true);
    // rightLayoutData.setSize(RIGHT_PANEL_WIDTH);
    rightLayoutData.setMargins(new Margins(PANEL_MARGIN));

    // design zone
    final BorderLayoutData centerLayoutData = new BorderLayoutData(LayoutRegion.CENTER);
    designPanel = new DesignPanel(pageLayoutDto);
    centerLayoutData.setMargins(new Margins(PANEL_MARGIN, 0, PANEL_MARGIN, 0));

    mainContainer.add(upperPanel, upperLayoutData);
    mainContainer.add(palettesPanel, leftLayoutData);
    mainContainer.add(designPanel, centerLayoutData);
    mainContainer.add(rightPanel, rightLayoutData);
    add(mainContainer);
  }
Esempio n. 2
0
  @Override
  protected void onRender(Element target, int index) {
    super.onRender(target, index);

    layout.setPadding(new Padding(2, 17, 1, 10)); // DIM
    layout.setHBoxLayoutAlign(HBoxLayout.HBoxLayoutAlign.MIDDLE);
    c.setLayout(layout);
    c.setLayoutOnChange(true);
    c.setAutoHeight(false);
    c.setAutoWidth(false);

    left.setIcon(AbstractImagePrototype.create(AzzeroCO2Resources.INSTANCE.left()));
    left.setIconAlign(Style.IconAlign.LEFT);
    left.setSize(32, 32);
    left.setText("");
    left.setToolTip("");
    left.setTitle("");
    left.setEnabled(false);
    left.setVisible(false);

    left.addSelectionListener(
        new SelectionListener<ButtonEvent>() {
          @Override
          public void componentSelected(ButtonEvent ce) {
            Dispatcher.forwardEvent(new AppEvent(UnAnnoDiAttivitaEvents.Previous, ce));
          }
        });
    c.add(left, new HBoxLayoutData(new Margins(0, 0, 0, 0)));

    flex.setFlex(1);
    c.add(leftText, flex);

    leftText.setSize(200, 15);
    rigthText.setSize(250, 15);
    rigthText.setStyleAttribute("text-align", "right");
    rigthText.setStyleAttribute("font-family", "arial");
    leftText.setStyleAttribute("font-family", "arial");
    leftText.setStyleAttribute("font-size", "14px");
    rigthText.setStyleAttribute("font-size", "14px");

    c.add(rigthText, new HBoxLayoutData(new Margins(0, 5, 0, 0)));

    right.setIconAlign(Style.IconAlign.RIGHT);
    //  right.setText("Energia");
    right.setIcon(AbstractImagePrototype.create(AzzeroCO2Resources.INSTANCE.rigth()));
    right.setSize(32, 32);
    right.setTitle("");
    right.setText("");
    right.setToolTip("");

    c.add(right, new HBoxLayoutData(new Margins(0, 0, 0, 0)));
    right.addSelectionListener(
        new SelectionListener<ButtonEvent>() {
          @Override
          public void componentSelected(ButtonEvent ce) {
            if (rigthText.getText().equalsIgnoreCase("torna alla home")) {
              Dispatcher.forwardEvent(CentralEvents.ShowPanel, Eventi.MAIN);
            } else {
              Dispatcher.forwardEvent(new AppEvent(UnAnnoDiAttivitaEvents.Next, ce));
            }
          }
        });
    add(c);
  }