Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » doubts about gef
doubts about gef [message #203409] Mon, 21 November 2005 21:22 Go to next message
Eclipse UserFriend
Originally posted by: hdsn82.yahoo.com.br

When I execute the code bellow, if I minimize the window run the figure
dissappear...Do you guys know why is it happen? What code changes should I
do in this case?
Thanks a bunch!

import java.awt.Color;
import org.eclipse.draw2d.ChopboxAnchor;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.LightweightSystem;
import org.eclipse.draw2d.PolygonDecoration;
import org.eclipse.draw2d.PolylineConnection;
import org.eclipse.draw2d.XYLayout;
import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class DrawExample {

public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Drawing Example");



Canvas canvas = new Canvas(shell, SWT.NULL);

canvas.setSize(600, 400); //espaço interno onde está inserido o desenho
canvas.setLocation(-40, -30);
//canvas.addPaintListener(this);
canvas.setVisible(true);
shell.open();
shell.setSize(600, 400); //tamanho da tela que contém o desenho

GC gc = new GC(canvas);
gc.drawArc(200,156,150,130,180, -180);
//3º - largura da elipse,
//4º - altura da elipse

gc.drawArc(200,156,150,130,-180, 180);
gc.drawText("lk;fasjdfl;sda", 220,190);

while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.getCurrent().dispose();
}
}
Re: doubts about gef [message #203458 is a reply to message #203409] Tue, 22 November 2005 09:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: greg.gigon.tugulu.com

And why is it a question about GEF?? I don't see any other code that imports.

Greg

Neto wrote:
> When I execute the code bellow, if I minimize the window run the figure
> dissappear...Do you guys know why is it happen? What code changes should
> I do in this case?
> Thanks a bunch!
>
> import java.awt.Color;
> import org.eclipse.draw2d.ChopboxAnchor;
> import org.eclipse.draw2d.Figure;
> import org.eclipse.draw2d.LightweightSystem;
> import org.eclipse.draw2d.PolygonDecoration;
> import org.eclipse.draw2d.PolylineConnection;
> import org.eclipse.draw2d.XYLayout;
> import org.eclipse.draw2d.geometry.PointList;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.graphics.GC;
> import org.eclipse.swt.widgets.Canvas;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Shell;
>
> public class DrawExample {
>
> public static void main(String[] args) {
> Display display = new Display();
> Shell shell = new Shell(display);
> shell.setText("Drawing Example");
>
>
> Canvas canvas = new Canvas(shell, SWT.NULL);
>
> canvas.setSize(600, 400); //espaço interno onde está inserido o desenho
> canvas.setLocation(-40, -30);
> //canvas.addPaintListener(this);
> canvas.setVisible(true);
> shell.open();
> shell.setSize(600, 400); //tamanho da tela que contém o desenho
>
> GC gc = new GC(canvas);
> gc.drawArc(200,156,150,130,180, -180);
> //3º - largura da elipse,
> //4º - altura da elipse gc.drawArc(200,156,150,130,-180, 180);
> gc.drawText("lk;fasjdfl;sda", 220,190);
>
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch())
> display.sleep();
> }
> display.getCurrent().dispose();
> }
> }
>
Re: doubts about gef [message #203539 is a reply to message #203409] Tue, 22 November 2005 18:51 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Gustei de voce na ultima novela do Globo ;-)

You are painting just once. You need to use a paint listener and paint every
time the control needs to paint.

"Neto" <hdsn82@yahoo.com.br> wrote in message
news:dfea4ec4cdfaa652884a43405147bb5c$1@www.eclipse.org...
> When I execute the code bellow, if I minimize the window run the figure
> dissappear...Do you guys know why is it happen? What code changes should I
> do in this case?
> Thanks a bunch!
>
> import java.awt.Color;
> import org.eclipse.draw2d.ChopboxAnchor;
> import org.eclipse.draw2d.Figure;
> import org.eclipse.draw2d.LightweightSystem;
> import org.eclipse.draw2d.PolygonDecoration;
> import org.eclipse.draw2d.PolylineConnection;
> import org.eclipse.draw2d.XYLayout;
> import org.eclipse.draw2d.geometry.PointList;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.graphics.GC;
> import org.eclipse.swt.widgets.Canvas;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Shell;
>
> public class DrawExample {
>
> public static void main(String[] args) {
> Display display = new Display();
> Shell shell = new Shell(display);
> shell.setText("Drawing Example");
>
> Canvas canvas = new Canvas(shell, SWT.NULL);
>
> canvas.setSize(600, 400); //espa
Previous Topic:method findFigureAt returns null
Next Topic:Compound create command
Goto Forum:
  


Current Time: Tue Jan 14 07:43:01 GMT 2025

Powered by FUDForum. Page generated in 0.03466 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top