Package org.rascalmpl.library.vis.figure

Examples of org.rascalmpl.library.vis.figure.Figure


  private double maxMinWidthOfAutoElement(Dimension d){
    double maxMinWidth = 0;
    for(int i = 0; i < getNrColumns(d); i++){
      boolean columnUnresizable  = columnsSize.get(d)[i].sizeInfo == SizeInfo.UNRESIZABLE;
      for(int j = 0 ; j < getNrRows(d) ; j++){
        Figure elem = getFigureFromMatrix(d, j,i);
       
        if(!elem.prop.is2DPropertySet(d, SHRINK) && !columnUnresizable){
          maxMinWidth = Math.max(maxMinWidth,elem.minSize.get(d));
        }
      }
View Full Code Here


    double minSizeOfGrid = 0;
    boolean resizable = false;
    boolean autoSize = true;
    boolean allShrinkSet = true;
    for(int row = 0 ; row < getNrRows(d); row++){
      Figure fig = getFigureFromMatrix(d, row, column);
      resizable= resizable || fig.resizable.get(d);
      if(fig.resizable.get(d) && fig.prop.is2DPropertySet(d, SHRINK)){
        autoSize = false;
        maxShrink = Math.max(maxShrink, fig.prop.get2DReal(d, SHRINK));
        minSizeOfGrid = Math.max(minSizeOfGrid, fig.minSize.get(d) / fig.prop.get2DReal(d, SHRINK));
View Full Code Here

        case NONE_SHRINK_SET: colWidth =sizeOfAutoElement ; break;
        case UNRESIZABLE: colWidth = s.minSize + extraSpaceForUnresizableCols; break;
      }
     
      for(int row = 0 ; row < getNrRows(d); row++){
        Figure elem = getFigureFromMatrix(d,row,column);
        if(elem.prop.is2DPropertySet(d, SHRINK)){
          elem.size.set(d, elem.prop.get2DReal(d, SHRINK)*spaceForColumns);
        } else if(!elem.resizable.get(d)){
          elem.size.set(d,elem.minSize.get(d));
        } else {
View Full Code Here

        gap = majorSizeLeftExcludingGaps / (double)nrOfGaps;
      } else {
        x = (majorSizeLeftExcludingGaps - (nrOfGaps * gap)) * prop.getReal(Properties.INNER_ALIGN);
      }
      for(int j = startOfRow ; j < endOfRow ; j++){
        Figure child = children[j];
        child.size.set(child.minSize);
        child.localLocation.set(major, x);
        child.localLocation.set(minor, y + ( (maxMinor - child.minSize.get(minor)) * prop.get2DReal(minor,ALIGN)));
        x+= child.minSize.get(major) + gap;
      }
View Full Code Here

    this.env = env;
    runTimePropertyAdjuster = new RunTimePropertyAdjuster(this);
    children = new ArrayList<FigureSWTApplet>();
    overlapFigures = new LinkedList<Overlap>();
 
    Figure fig = FigureFactory.make(this, cfig, null, null);
    if(!fig.widthDependsOnHeight()){
      fig = new WhiteSpace( fig, new PropertyManager());
    }
    this.figure = fig;
    inputHandler = new InputHandler(this, overlapFigures);
    viewPortHandler = new ViewPortHandler(this,overlapFigures);
View Full Code Here

    this.nodes = new ArrayList<SpringGraphNode>();
    this.env = fpa.getCallBackEnv();
    registered = new HashMap<String,SpringGraphNode>();
    for(IValue v : nodes){
      IConstructor c = (IConstructor) v;
      Figure fig = FigureFactory.make(fpa, c, properties, null);
      String name = fig.prop.getStr(ID);

      if(name.length() == 0)
        throw RuntimeExceptionFactory.figureException("Id property should be defined", v, fpa.getRascalContext().getCurrentAST(), fpa.getRascalContext().getStackTrace());
View Full Code Here

    if(children.length == 1) return;
    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);
View Full Code Here

    }
  }
 
  @Override
  public void initElem(IFigureConstructionEnv env, MouseOver mparent, boolean swtSeen, boolean visible, NameResolver resolver){
    Figure fig = resolver.resolveFigure(projectOnId.getValue());
    if(fig instanceof Screen){
      Screen hs = (Screen)fig;
      hs.registerProjection(this);
    }
  }
View Full Code Here

    innerFig.globalLocation.set(globalLocation);
    innerFig.resize(view,transform);
    double majorSpaceForProjection = size.get(major) - innerFig.size.get(major);
    double majorProjectionOffset = innerFig.size.get(major) * (1.0 - innerFig.prop.get2DReal(major, ALIGN));
    for(Projection p : projections){
      Figure pFrom = p.projectFrom;
      Figure pr = p.projection;
      double projectFromMinor =
        pFrom.globalLocation.get(minor) - globalLocation.get(minor);
      pr.size.set(minor, pFrom.size.get(minor) * pr.prop.get2DReal(minor, SHRINK));
      pr.size.set(major,majorSpaceForProjection * pr.prop.get2DReal(major, SHRINK ));
      pr.size.setMax(pr.minSize);
      pr.localLocation.set(minor,projectFromMinor + (pFrom.size.get(minor) - pr.size.get(minor)) * pr.prop.get2DReal(minor, ALIGN));
      pr.localLocation.set(major,majorProjectionOffset + (majorSpaceForProjection - pr.size.get(major))* pr.prop.get2DReal(major, ALIGN));
      pr.globalLocation.set(globalLocation);
      pr.resize(view, transform);
    }
  }
View Full Code Here

          break;
        } else if(other.getFrom() == e.getTo() && other.getTo() == e.getFrom()){
          // Reverse edge, copy its arrows
          if(debug)System.err.println("Found reverse edge");
         
          Figure toArrow = e.toArrow;
          //if(toArrow != null)
          //  children.add(toArrow);
          if(toArrow != null && other.fromArrow == null)
            other.fromArrow = toArrow;
         
          Figure fromArrow = e.fromArrow;
          //if(fromArrow != null)
          //  children.add(fromArrow);
         
          if(fromArrow != null && other.toArrow == null)
            other.toArrow = fromArrow;
View Full Code Here

TOP

Related Classes of org.rascalmpl.library.vis.figure.Figure

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.