Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Dragging above or left from (0,0) moves figure.
Dragging above or left from (0,0) moves figure. [message #64717] Thu, 13 February 2003 11:04 Go to next message
Eclipse UserFriend
Originally posted by: g.wagenknecht.intershop.de

Hi!

How to avoid that? I know it was a problem a long time ago. My editor worked
already without that issue but now it is back again and I can't explain why.

MyEditor#configureGraphicalViewer()
{
super.configureGraphicalViewer();
ScrollingGraphicalViewer viewer = (ScrollingGraphicalViewer)
getGraphicalViewer();
viewer.setRootEditPart(new ScalableFreeformRootEditPart());

viewer.setEditPartFactory(PipelineEditorEditPartFactory.getE ditPartFactory()
);
[...]
}

MyEditor#initializeGraphicalViewer()
{
getGraphicalViewer().setContents(getMyRootModelObject());
[...]
}

MyRootModelObjectEditPart#createFigure()
{
LayeredPane pane = new FreeformLayeredPane();


VPMPreferences.getPreferenceStore().addPropertyChangeListene r(preferencesLis
tener);
GridFigure gridFigure = new GridFigure();
initializeGridFigure(gridFigure);

/*
* GridFigure is a FreeformLayer with a GridLayout
* GridLayout is a subclass of AbstractLayout
* Could it be possible that the layout
* must be a subclass for "FreeformLayout"?
*/

FreeformLayer textLayer = new FreeformLayer();
textLayer.setLayoutManager(new DelegatingLayout());
textLayer.setBorder(new MarginBorder(5));
textLayer.setOpaque(false);

pane.add(gridFigure, GRID_LAYER, 0);
pane.add(textLayer, TEXT_LAYER, 1);
return pane;
}

MyRootModelObjectEditPart#getContentPane()
{
return ((LayeredPane)getFigure().getLayer(GRID_LAYER);
}

MyRootModelObjectEditPart#registerVisuals()
{
//super.registerVisuals();
getViewer().getVisualPartMap().put(getContentPane(), this);
}
Re: Dragging above or left from (0,0) moves figure. [message #64811 is a reply to message #64717] Thu, 13 February 2003 14:12 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You will have to post your code for you contents editpart, root editpart,
and any figures used by them.

"Gunnar Wagenknecht" <g.wagenknecht@intershop.de> wrote in message
news:b2fsjn$i9v$1@rogue.oti.com...
> Hi!
>
> How to avoid that? I know it was a problem a long time ago. My editor
worked
> already without that issue but now it is back again and I can't explain
why.
>
> MyEditor#configureGraphicalViewer()
> {
> super.configureGraphicalViewer();
> ScrollingGraphicalViewer viewer = (ScrollingGraphicalViewer)
> getGraphicalViewer();
> viewer.setRootEditPart(new ScalableFreeformRootEditPart());
>
>
viewer.setEditPartFactory(PipelineEditorEditPartFactory.getE ditPartFactory()
> );
> [...]
> }
>
> MyEditor#initializeGraphicalViewer()
> {
> getGraphicalViewer().setContents(getMyRootModelObject());
> [...]
> }
>
> MyRootModelObjectEditPart#createFigure()
> {
> LayeredPane pane = new FreeformLayeredPane();
>
>
>
VPMPreferences.getPreferenceStore().addPropertyChangeListene r(preferencesLis
> tener);
> GridFigure gridFigure = new GridFigure();
> initializeGridFigure(gridFigure);
>
> /*
> * GridFigure is a FreeformLayer with a GridLayout
> * GridLayout is a subclass of AbstractLayout
> * Could it be possible that the layout
> * must be a subclass for "FreeformLayout"?
> */
>
> FreeformLayer textLayer = new FreeformLayer();
> textLayer.setLayoutManager(new DelegatingLayout());
> textLayer.setBorder(new MarginBorder(5));
> textLayer.setOpaque(false);
>
> pane.add(gridFigure, GRID_LAYER, 0);
> pane.add(textLayer, TEXT_LAYER, 1);
> return pane;
> }
>
> MyRootModelObjectEditPart#getContentPane()
> {
> return ((LayeredPane)getFigure().getLayer(GRID_LAYER);
> }
>
> MyRootModelObjectEditPart#registerVisuals()
> {
> //super.registerVisuals();
> getViewer().getVisualPartMap().put(getContentPane(), this);
> }
>
>
>
>
Previous Topic:How to add combo box and textbox in a figure in GEF.
Next Topic:Figure is not a child of this parent
Goto Forum:
  


Current Time: Thu Dec 26 16:38:11 GMT 2024

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

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

Back to the top