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
1
vote
1 answer

MouseMotionListener events on sub-figures - GEF

I'm using a parent draw2d figure which contains several sub figures (buttons. using Toolbar layout) which registered to MouseMotionListener and do some action (lets say 'enterAction') on mouse enter do something else on mouse exit…
akaspi
  • 275
  • 1
  • 3
  • 12
1
vote
1 answer

scrollpane to the figure

I wanted to add one scrollbar into the RoundedRectangle. I have 3 Rounded rectangle in the root figure. Now I want to add scrollbar to each of the rounded rectangle. Is it possible to add the scrollbar to the rounded rectangle or rectangle figure?…
user414967
  • 5,225
  • 10
  • 40
  • 61
1
vote
1 answer

How to move figures when they are part of a connection

I am working on a small graphical editor using the Draw2d library (without GEF). One requirement is, that you can move figures by dragging them with the mouse. This works fine as long as there is no (Polyline-) connection between the figures. When I…
BitSchupser
  • 432
  • 3
  • 13
1
vote
1 answer

how to set line width & color of connection line in draw2d?

I am trying to set width and color of connection line in draw2d. I found method "setLineWidth()" method but on what I need to call this method. I call this method on input port object but did not work. Plz help me.
1
vote
1 answer

How to set background color of an image using draw2d?

I have drawn one rectangle by using RectangleFigure in draw2d. And I am able to color the rectangle figure by calling rectangleFigure.setBackgroundColor. Now the same way I want to color the Image also. For that I used ImageFigure in draw2d and I…
user414967
  • 5,225
  • 10
  • 40
  • 61
1
vote
0 answers

How to layout a graph in a GEF editor with prefuse

Is it possible to "plug in" a prefuse layout (such as NodeLinkTreeLayout) to layout a graph in a GEF editor? Or would I have to port the algorithm to Draw2D?
QueNuevo
  • 105
  • 12
1
vote
2 answers

Draw Vertical Label using draw2d in eclipse plugin

I am doing an Eclipse plugin using gef. Does anybody knows how to draw a vertical label? Kind Regards, Kyriakos Georgiou
Kyriakos
  • 757
  • 8
  • 23
1
vote
1 answer

GEF: How to draw diagram bottom up

I'm trying to draw a tree within a GEF editor. The problem is that I need to draw it bottom up. I have a primary layer for the node figures, and a connection layer for the connections. The primary layer is a FreeformLayer, the root edit part a…
QueNuevo
  • 105
  • 12
1
vote
1 answer

gef rectangle figure single click

I am doing a small project in Draw2d and GEF. I need to get the single click through performRequest() method. Currently I am getting double clicking through performRequest(). There I am checking request.getType()== open then it is double click. But…
user414967
  • 5,225
  • 10
  • 40
  • 61
1
vote
2 answers

drawing rectangle in drawing issue

We are creating some graphical applications to the our project. We are using Draw2d and GEF technologies in our project. We have to draw one rectangle in the draw area. The functionality is as follows. Use click the rectangle button from the…
0
votes
1 answer

create image from layer containing the polylines

I made an swt.graphics.Image object of a draw2d Layer containing draw2d polylines and few other figures like circles ellipses etc. I made a jpeg file from this Image object, all I can see are the ellipses, circles etc but no figures drawn using…
barry
  • 111
  • 7
0
votes
1 answer

Draw2D / GEF: How to access nested figures (e.g., for connections)

I'm currently learning GEF (as in the Eclipse project), and while doing so have come across a question. In my future application I will have to connect a Figure with the nested figure of some other Figure. I have found that via the following code…
s.d
  • 4,017
  • 5
  • 35
  • 65
0
votes
1 answer

issue drawing aligned text using TextFlow and FlowPage

i'm drawing a multiline text label using a FlowPage object that contains a TextFlow object. the code of my label class is: class TransitionLabel extends FlowPage { private TextFlow content; public TransitionLabel() { …
FSp
  • 1,545
  • 17
  • 37
0
votes
2 answers

Draw 2D: Paint grid on grid layout figure

How can I paint the grid itself (e.g. grid lines) on a Figure, which has grid layout. I think i need to paint it in another layer, but i can not figure out what exactly to do, to paint 'above' the layer with grid layout.
execc
  • 1,083
  • 12
  • 25
0
votes
1 answer

How to implement dragdetection on Slider without using dragdetect listener?

I want to implement a dragdetect on Slider widget. So when user drags the thumb. the drag should be detected. can anyone suggest a workaround with out using the drag detect listener. thanks regards Bharath Y
barry
  • 111
  • 7