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
0
votes
1 answer

Change height of figures in GEF programmatically

I have a case where I have to add figures in another figure, i.e., nested figures. My figure which will contain other figure extends org.eclipse.draw2d.Figure. I want to change the height of this figure when it contains more than 4 figures, so that…
nullpointer
  • 490
  • 2
  • 4
  • 20
0
votes
1 answer

GEF java draw2d Layout that adjusts to the width of the container so that it spans over more lines

I need to show a line/multiline of images in GEF GraphicalViewer, so that it adjusts to the width of the container by spanning over more lines
honzajde
  • 2,270
  • 3
  • 31
  • 36
0
votes
2 answers

Draw a PolylineConnection between existing Nodes on a FigureCanvas

I am having list of nodes to be drawn.Here Node means RectangleFigure. So, all these nodes are plotted first on canvas(FigureCanvas) Then I have a map maintained having dependency relations between nodes drawn earlier. In the map, keys are the nodes…
Sheetal Bhatewara
  • 1,537
  • 2
  • 9
  • 10
0
votes
2 answers

How to dispose of an SWT Font set on a Draw2D Label?

In a GEF editor, I have the following EditPart: public class MyLabelEditPart extends AbstractGraphicalEditPart { @Override protected IFigure createFigure() { return new Label(); } @Override protected void refreshVisuals() { MyModel model =…
s.d
  • 4,017
  • 5
  • 35
  • 65
0
votes
1 answer

Direct Edit Confirmation in GEF EditParts

Introduction: I write an Eclipse plugin containing an editor which I implement with GEF. I have nodes and edges in my editor. The nodes have names and I want to edit the name of the nodes via direct edit. I install the direct edit policy to the node…
Jan Koester
  • 1,178
  • 12
  • 26
0
votes
1 answer

How to add DropListener to drop text in a draw2d Label

I am Trying to add a dropListener so I can Drop and text into a draw2d Label ,in GEf Editor , Can anyone help how Can I do that. An example will be great.
AK_AKA_KA
  • 1
  • 1
0
votes
1 answer

Customizing Selection Handles of GEF figures

Whenever a figure is selected in the GEF Editor, by default, we see a black,filled rectangle resize handles and a black border outlining the figure. I am implementing a feature where i am explicitly(through code) applying handles to a…
0
votes
1 answer

In which order - if any - are nodes drawn in a GEF editor?

I'm trying to plug a (very) simple graph layout algorithm into my GEF editor. I do it by simply adding calculateX() and calculateY() methods to my NodeEditParts' refreshVisuals() (the graph figure has an XYLayout obviously). It does work, albeit…
s.d
  • 4,017
  • 5
  • 35
  • 65
0
votes
1 answer

Add context sensitive help to UI components such as a GEF/Draw2d figure

As a tooltip can just provide less hints,we decide to add F1(context sensitive) help to the UI components such as a draw2d figure.But facing a problem that: we can't find suitable positions and parameters to invoke the method…
Sam Su
  • 6,532
  • 8
  • 39
  • 80
0
votes
1 answer

Slow scrolling with ScrollPane

I have been using draw2d library (not GEF) and ScrollPane. The figure presented in this ScrollPane is a kind of diagram with some Rectangles and Connections and the scrolling is ok, but for big diagram it is very slowly. Without the connections…
Kishore_2021
  • 645
  • 12
  • 38
0
votes
1 answer

gef : change child constraint to a new parent

i have somme process elements that can contain other process elements with no limit. i managed the addition of new process into other directly from the palette, it works right but when i drag a process already drawn to integrate it as a new child of…
user1125516
  • 250
  • 2
  • 4
  • 11
0
votes
2 answers

How to underline text in draw2d

Is there a simple way to draw underlined text in draw2d without manually drawing a line under the text?
thehiatus
  • 1,575
  • 13
  • 23
0
votes
1 answer

How to change checkbox size in GEF (org.eclipse.draw2d.Checkbox)

In GEF (Graphical Editing Framework), is it possible to change the size of a check box and the check mark inside it? I tried three methods: setPreferredSize setSize setBounds But they can only widen the padding between it and its parent.
ndquangr
  • 465
  • 3
  • 9
0
votes
1 answer

Best Practice for interactive 2D programming way in iOS

I want to create a diagram application, I can create some shapes. Every shape can be moved in the canvas. What is the best way to implement it? Now I know is just two way: with only UIView, draw all shapes in this UIView. When touch events reached,…
0
votes
1 answer

Serializing draw2d LayeredPane

I need some help with Serialization of draw2d Layered Panes. I read about Serialization, and found that a Class can be serialized only if it implements Serializable Interface, and all its fields are either themselves Serializable, or transient. I…
Saurabh
  • 63
  • 8