|change visulization when selecting Object in diagram [message #894440]
||Mon, 09 July 2012 09:11
| Jason Lin
Registered: July 2012
(1) Model: A main EObject(Procedure) which is related with other EObjects (three Tables);
(2) Assume there is an main EObject(Procedure) in the digram.
(3) When I select this main EOjbect, the related objects display.
When I change selection to others, then only display the main EObject.
Code snippet of AddProcedureFeature:
Table dataTable = procedure.getDataTable();
Table argTable = procedure.getArgTable();
Table resultTable = procedure.getResultTable();
AddContext addTableContext = new AddContext(new AreaContext(),dataTable);
//Trigger the Graphiti framework to find a feature that is capable of adding a table instead of adding it by ourselves
PictogramElement dataTableArea = addGraphicalRepresentation(addTableContext, dataTable);
//gaService.setLocationAndSize(dataTableArea, 0, 0, 60, 60);
PictogramElement argTableArea = addGraphicalRepresentation(addTableContext, argTable);
PictogramElement resultTableArea = addGraphicalRepresentation(addTableContext,resultTable);
//Set location in the container
gaService.setLocationAndSize(dataTableArea.getGraphicsAlgorithm(), 20, 20, 60, 60);
gaService.setLocationAndSize(argTableArea.getGraphicsAlgorithm(), 20, 200, 60, 60);
I first want to extend AbstractCustomFeature to meet my requirement. When select the Function, the method canExcute(ICustomContext context) will be invoked but IMO just because of components creatation such as contextButtonPad.
My Problem is that: Even if I can change the visualization when select, I can't change it back when selection changes to others.
Thus, I think my solution direction is incorrect.
Could anybody tell me which point should I begin?
Thanks in advance.
[Updated on: Mon, 09 July 2012 09:53]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01868 seconds