Issue #429 telestrator fixes and view changes
Former-commit-id: 51969dfc82d750571115d179911333cec55f677f
This commit is contained in:
parent
c5fb910ea0
commit
c6c0483cee
8 changed files with 65 additions and 28 deletions
|
@ -54,6 +54,7 @@ import org.eclipse.swt.widgets.Display;
|
|||
import org.eclipse.swt.widgets.Menu;
|
||||
import org.eclipse.swt.widgets.MessageBox;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.swt.widgets.TreeColumn;
|
||||
import org.eclipse.swt.widgets.TreeItem;
|
||||
import org.eclipse.ui.IEditorPart;
|
||||
import org.eclipse.ui.IEditorReference;
|
||||
|
@ -764,6 +765,10 @@ public class CollaborationGroupView extends ViewPart implements IPartListener {
|
|||
usersTreeViewer = new TreeViewer(child);
|
||||
usersTreeViewer.getTree().setLayoutData(
|
||||
new GridData(SWT.FILL, SWT.FILL, true, true));
|
||||
|
||||
TreeColumn column = new TreeColumn(usersTreeViewer.getTree(), SWT.NONE);
|
||||
column.setWidth(200);
|
||||
|
||||
usersTreeViewer.setContentProvider(new UsersTreeContentProvider());
|
||||
usersTreeViewer.setLabelProvider(new UsersTreeLabelProvider());
|
||||
usersTreeViewer.setSorter(new UsersTreeViewerSorter());
|
||||
|
@ -1369,6 +1374,7 @@ public class CollaborationGroupView extends ViewPart implements IPartListener {
|
|||
} else if (part == this) {
|
||||
CollaborationDataManager.getInstance().registerEventHandler(this);
|
||||
populateTree();
|
||||
usersTreeViewer.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
import com.raytheon.uf.viz.collaboration.comm.identity.event.IDisplayEvent;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Event for when a new user enters and a color is added
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
|
|
@ -25,15 +25,20 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
import org.eclipse.jface.viewers.ILabelProviderListener;
|
||||
import org.eclipse.jface.viewers.ITableColorProvider;
|
||||
import org.eclipse.jface.viewers.ITableFontProvider;
|
||||
import org.eclipse.jface.viewers.ITableLabelProvider;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.Font;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
|
||||
import com.raytheon.uf.viz.collaboration.data.CollaborationGroup;
|
||||
import com.raytheon.uf.viz.collaboration.data.CollaborationNode;
|
||||
import com.raytheon.uf.viz.collaboration.data.LoginUser;
|
||||
import com.raytheon.uf.viz.collaboration.data.SessionGroup;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
|
@ -51,12 +56,14 @@ import com.raytheon.uf.viz.collaboration.data.CollaborationNode;
|
|||
* @author rferrel
|
||||
* @version 1.0
|
||||
*/
|
||||
public class UsersTreeLabelProvider implements ILabelProvider,
|
||||
public class UsersTreeLabelProvider implements ITableLabelProvider,
|
||||
ITableFontProvider, ITableColorProvider {
|
||||
private List<ILabelProviderListener> listeners;
|
||||
|
||||
private Map<String, Image> imageMap;
|
||||
|
||||
private Font boldFont = null;
|
||||
|
||||
public UsersTreeLabelProvider() {
|
||||
listeners = new ArrayList<ILabelProviderListener>();
|
||||
imageMap = new HashMap<String, Image>();
|
||||
|
@ -86,7 +93,7 @@ public class UsersTreeLabelProvider implements ILabelProvider,
|
|||
}
|
||||
|
||||
@Override
|
||||
public Image getImage(Object element) {
|
||||
public Image getColumnImage(Object element, int index) {
|
||||
if (Activator.getDefault() == null) {
|
||||
return null;
|
||||
}
|
||||
|
@ -108,7 +115,7 @@ public class UsersTreeLabelProvider implements ILabelProvider,
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getText(Object element) {
|
||||
public String getColumnText(Object element, int index) {
|
||||
CollaborationNode elem = (CollaborationNode) element;
|
||||
if (elem.getText() == null) {
|
||||
return elem.getId();
|
||||
|
@ -151,8 +158,22 @@ public class UsersTreeLabelProvider implements ILabelProvider,
|
|||
*/
|
||||
@Override
|
||||
public Font getFont(Object element, int columnIndex) {
|
||||
// TODO Auto-generated method stub
|
||||
if (element instanceof CollaborationGroup
|
||||
|| element instanceof LoginUser) {
|
||||
if (element instanceof SessionGroup
|
||||
&& !((SessionGroup) element).isSessionRoot()) {
|
||||
// for this case do nothing, as it is not the top level of
|
||||
// session groups
|
||||
} else {
|
||||
if (boldFont == null) {
|
||||
Font currFont = Display.getCurrent().getSystemFont();
|
||||
boldFont = new Font(Display.getCurrent(),
|
||||
currFont.toString(),
|
||||
currFont.getFontData()[0].getHeight(), SWT.BOLD);
|
||||
}
|
||||
return boldFont;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ public class ChangeStatusDialog extends CaveSWTDialog {
|
|||
|
||||
public ChangeStatusDialog(Shell parentShell) {
|
||||
super(parentShell, SWT.DIALOG_TRIM);
|
||||
setText("Collaboration Server Log On");
|
||||
setText("Change Status");
|
||||
}
|
||||
|
||||
private Control createDialogArea(Composite parent) {
|
||||
|
|
|
@ -226,6 +226,9 @@ public class CollaborationDrawingLayer extends DrawingLayer {
|
|||
}
|
||||
break;
|
||||
case ERASE:
|
||||
if (true) {
|
||||
return;
|
||||
}
|
||||
userName = event.getUserName();
|
||||
double extentPercentageX = paintProps.getView().getExtent()
|
||||
.getWidth()
|
||||
|
|
|
@ -138,8 +138,10 @@ public class CollaborationPathToolbar extends PathToolbar {
|
|||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
DrawingLayer layer = getDrawingResource();
|
||||
CollaborationDrawingLayer dLayer = (CollaborationDrawingLayer) layer;
|
||||
dLayer.sendDisableOthers();
|
||||
if (layer instanceof CollaborationDrawingLayer) {
|
||||
CollaborationDrawingLayer dLayer = (CollaborationDrawingLayer) layer;
|
||||
dLayer.sendDisableOthers();
|
||||
}
|
||||
if (leaderOnly.getSelection()) {
|
||||
lastTool.activate();
|
||||
} else {
|
||||
|
|
|
@ -156,11 +156,13 @@ public class DrawingLayer extends
|
|||
(float) outline.getOutlineWidth(), outline.getLineStyle());
|
||||
}
|
||||
|
||||
for (Geometry g : this.tempGeometries) {
|
||||
drawTempLinePrimitive(g, tempWireframeShape);
|
||||
if (state == LayerState.DRAWING) {
|
||||
for (Geometry g : this.tempGeometries) {
|
||||
drawTempLinePrimitive(g, tempWireframeShape);
|
||||
}
|
||||
target.drawWireframeShape(tempWireframeShape, color,
|
||||
outline.getOutlineWidth(), outline.getLineStyle());
|
||||
}
|
||||
target.drawWireframeShape(tempWireframeShape, color,
|
||||
outline.getOutlineWidth(), outline.getLineStyle());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -106,8 +106,6 @@ public class PathToolbar extends CaveSWTDialog {
|
|||
DrawingEventBus.register(PathToolbar.getToolbar());
|
||||
}
|
||||
|
||||
lastTool = VizPerspectiveListener.getCurrentPerspectiveManager()
|
||||
.getToolManager().getSelectedModalTool(EDIT_TOOL_CATEGY);
|
||||
return pathToolbar;
|
||||
}
|
||||
|
||||
|
@ -118,6 +116,9 @@ public class PathToolbar extends CaveSWTDialog {
|
|||
protected PathToolbar(Shell parentShell) {
|
||||
super(parentShell, SWT.DIALOG_TRIM | CAVE.DO_NOT_BLOCK);
|
||||
setText("Drawing");
|
||||
lastTool = VizPerspectiveListener.getCurrentPerspectiveManager()
|
||||
.getToolManager().getSelectedModalTool(EDIT_TOOL_CATEGY);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -168,18 +169,20 @@ public class PathToolbar extends CaveSWTDialog {
|
|||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
DrawingLayer layer = getDrawingResource();
|
||||
switch (layer.getState()) {
|
||||
case DRAWING:
|
||||
lastTool.activate();
|
||||
layer.setState(LayerState.NONE);
|
||||
break;
|
||||
case ERASING:
|
||||
layer.setState(LayerState.DRAWING);
|
||||
eraserItem.setSelection(false);
|
||||
break;
|
||||
case NONE:
|
||||
layer.setState(LayerState.DRAWING);
|
||||
break;
|
||||
if (layer != null) {
|
||||
switch (layer.getState()) {
|
||||
case DRAWING:
|
||||
lastTool.activate();
|
||||
layer.setState(LayerState.NONE);
|
||||
break;
|
||||
case ERASING:
|
||||
layer.setState(LayerState.DRAWING);
|
||||
eraserItem.setSelection(false);
|
||||
break;
|
||||
case NONE:
|
||||
layer.setState(LayerState.DRAWING);
|
||||
break;
|
||||
}
|
||||
}
|
||||
updateToolbar();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue