Problem Scrolling in FigureCanvas [message #164654] |
Wed, 19 January 2005 14:05  |
Eclipse User |
|
|
|
Originally posted by: eemorale.cs.ucsd.edu
Hi,
I'm putting a figure in FigureCanvas and it only scrolls down to a
certain point in the figure inside leaving me with only half of the
figure able to viewed. My guess is the problem is with FigureCanvas's
parent object (getContainer()) since I'm in a MultiPageEditorPart.
The following code works fine in a ViewPart when using the parent
object given to you in the "createPartControl" method. I was
wondering if there was a way to get the scrollbar working to scroll
down completely in a MultiPageEditorPart. I've already tried wrapping
getContainer() in a Composite with a layout, but that gives me a blank
figure.
Thanks for your help,
Ernesto
Here's the Code:
--------------------------------------------------
FigureCanvas counterExampleCanvas = new FigureCanvas(getContainer(),
new LightweightSystem());
counterExampleCanvas.setBackground(white);
counterExampleCanvas.setScrollBarVisibility(FigureCanvas.ALW AYS);
GridData gridData = new GridData();
gridData.verticalAlignment = GridData.FILL;
gridData.grabExcessVerticalSpace = true;
gridData.grabExcessHorizontalSpace = true;
gridData.horizontalAlignment = GridData.FILL;
counterExampleCanvas.setLayoutData(gridData);
// SequenceDiagramRenderer is a subtype of
Figure
SequenceDiagramRenderer rend = new
SequenceDiagramRenderer(counterExampleMsc);
counterExampleCanvas.setContents(rend);
int index = addPage(counterExampleCanvas );
StringBuffer pageName = new
StringBuffer("CounterExample: ");
pageName.append(i);
setPageText(index, pageName.toString());
|
|
|
Re: Problem Scrolling in FigureCanvas [message #165129 is a reply to message #164654] |
Fri, 21 January 2005 16:49  |
Eclipse User |
|
|
|
If I understand your problem correctly, you shouldn't be adding different
pages to a figure canvas, rather different figure canvasses to each page.
"Ernesto Morales-Perea" <eemorale@cs.ucsd.edu> wrote in message
news:n8btu0h2gcv0isre39vi5hln7442705qq0@4ax.com...
> Hi,
>
> I'm putting a figure in FigureCanvas and it only scrolls down to a
> certain point in the figure inside leaving me with only half of the
> figure able to viewed. My guess is the problem is with FigureCanvas's
> parent object (getContainer()) since I'm in a MultiPageEditorPart.
> The following code works fine in a ViewPart when using the parent
> object given to you in the "createPartControl" method. I was
> wondering if there was a way to get the scrollbar working to scroll
> down completely in a MultiPageEditorPart. I've already tried wrapping
> getContainer() in a Composite with a layout, but that gives me a blank
> figure.
>
> Thanks for your help,
> Ernesto
>
> Here's the Code:
> --------------------------------------------------
>
> FigureCanvas counterExampleCanvas = new FigureCanvas(getContainer(),
> new LightweightSystem());
> counterExampleCanvas.setBackground(white);
>
> counterExampleCanvas.setScrollBarVisibility(FigureCanvas.ALW AYS);
>
> GridData gridData = new GridData();
> gridData.verticalAlignment = GridData.FILL;
> gridData.grabExcessVerticalSpace = true;
> gridData.grabExcessHorizontalSpace = true;
> gridData.horizontalAlignment = GridData.FILL;
>
> counterExampleCanvas.setLayoutData(gridData);
>
> // SequenceDiagramRenderer is a subtype of
> Figure
> SequenceDiagramRenderer rend = new
> SequenceDiagramRenderer(counterExampleMsc);
> counterExampleCanvas.setContents(rend);
>
> int index = addPage(counterExampleCanvas );
> StringBuffer pageName = new
> StringBuffer("CounterExample: ");
> pageName.append(i);
> setPageText(index, pageName.toString());
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.06324 seconds