Package org.gvt.model

Examples of org.gvt.model.CompoundModel


    }
  }

  public Rectangle getBounds(ScrollingGraphicalViewer viewer, Figure f)
  {
    CompoundModel rootModel = (CompoundModel) ((ChsRootEditPart) viewer.
      getRootEditPart().getChildren().get(0)).getModel();

    org.eclipse.draw2d.geometry.Rectangle bounds
      = rootModel.calculateBounds();
    org.eclipse.draw2d.geometry.Rectangle boundsRoot = f.getBounds();

    boundsRoot.setSize(bounds.x + bounds.width + CompoundModel.MARGIN_SIZE,
      bounds.y + bounds.height + CompoundModel.MARGIN_SIZE);
View Full Code Here


    }

    try
    {
      // get the root of graph
      CompoundModel root = (CompoundModel)
        ((ChsRootEditPart) main.getViewer().getRootEditPart().
          getChildren().get(0)).getModel();

      BufferedWriter xmlFile =
        new BufferedWriter(new FileWriter(fileName));
View Full Code Here

    this.model = model;
  }

  public CompoundModel readXMLFile(File xmlFile)
  {
    CompoundModel root = null;

    XRef.clearDBSet();

    try
    {
View Full Code Here

    Ranker<CompoundModel> r = new Ranker<CompoundModel>();

    for (NodeModel neigh : neighbors)
    {
      if (neigh instanceof ComplexMember) neigh = neigh.getParentModel();
      CompoundModel cm = neigh.getParentModel();
      if (cm != null) r.count(cm);
    }

    List<List<CompoundModel>> list = r.getRankedList();
    if (list.isEmpty()) return;

    List<CompoundModel> firstGroup = list.get(0);

    CompoundModel comp;

    if (firstGroup.size() == 1)
    {
      comp = firstGroup.get(0);
    }
    else
    {
      for (NodeModel neigh : neighbors)
      {
        if (neigh instanceof ComplexMember) neigh = neigh.getParentModel();
        CompoundModel cm = neigh.getParentModel();
        if (cm != null) cm = cm.getParentModel();
        if (cm != null) r.count(cm);
      }

      list = r.getRankedList();
      List<CompoundModel> secondGroup = list.get(0);
View Full Code Here

  public void run()
  {
    try
    {
      main.lockWithMessage("Performing layout ...");
      CompoundModel root = (CompoundModel)((ChsRootEditPart) main.getViewer().
          getRootEditPart().getChildren().get(0)).getModel();

      LayoutCommand command = new LayoutCommand(main, new SpringLayout(root));
      command.execute();
    }
View Full Code Here

      File xmlfile = new File(filename);

      SIFReader reader = new SIFReader();

      CompoundModel root = reader.readXMLFile(xmlfile);

      if (root != null)
      {
        main.createNewTab(root);
View Full Code Here

  // Section: Traversing
  //----------------------------------------------------------------------------------------------

  public Collection<? extends Node> getParents()
  {
    CompoundModel p = this.getParentModel();
    Collection<Node> col = new ArrayList<Node>(1);

    if (p == null || p.isRoot())
    {
      return col;
    }
    else
    {
View Full Code Here

    }
  }

  public Rectangle getBounds(ScrollingGraphicalViewer viewer, Figure f, double zoom)
  {
    CompoundModel rootModel = (CompoundModel) ((ChsRootEditPart) viewer.
      getRootEditPart().getChildren().get(0)).getModel();

    org.eclipse.draw2d.geometry.Rectangle bounds
      = rootModel.calculateBounds();
    org.eclipse.draw2d.geometry.Rectangle boundsRoot = f.getBounds();

    boundsRoot.setSize((int) (bounds.x + ((bounds.width + CompoundModel.MARGIN_SIZE) * zoom)),
      (int) (bounds.y + ((bounds.height + CompoundModel.MARGIN_SIZE) * zoom)));

 
View Full Code Here

  // Section: Traversing
  //----------------------------------------------------------------------------------------------

  public Collection<? extends Node> getParents()
  {
    CompoundModel p = this.getParentModel();
    Collection<Node> col = new ArrayList<Node>(1);

    if (p == null || p.isRoot())
    {
      return col;
    }
    else
    {
View Full Code Here

    }
  }

  public Rectangle getBounds(ScrollingGraphicalViewer viewer, Figure f, double zoom)
  {
    CompoundModel rootModel = (CompoundModel) ((ChsRootEditPart) viewer.
      getRootEditPart().getChildren().get(0)).getModel();

    org.eclipse.draw2d.geometry.Rectangle bounds
      = rootModel.calculateBounds();
    org.eclipse.draw2d.geometry.Rectangle boundsRoot = f.getBounds();

    boundsRoot.setSize((int) (bounds.x + ((bounds.width + CompoundModel.MARGIN_SIZE) * zoom)),
      (int) (bounds.y + ((bounds.height + CompoundModel.MARGIN_SIZE) * zoom)));

 
View Full Code Here

TOP

Related Classes of org.gvt.model.CompoundModel

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.