Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [rap-dev] New RWT graphic widget GCCanvas

Mirko,

this looks really cool:) I saw your newsgroup posting from yesterday and just wanted to ask you whether you would care to share the source. This question is obsolete now...

My first idea was that this widget could start out in the sandbox component. Any other opinion?

Thanks a lot!
Rüdiger

mirkosol@xxxxxxxxx wrote:
Hi There,

I've developed a new RWT widget to emulate the SWT GC graphics on a canvas. The new widget extends the Composite component and allows to draw figures and graphs inside RAP dialogs. You can find a usage example attached to this mail. The widget is compatible both with Firefox/Mozilla (use the canvas tag) and MSIE browsers (include the google excanvas extension script). This is a list of the available GCCanvas methods (current version): public class GCCanvas extends Composite (construnctor) public GCCanvas(final Composite parent,final int style) public String drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) public String drawImage(Image image, int x, int y) public String drawImage(Image image, int x, int y,int width , int height) public String drawImage(String sImagePath, int x, int y) public String drawImage(String sImagePath, int x, int y,int width , int height) public String drawLine(int x1, int y1, int x2, int y2) public String drawOval(int x, int y, int width, int height) public String drawPoint(int x, int y) public String drawPolygon(int[] pointArray) public String drawPolyline(int[] pointArray) public String drawRectangle(int x, int y, int width, int height) public String drawRectangle(Rectangle rect) public String drawRoundRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight) public String drawString(String string, int x, int y) public String drawText(String string, int x, int y) public String fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) public String fillGradientRectangle(int x, int y, int width, int height,boolean vertical) public String fillOval(int x, int y, int width, int height) public String fillPolygon(int[] pointArray) public String fillRectangle(int x, int y, int width, int height) public String fillRoundRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight) public void removePath(String pathId) public void removeAll() public void setSize(int width, int height) public void setLineWidth(int width)
      public int getLineWidth()
      public void setCanvasColor(Color color)
      public Color getCanvasColor()
      public void setForeground(Color color)
      public Color getForeground()
      public void setBackground(Color color)
      public Color getBackground()
      public void setAlpha(int alpha)
      public int getAlpha()
public void setGradientBackground(LinearGradient gradient) public void setGradientBackground(RadialGradient gradient) public void setFont(Font font) public Font getFont()
--------------------------------

Notes:
- The GCCanvas can listen to all mouse/key Composite events.
- Each drawing function returns the pathID; for MSIE a path with a specific PathId can be removed from the canvas.  (see the demo code)
I also attach two images that represent the figure generated by the Demo code, before and after a double click on the canvas. Please tell me how I can upload the source code to the rap repository. I hope you are interested to include this useful widget inside the next RAP official releases.
GREAT WORK!!

Best Regards

Mirko Solazzi
Informatic/Electronic Engineer
mirkosol@xxxxxxxxx




------------------------------------------------------------------------


------------------------------------------------------------------------


------------------------------------------------------------------------

_______________________________________________
rap-dev mailing list
rap-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/rap-dev


Back to the top