Questions tagged [draw2d]

Draw2d is a layout and rendering toolkit for displaying graphics on an SWT canvas

Draw2d is a lightweight toolkit for displaying graphical components on an SWT canvas. Lightweight means that all graphical components, which are called figures in Draw2d, are simply Java objects, with no corresponding resource in the operating system.

A LightweightSystem associates a figure composition with an SWT canvas. It 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 are forwarded from the figures to an UpdateManager, which coordinates painting and layouting on the canvas.

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. 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.

(Excerpt from the Eclipse Draw2d site.)

147 questions
2
votes
2 answers

how do I specify a transparent background colour on a draw2d Figure?

I'm writing an eclipse plugin, and I'm layering some simple figures (i.e. view elements) together to create diagrams. A simple component looks like this A simple component with rendering issues…
CVertex
  • 17,997
  • 28
  • 94
  • 124
2
votes
1 answer

Layouting a large number of draw2d widgets in a Canvas

We are facing a problem, in handling a large number of Draw2d Figures, in a single Canvas. We are building a Tree of the nodes, with Connections between a parent, and a child node. The number of figures, in the canvas are of the order of 10000 (just…
Saurabh
  • 63
  • 8
2
votes
3 answers

Turning on anti-aliasing in SWT

I've called gc.setAntialias(SWT.ON); and it does nothing. According to that method, it should work. The Javadoc states: Sets the receiver's anti-aliasing value to the parameter, which must be one of SWT.DEFAULT, SWT.OFF or SWT.ON. It's not…
andyczerwonka
  • 4,230
  • 5
  • 34
  • 57
2
votes
1 answer

Creating Grid like GUI (Similar to Microsoft excel spreadsheet)

I want to create GUI like spread sheet. With resizeable cell size, filled with colour, Zoom in and zoom out etc features. Can I use draw2d for this?. Is there any grid like widgets available in any Java based GUI frameworks? Or do I need to draw…
Chandrayya G K
  • 8,719
  • 5
  • 40
  • 68
2
votes
0 answers

Is there a SWT widget to display DFX/Autocad Files? (or a converter to convert it to Draw2D)

I have some DXF or Autocad files, and need those to display in a eclipse rcp application. Is there a widget which provides such functionality? Or is there a library to convert these somehow to draw2d objects?
Mauli
  • 16,863
  • 27
  • 87
  • 114
1
vote
0 answers

Draw2d Figure Rotate

I have a RectangleFigure, I want to Rotate it with angle of 45 or so. Please give me sample code. I tried with Transform Class but in vain.
Sumant
  • 496
  • 1
  • 6
  • 20
1
vote
2 answers

Eclipse Draw2d. Changing z order for IFigure

I am working through the examples in 'The Eclipse Graphical Framework (GEF)' book and the included Genealogy example(Draw2d chapters) seems to have the z order of figures messed up. When a figure is dragged or selected its z order remains…
Mr1159pm
  • 774
  • 1
  • 10
  • 21
1
vote
2 answers

Eclipse RCP Draw2d Transparency (setAlpha) makes borders / outline invisible

We are providing users option to make figures drawn on canvas transparent. To achieve this we are using method setAlpha(0). But this makes figure completely invisible. Our requirement is that outline / border should be shown on transparent figures…
1
vote
1 answer

Eclipse GEF/draw2d Coordinate System Transformation

Can someone please explain to me how coordinate transformations work in draw2d? I have a hierarchical diagram where a figure can contain figures which also contain figures. At first I added internal figures by using the request's getLocation,…
vainolo
  • 6,907
  • 4
  • 24
  • 47
1
vote
1 answer

How to center a Label inside a RectangleFigure

I'm a complete newbie with draw2d, i'm trying to make some examples in order to learn how to use it... I'm trying to write a Figure which shows a Label with white background, some padding, and an enclosing grey background. For that, i wrote the…
roirodriguez
  • 1,685
  • 2
  • 17
  • 31
1
vote
0 answers

Extremely large SVG file when using Golang Draw2d

I have been using the library draw2d with go-nexrad, and I am able to generate PNG and SVG files. However, the SVG files that are generated are enormous, with a less than 10MB PNG file becoming a 28MB SVG file with the same options. Here is the…
Pufferfishe
  • 139
  • 1
  • 7
1
vote
0 answers

Maxima encountered a Lisp error: I do not understand what the problem is

I am trying to do an example in wxmaxima wxplot_size:[1024,768]$ wxanimate_framerate:2$ with_slider_draw( /* The parameter we want to assign to the slider and all values it can assume */ R,Resistors, /* The thing we actually want to draw…
ebjargu
  • 11
  • 1
  • 2
1
vote
1 answer

TextBox inside eclipse's draw2d figure

Is there any way to include a Text Box inside a draw2d figure? (a code example would be nice)
Protostome
  • 5,569
  • 5
  • 30
  • 45
1
vote
0 answers

Drag & Drop child node in Draw2d Custom Layout/Figure

I have a Draw2d(js) custom figure (Table) which contains nested custom figures (Column). I want to grag and drop column from one table to another. I just want from you guys some guidelines how to enable grag & drop, I'll handle other logic. I've…
Zohaib Ijaz
  • 21,926
  • 7
  • 38
  • 60
1
vote
2 answers

How to create a GEF figure with separate label?

I've been trying to create a Draw2D Figure that consists of two parts - a central resizeable shape, such as a circle or rectangle, and an editable label for the bottom part. An example of this type of figure is the icon/label you see on a computer's…
Phillipus
  • 455
  • 1
  • 5
  • 14
1
2
3
9 10