|
|
Re: Is my Styling approach correct. [message #1059548 is a reply to message #1059169] |
Mon, 20 May 2013 12:04 |
Courtney Jines Messages: 13 Registered: September 2012 |
Junior Member |
|
|
Thank you very much Dirk.
I am using concept of labeling for Styling. Only thing which is causing confusion is that I want to show a painter with a color image.
And I am getting the color by converting cell value and setting wrapped painter as shown below.
@Override
public void paintCell(ILayerCell cell, GC gc, Rectangle rectangle,
IConfigRegistry configRegistry) {
Color colorValue = BeansUtilManager.decodeColorFromInteger(new Integer(cell.getDataValue().toString()));
ColorImage colorImage = new ColorImage(PREFERRED_WIDTH,PREFERRED_HEIGHT, colorValue);
if (image != null && !image.isDisposed()) {
image.dispose();
image = null;
}
image = colorImage.getImage();
setWrappedPainter(new BeveledBorderDecorator(new ImagePainter(image)));
super.paintCell(cell, gc, rectangle, configRegistry);
}
Is above changes are valid(Actually it is fulfilling our requirement). Please share your opinion.
Thanks in advance Dirk Sir, I know you will answer me
[Updated on: Tue, 21 May 2013 09:00] Report message to a moderator
|
|
|
|
Re: Is my Styling approach correct. [message #1059654 is a reply to message #1059570] |
Tue, 21 May 2013 06:23 |
Courtney Jines Messages: 13 Registered: September 2012 |
Junior Member |
|
|
Hello Dirk,
After doing the same as suggested above. My painter which is being display in cell with no text(bcoz i overridden the gettexttodisplay() and returned empty string) but image is only Right or Left aligned but i want it in center. with button like look lifted upward. It is working fine for others painters where image is right aligned and lifted up as button kind look.
CellPainterDecorator cpw = new CellPainterDecorator(new TextPainter(),
CellEdgeEnum.LEFT,
new BeveledBorderDecorator(new ImagePainter(){
@Override
protected Image getImage(ILayerCell cell,
IConfigRegistry configRegistry) {
//RETURNING IMAGE FROM HERE},true));
setWrappedPainter(cpw);
Please suggest some appropriate solution or any other approach to get this output.
Thanks
Amresh
[Updated on: Wed, 22 May 2013 14:24] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03030 seconds