call-seq:
    layout( config )

 Creates a new Layout based on the given _config_ options (a hash).
 The type of Layout created is determined by the 'type' option in the
 config. The remaining config options are passed to the Layout
 initializer.
334513
def layout( config )
      return ::Logsly::Logging182::Layouts::Basic.new if config.nil?

      type = config.delete(:type)
      raise Error, 'layout type not given' if type.nil?

      clazz = ::Logsly::Logging182::Layouts.const_get type
      clazz.new config
    rescue NameError
      raise Error, "unknown layout class Logsly::Logging182::Layouts::#{type}"
    end
1175599
@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 296, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 266, Short.MAX_VALUE)
        );
    }
779853
public function createLayout(Layout $layout): Layout
    {
        $query = $this->connection->createQueryBuilder()
            ->insert('ngbm_layout')
            ->values(
                [
                    'id' => ':id',
                    'status' => ':status',
                    'type' => ':type',
                    'name' => ':name',
                    'description' => ':description',
                    'created' => ':created',
                    'modified' => ':modified',
                    'shared' => ':shared',
                    'main_locale' => ':main_locale',
                ]
            )
            ->setValue(
                'id',
                $layout->id !== null ?
                    (int) $layout->id :
                    $this->connectionHelper->getAutoIncrementValue('ngbm_layout')
            )
            ->setParameter('status', $layout->status, Type::INTEGER)
            ->setParameter('type', $layout->type, Type::STRING)
            ->setParameter('name', $layout->name, Type::STRING)
            ->setParameter('description', $layout->description, Type::STRING)
            ->setParameter('created', $layout->created, Type::INTEGER)
            ->setParameter('modified', $layout->modified, Type::INTEGER)
            ->setParameter('shared', $layout->shared, Type::BOOLEAN)
            ->setParameter('main_locale', $layout->mainLocale, Type::STRING);

        $query->execute();

        $layout->id = $layout->id ?? (int) $this->connectionHelper->lastInsertId('ngbm_layout');

        return $layout;
    }
409431
protected function initLayout()
    {
        if ($this->layout === null) {
            $this->layout = 'Generic';
        }

        if (is_string($this->layout) || is_array($this->layout)) {
            $this->layout = $this->factory($this->layout, ['form'=>$this], 'FormLayout');
            $this->layout = $this->add($this->layout);
        } elseif (is_object($this->layout)) {
            $this->layout->form = $this;
            $this->add($this->layout);
        } else {
            throw new Exception(['Unsupported specification of form layout. Can be array, string or object', 'layout' => $this->layout]);
        }

        // Add save button in layout
        if ($this->buttonSave) {
            $this->buttonSave = $this->layout->addButton($this->buttonSave);
            $this->buttonSave->setAttr('tabindex', 0);
            $this->buttonSave->on('click', $this->js()->form('submit'));
            $this->buttonSave->on('keypress', new jsExpression('if (event.keyCode === 13){$([name]).form("submit");}', ['name' => '#'.$this->name]));
        }
    }
515351
def write_layout(layout = nil, type = nil) # :nodoc:
      tag = 'c:layout'

      if layout
        @writer.tag_elements(tag)  { write_manual_layout(layout, type) }
      else
        @writer.empty_tag(tag)
      end
    end
1316998
function() {
      if (options.fit) {
        options.cy.fit(options.eles.nodes(), options.padding);
      }

      if (!ready) {
        ready = true;
        self.cy.one('layoutready', options.ready);
        self.cy.trigger({type: 'layoutready', layout: self});
      }
    }
538272
def init_layout(self):
        
        super(AndroidRadioGroup, self).init_layout()
        d = self.declaration
        w = self.widget
        if d.checked:
            self.set_checked(d.checked)
        else:
            #: Check if any of the children have "checked = True"
            for c in d.children:
                if c.checked:
                    d.checked = c

        w.setOnCheckedChangeListener(w.getId())
        w.onCheckedChanged.connect(self.on_checked_changed)
1340376
def _layout_for_ajax(default) #:nodoc:
      ajax_layout = self.class.read_inheritable_attribute(:ajax_layout)
      ajax_layout = if ajax_layout.nil? && default.nil?
          nil
        elsif ajax_layout.nil? && !default.nil? # look for one with the default name in layouts/ajax
          if default =~ /^layouts\/ajax\//
            default
          elsif !(default =~ /^ajax\//)
            "ajax/#{default.sub(/layouts(\/)?/, '')}"
          else
            default
          end
        elsif ajax_layout.include?(?/) # path to specific layout
          ajax_layout
        else # layout name, look in ajax/
          "ajax/#{ajax_layout}"
        end
      ajax_layout = ajax_layout =~ /\blayouts/ ? ajax_layout : "layouts/#{ajax_layout}" if ajax_layout
      ajax_layout
    end
326700
function layoutInit() {
  IBMChat.subscribe('layout:choose', function(data) {
    var widget = new Choose(data);
    widgets[data.uuid] = widget;
  });
  IBMChat.subscribe('layout:confirm', function(data) {
    var widget = new Choose(data);
    widgets[data.uuid] = widget;
  });
}
137493
private static void initLayout() {
		Log.info("Initializing Layout...");
		try {
			conf.getLayout().init();
			configContext.setLayout(conf.getLayout());
			Log.info(conf.getLayout().getClass().getName() + " Initialized.");
		} catch (InitializationException e) {
			Log.error("There is a problem in the layout: ", conf.getLayout().getClass().getName(), " you configured.",
					ErrorGuide.getGuide(ErrorGuide.LAYOUT_ERROR));
			terminate();
			throw new InitializationException(INIT_FAILED);
		}

	}
891231
function Config(options) {
  if (!(this instanceof Config)) {
    return new Config(options);
  }

  utils.is(this, 'config');
  use(this);

  define(this, 'count', 0);
  this.options = options || {};
  this.targets = {};
  this.tasks = {};

  if (utils.isConfig(options)) {
    this.options = {};
    this.expand(options);
    return this;
  }
}
317111
def place_in_layouts(content, payload, info)
      output = content.dup
      layout = layouts[document.data["layout"]]

      Bunto.logger.warn(
        "Build Warning:",
        "Layout '#{document.data["layout"]}' requested in "\
        "#{document.relative_path} does not exist."
      ) if invalid_layout? layout

      used = Set.new([layout])

      # Reset the payload layout data to ensure it starts fresh for each page.
      payload["layout"] = nil

      while layout
        payload["content"] = output
        payload["layout"]  = Utils.deep_merge_hashes(layout.data, payload["layout"] || {})

        output = render_liquid(
          layout.content,
          payload,
          info,
          layout.relative_path
        )

        # Add layout to dependency tree
        site.regenerator.add_dependency(
          site.in_source_dir(document.path),
          site.in_source_dir(layout.path)
        ) if document.write?

        if (layout = layouts[layout.data["layout"]])
          break if used.include?(layout)
          used << layout
        end
      end

      output
    end
749746
function(config) {

      var x, style;

      // save config
      hashedit.config = config;

      // set path
      if (config.path != null) {
        hashedit.path = config.path;
      }

      // set login
      if (config.login != null) {
        hashedit.loginUrl = config.login;
      }

      // set grid
      if (config.grid != null) {
        hashedit.grid = config.grid;
      }

      // create container
      hashedit.current.container = document.createElement('div');
      hashedit.current.container.setAttribute('class', 'hashedit-container');
      hashedit.current.container.setAttribute('id', 'hashedit-container');

      // set stylesheet
      if (config.stylesheet !== null) {
        hashedit.stylesheet = config.stylesheet;
      }

      // set url
      if (config.url !== null) {
        hashedit.url = config.url;
      }

      // append container to body
      document.body.appendChild(hashedit.current.container);

      // create style
      style = document.createElement('style');

      // append scoped stylesheet to container
      for (x = 0; x < hashedit.stylesheet.length; x++) {
        style.innerHTML += '@import url(' + hashedit.stylesheet[x] + ');';
      }

      hashedit.current.container.appendChild(style);

      // check auth
      if (config.demo === true) {

        hashedit.demo = true;

        // init hashedit
        hashedit.setActive();
        hashedit.setupView();
        hashedit.setupSortable();
        hashedit.setupBlocks();
        hashedit.setContentEditable();
        hashedit.setupContentEditableEvents();
        hashedit.setupMenu(config.path);
        hashedit.setupToast();
        hashedit.createMenu(config.path);
        hashedit.loadHTML(config.path);
        hashedit.translate();

      }
      else {

        // set default auth
        var obj = {
          credentials: 'include'
        }

        // enable token based auth
        if(hashedit.useToken) {

          // set obj headers
          obj = {
            headers: {}
          };

          obj.headers[hashedit.authHeader] = hashedit.authHeaderPrefix + ' ' + localStorage.getItem(hashedit.tokenName);
        }

        // check auth
        fetch(hashedit.authUrl, obj)
          .then(function(response) {

            if (response.status !== 200) {
              hashedit.showAuth();
            }
            else {

              // init hashedit
              hashedit.setActive();
              hashedit.setupView();
              hashedit.setupSortable();
              hashedit.setupBlocks();
              hashedit.setContentEditable();
              hashedit.setupContentEditableEvents();
              hashedit.setupMenu(config.path);
              hashedit.setupToast();
              hashedit.createMenu(config.path);
              hashedit.loadHTML(config.path);
              hashedit.translate();

              // setup loaded event
              var event = new Event('hashedit.loaded');
              document.dispatchEvent(event);

            }

          });
      }

    }
1305909
public void layout(float layoutX, float layoutY, float layoutWidth, float layoutHeight) {
        if (sizeInvalid)
            computeSize();

        float hpadding = w(padLeft) + w(padRight);
        float vpadding = h(padTop) + h(padBottom);

        float totalExpandWidth = 0, totalExpandHeight = 0;
        for (int i = 0; i < columns; i++)
            totalExpandWidth += expandWidth[i];
        for (int i = 0; i < rows; i++)
            totalExpandHeight += expandHeight[i];

        // Size columns and rows between min and pref size using (preferred -
        // min) size to weight distribution of extra space.
        float[] localColumnWeightedWidth;
        float totalGrowWidth = tablePrefWidth - tableMinWidth;
        if (totalGrowWidth == 0)
            localColumnWeightedWidth = columnMinWidth;
        else {
            float extraWidth = Math.min(totalGrowWidth, Math.max(0, layoutWidth - tableMinWidth));
            localColumnWeightedWidth = this.columnWeightedWidth = ensureSize(this.columnWeightedWidth, columns);
            for (int i = 0; i < columns; i++) {
                float growWidth = columnPrefWidth[i] - columnMinWidth[i];
                float growRatio = growWidth / (float) totalGrowWidth;
                localColumnWeightedWidth[i] = columnMinWidth[i] + extraWidth * growRatio;
            }
        }

        float[] localRowWeightedHeight;
        float totalGrowHeight = tablePrefHeight - tableMinHeight;
        if (totalGrowHeight == 0)
            localRowWeightedHeight = rowMinHeight;
        else {
            localRowWeightedHeight = this.rowWeightedHeight = ensureSize(this.rowWeightedHeight, rows);
            float extraHeight = Math.min(totalGrowHeight, Math.max(0, layoutHeight - tableMinHeight));
            for (int i = 0; i < rows; i++) {
                float growHeight = rowPrefHeight[i] - rowMinHeight[i];
                float growRatio = growHeight / (float) totalGrowHeight;
                localRowWeightedHeight[i] = rowMinHeight[i] + extraHeight * growRatio;
            }
        }

        // Determine widget and cell sizes (before expand or fill).
        for (int i = 0, n = cells.size(); i < n; i++) {
            Cell<C, T> c = cells.get(i);
            if (c.ignore)
                continue;

            float spannedWeightedWidth = 0;
            for (int column = c.column, nn = column + c.colspan; column < nn; column++)
                spannedWeightedWidth += localColumnWeightedWidth[column];
            float weightedHeight = localRowWeightedHeight[c.row];

            float prefWidth = w(c.prefWidth, c);
            float prefHeight = h(c.prefHeight, c);
            float minWidth = w(c.minWidth, c);
            float minHeight = h(c.minHeight, c);
            float maxWidth = w(c.maxWidth, c);
            float maxHeight = h(c.maxHeight, c);
            if (prefWidth < minWidth)
                prefWidth = minWidth;
            if (prefHeight < minHeight)
                prefHeight = minHeight;
            if (maxWidth > 0 && prefWidth > maxWidth)
                prefWidth = maxWidth;
            if (maxHeight > 0 && prefHeight > maxHeight)
                prefHeight = maxHeight;

            c.widgetWidth = Math.min(spannedWeightedWidth - c.computedPadLeft - c.computedPadRight, prefWidth);
            c.widgetHeight = Math.min(weightedHeight - c.computedPadTop - c.computedPadBottom, prefHeight);

            if (c.colspan == 1)
                columnWidth[c.column] = Math.max(columnWidth[c.column], spannedWeightedWidth);
            rowHeight[c.row] = Math.max(rowHeight[c.row], weightedHeight);
        }

        // Distribute remaining space to any expanding columns/rows.
        if (totalExpandWidth > 0) {
            float extra = layoutWidth - hpadding;
            for (int i = 0; i < columns; i++)
                extra -= columnWidth[i];
            float used = 0;
            int lastIndex = 0;
            for (int i = 0; i < columns; i++) {
                if (expandWidth[i] == 0)
                    continue;
                float amount = extra * expandWidth[i] / totalExpandWidth;
                columnWidth[i] += amount;
                used += amount;
                lastIndex = i;
            }
            columnWidth[lastIndex] += extra - used;
        }
        if (totalExpandHeight > 0) {
            float extra = layoutHeight - vpadding;
            for (int i = 0; i < rows; i++)
                extra -= rowHeight[i];
            float used = 0;
            int lastIndex = 0;
            for (int i = 0; i < rows; i++) {
                if (expandHeight[i] == 0)
                    continue;
                float amount = extra * expandHeight[i] / totalExpandHeight;
                rowHeight[i] += amount;
                used += amount;
                lastIndex = i;
            }
            rowHeight[lastIndex] += extra - used;
        }

        // Distribute any additional width added by colspanned cells to the
        // columns spanned.
        for (int i = 0, n = cells.size(); i < n; i++) {
            Cell<C, T> c = cells.get(i);
            if (c.ignore)
                continue;
            if (c.colspan == 1)
                continue;

            float extraWidth = 0;
            for (int column = c.column, nn = column + c.colspan; column < nn; column++)
                extraWidth += localColumnWeightedWidth[column] - columnWidth[column];
            extraWidth -= Math.max(0, c.computedPadLeft + c.computedPadRight);

            extraWidth /= c.colspan;
            if (extraWidth > 0) {
                for (int column = c.column, nn = column + c.colspan; column < nn; column++)
                    columnWidth[column] += extraWidth;
            }
        }

        // Determine table size.
        float tableWidth = hpadding, tableHeight = vpadding;
        for (int i = 0; i < columns; i++)
            tableWidth += columnWidth[i];
        for (int i = 0; i < rows; i++)
            tableHeight += rowHeight[i];

        // Position table within the container.
        float x = layoutX + w(padLeft);
        if ((align & RIGHT) != 0)
            x += layoutWidth - tableWidth;
        else if ((align & LEFT) == 0) // Center
            x += (layoutWidth - tableWidth) / 2;

        float y = layoutY + w(padTop);
        if ((align & BOTTOM) != 0)
            y += layoutHeight - tableHeight;
        else if ((align & TOP) == 0) // Center
            y += (layoutHeight - tableHeight) / 2;

        // Position widgets within cells.
        float currentX = x, currentY = y;
        for (int i = 0, n = cells.size(); i < n; i++) {
            Cell<C, T> c = cells.get(i);
            if (c.ignore)
                continue;

            float spannedCellWidth = 0;
            for (int column = c.column, nn = column + c.colspan; column < nn; column++)
                spannedCellWidth += columnWidth[column];
            spannedCellWidth -= c.computedPadLeft + c.computedPadRight;

            currentX += c.computedPadLeft;

            if (c.fillX > 0) {
                c.widgetWidth = spannedCellWidth * c.fillX;
                float maxWidth = w(c.maxWidth, c);
                if (maxWidth > 0)
                    c.widgetWidth = Math.min(c.widgetWidth, maxWidth);
            }
            if (c.fillY > 0) {
                c.widgetHeight = rowHeight[c.row] * c.fillY - c.computedPadTop - c.computedPadBottom;
                float maxHeight = h(c.maxHeight, c);
                if (maxHeight > 0)
                    c.widgetHeight = Math.min(c.widgetHeight, maxHeight);
            }

            if ((c.align & LEFT) != 0)
                c.widgetX = currentX;
            else if ((c.align & RIGHT) != 0)
                c.widgetX = currentX + spannedCellWidth - c.widgetWidth;
            else
                c.widgetX = currentX + (spannedCellWidth - c.widgetWidth) / 2;

            if ((c.align & TOP) != 0)
                c.widgetY = currentY + c.computedPadTop;
            else if ((c.align & BOTTOM) != 0)
                c.widgetY = currentY + rowHeight[c.row] - c.widgetHeight - c.computedPadBottom;
            else
                c.widgetY = currentY + (rowHeight[c.row] - c.widgetHeight + c.computedPadTop - c.computedPadBottom) / 2;

            if (c.endRow) {
                currentX = x;
                currentY += rowHeight[c.row];
            } else
                currentX += spannedCellWidth + c.computedPadRight;
        }

        // Draw debug widgets and bounds.
        if (debug == Debug.none)
            return;
        toolkit.clearDebugRectangles(this);
        currentX = x;
        currentY = y;
        if (debug == Debug.table || debug == Debug.all) {
            toolkit.addDebugRectangle(this, Debug.table, layoutX, layoutY, layoutWidth, layoutHeight);
            toolkit.addDebugRectangle(this, Debug.table, x, y, tableWidth - hpadding, tableHeight - vpadding);
        }
        for (int i = 0, n = cells.size(); i < n; i++) {
            Cell<C, T> c = cells.get(i);
            if (c.ignore)
                continue;

            // Widget bounds.
            if (debug == Debug.widget || debug == Debug.all)
                toolkit.addDebugRectangle(this, Debug.widget, c.widgetX, c.widgetY, c.widgetWidth, c.widgetHeight);

            // Cell bounds.
            float spannedCellWidth = 0;
            for (int column = c.column, nn = column + c.colspan; column < nn; column++)
                spannedCellWidth += columnWidth[column];
            spannedCellWidth -= c.computedPadLeft + c.computedPadRight;
            currentX += c.computedPadLeft;
            if (debug == Debug.cell || debug == Debug.all) {
                toolkit.addDebugRectangle(this, Debug.cell, currentX, currentY + c.computedPadTop, spannedCellWidth, rowHeight[c.row] - c.computedPadTop - c.computedPadBottom);
            }

            if (c.endRow) {
                currentX = x;
                currentY += rowHeight[c.row];
            } else
                currentX += spannedCellWidth + c.computedPadRight;
        }
    }
2302
function(config){
        
        if(isString(config)){
            this.config.appBase = config;
        }else if(isObject(config)){// If the config object is provided
            this.config = Object.assign(this.config, config);
        }

        // If the app base isn't provided
        if(!this.config.appBase){
            this.config.appBase = utils.getAppLocalPath();
        }else if(this.config.appBase.length && this.config.appBase[this.config.appBase.length-1] !== '/'){
            this.config.appBase += '/';
        }

        // If the layouts list was passed in the config
        if(this.config.layouts && isObject(this.config.layouts)){
            Object.keys(this.config.layouts).forEach(key => {
                layouts.add(key, this.config.layouts[key]);
            });
        }

        // If the dev mode is on
        if(this.config.devMode === true){
            // Attach some shortcuts
            Application.on('ready', function(){

                // Ctrl+F12 to toggle the dev tools
                Shortcuts.register('CmdOrCtrl+F12', function(){
                    const window = windowManager.getCurrent();
                    if(window) window.toggleDevTools();
                });

                // Ctrl+R to reload the page
                Shortcuts.register('CmdOrCtrl+R', function(){
                    const window = windowManager.getCurrent();
                    if(window) window.reload();
                });

            });
        }

        // If a default setup is provided
        if(this.config.defaultSetup){
            this.setDefaultSetup(this.config.defaultSetup);
            delete this.config.defaultSetup;
        }
    }
800175
protected function setupLayout()
    {
        if ( ! is_null($this->layout))
        {
            $this->layout = View::make($this->layout);
        }
        //share the config option to all the views
        View::share('cpanel', Config::get('cpanel::site_config'));
    }
11067
public void createLayout(final Sbgn sbgn, boolean doLayout)
    {
        viewToLayout = new HashMap();
        glyphToVNode = new HashMap();
        idToGLyph = new HashMap();
        idToCompartmentGlyphs = new HashMap();
        portIDToOwnerGlyph = new HashMap();
        layoutToView = new HashMap();
        idToArcs = new HashMap<String, Arc>();

        this.layout = new SbgnPDLayout();
        final LGraphManager graphMgr = layout.getGraphManager();
        graphMgr.addRoot();

        root = new VCompound(new Glyph());

        // Detect compartment glyphs and put them in a hashmap;
        // also set compartment glyphs of members of complexes.
        for (Glyph g: sbgn.getMap().getGlyph())
        {
            if(glyphClazzOneOf(g, GlyphClazz.COMPARTMENT)) {
                idToCompartmentGlyphs.put(g.getId(), g);
            }
            //Set compartmentRef to all children of a Complex node.
            Glyph compartment = (Glyph)g.getCompartmentRef();
            if(compartment != null && glyphClazzOneOf(g, GlyphClazz.COMPLEX)) {
                setCompartmentRefForComplexMembers(g, compartment, new HashSet<Glyph>());
            }
        }

        // Nest glyphs inside compartment glyphs according to their compartmentRef.
        // This list holds the glyphs that will be deleted after corresponding glyph
        // is added to child glyph of another glyph.
        if(!idToCompartmentGlyphs.isEmpty()) {
            List<Glyph> deletedList = new ArrayList<Glyph>();
            for (Glyph g : sbgn.getMap().getGlyph()) {
                Glyph containerCompartment = (Glyph) g.getCompartmentRef();
                if (containerCompartment != null) {
                    idToCompartmentGlyphs.get(containerCompartment.getId()).getGlyph().add(g);
                    deletedList.add(g);
                }
            }
            // Delete the duplicate glyphs, after they are moved to corresponding compartment glyph.
            for (Glyph g : deletedList) {
                sbgn.getMap().getGlyph().remove(g);
            }
        }

        // initialize the map for keeping ports and their owner glyphs
        // with entries like: <portID, ownerGlyph>
        initPortIdToGlyphMap(sbgn.getMap().getGlyph());

        //Remove ports from source and target field of ports
        //replace them with owner glyphs of these ports
        removePortsFromArcs(sbgn.getMap().getArc());

        // Assign logical operator and Process nodes to compartment
        assignProcessAndLogicOpNodesToCompartment(sbgn);

        // Create Vnodes for ChiLay layout component
        createVNodes(root, sbgn.getMap().getGlyph());

        for (VNode vNode: root.children) {
            createLNode(vNode, null);
        }

        // Create LEdges for ChiLay layout component
        createLEdges(sbgn.getMap().getArc());

        // Apply layout
        if(doLayout) {
            layout.runLayout();
        }

        graphMgr.updateBounds();

        // Here if any SbgnProcessNode node is returned from SBGNPD Layout
        // this means that we will have two additional port info. We should
        // add this information to libSbgn objects
        for (Object lNode : layout.getAllNodes()) {
            if (lNode instanceof SbgnProcessNode) {
                //Set geometry of corresponding node
                VNode vNode = layoutToView.get(((SbgnProcessNode) lNode).label);
                Bbox tempBbox = vNode.glyph.getBbox();
                tempBbox.setX((float) (((SbgnProcessNode) lNode).getLeft()));
                tempBbox.setY((float) (((SbgnProcessNode) lNode).getTop()));
                vNode.glyph.setBbox(tempBbox);

                //Created port objects in layout level
                SbgnPDNode inputLPort = ((SbgnProcessNode) lNode).getInputPort();
                SbgnPDNode outputLPort = ((SbgnProcessNode) lNode).getOutputPort();

                // New port objects
                Port inputPort = new Port();
                Port outputPort = new Port();

                // Set port attributes
                inputPort.setX((float) (inputLPort.getCenterX()));
                inputPort.setY((float) (inputLPort.getCenterY()));
                inputPort.setId(inputLPort.label);

                outputPort.setX((float) (outputLPort.getCenterX()));
                outputPort.setY((float) (outputLPort.getCenterY()));
                outputPort.setId((outputLPort.label));

                //Clear existing ports !
                vNode.glyph.getPort().clear();
                //Connect existing arcs to newly created ports
                //These ports are created by ChiLay and SBGNPD Layout
                connectArcToPort(inputLPort, inputPort);
                connectArcToPort(outputLPort, outputPort);

                //Add ports to the corresponding glyph
                vNode.glyph.getPort().add(inputPort);
                vNode.glyph.getPort().add(outputPort);
            }
        }

        // Update the bounds
        for (VNode vNode: root.children) {
            updateCompoundBounds(vNode.glyph, vNode.glyph.getGlyph());
        }

        // Clear inside of the compartmentGlyphs
        for (Glyph compGlyph: idToCompartmentGlyphs.values()) {
            //Again add the members of compartments
            for(Glyph memberGlyph: compGlyph.getGlyph() ) {
                sbgn.getMap().getGlyph().add(memberGlyph);
            }
            compGlyph.getGlyph().clear();
        }
    }