Package org.criticalfailure.torchlight.core.domain.entity.object

Examples of org.criticalfailure.torchlight.core.domain.entity.object.ObjectTemplate


                    // TODO
            }
        }
        else if(element instanceof ObjectTemplate) {
            logger.debug("element is a basic object");
            ObjectTemplate bo = (ObjectTemplate)element;

            switch(columnIndex) {
                case 0:
                    logger.debug("column 0");
                    return bo.getName();

                case 1:
                    logger.debug("column 1");

                    // TODO
View Full Code Here


                            .beginTask(
                                    Messages
                                            .getString("campaign.manager.ui.dialog.object_template.create.option.from_campaign.task.label"),
                                    7);

                    ObjectTemplate template = objectTemplateFactory.createObjectTemplate(selectionPage
                            .getSelectedObjectTemplate());
                    logger.trace("template: " + template);
                    monitor.worked(1);

                    // copy the newly created template into the provided one
                    objectTemplate.setName(template.getName());
                    monitor.worked(1);
                    objectTemplate.setDescription(template.getDescription());
                    monitor.worked(1);
                    objectTemplate.setImage(template.getImage());
                    monitor.worked(1);
                    objectTemplate.setType(template.getType());
                    monitor.worked(1);
                    objectTemplate.setLabelProperty(template.getLabelProperty());
                    monitor.worked(1);
                    objectTemplate.setProperties(template.getProperties());
                    for(ObjectProperty op : objectTemplate.getProperties()) {
                        op.setObjectTemplate(objectTemplate);
                    }
                    monitor.worked(1);
View Full Code Here

     */
    public ObjectTemplate createObjectTemplate(AbstractCampaign campaign, boolean empty) {

        logger.info("Creating new object template.");

        ObjectTemplate ot = (ObjectTemplate)appContext.getBean("objectTemplate");

        ot.setCampaign(campaign);

        if(!empty) {
            // TODO
        }

View Full Code Here

     */
    public ObjectTemplate createObjectTemplate(ObjectTemplate template) {

        logger.info("Creating new object template from template: " + template);

        ObjectTemplate ot = (ObjectTemplate)appContext.getBean("objectTemplate");

        ot.setId(template.getId());
        ot.setCampaign(template.getCampaign());
        ot.setName(template.getName());
        ot.setType(template.getType());
        ot.setImage(template.getImage());
        ot.setLabelProperty(template.getLabelProperty());
        try {
            ot.setParent(template.getParent());
        }
        catch(Exception e) {
            logger.error("Exception while trying to create object template from template: " + e.getLocalizedMessage(),
                    e);
        }
        for(ObjectProperty origProp : template.getProperties()) {
            ObjectProperty op = objectPropertyFactory.createObjectProperty(origProp);
            logger.trace("op: " + op);

            ot.addProperty(op);
            op.setObjectTemplate(ot);
        }

        logger.info("Object template created: " + ot);
        return ot;
View Full Code Here

                logger.trace("templateId: " + templateId);

                ObjectTemplateSO otVO = csm.loadObjectTemplate(templateId);
                logger.trace("otVO: " + otVO);

                ObjectTemplate ot = objectTemplateStorageObjectTranslator.translateFrom(otVO, csm);
                logger.trace("ot: " + ot);

                objects.add(ot);
                ot.setCampaign(c);
            }
            c.setObjects(objects);

            Set<ObjectInstance> instances = new HashSet<ObjectInstance>();
            logger.debug("instances: " + so.getInstances().size());
View Full Code Here

    public ObjectTemplate translateFrom(ObjectTemplateSO so, ICampaignStorageManager csm)
            throws StorageObjectTranslationException {

        logger.debug("translate from: " + so);

        ObjectTemplate ot = objectTemplateFactory.createObjectTemplate(null, true);
        logger.trace("ot: " + ot);

        translateFromWithMerge(so, ot, csm);

        return ot;
View Full Code Here

                logger.debug("setting parent: " + so.getObjectTemplateId());

                ObjectTemplateSO parentVO = csm.loadObjectTemplate(so.getObjectTemplateId());
                logger.trace("parentVO: " + parentVO);

                ObjectTemplate parentTemplate = translateFrom(parentVO, csm);
                logger.trace("parentTemplate: " + parentTemplate);

                ot.setParent(parentTemplate);
            }
View Full Code Here

                ObjectProperty op = objectPropertyFactory.createObjectProperty(objectInstance.getCampaign(), true);
                logger.trace("op: " + op);

                op.setName(selectedObject.getName());

                ObjectTemplate ot = objectInstance.getObjectTemplate();
                logger.trace("ot: " + ot);

                ot.addProperty(op);
                op.setObjectTemplate(ot);
                op.setCampaign(ot.getCampaign());

                try {
                    ot.save();
                }
                catch(Exception e) {
                    logger.error("Exception while trying to save object template: " + e.getLocalizedMessage(), e);

                    alertService.addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), e
View Full Code Here

            }

            ObjectTemplateSO otVO = csm.loadObjectTemplate(so.getObjectTemplateId());
            logger.trace("otVO: " + otVO);

            ObjectTemplate ot = objectTemplateStorageObjectTranslator.translateFrom(otVO, csm);
            logger.trace("ot: " + ot);

            oi.setObjectTemplate(ot);
        }
        catch(Exception e) {
View Full Code Here

     * @see org.eclipse.jface.action.Action#runWithEvent(org.eclipse.swt.widgets.Event)
     */
    @Override
    public void runWithEvent(Event event) {

        ObjectTemplate ot;
        try {
            ot = getEncounterObjectTemplate();
        }
        catch(Exception e) {
            logger.error("Exception while retrieving encounter object template: " + e.getLocalizedMessage(), e);
View Full Code Here

TOP

Related Classes of org.criticalfailure.torchlight.core.domain.entity.object.ObjectTemplate

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.