problem with GridData
problem with GridData
chart = new TChart(parent, SWT.BORDER);
chart.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
Caused by: java.lang.ClassCastException: org.eclipse.swt.layout.GridData cannot be cast to org.eclipse.swt.layout.FillData
at org.eclipse.swt.layout.FillLayout.computeChildSize(Unknown Source)
at org.eclipse.swt.layout.FillLayout.computeSize(Unknown Source)
How does position change? Now chart has central position.
chart.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
Caused by: java.lang.ClassCastException: org.eclipse.swt.layout.GridData cannot be cast to org.eclipse.swt.layout.FillData
at org.eclipse.swt.layout.FillLayout.computeChildSize(Unknown Source)
at org.eclipse.swt.layout.FillLayout.computeSize(Unknown Source)
How does position change? Now chart has central position.
Re: problem with GridData
Hi Dimitry,
You could achieve it playing with the Layout. Here you have an example:
I'd suggest you to read this article about the Layouts in SWT:
http://www.eclipse.org/articles/article ... index.html
You could achieve it playing with the Layout. Here you have an example:
Code: Select all
RowLayout rowLayout = new RowLayout();
rowLayout.wrap = false;
rowLayout.pack = false;
rowLayout.justify = true;
rowLayout.type = SWT.VERTICAL;
rowLayout.marginLeft = 50;
rowLayout.marginTop = 0;
rowLayout.marginRight = 0;
rowLayout.marginBottom = 0;
rowLayout.spacing = 0;
shell.setLayout(rowLayout);
tChart1.setLayoutData(new RowData(500, 300));
http://www.eclipse.org/articles/article ... index.html
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: problem with GridData
I made parent Composite and set inside it chart
chart = new TChart(parent, SWT.BORDER);
chart.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING ));
FILL_BOTH is working but .VERTICAL_ALIGN_BEGINNING is not working
I think you generate composite and set inside it widget( chart ) and I can manage only parent composite
But it's not correctly
chart = new TChart(parent, SWT.BORDER);
chart.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING ));
FILL_BOTH is working but .VERTICAL_ALIGN_BEGINNING is not working
I think you generate composite and set inside it widget( chart ) and I can manage only parent composite
But it's not correctly
Re: problem with GridData
Hi Dimitry,
Could you please arrange a simple example project with just the structure and a blank chart reproducing the problem?
Thanks in advance.
Could you please arrange a simple example project with just the structure and a blank chart reproducing the problem?
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: problem with GridData
Sorry for pause.
Repeat. You set chart widget in vertical Center parent composite.
Repeat. You set chart widget in vertical Center parent composite.
Code: Select all
protected void createScroll(Composite parent) {
grpScroll = ShopWidget.createScrollComposite(parent);
grpScroll.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING));
grpMainScroll = ShopWidget.createGroup(grpScroll, 1, SWT.NONE);
grpScroll.setContent(grpMainScroll);
}
protected void viewSteema(final Composite parent) {
ShopWidget.removeComposite(grpChart);
grpChart = ShopWidget.createGroup(grpMainScroll, 1, SWT.NONE);
grpChart.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING));
try {
new ChartTime(grpChart).view();
} catch (AdsmException e) {
e.printStackTrace();
}
int yy = 40 * countNodes;
grpScroll.setMinSize(parent.computeSize(SWT.DEFAULT, yy));
grpMainScroll.layout(true);
}
protected Composite viewChart(Composite parent) {
final Composite grpMain = ShopWidget.createGroup(parent, 1, SWT.NONE);
createScroll(grpMain);
viewSteema(grpMain);
return grpMain;
}
Re: problem with GridData
Hi Dimitry,
I'm afraid there are too many objects and classes in your code I don't know where they come from.
Please, try to arrange a simple example project we can run as-is to reproduce the problem here.
Thanks in advance.
I'm afraid there are too many objects and classes in your code I don't know where they come from.
Please, try to arrange a simple example project we can run as-is to reproduce the problem here.
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: problem with GridData
try so and look at result
Code: Select all
protected Composite viewChart(final Composite parent) {
final Composite grpMain = ShopWidget.createGroup(parent, 1, SWT.NONE);
ScrolledComposite grpScroll = new ScrolledComposite(grpMain, SWT.NONE | SWT.V_SCROLL | SWT.H_SCROLL); // standard SWT scroll composite
grpScroll.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING));
grpScroll.setExpandHorizontal(true);
grpScroll.setExpandVertical(true);
Composite grpMainScroll = ShopWidget.createGroup(grpScroll, 1, SWT.NONE); // composite inside scroll composite
grpScroll.setContent(grpMainScroll);
viewSteemaChart(grpMainScroll); // abstract function for call any steema chart with paretn composite grpMainScroll
grpScroll.setMinSize(grpMain.computeSize(SWT.DEFAULT, 6000));
grpMainScroll.layout(true)
return grpMain;
}
Re: problem with GridData
Yeray, And let's using email.
Re: problem with GridData
Hi Dimitry,
I'm afraid I can't still build this here. Please, try to arrange a simple example project and attach it here.
I'm afraid I can't still build this here. Please, try to arrange a simple example project and attach it here.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |