Dragging above or left from (0,0) moves figure. [message #64717] |
Thu, 13 February 2003 11:04 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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);
> }
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03228 seconds