Package de.fu_berlin.inf.dpp

Examples of de.fu_berlin.inf.dpp.User


        ISarosSession sarosSession = sessionManager.getSarosSession();
        if (sarosSession == null)
            return;

        User user = sarosSession.getUser(jid);
        /*
         * For the case a left user notification came after the moment the user
         * left the session we need to cache his metrics.
         */
        if (user != null) {
            senderCache.put(jid, user.getHumanReadableName());
            colorCache.put(jid, SarosAnnotation.getUserColor(user));
        }
        final String sender = senderCache.get(jid);
        final Color color = colorCache.get(jid);

View Full Code Here


    User toFollowUser;

    @Override
    public void run() {
        User toFollow = getNewToFollow();
        log.info("Following: " + toFollow); //$NON-NLS-1$
        editorManager.setFollowing(toFollow);
    }
View Full Code Here

        if (inputElement instanceof RosterSessionInput) {
            ISarosSession sarosSession = ((RosterSessionInput) inputElement)
                .getSarosSession();
            if (sarosSession != null) {
                JID rqJID = sarosSession.getResourceQualifiedJID(new JID(jid));
                User user = sarosSession.getUser(rqJID);
                return getUserElement(inputElement, user);
            }
        }

        return null;
View Full Code Here

    public Map<JID, JupiterActivity> transformJupiterActivity(
        JupiterActivity jupiterActivity) throws TransformationException {

        Map<JID, JupiterActivity> result = new HashMap<JID, JupiterActivity>();

        User source = jupiterActivity.getSource();

        // 1. Use JupiterClient of sender to transform JupiterActivity
        Jupiter sourceProxy = proxies.get(source.getJID());
        Operation op = sourceProxy.receiveJupiterActivity(jupiterActivity);

        // 2. Generate outgoing JupiterActivities for all other clients and the
        // host
        for (Map.Entry<JID, Jupiter> entry : proxies.entrySet()) {

            JID jid = entry.getKey();

            // Skip sender
            if (jid.equals(source.getJID()))
                continue;

            Jupiter remoteProxy = entry.getValue();

            JupiterActivity transformed = remoteProxy.generateJupiterActivity(
View Full Code Here

    public Map<JID, ChecksumActivity> withTimestamp(
        ChecksumActivity checksumActivity) throws TransformationException {

        Map<JID, ChecksumActivity> result = new HashMap<JID, ChecksumActivity>();

        User source = checksumActivity.getSource();

        // 1. Verify that this checksum can still be sent to others...
        Jupiter sourceProxy = proxies.get(source.getJID());

        boolean isCurrent = sourceProxy.isCurrent(checksumActivity
            .getTimestamp());

        if (!isCurrent)
            return result; // Checksum is no longer valid => discard

        // 2. Put timestamp into all resulting checksums
        for (Map.Entry<JID, Jupiter> entry : proxies.entrySet()) {

            JID jid = entry.getKey();

            // Skip sender
            if (jid.equals(source.getJID()))
                continue;

            Jupiter remoteProxy = entry.getValue();

            ChecksumActivity timestamped = checksumActivity
View Full Code Here

        /*
         * Compares session part
         */
        if (e1 instanceof UserElement && e2 instanceof UserElement) {
            User user1 = (User) Platform.getAdapterManager().getAdapter(e1,
                User.class);
            User user2 = (User) Platform.getAdapterManager().getAdapter(e2,
                User.class);

            if (user1.equals(user2))
                return 0;
            if (user1.isHost())
                return -1;
            if (user2.isHost())
                return +1;
            return user1.getJID().toString()
                .compareToIgnoreCase(user2.getJID().toString());
        }

        /*
         * Compares Roster part
         */
 
View Full Code Here

        this.containedActivity = containedActivity;
    }

    public IActivity getActivity(ISarosSession sarosSession) {
        SPath sPath = path == null ? null : path.toSPath(sarosSession);
        User user = sarosSession == null ? null : sarosSession.getUser(source);
        final VCSActivity vcsActivity = new VCSActivity(type, user, sPath, url,
            directory, param1);
        vcsActivity.containedActivity.ensureCapacity(containedActivity.size());
        for (IResourceActivityDataObject ado : containedActivity) {
            vcsActivity.containedActivity.add((IResourceActivity) ado
View Full Code Here

                    if (selectedColor == null) {
                        break;
                    }
                    ISarosSession sarosSession = sessionManager
                        .getSarosSession();
                    User localUser = sarosSession.getLocalUser();

                    Collection<User> listOfUsers = new Vector<User>();
                    listOfUsers.addAll(sarosSession.getParticipants());
                    listOfUsers.remove(localUser);
View Full Code Here

                if (sarosSession == null) {
                    log.warn("Not in a shared project, discarding packet!");
                    return;
                }

                final User from = sarosSession
                    .getUser(transferDescription.sender);
                if (from == null) {
                    log.warn("Buddy left, discarding packet!");
                    return;
                }
View Full Code Here

            public void mouseDoubleClick(MouseEvent event) {
                if (control instanceof Tree) {
                    TreeItem treeItem = ((Tree) control).getItem(new Point(
                        event.x, event.y));
                    if (treeItem != null) {
                        User user = (User) Platform.getAdapterManager()
                            .getAdapter(treeItem.getData(), User.class);

                        if (user != null) {
                            editorManager.jumpToUser(user);
                            return;
                        }

                        RosterEntryElement rosterEntryElement = (RosterEntryElement) Platform
                            .getAdapterManager().getAdapter(treeItem.getData(),
                                RosterEntryElement.class);

                        ChatControl chatControl = chatRooms
                            .getActiveChatControl();

                        /*
                         * TODO create links like those of the World of Warcraft
                         * chat which then can be clicked to execute some action
                         * e.g inviting user to a session are add them to the
                         * roster (but should not be done here at all)
                         */

                        if (rosterEntryElement != null && chatControl != null) {
                            String currentText = chatControl.getInputText();
                            chatControl.setInputText(currentText + "["
                                + rosterEntryElement.getJID().getBase() + "]");
                        }

                    }
                } else {
                    log.warn("Control is not instance of Tree.");
                }
            }

            @Override
            public void mouseDown(MouseEvent event) {
                if (control instanceof Tree) {
                    TreeItem treeItem = ((Tree) control).getItem(new Point(
                        event.x, event.y));
                    if (treeItem != null) {
                        User user = (User) Platform.getAdapterManager()
                            .getAdapter(treeItem.getData(), User.class);
                        fmAction.setFollowModeActionStatus(user);
                    }
                } else {
                    log.warn("Control is not instance of Tree.");
View Full Code Here

TOP

Related Classes of de.fu_berlin.inf.dpp.User

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.