Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

GEF/GEF4/Geometry/Tutorial

< GEF‎ | GEF4‎ | Geometry
Revision as of 11:32, 21 October 2011 by Unnamed Poltroon (Talk)

Description

This is a small tutorial for the GEF4 Geometry API.

Creating shapes

You can find all the shapes in the org.eclipse.gef4.geometry.shapes package. In the majority of cases, you will get along with those predeclared shapes. If you feel the need of another one that is not provided there, you can draw the joker (Path) which can be used to work with complicated composed shapes. But we will begin by demonstrating the other shapes first.

You are able to create a shape via its constructor:

   Point p1 = new Point(100, 100);
   Point p2 = new Point(200, 200);
   Line line = new Line(p1, p2);

Alternatively, every constructor is able to handle primitive data types:

   Line line = new Line(100, 100, 200, 200);

Back to the top