Examples of Participant


Examples of org.criticalfailure.torchlight.core.domain.entity.Participant

     */
    public Participant createParticipant(Participant template) {

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

        Participant p = (Participant)appContext.getBean("participant");

        p.setId(template.getId());
        p.setName(template.getName());
        p.setAddress(template.getAddress());
        p.setContactInfo(template.getContactInfo());
        p.setNotes(template.getNotes());

        logger.info("Created participant: " + p);
        return p;
    }
View Full Code Here

Examples of org.criticalfailure.torchlight.core.domain.entity.Participant

            Set<Participant> participants = new HashSet<Participant>();
            logger.debug("participants: " + so.getParticipants().size());
            for(String participantId : so.getParticipants()) {
                logger.trace("participantId: " + participantId);

                Participant participant = participantManager.getParticipant(participantId);
                logger.trace("participant: " + participant);

                participants.add(participant);
            }
            c.setParticipants(participants);
View Full Code Here

Examples of org.criticalfailure.torchlight.core.domain.entity.Participant

            if(so.getCampaignId() != null) {
                oi.setCampaign(campaignManager.getCampaign(so.getCampaignId()));
            }

            if(StringUtils.stripToNull(so.getParticipantId()) != null) {
                Participant p = participantManager.getParticipant(so.getParticipantId());
                logger.trace("p: " + p);
                if(p == null) {
                    p = participantStorageObjectTranslator.translateFrom(csm.loadParticipant(so.getParticipantId()),
                            csm);
                }
View Full Code Here

Examples of org.criticalfailure.torchlight.core.domain.entity.Participant

                String filePath = PathUtils.buildPath(participantStoragePath, participantId);
                logger.trace("filePath: " + filePath);
                logger.info("Loading local participant from file: " + filePath);

                XMLDecoder dec = new XMLDecoder(new BufferedInputStream(new FileInputStream(filePath)));
                Participant p = (Participant)dec.readObject();
                logger.trace("participant: " + p);

                dec.close();

                participants.add(p);
View Full Code Here

Examples of org.criticalfailure.torchlight.core.domain.entity.Participant

     * .lang.Object)
     */
    public Participant translateFrom(ParticipantSO vo, ICampaignStorageManager csm)
            throws StorageObjectTranslationException {

        Participant p = participantFactory.createParticipant(true);

        translateFromWithMerge(vo, p, csm);

        return p;
    }
View Full Code Here

Examples of org.criticalfailure.torchlight.core.domain.entity.Participant

    public Participant getOwner() {
        return owner;
    }

    public void setOwner(Participant owner) {
        Participant old = this.owner;
        this.owner = owner;

        postPropertyChangeEvent("owner", old, owner);
    }
View Full Code Here

Examples of org.criticalfailure.torchlight.core.domain.entity.Participant

    @Override
    public void runWithEvent(Event event) {

        logger.info("Executing 'create participant' action: " + event);

        Participant p = participantFactory.createParticipant(false);
        logger.trace("p: " + p);

        try {
            // create a dialog to get information from the user
            IParticipantBuilderDialog dialog = (IParticipantBuilderDialog)appContext.getBean(
View Full Code Here

Examples of org.criticalfailure.torchlight.core.model.model.Participant

                }
                break;
               
            case ACTION_TYPE_PARTICIPANT:
                try {
                    Participant participant;

                    // find a participant creation helper
                    if(runWizard) {
                        logger.debug("running wizard to create participant");
View Full Code Here

Examples of org.criticalfailure.torchlight.core.model.model.Participant

    {
        Label label;
       
        logger.debug("creating controls");
       
        final Participant p = ((ParticipantEditorInput)getEditorInput()).getParticipant();
       
        SashForm sashForm = new SashForm(parent, SWT.HORIZONTAL);
       
        Composite leftSide = new Composite(sashForm, SWT.NONE);
        new Sash(sashForm, SWT.NONE);
        Composite rightSide = new Composite(sashForm, SWT.NONE);
       
        sashForm.setWeights(new int[] { 65, 35 });
       
        // create a generic focus listener that saves the object when focus is lost
        FocusListener saveObjectFocusListener = new FocusListener() {
      public void focusGained(FocusEvent event)
      {
          logger.trace("focus gained: " + event);
      }

      public void focusLost(FocusEvent event)
      {
          logger.debug("focus lost: " + event);
         
//          try
//                {
//              Participant p = ((ParticipantEditorInput)getEditorInput()).getParticipant();
//             
//                  logger.info("Saving participant: " + p);
////                    DataStore.getDataStore().saveObject(p, null);
//                }
//                catch(DataPersistenceException e)
//                {
//                    logger.error("exception while saving participant: " + e.getLocalizedMessage(), e);
//                   
//                    MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.getString("campaign.editor.error.save_participant.title"), Messages.getString("campaign.editor.error.save_participant.message"));
//                }
      }
        };

        {
            GridLayout layout = new GridLayout();
            layout.numColumns = 4;
            leftSide.setLayout(layout);

            // name
            label = new Label(leftSide, SWT.RIGHT);
            label.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
            label.setText(Messages.getString("participant.editor.name.label"));

            name = new Text(leftSide, SWT.BORDER);
            name.setText(p.getName());
            name.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
            name.addModifyListener(new ModifyListener() {
                public void modifyText(ModifyEvent e)
                {
                    logger.debug("modifying participant name");

                    p.setName(name.getText());

                    dirty = true;

                    ParticipantEditor.this.setPartName(Messages.getString("participant.editor.title.tab") + ": " + ((ParticipantEditorInput)getEditorInput()).getParticipant().getName());
                }
            });
            name.addFocusListener(saveObjectFocusListener);

            // role
            label = new Label(leftSide, SWT.RIGHT);
            label.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
            label.setText(Messages.getString("participant.editor.role.label"));

            role = new Combo(leftSide, SWT.READ_ONLY | SWT.DROP_DOWN);
            role.add(Messages.getString("participant.role.player"));
            role.add(Messages.getString("participant.role.dm"));
//            role.select(IApplicationConstants.DUNGEON_MASTER_ROLE.equals(p.getRole()) ? 1 : 0);
            role.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
            role.addSelectionListener(new SelectionListener() {
                public void widgetDefaultSelected(SelectionEvent e)
                {
                    // do nothing
                }

                public void widgetSelected(SelectionEvent e)
                {
                    logger.debug("modifying participant role");

                    int selection = role.getSelectionIndex();

//                    if(selection == 1)
//                        p.setRole(IApplicationConstants.DUNGEON_MASTER_ROLE);
//                    else
//                        p.setRole(IApplicationConstants.PLAYER_ROLE);

                    dirty = true;
                }
            });
            role.addFocusListener(saveObjectFocusListener);

            // address
            label = new Label(leftSide, SWT.RIGHT);
            label.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
            label.setText(Messages.getString("participant.editor.address.label"));
           
            address = new Text(leftSide, SWT.BORDER | SWT.MULTI);
            {
                GridData gd = new GridData(GridData.FILL_BOTH);
                gd.horizontalSpan = 3;
                address.setLayoutData(gd);
            }
            address.setSize(0, 50); // TODO: better determination?
            address.setText(p.getAddress());
            address.addModifyListener(new ModifyListener() {
                public void modifyText(ModifyEvent e)
                {
                    logger.debug("modifying participant address");
                   
                    p.setAddress(address.getText());
                   
                    dirty = true;
                }
            });
            address.addFocusListener(saveObjectFocusListener);
           
            // notes
            label = new Label(leftSide, SWT.RIGHT);
            label.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
            label.setText(Messages.getString("participant.editor.notes.label"));
           
            notes = new Text(leftSide, SWT.BORDER | SWT.MULTI);
            {
                GridData gd = new GridData(GridData.FILL_BOTH);
                gd.horizontalSpan = 3;
                notes.setLayoutData(gd);
            }
            notes.setText(p.getAddress());
            notes.addModifyListener(new ModifyListener() {
                public void modifyText(ModifyEvent e)
                {
                    logger.debug("modifying participant notes");
                   
                    p.setAddress(notes.getText());
                   
                    dirty = true;
                }
            });
            notes.addFocusListener(saveObjectFocusListener);
View Full Code Here

Examples of org.criticalfailure.torchlight.core.model.model.Participant

    public boolean matches(IEditorReference editorRef, IEditorInput input)
    {
        logger.debug("matches? editorRef: " + editorRef + "; input: " + input);
       
        if(input instanceof ParticipantEditorInput) {
            Participant p = (Participant)((ParticipantEditorInput)input).getParticipant();
            logger.trace("p: " + p);
           
            if(p != null)
            {
                return true;
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.