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

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


    SWTGraphicsContext swtGC = new SWTGraphicsContext();
    swtGC.setGC(gc);
   
    gc.setBackground(getDisplay().getSystemColor(SWT.COLOR_WHITE));

    figure.draw(new Coordinate(1.0, 1.0), swtGC, new Rectangle(0, 0, figureWidth, figureHeight), new SWTElementsVisibilityManager().getVisibleSWTElementsVector());
 
    ImageLoader il = new ImageLoader();
    il.data = new ImageData[] {image.getImageData()};
    il.save(to, SWT.IMAGE_PNG);
  }
View Full Code Here


    figuresUnderMouseSorted = new ArrayList<Figure>();
    figuresUnderMouseSortedPrev = new ArrayList<Figure>();
    newUnderMouse = new ArrayList<Figure>();
    noLongerUnderMouse = new ArrayList<Figure>();
   
    mouseLocation = new Coordinate(-10,-10);
    this.figure = parent.getFigure();
    this.env = parent.getExectutionEnv();
    this.overlapFigures = overlapFigures;
    this.parent = parent;
   
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;
View Full Code Here

    if(debug) System.err.println("edge: (" + getFrom().name + ": " + getFrom().getCenterX() + "," + getFrom().getCenterY() + ") -> (" +
        to.name + ": " + to.getCenterX() + "," + to.getCenterY() + ")");

    double globalX = globalLocation.getX();
    double globalY = globalLocation.getY();
    Coordinate centerFrom = getFrom().figure.getGlobalCenter();
    Coordinate centerTo = getTo().figure.getGlobalCenter();
   
    applyProperties(gc);
    gc.line(centerFrom.getX(), centerFrom.getY(), centerTo.getX(), centerTo.getY());
   
    if(toArrow != null){
      getTo().figure.connectArrowFrom(
          globalX + getTo().getCenterX(), globalY + getTo().getCenterY(),
          globalX + getFrom().getCenterX(), globalY + getFrom().getCenterY(),
View Full Code Here

  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

  Coordinate getChildCenter(int i){
    double majorPos = children[i].globalLocation.get(major) ;
    if(majorFlipped()){
      majorPos += children[i].size.get(major);
    }
    return new Coordinate(major,majorPos,getMinorCenter(i));
  }
View Full Code Here

    double hg = prop.get2DReal(major, GAP)/2.0;
    if(majorFlipped()){
      hg=-hg;
    }
    Figure root = children[0];
    Coordinate fromRoot = new Coordinate(major,getBottomRoot(),root.globalLocation.get(minor) + root.size.get(minor)/2.0);
   
    if(prop.getBool(MANHATTAN_LINES)){
      Coordinate toCenter = new Coordinate(fromRoot);
      toCenter.add(major,hg);
      drawLine(gc,fromRoot,toCenter);
      Coordinate from = getChildCenter(1);
      Coordinate to = getChildCenter(children.length-1);
      from.add(major,-hg);
      to.add(major,-hg);
      drawLine(gc,from,to);
    }
    for(int i = 1; i < children.length ; i++){
      Coordinate child = getChildCenter(i);
      Coordinate from;
      if(prop.getBool(MANHATTAN_LINES)){
        from = new Coordinate(child);
        from.add(major,-hg);
      } else {
        from = fromRoot;
      }
      drawLine(gc,from,child);
    }
View Full Code Here

    toArrow.drawElement(gc,visibleSWTElements);
    gc.popMatrix();
  }
 
  public Coordinate getGlobalCenter(){
    return new Coordinate(globalLocation.getX() + size.getX()/2, globalLocation.getY() + size.getY()/2);
  }
View Full Code Here

  public Coordinate getGlobalCenter(){
    return new Coordinate(globalLocation.getX() + size.getX()/2, globalLocation.getY() + size.getY()/2);
  }
 
  public Coordinate getLocalCenter(){
    return new Coordinate(localLocation.getX() + size.getX()/2, localLocation.getY() + size.getY()/2);
  }
View Full Code Here

        return Math.max(l, r);
      }
    }
   
    void add(double major, double minor){
      outline.add(new Coordinate(major,minor));
    }
View Full Code Here

TOP

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

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.