01 Simple, getting started, example.

The absolute basic example of draw2d. Neither user interaction nor other fancy stuff.
Just paint some basic figures with the draw2d API.

02 Simple figures with resize handles and drag drop

Absolute basic example with Drag&Drop interaction.
No Reocket science. ;-)

Try to resize or to move the figures around.

Vector Draw

Getting startet with Ports

First example with objects with ports. You can Drag&Drop the ports and drop them onto other Ports to create Connections.

draw2d.Ports are the basic class for draw2d.Connections between draw2.Figures.
Connections can be created with API calls or user interaction. Additional, you can see a Tools Palette with some buttons for undo/redo. the Draw2D supports a undo/redo Stack for all user operations. No additional coding is required.

Connector with a Z-Router

Connector with a Label

You can add any figure as decoration to a connection. Addition you can hand over a DecorationLocator to place them like your flavor.

Try it out. Drag&Drop the green objects to inspect the label relocation. The label will stay in the middle of the connection.

Connector with Decoration

Connector with a ContextMenu

Connector with a double click callback

Connector with different router

Own draw Connector

Create Connector via API call v.1

Create Connecotr via API call v.2

Change the Port representation

Port Test

Simple Context Menu

Double click callback

Canvas context menu

Object flow menu

Arrow Line

UML

Image Resize

Round Corner Figure

Round Corner Figure 2

Vector Figure

Input Figure

A simple figure with a form input field.

Timer Figure

Compartment Figure

Own Draw Figure

Hover Figure

Figure with Link action

Figure Tooltip

Circuit

UI Painter

Model View Controller

Complete XML Handling

ExtJS Integration

Command Listener

Very Simple XML Serializer

Selection Listener

Selection Listener 2

SnapTo Geometry

SnapTo Grid

Scroll To

Viewport

Toggle Button

Figure Resize

Color Test