Issue #427 instantiate collaboration resource
Change-Id: I5aa7ec5d7dfb3f2373730eb40dd9ea3178112d20 Former-commit-id:260c7c10eb
[formerly260c7c10eb
[formerly 5cd5a85bf836ade2da3b43b2797c2a65d61be461]] Former-commit-id:f06338bcd4
Former-commit-id:0f5b0f7e9e
This commit is contained in:
parent
27c2635ce2
commit
2f8e80b254
4 changed files with 199 additions and 1 deletions
|
@ -96,7 +96,7 @@ public class CollaborationEditorInputHandler implements IInputHandler {
|
||||||
coords[1], mouseButton);
|
coords[1], mouseButton);
|
||||||
sendEvent(event);
|
sendEvent(event);
|
||||||
}
|
}
|
||||||
return leader;
|
return !leader;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -30,9 +30,13 @@ import com.raytheon.uf.viz.collaboration.ui.editor.CollaborationEditor;
|
||||||
import com.raytheon.uf.viz.collaboration.ui.editor.CollaborationEditorInputHandler;
|
import com.raytheon.uf.viz.collaboration.ui.editor.CollaborationEditorInputHandler;
|
||||||
import com.raytheon.uf.viz.collaboration.ui.editor.EditorSetup;
|
import com.raytheon.uf.viz.collaboration.ui.editor.EditorSetup;
|
||||||
import com.raytheon.uf.viz.collaboration.ui.editor.SharedEditor;
|
import com.raytheon.uf.viz.collaboration.ui.editor.SharedEditor;
|
||||||
|
import com.raytheon.uf.viz.collaboration.ui.rsc.CollaborationResource;
|
||||||
|
import com.raytheon.uf.viz.collaboration.ui.rsc.CollaborationResourceData;
|
||||||
import com.raytheon.uf.viz.collaboration.ui.telestrator.CollaborationPathDrawingResourceData;
|
import com.raytheon.uf.viz.collaboration.ui.telestrator.CollaborationPathDrawingResourceData;
|
||||||
import com.raytheon.uf.viz.collaboration.ui.telestrator.CollaborationPathToolbar;
|
import com.raytheon.uf.viz.collaboration.ui.telestrator.CollaborationPathToolbar;
|
||||||
import com.raytheon.uf.viz.core.VizApp;
|
import com.raytheon.uf.viz.core.VizApp;
|
||||||
|
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||||
|
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
import com.raytheon.uf.viz.core.rsc.IInputHandler.InputPriority;
|
import com.raytheon.uf.viz.core.rsc.IInputHandler.InputPriority;
|
||||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||||
|
@ -60,6 +64,8 @@ public class ParticipantEventController extends AbstractRoleEventController {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(ParticipantEventController.class);
|
.getHandler(ParticipantEventController.class);
|
||||||
|
|
||||||
|
private CollaborationResource collabRsc;
|
||||||
|
|
||||||
public ParticipantEventController(ISharedDisplaySession session) {
|
public ParticipantEventController(ISharedDisplaySession session) {
|
||||||
super(session);
|
super(session);
|
||||||
}
|
}
|
||||||
|
@ -73,6 +79,8 @@ public class ParticipantEventController extends AbstractRoleEventController {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
CollaborationEditor editor = EditorSetup.createEditor(se);
|
CollaborationEditor editor = EditorSetup.createEditor(se);
|
||||||
|
initializeResources(editor.getActiveDisplayPane()
|
||||||
|
.getDescriptor());
|
||||||
editor.registerMouseHandler(
|
editor.registerMouseHandler(
|
||||||
new CollaborationEditorInputHandler(session, editor
|
new CollaborationEditorInputHandler(session, editor
|
||||||
.getDisplayPanes()[0]),
|
.getDisplayPanes()[0]),
|
||||||
|
@ -102,6 +110,15 @@ public class ParticipantEventController extends AbstractRoleEventController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initializeResources(IDescriptor desc) {
|
||||||
|
CollaborationResourceData crd = new CollaborationResourceData();
|
||||||
|
ResourcePair rp = ResourcePair.constructSystemResourcePair(crd);
|
||||||
|
desc.getResourceList().add(rp);
|
||||||
|
desc.getResourceList().instantiateResources(desc, false);
|
||||||
|
collabRsc = (CollaborationResource) rp.getResource();
|
||||||
|
this.session.registerEventHandler(collabRsc);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
@ -132,5 +149,9 @@ public class ParticipantEventController extends AbstractRoleEventController {
|
||||||
public void shutdown() {
|
public void shutdown() {
|
||||||
super.shutdown();
|
super.shutdown();
|
||||||
CollaborationPathToolbar.getToolbar().close();
|
CollaborationPathToolbar.getToolbar().close();
|
||||||
|
|
||||||
|
if (this.collabRsc != null) {
|
||||||
|
this.session.unRegisterEventHandler(collabRsc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,90 @@
|
||||||
|
/**
|
||||||
|
* This software was developed and / or modified by Raytheon Company,
|
||||||
|
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||||
|
*
|
||||||
|
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||||
|
* This software product contains export-restricted data whose
|
||||||
|
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||||
|
* to non-U.S. persons whether in the United States or abroad requires
|
||||||
|
* an export license or other authorization.
|
||||||
|
*
|
||||||
|
* Contractor Name: Raytheon Company
|
||||||
|
* Contractor Address: 6825 Pine Street, Suite 340
|
||||||
|
* Mail Stop B8
|
||||||
|
* Omaha, NE 68106
|
||||||
|
* 402.291.0100
|
||||||
|
*
|
||||||
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
|
* further licensing information.
|
||||||
|
**/
|
||||||
|
package com.raytheon.uf.viz.collaboration.ui.rsc;
|
||||||
|
|
||||||
|
import org.eclipse.swt.graphics.RGB;
|
||||||
|
|
||||||
|
import com.google.common.eventbus.Subscribe;
|
||||||
|
import com.raytheon.uf.viz.collaboration.comm.identity.event.IRenderable;
|
||||||
|
import com.raytheon.uf.viz.core.DrawableString;
|
||||||
|
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||||
|
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||||
|
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||||
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
|
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||||
|
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A resource for displaying rendered data that is received from the Data
|
||||||
|
* Provider.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Apr 3, 2012 njensen Initial creation
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author njensen
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class CollaborationResource extends
|
||||||
|
AbstractVizResource<CollaborationResourceData, IDescriptor> {
|
||||||
|
|
||||||
|
protected CollaborationResource(CollaborationResourceData resourceData,
|
||||||
|
LoadProperties loadProperties) {
|
||||||
|
super(resourceData, loadProperties);
|
||||||
|
// TODO Auto-generated constructor stub
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void disposeInternal() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void paintInternal(IGraphicsTarget target,
|
||||||
|
PaintProperties paintProps) throws VizException {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
DrawableString string = new DrawableString(
|
||||||
|
"You can't see it but there is a collaboration resource on this editor",
|
||||||
|
new RGB(255, 0, 255));
|
||||||
|
string.setCoordinates(800, 3000);
|
||||||
|
target.drawStrings(string);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initInternal(IGraphicsTarget target) throws VizException {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Subscribe
|
||||||
|
public void renderableArrived(IRenderable render) {
|
||||||
|
// TODO add it to a list or something
|
||||||
|
System.out.println("Received renderable " + render);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,87 @@
|
||||||
|
/**
|
||||||
|
* This software was developed and / or modified by Raytheon Company,
|
||||||
|
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||||
|
*
|
||||||
|
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||||
|
* This software product contains export-restricted data whose
|
||||||
|
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||||
|
* to non-U.S. persons whether in the United States or abroad requires
|
||||||
|
* an export license or other authorization.
|
||||||
|
*
|
||||||
|
* Contractor Name: Raytheon Company
|
||||||
|
* Contractor Address: 6825 Pine Street, Suite 340
|
||||||
|
* Mail Stop B8
|
||||||
|
* Omaha, NE 68106
|
||||||
|
* 402.291.0100
|
||||||
|
*
|
||||||
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
|
* further licensing information.
|
||||||
|
**/
|
||||||
|
package com.raytheon.uf.viz.collaboration.ui.rsc;
|
||||||
|
|
||||||
|
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||||
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
|
import com.raytheon.uf.viz.core.rsc.AbstractResourceData;
|
||||||
|
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||||
|
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resource data for a CollaborationResource.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Apr 3, 2012 njensen Initial creation
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author njensen
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class CollaborationResourceData extends AbstractResourceData {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* com.raytheon.uf.viz.core.rsc.AbstractResourceData#construct(com.raytheon
|
||||||
|
* .uf.viz.core.rsc.LoadProperties,
|
||||||
|
* com.raytheon.uf.viz.core.drawables.IDescriptor)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AbstractVizResource<?, ?> construct(LoadProperties loadProperties,
|
||||||
|
IDescriptor descriptor) throws VizException {
|
||||||
|
return new CollaborationResource(this, loadProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* com.raytheon.uf.viz.core.rsc.AbstractResourceData#update(java.lang.Object
|
||||||
|
* )
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void update(Object updateData) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* com.raytheon.uf.viz.core.rsc.AbstractResourceData#equals(java.lang.Object
|
||||||
|
* )
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue