Package org.sbml.jsbml.ext.layout

Examples of org.sbml.jsbml.ext.layout.Point


 
  /** Calculate the maximum and minium X and Y values for the given layout.
   * Is needed to set the unset nodes in the layout.
   */
  private void setXYRange(Collection<BoundingBox> boxes){
    Point point;
    double x;
    double y;
    boolean setX = false;
    boolean setY = false;
    if (min_x != 0.0 || max_x != 0.0){ setX = true; }
    if (min_y != 0.0 || max_y != 0.0){ setX = true; }
   
    for (BoundingBox box : boxes){
      point = box.getPosition();
      x = point.getX();
      y = point.getY();
      if (x != 0.0){
        if (!setX){
          min_x = x;
          max_x = x;
          setX = true;
View Full Code Here


          double zpos = 0.0;
          double height = nodeView.getHeight();
          double width = nodeView.getWidth();
          double depth = 0.0;
          Dimensions dim = new Dimensions(width, height, depth, level, version);
          Point point = new Point(xpos, ypos, zpos, level, version);
         
          BoundingBox box = new BoundingBox();
          box.setLevel(level);
          box.setVersion(version);
          box.setPosition(point);
View Full Code Here

    return box;
  }
   
  private static void setMissingBoundaryBoxInformation(BoundingBox box) {
    Dimensions dim;
    Point point;
    // Fill Dimension
    if (!box.isSetDimensions()) {
      dim = new Dimensions();
      dim.setHeight(GENERIC_HEIGHT);
      dim.setWidth(GENERIC_WIDTH);
      box.setDimensions(dim);
    } else {
      dim = box.getDimensions();
      if (!dim.isSetHeight()) {
        dim.setHeight(GENERIC_HEIGHT);
      }
      if (!dim.isSetWidth()) {
        dim.setWidth(GENERIC_WIDTH);
      }
    }
    // Fill Positions
    if (!box.isSetPosition()) {
      point = new Point();
      point.setX(GENERIC_X);
      point.setY(GENERIC_Y);
      box.setPosition(point);
    } else {
      point = box.getPosition();
      if (!point.isSetX()) {
        point.setX(GENERIC_X);
      }
      if (!point.isSetY()) {
        point.setY(GENERIC_Y);
      }
    }
  }
View Full Code Here

 
  private static BoundingBox createGenericBoundingBox(){
    Dimensions dim = new Dimensions();
    dim.setWidth(GENERIC_WIDTH);
    dim.setHeight(GENERIC_HEIGHT);
    Point point = new Point();
    point.setX(GENERIC_X);
    point.setY(GENERIC_Y);
    BoundingBox box = new BoundingBox();
    box.setDimensions(dim);
    box.setPosition(point);
    return box;
  }
View Full Code Here

  public void applyLayoutPositionsToNetwork(CyNetwork network){
   
    CyNetworkView view = Cytoscape.getNetworkView(network.getIdentifier());
      String key;
      BoundingBox box;
      Point point;
     
      double offset = 80.0;
      double current_x = min_x;
      double current_y = min_y - 2.0*offset;
     
      double x;
      double y;
     
    @SuppressWarnings("unchecked")
    List<Node> nodes = network.nodesList();
      for (Node node : nodes){
        key = node.getIdentifier();
        if (speciesBoundingBoxes.containsKey(key)){
          box = speciesBoundingBoxes.get(key);
        } else {
          box = reactionBoundingBoxes.get(key);
        }
       
        // set the position of the node
        giny.view.NodeView nodeView = view.getNodeView(node);
       
        point = box.getPosition();
        x = point.getX();
        y = point.getY();
       
        // layout generic nodes in grid
        if (x == GENERIC_X && y == GENERIC_Y){
          x = current_x;
          y = current_y;
View Full Code Here

 
  public void applyLayoutPositionsToLayoutNetwork(CyNetwork network){
    CyNetworkView view = Cytoscape.getNetworkView(network.getIdentifier());
      String key;
      BoundingBox box;
      Point point;
     
      double offset = 80.0;
      double current_x = min_x;
      double current_y = min_y - 2.0*offset;
     
      double x;
      double y;
     
    @SuppressWarnings("unchecked")
    List<Node> nodes = network.nodesList();
      for (Node node : nodes){
        key = node.getIdentifier();
        if (speciesGlyphBoundingBoxes.containsKey(key)){
          box = speciesGlyphBoundingBoxes.get(key);
        } else {
          box = reactionGlyphBoundingBoxes.get(key);
        }
       
        // set the position of the node
        giny.view.NodeView nodeView = view.getNodeView(node);
       
        point = box.getPosition();
        x = point.getX();
        y = point.getY();
       
        // layout generic nodes in grid
        if (x == GENERIC_X && y == GENERIC_Y){
          x = current_x;
          y = current_y;
View Full Code Here

          listOfElementsToWrite.add(layout.getListOfReactionGlyphs());
        } else if (layout.isSetListOfTextGlyphs()) {
          listOfElementsToWrite.add(layout.getListOfTextGlyphs());
        }
      } else if (sbase instanceof Point) {
        Point point = (Point) sbase;
        SBase parent = point.getParentSBMLObject();
        if (parent instanceof CurveSegment) {
          log4jLogger.debug(" curveSegment: point element name: "
              + point.getElementName());
        }
      }
    }

    if (listOfElementsToWrite.isEmpty()) {
View Full Code Here

            return listOfCurveSegments;
          }
        } else if (contextObject instanceof BoundingBox) {
          BoundingBox boundingBox = (BoundingBox) contextObject;
          if (elementName.equals("position")) {
            Point point = (Point) newContextObject;
            setNamespace(point, namespaceURI);
            boundingBox.setPosition(point);
            return point;
          } else if (elementName.equals("dimensions")) {
            Dimensions dimensions = (Dimensions) newContextObject;
            setNamespace(dimensions, namespaceURI);
            boundingBox.setDimensions(dimensions);
            return dimensions;
          }
        } else if (contextObject instanceof CurveSegment) {
          if (elementName.equals("start")) {
            CurveSegment lineSegment = (CurveSegment) contextObject;
            Point start = (Point) newContextObject;
            lineSegment.setStart(start);
            setNamespace(start, namespaceURI);
            return start;
          } else if (elementName.equals("end")) {
            CurveSegment lineSegment = (CurveSegment) contextObject;
            Point end = (Point) newContextObject;
            lineSegment.setEnd(end);
            setNamespace(end, namespaceURI);
            return end;
          } else if (elementName.equals("basePoint1")) {
            CubicBezier lineSegment = (CubicBezier) contextObject;
View Full Code Here

TOP

Related Classes of org.sbml.jsbml.ext.layout.Point

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.