Lines 21-28
Link Here
|
21 |
import org.eclipse.draw2d.FreeformLayer; |
21 |
import org.eclipse.draw2d.FreeformLayer; |
22 |
import org.eclipse.draw2d.FreeformLayout; |
22 |
import org.eclipse.draw2d.FreeformLayout; |
23 |
import org.eclipse.draw2d.FreeformViewport; |
23 |
import org.eclipse.draw2d.FreeformViewport; |
|
|
24 |
import org.eclipse.draw2d.Graphics; |
24 |
import org.eclipse.draw2d.IFigure; |
25 |
import org.eclipse.draw2d.IFigure; |
25 |
import org.eclipse.draw2d.LayoutAnimator; |
26 |
import org.eclipse.draw2d.LayoutAnimator; |
|
|
27 |
import org.eclipse.draw2d.MouseListener; |
26 |
import org.eclipse.draw2d.MouseMotionListener; |
28 |
import org.eclipse.draw2d.MouseMotionListener; |
27 |
import org.eclipse.draw2d.SWTEventDispatcher; |
29 |
import org.eclipse.draw2d.SWTEventDispatcher; |
28 |
import org.eclipse.draw2d.ScalableFigure; |
30 |
import org.eclipse.draw2d.ScalableFigure; |
Lines 101-106
Link Here
|
101 |
LayoutAlgorithm layoutAlgorithm = null; |
103 |
LayoutAlgorithm layoutAlgorithm = null; |
102 |
private Dimension preferredSize = null; |
104 |
private Dimension preferredSize = null; |
103 |
int style = 0; |
105 |
int style = 0; |
|
|
106 |
private boolean antiAliasing; |
104 |
|
107 |
|
105 |
private ScalableFreeformLayeredPane rootlayer; |
108 |
private ScalableFreeformLayeredPane rootlayer; |
106 |
private ZestRootLayer zestRootLayer; |
109 |
private ZestRootLayer zestRootLayer; |
Lines 161-167
Link Here
|
161 |
}); |
164 |
}); |
162 |
|
165 |
|
163 |
this.setContents(createLayers()); |
166 |
this.setContents(createLayers()); |
164 |
DragSupport dragSupport = new DragSupport(this); |
167 |
IDragSupport dragSupport = createDragSupport(); |
165 |
this.getLightweightSystem().getRootFigure().addMouseListener(dragSupport); |
168 |
this.getLightweightSystem().getRootFigure().addMouseListener(dragSupport); |
166 |
this.getLightweightSystem().getRootFigure().addMouseMotionListener(dragSupport); |
169 |
this.getLightweightSystem().getRootFigure().addMouseMotionListener(dragSupport); |
167 |
|
170 |
|
Lines 465-474
Link Here
|
465 |
|
468 |
|
466 |
} |
469 |
} |
467 |
|
470 |
|
|
|
471 |
public interface IDragSupport extends MouseMotionListener, MouseListener { |
472 |
|
473 |
} |
474 |
|
475 |
protected IDragSupport createDragSupport() { |
476 |
return new DragSupport(this); |
477 |
} |
478 |
|
468 |
// ///////////////////////////////////////////////////////////////////////////////// |
479 |
// ///////////////////////////////////////////////////////////////////////////////// |
469 |
// PRIVATE METHODS. These are NON API |
480 |
// PRIVATE METHODS. These are NON API |
470 |
// ///////////////////////////////////////////////////////////////////////////////// |
481 |
// ///////////////////////////////////////////////////////////////////////////////// |
471 |
class DragSupport implements MouseMotionListener, org.eclipse.draw2d.MouseListener { |
482 |
class DragSupport implements IDragSupport { |
472 |
/** |
483 |
/** |
473 |
* |
484 |
* |
474 |
*/ |
485 |
*/ |
Lines 1043-1049
Link Here
|
1043 |
} |
1054 |
} |
1044 |
|
1055 |
|
1045 |
private ScalableFigure createLayers() { |
1056 |
private ScalableFigure createLayers() { |
1046 |
rootlayer = new ScalableFreeformLayeredPane(); |
1057 |
rootlayer = new ScalableFreeformLayeredPane() { |
|
|
1058 |
public void paint(Graphics graphics) { |
1059 |
if (isAntiAliasing()) { |
1060 |
graphics.setAntialias(SWT.ON); |
1061 |
} |
1062 |
|
1063 |
super.paint(graphics); |
1064 |
} |
1065 |
}; |
1047 |
rootlayer.setLayoutManager(new FreeformLayout()); |
1066 |
rootlayer.setLayoutManager(new FreeformLayout()); |
1048 |
zestRootLayer = new ZestRootLayer(); |
1067 |
zestRootLayer = new ZestRootLayer(); |
1049 |
|
1068 |
|
Lines 1164-1171
Link Here
|
1164 |
return GraphItem.GRAPH; |
1183 |
return GraphItem.GRAPH; |
1165 |
} |
1184 |
} |
1166 |
|
1185 |
|
1167 |
GraphItem getGraphItem(IFigure figure) { |
1186 |
public GraphItem getGraphItem(IFigure figure) { |
1168 |
return (GraphItem) figure2ItemMap.get(figure); |
1187 |
return (GraphItem) figure2ItemMap.get(figure); |
1169 |
} |
1188 |
} |
1170 |
|
1189 |
|
|
|
1190 |
public boolean isAntiAliasing() { |
1191 |
return antiAliasing; |
1192 |
} |
1193 |
|
1194 |
public void setAntiAliasing(boolean antiAliasing) { |
1195 |
this.antiAliasing = antiAliasing; |
1196 |
} |
1171 |
} |
1197 |
} |