Search in sources :

Example 1 with Layer

use of org.eclipse.draw2d.Layer in project webtools.sourceediting by eclipse.

the class RootEditPart method createPrintableLayers.

protected LayeredPane createPrintableLayers() {
    LayeredPane pane = super.createPrintableLayers();
    Layer layer = new ScaledHandleLayer();
    layer.setPreferredSize(new Dimension(5, 5));
    pane.add(layer, DesignViewerGraphicConstants.SCALED_HANDLE_LAYER);
    return pane;
}
Also used : LayeredPane(org.eclipse.draw2d.LayeredPane) Dimension(org.eclipse.draw2d.geometry.Dimension) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer) Layer(org.eclipse.draw2d.Layer)

Example 2 with Layer

use of org.eclipse.draw2d.Layer in project archi by archimatetool.

the class GraphicalRootEditPart method createFigure.

/**
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {
    innerLayers = new LayeredPane();
    printableLayers = new LayeredPane();
    Layer layer = new Layer();
    layer.setLayoutManager(new StackLayout());
    printableLayers.add(layer, PRIMARY_LAYER);
    layer = new ConnectionLayer();
    layer.setPreferredSize(new Dimension(5, 5));
    printableLayers.add(layer, CONNECTION_LAYER);
    innerLayers.add(printableLayers, PRINTABLE_LAYERS);
    layer = new Layer();
    layer.setPreferredSize(new Dimension(5, 5));
    innerLayers.add(layer, HANDLE_LAYER);
    layer = new FeedbackLayer();
    layer.setPreferredSize(new Dimension(5, 5));
    innerLayers.add(layer, FEEDBACK_LAYER);
    ScrollPane pane = new ScrollPane();
    pane.setViewport(new Viewport(true));
    pane.setContents(innerLayers);
    return pane;
}
Also used : LayeredPane(org.eclipse.draw2d.LayeredPane) ScrollPane(org.eclipse.draw2d.ScrollPane) StackLayout(org.eclipse.draw2d.StackLayout) Viewport(org.eclipse.draw2d.Viewport) Dimension(org.eclipse.draw2d.geometry.Dimension) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer) Layer(org.eclipse.draw2d.Layer) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer)

Example 3 with Layer

use of org.eclipse.draw2d.Layer in project archi by archimatetool.

the class ScalableRootEditPart method createLayers.

/**
 * Creates the top-most set of layers on the given layered pane
 *
 * @param layeredPane
 *            the parent for the created layers
 */
protected void createLayers(LayeredPane layeredPane) {
    layeredPane.add(getScaledLayers(), SCALABLE_LAYERS);
    layeredPane.add(new Layer() {

        @Override
        public Dimension getPreferredSize(int wHint, int hHint) {
            return new Dimension();
        }
    }, HANDLE_LAYER);
    layeredPane.add(new FeedbackLayer(), FEEDBACK_LAYER);
    layeredPane.add(new GuideLayer(), GUIDE_LAYER);
}
Also used : Dimension(org.eclipse.draw2d.geometry.Dimension) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer) Layer(org.eclipse.draw2d.Layer) Point(org.eclipse.draw2d.geometry.Point)

Example 4 with Layer

use of org.eclipse.draw2d.Layer in project archi by archimatetool.

the class ScalableRootEditPart method createPrintableLayers.

/**
 * Creates a layered pane and the layers that should be printed.
 *
 * @see org.eclipse.gef.print.PrintGraphicalViewerOperation
 * @return a new LayeredPane containing the printable layers
 */
protected LayeredPane createPrintableLayers() {
    LayeredPane pane = new LayeredPane();
    Layer layer = new Layer();
    layer.setLayoutManager(new StackLayout());
    pane.add(layer, PRIMARY_LAYER);
    layer = new ConnectionLayer();
    layer.setPreferredSize(new Dimension(5, 5));
    pane.add(layer, CONNECTION_LAYER);
    return pane;
}
Also used : LayeredPane(org.eclipse.draw2d.LayeredPane) ScalableLayeredPane(org.eclipse.draw2d.ScalableLayeredPane) StackLayout(org.eclipse.draw2d.StackLayout) Dimension(org.eclipse.draw2d.geometry.Dimension) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer) Layer(org.eclipse.draw2d.Layer) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer)

Example 5 with Layer

use of org.eclipse.draw2d.Layer in project liferay-ide by liferay.

the class LayoutTplRootEditPart method createLayers.

protected void createLayers(LayeredPane layeredPane) {
    /*
		 * layeredPane.add(getScaledLayers(), SCALABLE_LAYERS);
		 * layeredPane.add(getPrintableLayers(), PRINTABLE_LAYERS);
		 */
    Layer layer = new Layer();
    layer.setLayoutManager(new StackLayout());
    layeredPane.add(layer, PRIMARY_LAYER);
    Layer handleLayer = new Layer() {

        public Dimension getPreferredSize(int wHint, int hHint) {
            return new Dimension();
        }
    };
    layeredPane.add(handleLayer, HANDLE_LAYER);
    layeredPane.add(new FeedbackLayer(), FEEDBACK_LAYER);
}
Also used : StackLayout(org.eclipse.draw2d.StackLayout) Dimension(org.eclipse.draw2d.geometry.Dimension) Layer(org.eclipse.draw2d.Layer)

Aggregations

Layer (org.eclipse.draw2d.Layer)5 Dimension (org.eclipse.draw2d.geometry.Dimension)5 ConnectionLayer (org.eclipse.draw2d.ConnectionLayer)4 LayeredPane (org.eclipse.draw2d.LayeredPane)3 StackLayout (org.eclipse.draw2d.StackLayout)3 ScalableLayeredPane (org.eclipse.draw2d.ScalableLayeredPane)1 ScrollPane (org.eclipse.draw2d.ScrollPane)1 Viewport (org.eclipse.draw2d.Viewport)1 Point (org.eclipse.draw2d.geometry.Point)1