Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Writing a Java class for custom figures
Writing a Java class for custom figures [message #212165] Sun, 19 March 2006 15:19 Go to next message
Eclipse UserFriend
Originally posted by: a.farquea.gmail.com

Firstly i am using GMF but i wondered if anyone on here could help me with
this problem as i am just wanting to implement my own graphical figures by
creating some java classes.

I am attempting to implement a class which will allow me to load jpg's
into my gmfgraph via selecting a custom Figure and entering the
appropriate data into its field so that it uses my customfigure class.
However i am unsure as to what code i need in order to do this. I was
hoping someone could give me some help as to how the setImagePath method
should be written if possible, or a quick sample of code i can use and
adapt as i work;

/**
* */
package com.facetarch.figures;

import org.eclipse.swt.graphics.Image;
import org.eclipse.draw2d.ImageFigure;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Insets;
import org.eclipse.draw2d.geometry.Rectangle;

/**
* @author Farquea
*
*/
public class CustomFigure extends ImageFigure {

/**
* */
public CustomFigure() {
super();
}

public void setImagePath(String)
{

}

}

Date Subject
Re: Writing a Java class for custom figures [message #212482 is a reply to message #212165] Thu, 23 March 2006 20:55 Go to previous message
Steven R. Shaw is currently offline Steven R. ShawFriend
Messages: 128
Registered: July 2009
Senior Member
Please post this to the GMF newsgroup as the issue sounds specific to the
generative framework.

-Steve

"A. Farquea" <a.farquea@gmail.com> wrote in message
news:ac26cee90c085f00564aa32a01d7a494$1@www.eclipse.org...
> Firstly i am using GMF but i wondered if anyone on here could help me with
> this problem as i am just wanting to implement my own graphical figures by
> creating some java classes.
>
> I am attempting to implement a class which will allow me to load jpg's
> into my gmfgraph via selecting a custom Figure and entering the
> appropriate data into its field so that it uses my customfigure class.
> However i am unsure as to what code i need in order to do this. I was
> hoping someone could give me some help as to how the setImagePath method
> should be written if possible, or a quick sample of code i can use and
> adapt as i work;
>
> /**
> * */
> package com.facetarch.figures;
>
> import org.eclipse.swt.graphics.Image;
> import org.eclipse.draw2d.ImageFigure;
> import org.eclipse.draw2d.geometry.Dimension;
> import org.eclipse.draw2d.geometry.Insets;
> import org.eclipse.draw2d.geometry.Rectangle;
>
> /**
> * @author Farquea
> *
> */
> public class CustomFigure extends ImageFigure {
>
> /**
> * */
> public CustomFigure() {
> super();
> }
>
> public void setImagePath(String)
> {
>
> }
>
> }
>
> Date Subject
>
Previous Topic:GEF Logic sample reality check...
Next Topic:Problem about key binding!
Goto Forum:
  


Current Time: Mon Jan 13 13:02:01 GMT 2025

Powered by FUDForum. Page generated in 0.02273 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top