package info.limpet.stackedcharts.ui.editor.figures;

import org.eclipse.draw2d.FlowLayout;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.LayoutManager;
import org.eclipse.draw2d.Shape;

/**
 * A Draw2D container {@link Shape} that orders its children in row or in a column based on the
 * {@link #isVertical()} property. It uses internal layout, clients should not attempt to set new
 * {@link LayoutManager}.
 */
public class DirectionalShape extends Shape
{

  private boolean vertical;

  public DirectionalShape()
  {
    super.setLayoutManager(new DirectionFlowLayout());
  }

  @Override
  protected void fillShape(Graphics graphics)
  {
  }

  @Override
  protected void outlineShape(Graphics graphics)
  {
  }

  /**
   * @see #setVertical(boolean)
   * @return
   */
  public boolean isVertical()
  {
    return vertical;
  }

  /**
   * @param vertical
   *          when <code>true</code> children will be laid out from bottom to top
   */
  public void setVertical(boolean vertical)
  {
    this.vertical = vertical;
    ((FlowLayout) getLayoutManager()).setHorizontal(!vertical);
  }

  /**
   * Not intended to be called
   */
  @Override
  public void setLayoutManager(LayoutManager manager)
  {
    throw new UnsupportedOperationException("Layout manager is read-only");
  }
}

@@ -89,44 +89,8 @@
 ut;%0A
-import org.eclipse.draw2d.Graphics;%0A
 impo
@@ -152,20 +152,30 @@
 .draw2d.
-Shap
+RectangleFigur
 e;%0A%0A/**%0A
@@ -203,20 +203,30 @@
  %7B@link 
-Shap
+RectangleFigur
 e%7D that 
@@ -276,18 +276,18 @@
 ased
+%0A *
  on the
-%0A *
  %7B@l
@@ -377,15 +377,15 @@
  set
+%0A *
  new
-%0A *
  %7B@l
@@ -446,20 +446,30 @@
 extends 
-Shap
+RectangleFigur
 e%0A%7B%0A%0A  p
@@ -587,142 +587,28 @@
 ;%0A  
-%7D%0A%0A  @Override%0A  protected void fillShape(Graphics graphics)%0A  %7B%0A  %7D%0A%0A  @Override%0A  protected void outlineShape(Graphics graphics)%0A  %7B
+  setOutline(false);
 %0A  %7D

fix highlight of scatter set container on mouse drop