Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » DnD Gui
DnD Gui [message #918832] Fri, 21 September 2012 11:45 Go to next message
Sven Ort is currently offline Sven OrtFriend
Messages: 6
Registered: September 2012
Junior Member
Hi,
I want to program a gui, in which e.g. 10 sensors and actuators can be connected to a processor via mouse.
At each sensor or actuator, various parameters should be set by double clicking.

in the end everything should be saved by "Configurate" button in a txt file.

is this possibile with GEF?

thanks for the help
Re: DnD Gui [message #919607 is a reply to message #918832] Sat, 22 September 2012 06:04 Go to previous messageGo to next message
Igor Zapletnev is currently offline Igor ZapletnevFriend
Messages: 33
Registered: September 2012
Member
Hi,

Yes, GEF is a great tool to implement such editors.

Thanks,
Igor
Re: DnD Gui [message #925954 is a reply to message #918832] Fri, 28 September 2012 07:07 Go to previous messageGo to next message
Sven Ort is currently offline Sven OrtFriend
Messages: 6
Registered: September 2012
Junior Member
thanks, and is there any tuturial?

how can i install GEF?
Re: DnD Gui [message #930046 is a reply to message #925954] Tue, 02 October 2012 01:28 Go to previous messageGo to next message
Igor Zapletnev is currently offline Igor ZapletnevFriend
Messages: 33
Registered: September 2012
Member
Here is update site for GEF
You could find good examples there.

I don't have 25 messages on this forum and because of that I could not add link on other sites. So I could not share link to the usefull GEF tutorial.
I think you could mail me on igor.zapletnev@gmail.com and I will try to help you.

Thanks,
Igor

[Updated on: Tue, 02 October 2012 01:30]

Report message to a moderator

Re: DnD Gui [message #932880 is a reply to message #930046] Thu, 04 October 2012 14:29 Go to previous messageGo to next message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
GEF is a really great and powerful editing framework. But it has little bit steep learning curve from my point of view.

Here are some useful links
http://wiki.eclipse.org/GEF_Description
http://www.eclipse.org/gef/reference/interactions.html
http://www.eclipse.org/articles/Article-GEF-dnd/GEF-dnd.html
http://pbwhiteboard.blogspot.cz/2010/12/notes-for-starting-out-with-eclipse-gef.html
Re: DnD Gui [message #933829 is a reply to message #932880] Fri, 05 October 2012 11:30 Go to previous messageGo to next message
Sven Ort is currently offline Sven OrtFriend
Messages: 6
Registered: September 2012
Junior Member
i bought this book:
Eclipse-Graphical-Editing-Framework-Addison-Wesley

and startet with a view basic tutorials from the book but when I run the programm it shows an error: "selection does not contain a main type"

whats the problem?

the code is added


thanks
  • Attachment: code_V1.txt
    (Size: 1.45KB, Downloaded 310 times)
  • Attachment: error.jpg
    (Size: 248.46KB, Downloaded 274 times)

[Updated on: Fri, 05 October 2012 11:31]

Report message to a moderator

Re: DnD Gui [message #933984 is a reply to message #933829] Fri, 05 October 2012 14:33 Go to previous messageGo to next message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
You don't have the main method. Try this:
package com.qualityeclipse.genealogy.view;

import org.eclipse.draw2d.*;
import org.eclipse.draw2d.geometry.*;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;



public class main {
	
	public static void main(String[] args) {
		Shell shell= new Shell(new Display());
		shell.setSize(420, 380);
		shell.setText("DTFParametereingabe");
		shell.setLayout(new GridLayout());
		
		Canvas canvas = createDiagram(shell);
		canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
		
		Display display = shell.getDisplay();
		shell.open();
		while (!shell.isDisposed()) {
			while (!display.readAndDispatch()) {
				display.sleep();
			}
		}
	}
	
	
	
	private static Canvas createDiagram(Composite parent) {
		
		Figure root = new Figure();//root Figure und simples Layout erzeugen 
		root.setFont(parent.getFont()); //setze Font für root Figure, dass jedes Lable korrekt kalkuliert wird
		
		XYLayout layout = new XYLayout();
		root.setLayoutManager(layout);
		
		Canvas canvas = new Canvas(parent, SWT.DOUBLE_BUFFERED);//canvas erzeugen um root Figur zu erzeugen
		canvas.setBackground(ColorConstants.white); // Hintergrundfarbe bestimmen
		LightweightSystem lws = new LightweightSystem(canvas);
		lws.setContents(root);
		return canvas;
	}

}

I would also recommend to follow the Java naming conventions and name classes with uppercase letter first.
Re: DnD Gui [message #946463 is a reply to message #918832] Tue, 16 October 2012 08:11 Go to previous messageGo to next message
Sven Ort is currently offline Sven OrtFriend
Messages: 6
Registered: September 2012
Junior Member
For me it is not clear to create symbol on Canvas (eg a sensor) and by double clicking on it, a new Window opens where I can make various settings and store them to that Symbol.

eg Sensor1 (name: SE_0001; Latency: 1; connection with:PR_0001)

is this possible with GEF or do I have to create first a model with EMF.

EMF is very difficult for me to understand.

what else are the tasks of EMF that is not clear to me.

Re: DnD Gui [message #946613 is a reply to message #918832] Tue, 16 October 2012 10:42 Go to previous messageGo to next message
Sven Ort is currently offline Sven OrtFriend
Messages: 6
Registered: September 2012
Junior Member
I have now created 3 icons (sensor, actuator and super element), but I can not move them by drag and drop

I createt a new Class (FigureMover) and addet the Code from the Book but there is no effect.

where is the mistake?

[Updated on: Tue, 16 October 2012 12:11]

Report message to a moderator

Re: DnD Gui [message #964335 is a reply to message #918832] Tue, 30 October 2012 12:46 Go to previous message
Sven Ort is currently offline Sven OrtFriend
Messages: 6
Registered: September 2012
Junior Member
can nobody help me?
Previous Topic:Zest - Zooming functionality via mouse wheel
Next Topic:Delete EditPart Policy and DEL Key
Goto Forum:
  


Current Time: Thu Mar 28 13:03:31 GMT 2024

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

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

Back to the top