Examples of addComponent()


Examples of org.terasology.entitySystem.entity.EntityBuilder.addComponent()

    @Test
    public void clientSentInitialIfOwnedEntityRegistered() {
        connectClient();
        EntityBuilder builder = entityManager.newBuilder();
        NetworkComponent netComp = builder.addComponent(new NetworkComponent());
        netComp.replicateMode = NetworkComponent.ReplicateMode.OWNER;
        builder.setOwner(clientEntity);
        EntityRef entity = builder.build();

        networkSystem.registerNetworkEntity(entity);
View Full Code Here

Examples of org.terasology.entitySystem.entity.EntityRef.addComponent()

    @ReceiveEvent(components = {InventoryComponent.class, RetainBlockInventoryComponent.class})
    public void copyBlockInventory(OnBlockToItem event, EntityRef blockEntity) {
        EntityRef inventoryItem = event.getItem();
        int slotCount = InventoryUtils.getSlotCount(blockEntity);
        inventoryItem.addComponent(new InventoryComponent(slotCount));
        for (int i = 0; i < slotCount; i++) {
            inventoryManager.switchItem(blockEntity, blockEntity, i, inventoryItem, i);
        }
        ItemComponent itemComponent = inventoryItem.getComponent(ItemComponent.class);
        if (itemComponent != null && !itemComponent.stackId.isEmpty()) {
View Full Code Here

Examples of org.terasology.entitySystem.prefab.PrefabData.addComponent()

        entityManager.getComponentLibrary().register(new SimpleUri("test", "integer"), IntegerComponent.class);
        entitySerializer = new EntitySerializer(entityManager);
        componentLibrary = entityManager.getComponentLibrary();

        PrefabData prefabData = new PrefabData();
        prefabData.addComponent(new StringComponent("Value"));
        prefab = Assets.generateAsset(new AssetUri(AssetType.PREFAB, "test:Test"), prefabData, Prefab.class);
    }

    @Test
    public void testDeltaNoUnchangedComponents() throws Exception {
View Full Code Here

Examples of org.waveprotocol.wave.federation.ProtocolDocumentOperation.addComponent()

    final ProtocolDocumentOperation output = ProtocolDocumentOperationJsoImpl.create();
    inputOp.apply(new DocOpCursor() {

      private Component addComponent() {
        ComponentJsoImpl component = ComponentJsoImpl.create();
        output.addComponent(component);
        return component;
      }

      private KeyValuePair keyValuePair(String key, String value) {
        KeyValuePair pair = KeyValuePairJsoImpl.create();
View Full Code Here

Examples of org.woped.qualanalysis.sidebar.assistant.components.SimpleGridBagLayout.addComponent()

    // add workflow-label
    JLabel workflowLabel = new JLabel(Messages.getString(PREFIX + "WorkflowAnalysis"));
    workflowLabel.setFont(SUBHEADER_FONT);
    workflowLabel.setBorder(BOTTOM_BORDER);
    sgbl.addComponent(analysisPanel, workflowLabel, 0, 0, 1, 1, 1, 0);

    // add workflow info
    if (qualanalysisService.isWorkflowNet()) {
      // create "correct"-icon
      correctness = new JLabel(Messages.getImageIcon(CORRECT_ICON));
View Full Code Here

Examples of org.xhtmlrenderer.simple.extend.XhtmlForm.addComponent()

            XhtmlForm form = getForm(parentForm);
            if (form == null) {
                form = new XhtmlForm(uac, parentForm);
                addForm(parentForm, form);
            }
            cc = form.addComponent(e);
        }
        if (cc == null) {
            return null;
        } else if (cc == XhtmlForm.HIDDEN_FIELD) {
            return new EmptyReplacedElement(0, 0);
View Full Code Here

Examples of org.zkoss.zk.ui.sys.DesktopCtrl.addComponent()

        ((AbstractPage)_page).onReplaced(this, comp);
        //call onReplaced instead addRoot/removeRoot

      final DesktopCtrl desktopCtrl = (DesktopCtrl)_page.getDesktop();
      desktopCtrl.removeComponent(this, false);
      desktopCtrl.addComponent(comp);
      _page = null;
    }

    //add comp to the fellow map
    if (bFellow) {
View Full Code Here

Examples of shared.layout.JGridBagPanel.addComponent()

  protected void doInit()
    {
    JGridBagPanel panel = new JGridBagPanel();
        panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
        int row=0;
    panel.addComponent(new JLabel(Main.getString("export_label_type")), 0, row, GridBagConstraints.WEST, new Insets(5, 0, 0, 0));
        row++;
    panel.addComponent(m_typeBox = new JComboBox(), GridBagConstraints.RELATIVE, row, GridBagConstraints.WEST, new Insets(2, 0, 10, 0));
        m_typeBox.addItem(new JValueHolder<String>(Main.getString("export_type_jpg"), "image/jpeg"));
        m_typeBox.addItem(new JValueHolder<String>(Main.getString("export_type_png"), "image/png"));
        m_typeBox.addItem(new JValueHolder<String>(Main.getString("export_type_bmp"), "image/bmp"));
View Full Code Here

Examples of simplenlg.framework.DocumentElement.addComponent()

  public void testEmbedding() {
    DocumentElement sent = phraseFactory.createSentence("This is a test");
    DocumentElement sent2 = phraseFactory.createSentence(phraseFactory
        .createClause("John", "be", "missing"));
    DocumentElement section = phraseFactory.createSection("SECTION TITLE");
    section.addComponent(sent);
    section.addComponent(sent2);

    Assert.assertEquals(
        "SECTION TITLE\nThis is a test.\n\nJohn is missing.\n\n",
        this.realiser.realise(section).getRealisation());
View Full Code Here

Examples of simplenlg.framework.ListElement.addComponent()

        if (DiscourseFunction.INDIRECT_OBJECT.equals(discourseValue)) {
          indirects.addComponent(currentElement);
        } else if (DiscourseFunction.OBJECT.equals(discourseValue)) {
          directs.addComponent(currentElement);
        } else {
          unknowns.addComponent(currentElement);
        }
      }
    }
    if (!InterrogativeType.isIndirectObject(phrase
        .getFeature(Feature.INTERROGATIVE_TYPE))) {
View Full Code Here
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.