Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Draw2D rotation and transparency
Draw2D rotation and transparency [message #222704] Mon, 11 September 2006 12:08 Go to next message
Eclipse User
Originally posted by: m.farajmandi.gmail.com

Despite the nice structure and features of Draw2D, it ignores two
important graphics capablities; rotation (to any flexible degree) and
smooth transparency (e.g. 1-100 as opposed to on/off). I have see couple
of attempts trying to integrate Java2D with SWT or Draw2D(?):
Is there any project running somewhere in order to provide solution for
the aforementioned problems?
If not, do you know of any other graphics system in Java that does
provides similar capablities to Draw2D, but also includes true rotation
and transparency [I understand that the second question is not related
to this group, but I'd greately appreciate any tips/suggestions/help].

Many Thanks,

Mo.
Re: Draw2D rotation and transparency [message #222867 is a reply to message #222704] Thu, 14 September 2006 03:17 Go to previous messageGo to next message
Eclipse User
Originally posted by: mateu.yabar.justinmind.com

I don't know how to implement rotation, but it is quite easy to put
transparency in figures. I attach two examples:
This will produce a Panel with transparency:
-Start of class------------------------------------------------------- ----
public class TransparentPanel extends Panel {

public void setTransparentFill(int value) {
m_transparencyValue = value;
}

private int m_transparencyValue = 50;
private int m_transparencyValueOutline = 50;

public void paint(Graphics graphics) {
graphics.setAlpha(m_transparencyValue);
graphics.setAntialias(SWT.ON);
super.paint(graphics);
}

}
----End of class---------------------------------

and this will produce a panel with transparency
public class transparentRectangle extends RectangleFigure{

private int m_transparencyValue = 50;
private int m_transparencyValueOutline = 50;
protected void fillShape(Graphics g) {
// must call it before super
g.setAlpha(m_transparencyValue);
g.setAntialias(SWT.ON);
super.fillShape(g);

}

protected void outlineShape(Graphics g) {
// must call it before super
g.setAlpha(m_transparencyValueOutline);
g.setAntialias(SWT.ON);
super.outlineShape(g);
}


public void setTransparentFill(int value) {


m_transparencyValue = value;
}


public void setTransparentOutline(int value) {


m_transparencyValueOutline = value;
}

}

"mamadlin" <m.farajmandi@gmail.com> escribi
Re: Draw2D rotation and transparency [message #222903 is a reply to message #222867] Thu, 14 September 2006 13:45 Go to previous message
Eclipse User
Originally posted by: m.farajmandi.gmail.com

Thanks a lot for the reply Mateu.


Mateu Yábar Vallès wrote:
> I don't know how to implement rotation, but it is quite easy to put
> transparency in figures. I attach two examples:
> This will produce a Panel with transparency:
> -Start of class------------------------------------------------------- ----
> public class TransparentPanel extends Panel {
>
> public void setTransparentFill(int value) {
> m_transparencyValue = value;
> }
>
> private int m_transparencyValue = 50;
> private int m_transparencyValueOutline = 50;
>
> public void paint(Graphics graphics) {
> graphics.setAlpha(m_transparencyValue);
> graphics.setAntialias(SWT.ON);
> super.paint(graphics);
> }
>
> }
> ----End of class---------------------------------
>
> and this will produce a panel with transparency
> public class transparentRectangle extends RectangleFigure{
>
> private int m_transparencyValue = 50;
> private int m_transparencyValueOutline = 50;
> protected void fillShape(Graphics g) {
> // must call it before super
> g.setAlpha(m_transparencyValue);
> g.setAntialias(SWT.ON);
> super.fillShape(g);
>
> }
>
> protected void outlineShape(Graphics g) {
> // must call it before super
> g.setAlpha(m_transparencyValueOutline);
> g.setAntialias(SWT.ON);
> super.outlineShape(g);
> }
>
>
> public void setTransparentFill(int value) {
>
>
> m_transparencyValue = value;
> }
>
>
> public void setTransparentOutline(int value) {
>
>
> m_transparencyValueOutline = value;
> }
>
> }
>
> "mamadlin" <m.farajmandi@gmail.com> escribió en el mensaje
> news:ee41lu$572$1@utils.eclipse.org...
>
>>Despite the nice structure and features of Draw2D, it ignores two
>>important graphics capablities; rotation (to any flexible degree) and
>>smooth transparency (e.g. 1-100 as opposed to on/off). I have see couple
>>of attempts trying to integrate Java2D with SWT or Draw2D(?):
>>Is there any project running somewhere in order to provide solution for
>>the aforementioned problems?
>>If not, do you know of any other graphics system in Java that does
>>provides similar capablities to Draw2D, but also includes true rotation
>>and transparency [I understand that the second question is not related to
>>this group, but I'd greately appreciate any tips/suggestions/help].
>>
>>Many Thanks,
>>
>>Mo.
>
>
>
Previous Topic:Terminal selection and properties
Next Topic:Dependency on GEF and update site
Goto Forum:
  


Current Time: Tue Jul 29 19:11:20 EDT 2014

Powered by FUDForum. Page generated in 0.02081 seconds