Package org.rascalmpl.library.vis.util.vector

Examples of org.rascalmpl.library.vis.util.vector.BoundingBox


  }
 
  @Override
  public void computeMinSize(){
    //super.computeMinSize();
    BoundingBox iminSize = widget.getFigure().minSize;
    org.eclipse.swt.graphics.Rectangle r = widget.computeTrim(0, 0, FigureMath.ceil(iminSize.getX()), FigureMath.ceil(iminSize.getY()));
    minSize.set(r.width +1 ,r.height +1);
    Dimension minor = major.other();
    minSize.set(minor, Math.ceil(iminSize.get(minor))  );
  }
View Full Code Here


 
  protected WidthDependsOnHeight(Dimension major, Figure[] figures, PropertyManager properties) {
    super(figures, properties);
    this.major = major;
    minor = major.other();
    realSize = new BoundingBox();
  }
View Full Code Here

  boolean initialized = false;
  BoundingBox oldSize;

  public Pack( Figure[] figures, PropertyManager properties) {
    super(Dimension.X, figures, properties);
    oldSize = new BoundingBox();
  }
View Full Code Here

 
  public class CompareAspectSize implements Comparator<Figure>{

    @Override
    public int compare(Figure o1, Figure o2) {
      BoundingBox lhs = o1.minSize;
      BoundingBox rhs = o2.minSize;
      double r = (lhs.getY() > lhs.getX()) ? lhs.getY() / lhs.getX() : lhs.getX() / lhs.getY();
      double or = (rhs.getY() > rhs.getX()) ? rhs.getY() / rhs.getX() : rhs.getX() / rhs.getY();
           
      if (r < 2.0 && or < 2.0) {
        double s = lhs.getX() * lhs.getY();
        double os = rhs.getX() * rhs.getY();
        return s < os ? 1 : (s == os ? 0 : -1);
      }
      return r < or ? 1 : (r == or ? 0 : -1);
    }
View Full Code Here

 
  public ViewPortHandler(FigureSWTApplet parent, List<Overlap> overlapFigures){
    this.parent = parent;
    this.figure = parent.getFigure();
    this.overlapFigures = overlapFigures;
    parentSize = new BoundingBox();
    viewPortLocation = new Coordinate(0,0);
    zoom = new Coordinate(1,1);
    viewPortSize = new BoundingBox();
    setScrollbars();
    horBar = parent.getHorizontalBar();
    verBar = parent.getVerticalBar();
    int horY = horBar == null ? 0 : horBar.getSize().y;
    int verX = verBar == null ? 0 : verBar.getSize().x;
    scrollbarSize = new BoundingBox(verX, horY);
    for(Dimension d: HOR_VER){
      if(scrollBars.get(d) != null){
        scrollBars.get(d).setVisible(false);
      }
    }
    if(horBar != null){
      horBar.addSelectionListener(this);
    }
    if(verBar != null){
      verBar.addSelectionListener(this);
    }
    scrollBarsVisible = new TwoDimensional<Boolean>(false, false);
    scrollableMinSize = new BoundingBox(MIN_SIZE + scrollbarSize.getX(), MIN_SIZE+ scrollbarSize.getY());
    swtVisiblityMangager = new SWTElementsVisibilityManager();
    zorderManager = new SWTZOrderManager(parent,overlapFigures);
    gc = new SWTGraphicsContext();
    topLevel = new TransformMatrix();
    viewPortRectangle = new Rectangle(viewPortLocation, viewPortSize);
View Full Code Here

  public Text(PropertyManager properties,PropertyValue<String> txt) {
    super( properties);
    this.txt = txt;
    children = childless;
    minSizeUnrotated = new BoundingBox();
    mf = null;
  }
View Full Code Here

  public Coordinate globalLocation; //
  public TwoDimensional<Boolean> resizable;

  public Figure(PropertyManager properties) {
    this.prop = properties;
    minSize = new BoundingBox();
    size = new BoundingBox();
    localLocation = new Coordinate();
    globalLocation = new Coordinate();
    resizable = new TwoDimensional<Boolean>(true, true);
    sequenceNr = sequencer;
    sequencer++;
View Full Code Here

  public int compareTo(Figure o) {
    return sequenceNr - o.sequenceNr;
  }

  public BoundingBox getMinViewingSize() {
    BoundingBox minViewSize = new BoundingBox();
    minViewSize.set(minSize.getX() / prop.getReal(HGROW), minSize.getY() /prop.getReal(VGROW) );
    return minViewSize;
  }
View Full Code Here

  BoundingBox minExtraSizeForProjections;
 
  public Screen(Figure inner, PropertyManager properties) {
    super(inner, properties);
    projections = new ArrayList<Projection>();
    minExtraSizeForProjections = new BoundingBox();
  }
View Full Code Here

  }
 
  @Override
  public void computeMinSize(){
    setChildren();
    BoundingBox spaceForProjections = new BoundingBox();
    minSize.set(innerFig.minSize);
    for(Dimension d : HOR_VER){
      minSize.set(d,minSize.get(d) / innerFig.prop.get2DReal(d, SHRINK));
      spaceForProjections.set(d,minSize.get(d) * (1.0-innerFig.prop.get2DReal(d, SHRINK)));
    }
    for(Projection p : projections){
      for(Dimension d : HOR_VER){
        spaceForProjections.setMax(d, p.projection.minSize.get(d) / p.projection.prop.get2DReal(d, SHRINK));
      }
    }
    for(Dimension d: HOR_VER){
      double left = innerFig.minSize.get(d) * prop.get2DReal(d, ALIGN) - spaceForProjections.get(d);
      double right = innerFig.minSize.get(d) * prop.get2DReal(d, ALIGN) + spaceForProjections.get(d);
      double oldMinSize = minSize.get(d);
      minSize.setMax(d,right - left);
      minExtraSizeForProjections.set(d,minSize.get(d) - oldMinSize);
    }
  }
View Full Code Here

TOP

Related Classes of org.rascalmpl.library.vis.util.vector.BoundingBox

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.