draw2d

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

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 working for me, and I'm painting on a simple Canvas. ...

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 The drum icon on the right is part of a tiny widget drawer. And the incomplete line underneath it is trying to represent multiplicity, but it's being blocked by the widget drawer. ...

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

Re-aligning text in Eclipse Draw2D Label

I am building an RCP-based application with Draw2D Labels (Figures with text). When my graphical editor re-sizes the label, the text stays in it's initial position. Is there anyway to have the text reposition based on the new constraints of the label? ...

Gallery of GEF/Draw2D figures

I am new to GEF/Draw2D, I've seen some tutorials on the topic, but I am wondering if any of you have seen a gallery of all figures which are shipped together with GEF? So that one can quickly see what do they look like and what's their purpose? ...

Placing figure in top-right corner of another

I want child figure (org.eclipse.draw2d.Figure) to be relative to the top-right corner of the parent (I want place some small icon, which will be ImageFigure, to be 12 pixels from top and right borders). Is there an existing layout manager that can layout child this way? The org.eclipse.draw2d.XYLayout is not capable of measuring positi...

How to center Label vertical and horizontal in draw2d Figure ?

I have the following situation: Label label = new Label(); label.setText("bla"); RoundedRectangle fig = new RoundedRectangle(); fig.add(label); FlowLayout layout = new FlowLayout(); layout.setStretchMinorAxis(true); fig.setLayoutManager(layout); fig.setOpaque(true); That works only to center the label vertical or horizontal by using l...

Draw2D - Centering Multiple Lines of Text Vertically and Horizontally Inside a Figure

I'm trying to horizontally and vertically center two lines of text inside a Rectangle figure in Draw2D. The following code centers the text horizontally but not vertically: IFigure figure; figure = new Rectangle(); FlowPage flowPage = new FlowPage(); flowPage.setHorizontalAligment(PositionConstants.CENTER); textFlow = new TextFlow(); ...

How to draw the Graphviz "record" shape using Draw2d in a GEF editor?

Hi all, I m developing an eclipse plug-in to display graphs (an editor for graphs) using GEF/Draw2d. To do layouting for these, i plan to send the details to graphviz and get layout information to position them in the editor. I don't know how can record shapes be drawn in Draw2D, as it is not a fixed shape and can keep changing based o...

How to build a custom draw2d layoutmanager?

I would like to have a layout manager that can arrange two elements as follows: one main element ABCDEF centered one "postscript" element XYZ, positioned on the top right corner of the encapsulating figure For example: ***********XYZ* * ABCDEF * *************** Can I use an existing layoutmanager for this? How do I build a c...

Eclipse/SWT: Rectangle taking up entire canvas.

I am writing an Eclipse RCP-based application and am trying to draw a rectangle on top of a ViewPart. However, the rectangle seems to take up the whole screen even when specifiying the bounds. The following is my code. public void createPartControl(Composite parent) { Shell shell = parent.getShell(); Canvas canvas = n...

Performance of Eclipse GEF/Draw2D for graphs with many nodes

How does drawing large (10.000 nodes) graphs perform when using Eclipse GEF or Draw2D? The nodes can be drawn very simplistic (a circle); no labels and stuff. Is using GEF/Draw2D feasible for this task? ...

Handle key presses using swt.

Hi! I'm want do someStuff() when CTRL-C pressed. I had wrote some code, but it "not enough good". What can I do with it?) //org.eclipse.draw2d.Shape getShape(){....} getShape().addKeyListener(new KeyListener(){ @Override public void keyPressed(KeyEvent ke) { } @Override public void keyR...

Handle key presses using draw2d and swt.

Hi! Every org.eclipse.draw2d.Figure class has addKeyListener() method. But when key presses not every Figure handle it. What kind of figure handles key-events? Thanks. ...

Triangle in draw2d library

Hi! I can't understand org.eclipse.draw2d.Triangle's api. There are some fields for manipulation: protected int direction The direction this triangle will face. Possible values are PositionConstants.NORTH, PositionConstants.SOUTH, PositionConstants.EAST and PositionConstants.WEST. protected int orientation The orientation of t...