Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » How to avoid overlapping of containers while using custom layout provider(How to avoid overlapping of containers while using custom layout provider)
How to avoid overlapping of containers while using custom layout provider [message #1808919] Thu, 04 July 2019 13:30 Go to next message
Sharmila D is currently offline Sharmila DFriend
Messages: 79
Registered: June 2018
Member
Hii

All I am using custom layout provider to increase the size of container based on border nodes. It is working fine It is increasing the size.But if I import any big file containers are overlapping.

Please find the below code i have added in Customlayoutprovider

public class Customlayoutprovider implements LayoutProvider {


public Customlayoutprovider () {
}

private AbstractLayoutEditPartProvider global_layoutNodeProvider;


@Override
public boolean provides(IGraphicalEditPart container) {

return true;
}


@Override
public AbstractLayoutEditPartProvider
getLayoutNodeProvider(IGraphicalEditPart container) {
try {

if (this.global_layoutNodeProvider == null) {

final CompoundLayoutProvider local_compoundLayoutProvider = new
CompoundLayoutProvider();

final CustomEditorPartLayoutProvider local_editorProvider = new
CustomEditorPartLayoutProvider();

local_compoundLayoutProvider.addProvider(local_editorProvider);
CompoundLayoutProvider.
local_compoundLayoutProvider.addProvider
(new PinnedElementsLayoutProvider(local_editorProvider));

if (ENABLE_BORDERED_NODES_ARRANGE_ALL) {

AbstractLayoutProvider local_abstractLayoutProvider = new
CustomLayout(
local_compoundLayoutProvider);

this.global_layoutNodeProvider =
new ArrangeSelectionLayoutProvider
(local_abstractLayoutProvider);
}
else {

this.global_layoutNodeProvider =
new ArrangeSelectionLayoutProvider
(local_compoundLayoutProvider);
}
}


}
catch (Exception e) {
e.getStackTrace();
}/* End of catch(Exception e) */

return global_layoutNodeProvider;
}


@Override
public boolean isDiagramLayoutProvider() {

return true;
}

}

public class CustomLayout extends AbstractLayoutProvider {

public Command layoutEditParts(final List selectedObjects,
final IAdaptable layoutHint) {


Command local_command = null;


local_command = layoutEditParts(selectedObjects,
layoutHint, true);

if (selectedObjects.isEmpty()) {

return UnexecutableCommand.INSTANCE;
}


for (IGraphicalEditPart graphicalEditPart : Iterables.
filter(selectedObjects,
IGraphicalEditPart.class)) {
//Resolve the graphicalEditPart to EObject.
EObject local_semanticElement = graphicalEditPart.
resolveSemanticElement();
{
my code where based on border nodes size of the container will increase.
}
}
}
}

public class CustomEditorPartLayoutProvider extends AbstractCompositeLayoutProvider {
}


There is a problem if I import big file containers are ovelapping.Please find the attached screenshot .Please any one help me how to avoid overlapping of containers

Re: How to avoid overlapping of containers while using custom layout provider [message #1808978 is a reply to message #1808919] Fri, 05 July 2019 12:47 Go to previous message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 249
Registered: June 2017
Senior Member
Hi,

Layouting is a very complex matter. Since you are doing the layouting with your own code that we don't have access to or that we don't have enough resources to debug your case, we cannot help you with that.
But from what I understand first you retrieve the layout that does not take in consideration your constraint then you change the sizes. The layouting did let enough space between container that you grow bigger because it cannot know. So you have the overlap. You have to also change the positions of containers to remove this overlap. Sirius cannot do anything for you. It is up to you.
Regards,


Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:String representation of constraints
Next Topic:Problems while editing double attributes with Text-Widget
Goto Forum:
  


Current Time: Tue Aug 20 04:56:10 GMT 2019

Powered by FUDForum. Page generated in 0.02093 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top