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

How to Drag and Resize Polygon in Draw2d of Eclipse org.eclipse.draw2d.Polygon

I am working on Polygon Dragging , also Resizing of Polygon. I can draw rectangle using org.eclipse.draw2d.RectangleFigure and I am able to Drag it, I added MouseMotionListener and MouseListener to org.eclipse.draw2d.RectangleFigure. but while…
Sumant
  • 496
  • 1
  • 6
  • 20
0
votes
1 answer

Long press on up/down scroll button of the slider widget should scroll the slider widget thumb continuously

we have used a Slider widget (org.eclipse.swt.widgets.Slider) in our composite (which is inside a plugin) to scroll the FigureCanvas (the canvas's scroll bar has been disabled). This Slider should function in the same way as the scroll bar. But…
barry
  • 111
  • 7
0
votes
1 answer

Can I get a scrollable tooltip in draw2d?

I want to make the tooltip scrollable in draw2D, just like in Eclipse when you call out the Content Assist window. Can anyone help me? Thank you in advance!
huangcd
  • 2,369
  • 3
  • 18
  • 26
0
votes
1 answer

Get the size of a Draw2d Label Figure

if I have a class with a private Label = new Label(""); in it and in some method i write: private void setText(String text) { this.label.setText(text); System.out.println("label size = " + this.label.getSize(0,0)); } it will always print…
FSp
  • 1,545
  • 17
  • 37
0
votes
1 answer

SWT dynamically plotting large amount of data on a limited canvas by increasing its size from bottom and reducing it from top

There are lots of figures I want to plot on a draw2d figurecanvas.figures consume lot of memory. I want them to be plotted serially on the canvas but couldnt because of the memory issue. Now I want to plot them such a way that as when I scroll…
barry
  • 111
  • 7
0
votes
0 answers

Draw2d JS limited connection of ports

I have a Json file from which information is taken regarding the creation of flowcharts on canvas. The problem is that I want to limit the possible port connections. For example: There is a circuit that has a port named "localID" and I want to…
VARES
  • 1
0
votes
0 answers

How to maintain thumbanil aspectratio in draw2d for a node?

Using draw2d.js, I am creating node with width as 120 and height as 80 and adding thumbnail to the node by setting width as 100 and height as 60. But, after adding nodes to the canvas thumbnails gets distorted as well as when I try to drag a node…
Snehal
  • 1
  • 1
0
votes
1 answer

can not load javascript drow2d canvas with manuall extends cods

I have added some functionality to my objects in draw2d canvas. such as : var MyConnection= draw2d.Connection.extend({ init:function(attr){ this._super(attr); this.setRouter(new draw2d.layout.connection.VertexRouter()); …
Hassan B
  • 1
  • 3
0
votes
1 answer

Draw2D alignement in react, or Draw2D boxing

I found a simple application with React and draw2D. The dashbox is the div and the canvas. The circle is a draw2d.shape.basic.Circle({ x: 40, y: 10, stroke: 3 }) How to change the code to draw the circle inside the box…
dterencio
  • 71
  • 1
  • 7
0
votes
1 answer

Menu position appearing way off when the canvas it not positionned as top element on the page

Using Draw2d and the menu selection code from the demo but I don't get the expected result... In the demo, the menu appears on the right side of the clicked element. In my version the menu appears way off to the top. This seems to be caused by the…
Doctor
  • 7,115
  • 4
  • 37
  • 55
0
votes
2 answers

installation of draw2d latest version on angular 10

how can I install the latest version of draw2d library on angular 10? I used the command "npm i draw2d" but the version that has been installed is 1.0.38 although the latest version is 6.1 I guess. enter image description here thank you.
0
votes
1 answer

How to always show Sirius Label in foreground

For the context, I'm working with Capella, an Eclipse RCP application based on Sirius (hence, EMF, GMF and draw2d). This application is used for MBSE, that basically means diagram representations for industrial systems. I'm developping an add-on…
May.D
  • 1,832
  • 1
  • 18
  • 34
0
votes
1 answer

Save & Restore Diagrams In Draw2D.js Via JSON

How do I create nodes with labels that added to these nodes, so I can save and restore them via JSON? I tried to use JSON writer/reader in this way $(window).load(function () { var canvas = new draw2d.Canvas("gfx_holder"); // unmarshal…
SamaNoov
  • 42
  • 10
0
votes
1 answer

Unable to use draw2d in reactjs - Cannot read property 'x' of undefined

As a noob to draw2d I don't know if I've forgotten to import/initialise something When I click on my add button I get this error... VM50:7142 Uncaught TypeError: Cannot read property 'x' of undefined at Function.R._engine.create (eval at…
TedTrippin
  • 3,525
  • 5
  • 28
  • 46
0
votes
0 answers

How to get port, connection details

I am using draw2d with React. I have the node, ports, and connections working. My Questions are How to get the connected ports, am using canvas. How to get the connection path details between ports. Capture click events on the ports. Capture click…
sg28
  • 1,363
  • 9
  • 19