[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: drawRoundedRectangle doesn't work with AnitAlias activated

Hi Pratik,

how can I access the GC? The Graphic Context is hidden by SWTGraphics and
not accessible from outside. 


On Thu, 20 Oct 2005 12:43:19 -0400, Pratik Shah wrote:

> GC has a method setAdvanced() that you could manipulate to find out if
> there's a
> 
> gc.setAdvanced(true);
> boolean advancedGraphicsInstalled = gc.getAdvanced();
> gc.setAdvanced(false);
> 
> These methods aren't reflected in the Graphics class yet, though.
> 
> "Max" <mbrigl@xxxxxxx> wrote in message
> news:pan.2005.10.20.18.34.33.844620@xxxxxxxxxx
>> Thank's it is working with cairo 1. It is possible to check if if
>> antialias (cairo) is available. In that way it would be possible to
>> activate antialias only if cairo has been installed.
>>
>> regards
>>
>> On Wed, 19 Oct 2005 11:04:59 -0400, Pratik Shah wrote:
>>
>> > You need Cairo 1.0 with Eclipse 3.2 integration builds.  BTW, you
> shouldn't
>> > be modifying the bounds directly as you do in the paintFigure() method.
>> > Instead, do getBounds().getExpanded(-1,-1).
>> >
>> > "Max" <mbrigl@xxxxxxx> wrote in message
>> > news:pan.2005.10.19.09.23.46.601488@xxxxxxxxxx
>> >> Some methods on org.eclipse.draw2d.Graphics doesn't work on "Linux" if
>> >> antialising has been activated. I had the problem with
>> >> draw- & fillRoundedRectangle and with fillGradient.
>> >> I'm using cairo-0.1.23!
>> >>
>> >>  public class Snippet {
>> >>
>> >> public static void main(String args[]) {
>> >> Display d = new Display();
>> >> final Shell shell = new Shell(d);
>> >> shell.setSize(400, 400);
>> >> LightweightSystem lws = new LightweightSystem(shell);
>> >> Figure contents = new Figure();
>> >> XYLayout contentsLayout = new XYLayout();
>> >> contents.setLayoutManager(contentsLayout);
>> >>
>> >> Figure fig = new Figure() {
>> >>
>> >> @Override
>> >> protected void paintClientArea(Graphics graphics) {
>> >> graphics.setForegroundColor(ColorConstants.black);
>> >> graphics.drawRoundRectangle(getBounds().shrink(1, 1), 50, 50);
>> >> // graphics.fillGradient(getBounds(), true);
>> >> }
>> >>
>> >>
>> >> @Override
>> >> public void paint(Graphics graphics) {
>> >> graphics.setAntialias(SWT.ON);
>> >> super.paint(graphics);
>> >> }
>> >>
>> >> };
>> >> fig.setBounds(new Rectangle(100, 100, 100, 100));
>> >> contents.add(fig);
>> >>
>> >> lws.setContents(contents);
>> >> shell.open();
>> >> while (!shell.isDisposed())
>> >> while (!d.readAndDispatch())
>> >> d.sleep();
>> >> }
>> >> }
>> >>
>>