Issue #429 color fixes
Former-commit-id: 819a0b037d49993e56dc77207809dbf3903ea6ec
This commit is contained in:
parent
064657306f
commit
7116eb79cd
12 changed files with 102 additions and 53 deletions
|
@ -25,8 +25,11 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.eclipse.swt.graphics.RGB;
|
||||||
|
|
||||||
import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
|
import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
|
||||||
import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole;
|
import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole;
|
||||||
|
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
||||||
import com.raytheon.uf.viz.collaboration.ui.role.DataProviderEventController;
|
import com.raytheon.uf.viz.collaboration.ui.role.DataProviderEventController;
|
||||||
import com.raytheon.uf.viz.collaboration.ui.role.IRoleEventController;
|
import com.raytheon.uf.viz.collaboration.ui.role.IRoleEventController;
|
||||||
import com.raytheon.uf.viz.collaboration.ui.role.ParticipantEventController;
|
import com.raytheon.uf.viz.collaboration.ui.role.ParticipantEventController;
|
||||||
|
@ -64,7 +67,7 @@ public class SharedDisplaySessionMgr {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static void joinSession(ISharedDisplaySession session,
|
protected static void joinSession(ISharedDisplaySession session,
|
||||||
SharedDisplayRole initialRole) {
|
SharedDisplayRole initialRole, Map<UserId, RGB> colors) {
|
||||||
SessionContainer container = new SessionContainer();
|
SessionContainer container = new SessionContainer();
|
||||||
container.setSessionId(session.getSessionId());
|
container.setSessionId(session.getSessionId());
|
||||||
container.setSession(session);
|
container.setSession(session);
|
||||||
|
@ -92,6 +95,9 @@ public class SharedDisplaySessionMgr {
|
||||||
"ParticipantRole must be DataProvider or Participant for initialization");
|
"ParticipantRole must be DataProvider or Participant for initialization");
|
||||||
}
|
}
|
||||||
container.setRoleEventController(rec);
|
container.setRoleEventController(rec);
|
||||||
|
if (colors != null) {
|
||||||
|
container.getColorManager().setColors(colors);
|
||||||
|
}
|
||||||
sharedDisplaySessionMap.put(session.getSessionId(), container);
|
sharedDisplaySessionMap.put(session.getSessionId(), container);
|
||||||
|
|
||||||
rec.startup();
|
rec.startup();
|
||||||
|
|
|
@ -117,10 +117,12 @@ public class CreateSessionDialog extends CaveSWTDialog {
|
||||||
gd = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false);
|
gd = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false);
|
||||||
gd.horizontalSpan = 2;
|
gd.horizontalSpan = 2;
|
||||||
publicCollaboration.setLayoutData(gd);
|
publicCollaboration.setLayoutData(gd);
|
||||||
|
publicCollaboration.setSelection(true);
|
||||||
publicCollaboration.setText("Create Collaboration");
|
publicCollaboration.setText("Create Collaboration");
|
||||||
|
|
||||||
if (showInvite) {
|
if (showInvite) {
|
||||||
inviteUsers = new Button(body, SWT.CHECK);
|
inviteUsers = new Button(body, SWT.CHECK);
|
||||||
|
inviteUsers.setSelection(true);
|
||||||
gd = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false);
|
gd = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false);
|
||||||
gd.horizontalSpan = 2;
|
gd.horizontalSpan = 2;
|
||||||
inviteUsers.setLayoutData(gd);
|
inviteUsers.setLayoutData(gd);
|
||||||
|
@ -134,7 +136,7 @@ public class CreateSessionDialog extends CaveSWTDialog {
|
||||||
inviteLabel.setText("Message: ");
|
inviteLabel.setText("Message: ");
|
||||||
inviteLabel.setToolTipText("Message to send to invited users");
|
inviteLabel.setToolTipText("Message to send to invited users");
|
||||||
inviteMessageTF = new StyledText(body, SWT.BORDER | SWT.MULTI
|
inviteMessageTF = new StyledText(body, SWT.BORDER | SWT.MULTI
|
||||||
| SWT.WRAP | SWT.H_SCROLL | SWT.V_SCROLL);
|
| SWT.WRAP | SWT.V_SCROLL);
|
||||||
inviteMessageTF.setLayoutData(new GridData(GridData.FILL_BOTH));
|
inviteMessageTF.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||||
inviteMessageTF.pack();
|
inviteMessageTF.pack();
|
||||||
inviteMessageTF.setToolTipText("Message to send to invited users");
|
inviteMessageTF.setToolTipText("Message to send to invited users");
|
||||||
|
@ -158,8 +160,8 @@ public class CreateSessionDialog extends CaveSWTDialog {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
inviteLabel.setVisible(false);
|
inviteLabel.setVisible(true);
|
||||||
inviteMessageTF.setVisible(false);
|
inviteMessageTF.setVisible(true);
|
||||||
}
|
}
|
||||||
return body;
|
return body;
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,6 +91,10 @@ public class SessionColorManager {
|
||||||
colors.put(user, rgbPresets[count]);
|
colors.put(user, rgbPresets[count]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addColor(UserId id, RGB color) {
|
||||||
|
colors.put(id, color);
|
||||||
|
}
|
||||||
|
|
||||||
public void clearColors() {
|
public void clearColors() {
|
||||||
colors.clear();
|
colors.clear();
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,14 +215,14 @@ public abstract class AbstractSessionView extends ViewPart implements
|
||||||
* @param message
|
* @param message
|
||||||
*/
|
*/
|
||||||
public void appendMessage(IMessage message) {
|
public void appendMessage(IMessage message) {
|
||||||
String fqName = message.getFrom().getFQName();
|
UserId userId = (UserId) message.getFrom();
|
||||||
String name = message.getFrom().getName();
|
String name = message.getFrom().getName();
|
||||||
long timestamp = message.getTimeStamp();
|
long timestamp = message.getTimeStamp();
|
||||||
String body = message.getBody();
|
String body = message.getBody();
|
||||||
appendMessage(fqName, name, timestamp, body);
|
appendMessage(userId, name, timestamp, body);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void appendMessage(String fqName, String name, long timestamp,
|
public void appendMessage(UserId userId, String name, long timestamp,
|
||||||
String body) {
|
String body) {
|
||||||
IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService) getSite()
|
IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService) getSite()
|
||||||
.getAdapter(IWorkbenchSiteProgressService.class);
|
.getAdapter(IWorkbenchSiteProgressService.class);
|
||||||
|
@ -231,7 +231,8 @@ public abstract class AbstractSessionView extends ViewPart implements
|
||||||
// String fqName = message.getFrom().getFQName();
|
// String fqName = message.getFrom().getFQName();
|
||||||
// String name = message.getFrom().getName();
|
// String name = message.getFrom().getName();
|
||||||
if (name == null) {
|
if (name == null) {
|
||||||
name = fqName.substring(0, fqName.indexOf("@"));
|
name = userId.getFQName().substring(0,
|
||||||
|
userId.getFQName().indexOf("@"));
|
||||||
}
|
}
|
||||||
Calendar cal = Calendar.getInstance();
|
Calendar cal = Calendar.getInstance();
|
||||||
cal.setTimeInMillis(timestamp);
|
cal.setTimeInMillis(timestamp);
|
||||||
|
@ -263,13 +264,13 @@ public abstract class AbstractSessionView extends ViewPart implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
styleAndAppendText(sb, offset, name, fqName, ranges);
|
styleAndAppendText(sb, offset, name, userId, ranges);
|
||||||
// room for other fun things here, such as sounds and such
|
// room for other fun things here, such as sounds and such
|
||||||
executeSightsSounds();
|
executeSightsSounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void styleAndAppendText(StringBuilder sb, int offset,
|
protected abstract void styleAndAppendText(StringBuilder sb, int offset,
|
||||||
String name, String fqName, List<StyleRange> ranges);
|
String name, UserId userId, List<StyleRange> ranges);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find keys words in body of message starting at offset. /**
|
* Find keys words in body of message starting at offset. /**
|
||||||
|
|
|
@ -28,7 +28,6 @@ import org.eclipse.jface.viewers.ILabelProviderListener;
|
||||||
import org.eclipse.jface.viewers.ITableColorProvider;
|
import org.eclipse.jface.viewers.ITableColorProvider;
|
||||||
import org.eclipse.jface.viewers.ITableFontProvider;
|
import org.eclipse.jface.viewers.ITableFontProvider;
|
||||||
import org.eclipse.jface.viewers.ITableLabelProvider;
|
import org.eclipse.jface.viewers.ITableLabelProvider;
|
||||||
import org.eclipse.swt.SWT;
|
|
||||||
import org.eclipse.swt.graphics.Color;
|
import org.eclipse.swt.graphics.Color;
|
||||||
import org.eclipse.swt.graphics.Font;
|
import org.eclipse.swt.graphics.Font;
|
||||||
import org.eclipse.swt.graphics.Image;
|
import org.eclipse.swt.graphics.Image;
|
||||||
|
@ -36,6 +35,7 @@ import org.eclipse.swt.graphics.RGB;
|
||||||
import org.eclipse.swt.widgets.Display;
|
import org.eclipse.swt.widgets.Display;
|
||||||
|
|
||||||
import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession;
|
import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession;
|
||||||
|
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
||||||
import com.raytheon.uf.viz.collaboration.data.CollaborationDataManager;
|
import com.raytheon.uf.viz.collaboration.data.CollaborationDataManager;
|
||||||
import com.raytheon.uf.viz.collaboration.data.CollaborationUser;
|
import com.raytheon.uf.viz.collaboration.data.CollaborationUser;
|
||||||
import com.raytheon.uf.viz.collaboration.data.SharedDisplaySessionMgr;
|
import com.raytheon.uf.viz.collaboration.data.SharedDisplaySessionMgr;
|
||||||
|
@ -67,7 +67,7 @@ public class ParticipantsLabelProvider implements ITableColorProvider,
|
||||||
|
|
||||||
protected Map<String, Image> imageMap;
|
protected Map<String, Image> imageMap;
|
||||||
|
|
||||||
protected Map<String, Color> colors;
|
protected Map<UserId, Color> colors;
|
||||||
|
|
||||||
public ParticipantsLabelProvider() {
|
public ParticipantsLabelProvider() {
|
||||||
listeners = new ArrayList<ILabelProviderListener>();
|
listeners = new ArrayList<ILabelProviderListener>();
|
||||||
|
@ -141,19 +141,30 @@ public class ParticipantsLabelProvider implements ITableColorProvider,
|
||||||
@Override
|
@Override
|
||||||
public Color getForeground(Object element, int columnIndex) {
|
public Color getForeground(Object element, int columnIndex) {
|
||||||
if (colors == null) {
|
if (colors == null) {
|
||||||
colors = new HashMap<String, Color>();
|
colors = new HashMap<UserId, Color>();
|
||||||
}
|
}
|
||||||
|
// String host = ((CollaborationUser) element).
|
||||||
String id = ((CollaborationUser) element).getId();
|
String id = ((CollaborationUser) element).getId();
|
||||||
|
String[] uid = null;
|
||||||
|
if (id != null) {
|
||||||
|
uid = ((CollaborationUser) element).getId().split("@");
|
||||||
|
}
|
||||||
|
UserId userId = new UserId(uid[0], uid[1]);
|
||||||
RGB color = SharedDisplaySessionMgr.getSessionContainer(sessionId)
|
RGB color = SharedDisplaySessionMgr.getSessionContainer(sessionId)
|
||||||
.getColorManager().getColors().get(id);
|
.getColorManager().getColors().get(userId);
|
||||||
|
if (color == null) {
|
||||||
|
userId.setHost("conference." + uid[1]);
|
||||||
|
color = SharedDisplaySessionMgr.getSessionContainer(sessionId)
|
||||||
|
.getColorManager().getColors().get(userId);
|
||||||
|
}
|
||||||
|
|
||||||
// add to map so we can dispose
|
// add to map so we can dispose
|
||||||
if (color == null) {
|
if (color == null) {
|
||||||
colors.put(id, Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
|
colors.put(userId, new Color(Display.getCurrent(), 0, 0, 0));
|
||||||
} else {
|
} else {
|
||||||
colors.put(id, new Color(Display.getCurrent(), color));
|
colors.put(userId, new Color(Display.getCurrent(), color));
|
||||||
}
|
}
|
||||||
return colors.get(id);
|
return colors.get(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -37,6 +37,7 @@ import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
|
||||||
import com.raytheon.uf.viz.collaboration.comm.identity.IPeerToPeer;
|
import com.raytheon.uf.viz.collaboration.comm.identity.IPeerToPeer;
|
||||||
import com.raytheon.uf.viz.collaboration.comm.identity.listener.IMessageListener;
|
import com.raytheon.uf.viz.collaboration.comm.identity.listener.IMessageListener;
|
||||||
import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID;
|
import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID;
|
||||||
|
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
||||||
import com.raytheon.uf.viz.collaboration.data.CollaborationDataManager;
|
import com.raytheon.uf.viz.collaboration.data.CollaborationDataManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -180,7 +181,7 @@ public class PeerToPeerView extends AbstractSessionView {
|
||||||
IPeerToPeer p2p = (IPeerToPeer) manager.getSessionManager()
|
IPeerToPeer p2p = (IPeerToPeer) manager.getSessionManager()
|
||||||
.getPeerToPeerSession();
|
.getPeerToPeerSession();
|
||||||
p2p.sendPeerToPeer(peer, message);
|
p2p.sendPeerToPeer(peer, message);
|
||||||
appendMessage(manager.getLoginId(), null,
|
appendMessage((UserId) peer, manager.getLoginId(),
|
||||||
System.currentTimeMillis(), message);
|
System.currentTimeMillis(), message);
|
||||||
} catch (CollaborationException e) {
|
} catch (CollaborationException e) {
|
||||||
// TODO Auto-generated catch block. Please revise as
|
// TODO Auto-generated catch block. Please revise as
|
||||||
|
@ -192,9 +193,10 @@ public class PeerToPeerView extends AbstractSessionView {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void styleAndAppendText(StringBuilder sb, int offset,
|
protected void styleAndAppendText(StringBuilder sb, int offset,
|
||||||
String name, String fqName, List<StyleRange> ranges) {
|
String name, UserId userId, List<StyleRange> ranges) {
|
||||||
Color color = null;
|
Color color = null;
|
||||||
if (!fqName.equals(CollaborationDataManager.getInstance().getLoginId())) {
|
if (!userId.getFQName().equals(
|
||||||
|
CollaborationDataManager.getInstance().getLoginId())) {
|
||||||
color = userColor;
|
color = userColor;
|
||||||
} else {
|
} else {
|
||||||
color = chatterColor;
|
color = chatterColor;
|
||||||
|
|
|
@ -79,6 +79,7 @@ import com.raytheon.uf.viz.collaboration.data.CollaborationDataManager;
|
||||||
import com.raytheon.uf.viz.collaboration.data.CollaborationUser;
|
import com.raytheon.uf.viz.collaboration.data.CollaborationUser;
|
||||||
import com.raytheon.uf.viz.collaboration.data.SharedDisplaySessionMgr;
|
import com.raytheon.uf.viz.collaboration.data.SharedDisplaySessionMgr;
|
||||||
import com.raytheon.uf.viz.collaboration.ui.CollaborationUtils;
|
import com.raytheon.uf.viz.collaboration.ui.CollaborationUtils;
|
||||||
|
import com.raytheon.uf.viz.collaboration.ui.SessionColorManager;
|
||||||
import com.raytheon.uf.viz.core.VizApp;
|
import com.raytheon.uf.viz.core.VizApp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -121,7 +122,7 @@ public class SessionView extends AbstractSessionView {
|
||||||
|
|
||||||
protected Action chatAction;
|
protected Action chatAction;
|
||||||
|
|
||||||
protected Map<UserId, RGB> colors;
|
protected SessionColorManager manager;
|
||||||
|
|
||||||
protected Map<RGB, Color> mappedColors;
|
protected Map<RGB, Color> mappedColors;
|
||||||
|
|
||||||
|
@ -136,8 +137,8 @@ public class SessionView extends AbstractSessionView {
|
||||||
createContextMenu();
|
createContextMenu();
|
||||||
SharedDisplaySessionMgr.getSessionContainer(sessionId).getSession()
|
SharedDisplaySessionMgr.getSessionContainer(sessionId).getSession()
|
||||||
.getEventPublisher().register(this);
|
.getEventPublisher().register(this);
|
||||||
colors = SharedDisplaySessionMgr.getSessionContainer(sessionId)
|
manager = SharedDisplaySessionMgr.getSessionContainer(sessionId)
|
||||||
.getColorManager().getColors();
|
.getColorManager();
|
||||||
mappedColors = new HashMap<RGB, Color>();
|
mappedColors = new HashMap<RGB, Color>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -418,9 +419,6 @@ public class SessionView extends AbstractSessionView {
|
||||||
}
|
}
|
||||||
mappedColors.clear();
|
mappedColors.clear();
|
||||||
}
|
}
|
||||||
if (colors != null) {
|
|
||||||
colors.clear();
|
|
||||||
}
|
|
||||||
SharedDisplaySessionMgr.getSessionContainer(sessionId)
|
SharedDisplaySessionMgr.getSessionContainer(sessionId)
|
||||||
.getColorManager().clearColors();
|
.getColorManager().clearColors();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
|
@ -462,10 +460,12 @@ public class SessionView extends AbstractSessionView {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void styleAndAppendText(StringBuilder sb, int offset,
|
protected void styleAndAppendText(StringBuilder sb, int offset,
|
||||||
String name, String fqName, List<StyleRange> ranges) {
|
String name, UserId userId, List<StyleRange> ranges) {
|
||||||
int index = fqName.indexOf("/");
|
RGB rgb = manager.getColorFromUser(userId);
|
||||||
RGB rgb = colors.get(fqName.substring(0, index));
|
|
||||||
if (mappedColors.get(rgb) == null) {
|
if (mappedColors.get(rgb) == null) {
|
||||||
|
if (rgb == null) {
|
||||||
|
rgb = new RGB(0, 0, 0);
|
||||||
|
}
|
||||||
Color col = new Color(Display.getCurrent(), rgb);
|
Color col = new Color(Display.getCurrent(), rgb);
|
||||||
mappedColors.put(rgb, col);
|
mappedColors.put(rgb, col);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,6 @@ package com.raytheon.uf.viz.collaboration.ui.telestrator;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.eclipse.swt.graphics.RGB;
|
import org.eclipse.swt.graphics.RGB;
|
||||||
|
|
||||||
|
@ -38,6 +37,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
||||||
import com.raytheon.uf.viz.collaboration.data.CollaborationDataManager;
|
import com.raytheon.uf.viz.collaboration.data.CollaborationDataManager;
|
||||||
import com.raytheon.uf.viz.collaboration.data.SharedDisplaySessionMgr;
|
import com.raytheon.uf.viz.collaboration.data.SharedDisplaySessionMgr;
|
||||||
import com.raytheon.uf.viz.collaboration.ui.ColorChangeEvent;
|
import com.raytheon.uf.viz.collaboration.ui.ColorChangeEvent;
|
||||||
|
import com.raytheon.uf.viz.collaboration.ui.SessionColorManager;
|
||||||
import com.raytheon.uf.viz.collaboration.ui.login.LoginData;
|
import com.raytheon.uf.viz.collaboration.ui.login.LoginData;
|
||||||
import com.raytheon.uf.viz.collaboration.ui.telestrator.event.CollaborationDrawingEvent;
|
import com.raytheon.uf.viz.collaboration.ui.telestrator.event.CollaborationDrawingEvent;
|
||||||
import com.raytheon.uf.viz.collaboration.ui.telestrator.event.CollaborationDrawingEvent.CollaborationEventType;
|
import com.raytheon.uf.viz.collaboration.ui.telestrator.event.CollaborationDrawingEvent.CollaborationEventType;
|
||||||
|
@ -89,7 +89,7 @@ public class CollaborationDrawingLayer extends DrawingLayer {
|
||||||
|
|
||||||
private String sessionId;
|
private String sessionId;
|
||||||
|
|
||||||
private Map<UserId, RGB> colors;
|
private SessionColorManager colorManager;
|
||||||
|
|
||||||
private IWireframeShape tempRemoteShape = null;
|
private IWireframeShape tempRemoteShape = null;
|
||||||
|
|
||||||
|
@ -132,11 +132,11 @@ public class CollaborationDrawingLayer extends DrawingLayer {
|
||||||
this.deletedCollaboratorShapes = LinkedHashMultimap.create();
|
this.deletedCollaboratorShapes = LinkedHashMultimap.create();
|
||||||
this.deletedCollaboratorShapes = Multimaps
|
this.deletedCollaboratorShapes = Multimaps
|
||||||
.synchronizedMultimap(this.deletedCollaboratorShapes);
|
.synchronizedMultimap(this.deletedCollaboratorShapes);
|
||||||
colors = SharedDisplaySessionMgr.getSessionContainer(sessionId)
|
colorManager = SharedDisplaySessionMgr.getSessionContainer(sessionId)
|
||||||
.getColorManager().getColors();
|
.getColorManager();
|
||||||
LoginData data = CollaborationDataManager.getInstance().getLoginData();
|
LoginData data = CollaborationDataManager.getInstance().getLoginData();
|
||||||
UserId id = new UserId(data.getUser(), data.getServer());
|
UserId id = new UserId(data.getUser(), data.getServer());
|
||||||
color = colors.get(id);
|
color = colorManager.getColors().get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -164,7 +164,7 @@ public class CollaborationDrawingLayer extends DrawingLayer {
|
||||||
for (UserId userName : collaboratorShapes.keySet()) {
|
for (UserId userName : collaboratorShapes.keySet()) {
|
||||||
for (ShapeContainer sh : collaboratorShapes.get(userName)) {
|
for (ShapeContainer sh : collaboratorShapes.get(userName)) {
|
||||||
if (sh != null) {
|
if (sh != null) {
|
||||||
color = colors.get(userName);
|
color = colorManager.getColors().get(userName);
|
||||||
if (color == null) {
|
if (color == null) {
|
||||||
color = new RGB(255, 0, 0);
|
color = new RGB(255, 0, 0);
|
||||||
}
|
}
|
||||||
|
@ -179,11 +179,8 @@ public class CollaborationDrawingLayer extends DrawingLayer {
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void setColorEvent(ColorChangeEvent event) {
|
public void setColorEvent(ColorChangeEvent event) {
|
||||||
if (CollaborationDataManager.getInstance().getLoginId()
|
this.color = event.getColor();
|
||||||
.equals(event.getUserName())) {
|
colorManager.addUser(event.getUserName());
|
||||||
this.color = event.getColor();
|
|
||||||
}
|
|
||||||
colors.put(event.getUserName(), event.getColor());
|
|
||||||
issueRefresh();
|
issueRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -299,9 +296,18 @@ public class CollaborationDrawingLayer extends DrawingLayer {
|
||||||
* @param userName
|
* @param userName
|
||||||
*/
|
*/
|
||||||
private void clearSelfShapes(UserId userName) {
|
private void clearSelfShapes(UserId userName) {
|
||||||
for (ShapeContainer cont : collaboratorShapes.get(userName)) {
|
// TODO, fix this
|
||||||
cont.getShape().dispose();
|
for (UserId cont : collaboratorShapes.keySet()) {
|
||||||
|
if (cont.getFQName().equals(userName.getFQName())) {
|
||||||
|
for (ShapeContainer shape : collaboratorShapes.get(cont)) {
|
||||||
|
shape.getShape().dispose();
|
||||||
|
}
|
||||||
|
collaboratorShapes.removeAll(cont);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// for (ShapeContainer cont : collaboratorShapes.get(userName)) {
|
||||||
|
// cont.getShape().dispose();
|
||||||
|
// }
|
||||||
collaboratorShapes.removeAll(userName);
|
collaboratorShapes.removeAll(userName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -423,8 +429,9 @@ public class CollaborationDrawingLayer extends DrawingLayer {
|
||||||
super.reset();
|
super.reset();
|
||||||
CollaborationDrawingEvent event = new CollaborationDrawingEvent();
|
CollaborationDrawingEvent event = new CollaborationDrawingEvent();
|
||||||
event.setType(CollaborationEventType.CLEAR);
|
event.setType(CollaborationEventType.CLEAR);
|
||||||
// TODO, fix
|
LoginData data = CollaborationDataManager.getInstance().getLoginData();
|
||||||
// event.setUserName(CollaborationDataManager.getInstance().getLoginId());
|
UserId userId = new UserId(data.getUser(), data.getServer());
|
||||||
|
event.setUserName(userId);
|
||||||
sendGenericEvent(event);
|
sendGenericEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -455,10 +462,6 @@ public class CollaborationDrawingLayer extends DrawingLayer {
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addColor(UserId userName, RGB color) {
|
|
||||||
colors.put(userName, color);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the allowDraw
|
* @return the allowDraw
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
* further licensing information.
|
* further licensing information.
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.viz.collaboration.comm.provider.event;
|
package com.raytheon.uf.viz.collaboration.comm.identity.invite;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
|
@ -19,10 +19,12 @@
|
||||||
**/
|
**/
|
||||||
package com.raytheon.uf.viz.collaboration.comm.identity.invite;
|
package com.raytheon.uf.viz.collaboration.comm.identity.invite;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.eclipse.swt.graphics.RGB;
|
import org.eclipse.swt.graphics.RGB;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||||
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
||||||
|
|
||||||
|
@ -43,6 +45,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@DynamicSerialize
|
||||||
public class SharedDisplayVenueInvite extends VenueInvite {
|
public class SharedDisplayVenueInvite extends VenueInvite {
|
||||||
|
|
||||||
@DynamicSerializeElement
|
@DynamicSerializeElement
|
||||||
|
@ -52,7 +55,7 @@ public class SharedDisplayVenueInvite extends VenueInvite {
|
||||||
private UserId dataProvider;
|
private UserId dataProvider;
|
||||||
|
|
||||||
@DynamicSerializeElement
|
@DynamicSerializeElement
|
||||||
private Map<UserId, RGB> colors;
|
private ColorPopulator colors;
|
||||||
|
|
||||||
public UserId getSessionLeader() {
|
public UserId getSessionLeader() {
|
||||||
return sessionLeader;
|
return sessionLeader;
|
||||||
|
@ -73,7 +76,7 @@ public class SharedDisplayVenueInvite extends VenueInvite {
|
||||||
/**
|
/**
|
||||||
* @return the colors
|
* @return the colors
|
||||||
*/
|
*/
|
||||||
public Map<UserId, RGB> getColors() {
|
public ColorPopulator getColors() {
|
||||||
return colors;
|
return colors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,7 +84,22 @@ public class SharedDisplayVenueInvite extends VenueInvite {
|
||||||
* @param colors
|
* @param colors
|
||||||
* the colors to set
|
* the colors to set
|
||||||
*/
|
*/
|
||||||
public void setColors(Map<UserId, RGB> colors) {
|
public void setColors(ColorPopulator colors) {
|
||||||
this.colors = colors;
|
this.colors = colors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Map<UserId, RGB> getRGBColors() {
|
||||||
|
Map<UserId, RGB> map = new HashMap<UserId, RGB>();
|
||||||
|
for (int i = 0; i < colors.getUserName().size(); i++) {
|
||||||
|
RGB rgb = new RGB(colors.getRed().get(i), colors.getGreen().get(i),
|
||||||
|
colors.getBlue().get(i));
|
||||||
|
map.put(colors.getUserName().get(i), rgb);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRGBColors(Map<UserId, RGB> colors) {
|
||||||
|
ColorPopulator pop = new ColorPopulator(colors);
|
||||||
|
this.colors = pop;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,7 +243,8 @@ public class VenueSession extends BaseSession implements IVenueSession {
|
||||||
getConnectionNamespace(), id);
|
getConnectionNamespace(), id);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
sender.sendInvitation(roomId, userId, subject, msgBody);
|
sender.sendInvitation(roomId, userId, invite.getSubject(),
|
||||||
|
msgBody);
|
||||||
} catch (ECFException e) {
|
} catch (ECFException e) {
|
||||||
throw new CollaborationException("Error sending invitation", e);
|
throw new CollaborationException("Error sending invitation", e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,6 +139,7 @@ public class DrawingLayer extends
|
||||||
protected void paintInternal(IGraphicsTarget target,
|
protected void paintInternal(IGraphicsTarget target,
|
||||||
PaintProperties paintProps) throws VizException {
|
PaintProperties paintProps) throws VizException {
|
||||||
this.paintProps = paintProps;
|
this.paintProps = paintProps;
|
||||||
|
color = getCapability(ColorableCapability.class).getColor();
|
||||||
if (tempWireframeShape == null || needsRefresh) {
|
if (tempWireframeShape == null || needsRefresh) {
|
||||||
tempWireframeShape = target.createWireframeShape(true,
|
tempWireframeShape = target.createWireframeShape(true,
|
||||||
getDescriptor());
|
getDescriptor());
|
||||||
|
|
Loading…
Add table
Reference in a new issue