Package org.gvt.model

Examples of org.gvt.model.CompoundModel


      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

    CTabItem tab = main.createNewTab(graph);

    if (refsToHighlight != null && !refsToHighlight.isEmpty())
    {
      ScrollingGraphicalViewer viewer = main.getTabToViewerMap().get(tab);
      CompoundModel root = (CompoundModel) viewer.getContents().getModel();

      if (root instanceof BioPAXGraph)
      {
        new HighlightWithRefAction(main, (BioPAXGraph) root, refsToHighlight).run();
      }
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 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

  // 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

        getZoomManager().setZoom(1);
      ((ChsScalableRootEditPart) this.main.getViewer().getRootEditPart()).
        getZoomManager().setViewLocation(new Point(0, 0));

      // Calculate the marque zoom rectangle to zoom.
      CompoundModel root = (CompoundModel)
        ((ChsRootEditPart)this.main.getViewer().getRootEditPart().
          getChildren().get(0)).getModel();
      Rectangle r = root.calculateBounds();

      // Graph Margins are added
      r.expand(LGraph.getGraphMargin(), LGraph.getGraphMargin());

      // Zoom to rectangle to fit in window
View Full Code Here

  public void run()
  {
    if (main.getViewer() == null) return;

    CompoundModel root = (CompoundModel) ((ChsRootEditPart)main.getViewer().
      getRootEditPart().getChildren().get(0)).getModel();

    Iterator<NodeModel> nodeIter = root.getNodes().iterator();

    while (nodeIter.hasNext())
    {
      NodeModel node = nodeIter.next();
      node.setHighlight(false);
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 void closeTab(CTabItem tab, boolean rememberLayout)
  {
    ScrollingGraphicalViewer viewer = tabToViewerMap.get(tab);
    CompoundModel root = (CompoundModel) viewer.getContents().getModel();

    if (root instanceof BioPAXGraph)
    {
      BioPAXGraph graph = (BioPAXGraph) root;
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.