Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » flickering
flickering [message #148667] Wed, 25 August 2004 20:38 Go to next message
Alex Selkov is currently offline Alex SelkovFriend
Messages: 73
Registered: July 2009
Member
I have a very noticeable flickering on resize (snippet follows). Feel that
I do something in a completely wrong way.

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Ellipse;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.FlowLayout;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.LightweightSystem;
import org.eclipse.draw2d.LineBorder;
import org.eclipse.draw2d.Polyline;
import org.eclipse.draw2d.RectangleFigure;
import org.eclipse.draw2d.RoundedRectangle;
import org.eclipse.draw2d.ScrollPane;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class Demo4 {
private static final int GAP = 20;
private static final Dimension SIZE = new Dimension(75, 50);
private static final Dimension CORNER = new Dimension(30, 25);
private static final int COUNT = 20;

public static void main(String args[]) {
Shell shell = new Shell();
shell.setSize(600, 600);
shell.open();
shell.setText("Figures");
LightweightSystem lws = new LightweightSystem(shell);

IFigure panel = new Figure();
panel.setLayoutManager(new FlowLayout());
ScrollPane sp = new ScrollPane();
sp.setContents(panel);
sp.getViewport().setContentsTracksWidth(true);
lws.setContents(sp);

final Color BG_COLOR = ColorConstants.white;
final Color PANEL_COLOR = ColorConstants.blue;
final Color FG_COLOR = ColorConstants.red;
panel.setBackgroundColor(PANEL_COLOR);
panel.setOpaque(true);
for (int i = 0; i < COUNT; i++) {
RoundedRectangle rr = new RoundedRectangle();
rr.setBackgroundColor(BG_COLOR);
rr.setForegroundColor(FG_COLOR);
rr.setCornerDimensions(CORNER);
rr.setSize(SIZE);
rr.setLineWidth(i);
panel.add(rr);
}
Display display = Display.getDefault();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
}
Re: flickering [message #148677 is a reply to message #148667] Wed, 25 August 2004 21:40 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

> public class Demo4 {
> private static final int GAP = 20;
> private static final Dimension SIZE = new Dimension(75, 50);
> private static final Dimension CORNER = new Dimension(30, 25);
> private static final int COUNT = 20;
>
> public static void main(String args[]) {
> Shell shell = new Shell();

Use Shell(SWT.NO_BACKGROUND | SWT.NO_RESIZE_REDRAW);
Previous Topic:Global summary view
Next Topic:bug in PaletteContextMenuProvider?
Goto Forum:
  


Current Time: Fri Apr 26 14:33:25 GMT 2024

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

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

Back to the top