Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Draw a Line
Draw a Line [message #500132] Wed, 25 November 2009 07:24 Go to next message
Thomas is currently offline Thomas
Messages: 79
Registered: October 2009
Member
Hi,

i have got some problems with my gmf application. Now i need to draw a line on the Editor, but i cant imagine how. It should like in ms paint or like http://www.kiyut.com/products/sketsa/ this.

Are there some standart solutions, to make it easy?

Thanks

Thomas
Re: Draw a Line [message #500951 is a reply to message #500132] Mon, 30 November 2009 13:01 Go to previous messageGo to next message
Thomas is currently offline Thomas
Messages: 79
Registered: October 2009
Member
There is no way to create a line figure (Point(x1/y1) to Point(x2/y2)? So i what is the java solution to draw a line on a editor?
Re: Draw a Line [message #500963 is a reply to message #500132] Mon, 30 November 2009 13:47 Go to previous message
Thomas is currently offline Thomas
Messages: 79
Registered: October 2009
Member
Maybe i have found 1 solution. When i set source and target editpart for my PolylineConnectionEx on my diagrameditpart, with xyanchors, then i should be able to draw somehow a line. It still doesn´t work.

http://www.eclipsezone.com/eclipse/forums/t101269.html
2nd reply is my solution, because i don´t want to have (1/1) shapes. because if i export this as an svg, this shapes should not be exportet by the gmf export.

	@Override
	public void setSource(EditPart editPart) {
		System.out.println("setSource "+editPart);
		super.setSource(editPart);
//source should be diagrameditpart
	}

	/* (non-Javadoc)
	 * @see org.eclipse.gef.editparts.AbstractConnectionEditPart#setTarget(org.eclipse.gef.EditPart)
	 */
	@Override
	public void setTarget(EditPart editPart) {
		System.out.println("setTarget "+editPart);
		super.setTarget(editPart);
//target should be diagrameditpart
	}



@Override
	protected ConnectionAnchor getSourceConnectionAnchor() {
		System.out.println("getSourceConnectionAnchor");
		return super.getSourceConnectionAnchor();
//xyanchor
	}

	/* (non-Javadoc)
	 * @see  org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeE ditPart#getSourceConnectionAnchor(org.eclipse.gef.Connection EditPart)
	 */
	@Override
	public ConnectionAnchor getSourceConnectionAnchor(
			ConnectionEditPart connEditPart) {
		System.out.println("getSourceConnectionAnchor");
		return super.getSourceConnectionAnchor(connEditPart);
//xyanchor
	}

	/* (non-Javadoc)
	 * @see  org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeE ditPart#getSourceConnectionAnchor(org.eclipse.gef.Request)
	 */
	@Override
	public ConnectionAnchor getSourceConnectionAnchor(Request request) {
		System.out.println("getSourceConnectionAnchor");
		return super.getSourceConnectionAnchor(request);
//xyanchor
	}

	/* (non-Javadoc)
	 * @see  org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeE ditPart#getTargetConnectionAnchor()
	 */
	@Override
	protected ConnectionAnchor getTargetConnectionAnchor() {
		System.out.println("getTargetConnectionAnchor");
		return super.getTargetConnectionAnchor();
//xyanchor
	}

	/* (non-Javadoc)
	 * @see  org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeE ditPart#getTargetConnectionAnchor(org.eclipse.gef.Connection EditPart)
	 */
	@Override
	public ConnectionAnchor getTargetConnectionAnchor(
			ConnectionEditPart connEditPart) {
		System.out.println("getTargetConnectionAnchor");
		return super.getTargetConnectionAnchor(connEditPart);
//xyanchor
	}

	/* (non-Javadoc)
	 * @see  org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeE ditPart#getTargetConnectionAnchor(org.eclipse.gef.Request)
	 */
	@Override
	public ConnectionAnchor getTargetConnectionAnchor(Request request) {
		System.out.println("getTargetConnectionAnchor");
		return super.getTargetConnectionAnchor(request);
//xyanchor
	}

	/* (non-Javadoc)
	 * @see  org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeE ditPart#getTargetEditPart(org.eclipse.gef.Request)
	 */
	@Override
	public EditPart getTargetEditPart(Request request) {
		System.out.println("getTargetEditPart");
		return super.getTargetEditPart(request);
//xyanchor
	}

[Updated on: Mon, 30 November 2009 13:47]

Report message to a moderator

Previous Topic:Move a group of EditParts
Next Topic:Detecting interactive move
Goto Forum:
  


Current Time: Wed Sep 24 00:32:14 GMT 2014

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

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