Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 60549 Details for
Bug 176984
Rendering Problems
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Sample to reproduce the bug
LargeFigure.java (text/x-java), 2.88 KB, created by
Manuel Selva
on 2007-03-12 09:47:51 EDT
(
hide
)
Description:
Sample to reproduce the bug
Filename:
MIME Type:
Creator:
Manuel Selva
Created:
2007-03-12 09:47:51 EDT
Size:
2.88 KB
patch
obsolete
>package draw2d; > >import org.eclipse.draw2d.ColorConstants; >import org.eclipse.draw2d.FigureCanvas; >import org.eclipse.draw2d.Panel; >import org.eclipse.draw2d.RectangleFigure; >import org.eclipse.draw2d.XYLayout; >import org.eclipse.draw2d.geometry.Rectangle; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.widgets.Display; >import org.eclipse.swt.widgets.Shell; > >public class LargeFigure { > > /** > * @param args > */ > public static void main(String[] args) { > > //Create display and shell > Display display = new Display(); > Shell shell = new Shell(display); > shell.setLayout(new FillLayout()); > > FigureCanvas canvas = new FigureCanvas(shell); > Panel panel = new Panel(); > panel.setLayoutManager(new XYLayout()); > RectangleFigure rect = new RectangleFigure(); > rect.setBackgroundColor(ColorConstants.red); > panel.add(rect, new Rectangle(0, 0, 150000000, 100)); > canvas.setContents(panel); > > //Open the shell and start UI loop > shell.setSize(200, 150); > shell.open(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) { > display.sleep(); > } > } > display.dispose(); > } > > /*public static void main (String [] args) { > Display display = new Display (); > Shell shell = new Shell (display); > shell.setLayout(new FillLayout()); > final Point origin = new Point (0, 0); > final Canvas canvas = new Canvas (shell, SWT.DOUBLE_BUFFERED|SWT.NO_REDRAW_RESIZE | SWT.NO_BACKGROUND > | SWT.V_SCROLL | SWT.H_SCROLL); > final int width = 150000000; > final ScrollBar hBar = canvas.getHorizontalBar (); > final Color red = new Color(null,255,0,0); > hBar.setMaximum(width); > hBar.addListener (SWT.Selection, new Listener () { > public void handleEvent (Event e) { > int hSelection = hBar.getSelection (); > int destX = -hSelection - origin.x; > canvas.scroll (destX, 0, 0, 0, width, 100, true); > origin.x = -hSelection; > } > }); > final ScrollBar vBar = canvas.getVerticalBar (); > vBar.setMaximum(100); > vBar.addListener (SWT.Selection, new Listener () { > public void handleEvent (Event e) { > int vSelection = vBar.getSelection (); > int destY = -vSelection - origin.y; > canvas.scroll (0, destY, 0, 0, width, 100, true); > origin.y = -vSelection; > } > }); > canvas.addListener (SWT.Paint, new Listener () { > public void handleEvent (Event e) { > GC gc = e.gc; > gc.setBackground(red); > gc.fillRectangle(origin.x,origin.y,width,100); > gc.drawText ("test......", origin.x, origin.y); > } > }); > shell.setSize (200, 150); > shell.open (); > while (!shell.isDisposed ()) { > if (!display.readAndDispatch ()) display.sleep (); > } > display.dispose (); > }*/ >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 176984
:
60549
|
60649