Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Eclipse GEF and Draw2d Plug-in Developer Guide
Previous Page Home Next Page

Draw2d Overview

Draw2d is a lightweight toolkit of graphical components called figures . Lightweight means that a figure is simply a java object, with no corresponding resource in the operating system. Figures can be composed via a parent-child relationship. Every figure has a rectangular bounds inside which it, and its children, paint. A layout manager can be used to place children based on their index and/or constraint.

A LightweightSystem associates a figure composition with an SWT Canvas. The lightweight system hooks listeners for most SWT events, and forwards most of them to an EventDispatcher, which translates them into events on the appropriate figure.

Paint events, however, are forwarded to the UpdateManager, which coordinates painting and layout. Figures can be updated in ways which affect their appearance or size, and the update manager ensures that only one layout occurs, followed by a repaint of only the region which was updated.

Any type of diagram, document, or drawing can be easily constructed and efficiently updated by combining the provided figure and layout implementations along with the use of custom figures or layouts when needed.

Additional topics:

  • Painting - details of the paint process and how nesting affects painting
  • Layout - preferred size, layout, validating figures
  • Hit Testing - finding figures, correcting coordinates, modifying the space occupied by a figure
  • Connections and Routing - connections, anchors, decorations, and routing
  • Coordinate Systems - absolute and relative coordinates, working with absolute coordinates

  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire