Last change
on this file since 29 was
5,
checked in by zeiss, 14 years ago
|
|
-
Property svn:mime-type set to
text/plain
|
File size:
854 bytes
|
Rev | Line | |
---|
[5] | 1 | package de.ugoe.cs.swe.bnftools.ui.views.syntaxdiagram;
|
---|
| 2 |
|
---|
| 3 | import org.eclipse.draw2d.Figure;
|
---|
| 4 | import org.eclipse.draw2d.MouseEvent;
|
---|
| 5 | import org.eclipse.draw2d.MouseListener;
|
---|
| 6 | import org.eclipse.draw2d.MouseMotionListener;
|
---|
| 7 | import org.eclipse.draw2d.geometry.Dimension;
|
---|
| 8 | import org.eclipse.draw2d.geometry.Point;
|
---|
| 9 |
|
---|
| 10 | public class DragAndDropListener extends MouseMotionListener.Stub implements
|
---|
| 11 | MouseListener {
|
---|
| 12 |
|
---|
| 13 | Point start;
|
---|
| 14 |
|
---|
| 15 | public void mousePressed(MouseEvent e) {
|
---|
| 16 | start = e.getLocation();
|
---|
| 17 | }
|
---|
| 18 |
|
---|
| 19 | public void mouseReleased(MouseEvent e) {
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | public void mouseDoubleClicked(MouseEvent e) {
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | public void mouseDragged(MouseEvent e) {
|
---|
| 26 | Point p = e.getLocation();
|
---|
| 27 | Dimension d = p.getDifference(start);
|
---|
| 28 | start = p;
|
---|
| 29 | Figure f = ((Figure) e.getSource());
|
---|
| 30 | f.setBounds(f.getBounds().getTranslated(d.width, d.height));
|
---|
| 31 | }
|
---|
| 32 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.