Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » View not Displaying Properly
View not Displaying Properly [message #283297] Thu, 31 March 2005 13:47 Go to next message
Eclipse UserFriend
Hello all,

I am hoping someone can help me with a problem I am having creating a
view. This view is displaying a Plot. When createPartControl is called
all I do is store the Composite that is passed to it. I need to wait
until the data is set before creating the plot. The customer has a
requirement that requires more than one plot per view based on the data
that is passed to it. When I the data is set I build up the view using
this code:

<code> FillLayout layout = new FillLayout(SWT.VERTICAL);
parent.setLayout(layout);
Composite swtComp = new Composite(parent, SWT_EMBEDDED);
Frame awtFrame = SWT_AWT.new_Frame(swtComp);
chart = new JCChart();
pnl = new PlotPanel(chart);
awtFrame.add(pnl);
area = new CustomChartArea(this, chart);
chart.setChartArea(area);
...
</code>

When the view is displayed the screen is blank and no error has occurred.
If I resize the view the plot is displayed correctly.

I have tried calling all the repaint/update/redraw calls I could find and
it does not seem to work. I see my overloaded paint functions for the
plot being called. Does anyone have any other ideas on what I can do to
display the plot when it is first drawn?

Kevin
Re: View not Displaying Properly [message #283357 is a reply to message #283297] Fri, 01 April 2005 09:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Michael_Valenta.oti.com

Try calling parent.layout(). I can't say for sure if it will work but that's
what I've done in similar situations and it's worked for me.

Michael

"Kevin Stedman" <kstedman9@yahoo.com> wrote in message
news:fd923c5673aa14bfb26f1f3bf7848d29$1@www.eclipse.org...
> Hello all,
>
> I am hoping someone can help me with a problem I am having creating a
> view. This view is displaying a Plot. When createPartControl is called
> all I do is store the Composite that is passed to it. I need to wait
> until the data is set before creating the plot. The customer has a
> requirement that requires more than one plot per view based on the data
> that is passed to it. When I the data is set I build up the view using
> this code:
>
> <code> FillLayout layout = new FillLayout(SWT.VERTICAL);
> parent.setLayout(layout);
> Composite swtComp = new Composite(parent, SWT_EMBEDDED);
> Frame awtFrame = SWT_AWT.new_Frame(swtComp);
> chart = new JCChart();
> pnl = new PlotPanel(chart);
> awtFrame.add(pnl);
> area = new CustomChartArea(this, chart);
> chart.setChartArea(area);
> ...
> </code>
>
> When the view is displayed the screen is blank and no error has occurred.
> If I resize the view the plot is displayed correctly.
> I have tried calling all the repaint/update/redraw calls I could find and
> it does not seem to work. I see my overloaded paint functions for the
> plot being called. Does anyone have any other ideas on what I can do to
> display the plot when it is first drawn?
>
> Kevin
>
>
Re: View not Displaying Properly [message #283415 is a reply to message #283357] Fri, 01 April 2005 15:24 Go to previous message
Eclipse UserFriend
Thank you very much it worked. I will keep this one in my bag of tricks.

Kevin
Previous Topic:Can not build project after updated JRE,
Next Topic:TableLayout Problem
Goto Forum:
  


Current Time: Sun May 11 19:37:56 EDT 2025

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

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

Back to the top