Package org.openscience.jchempaint.renderer.elements

Examples of org.openscience.jchempaint.renderer.elements.TextElement


                                    totalBounds.getMaxY()+d,
                                    totalBounds.getMaxX()+d,
                                    totalBounds.getMinY()-d,
                                    model.getForeColor()));
        if (reaction.getID() != null) {
          diagram.add(new TextElement((totalBounds.getMinX()
                                      +totalBounds.getMaxX())/2,
                                      totalBounds.getMinY()-d,
                                      reaction.getID(),
                                      model.getForeColor()));
        }
View Full Code Here


    if (label.equals(APO2_LABEL)) {
      xOffset+=0.1; //prevent two labels possibly on top of each other, when apo1==apo2
    }
   
    diagram.add(new TextElement(apoAtom.getPoint2d().x+xOffset,apoAtom.getPoint2d().y+yOffset,label,APO_LABEL_COLOR));
  }
View Full Code Here

        int bondNum=bondItr.next();
        IBond b = bonds.get(bondNum);
        if (ac.contains(b)) {
              double xAvg = (b.getAtom(0).getPoint2d().x + b.getAtom(1).getPoint2d().x)/2;
              double yAvg = (b.getAtom(0).getPoint2d().y + b.getAtom(1).getPoint2d().y)/2;
              diagram.add(new TextElement(xAvg+0.1, yAvg-0.1,(bondNum==1?APO1_LABEL:APO2_LABEL),APO_LABEL_COLOR));
        }
      }
    }
  }
View Full Code Here

    int number = 1;
    for (IAtom atom : ac.atoms()) {
      Point2d p = atom.getPoint2d();
      numbers.add(
          new TextElement(
              p.x, p.y, String.valueOf(number), Color.BLACK));
      number++;
    }
    return numbers;
  }
View Full Code Here

        double minX = totalBounds.getMinX();
        double minY = totalBounds.getMinY();
        double maxX = totalBounds.getMaxX();
        double maxY = totalBounds.getMaxY();
        Color c = Color.GRAY;
        diagram.add(new TextElement(
                        (minX+maxX)/2, minY-d, (String)ac.getProperty(CDKConstants.TITLE), c,0.8));
        return diagram;
    }
View Full Code Here

        diagram.add(new RectangleElement(totalBounds.getMinX()-DISTANCE,
                                    totalBounds.getMaxY()+DISTANCE,
                                    totalBounds.getMaxX()+DISTANCE,
                                    totalBounds.getMinY()-DISTANCE,
                                    model.getForeColor()));
        diagram.add(new TextElement((totalBounds.getMinX()+totalBounds.getMaxX())/2, totalBounds.getMinY()-DISTANCE, "Products", model.getForeColor()));
        return diagram;
  }
View Full Code Here

        double maxX = totalBounds.getMaxX();
        double maxY = totalBounds.getMaxY();
        Color c = model.getForeColor();
        diagram.add(new RectangleElement(
                        minX - d, maxY + d, maxX + d, minY - d, c));
        diagram.add(new TextElement(
                        (minX+maxX)/2, minY-d, "Reactants", c));
        return diagram;
  }
View Full Code Here

  }
 
  public TextElement makePlus(
          Rectangle2D a, Rectangle2D b, double axis, Color color) {
      double x = (a.getCenterX() + b.getCenterX()) / 2;
      return new TextElement(x, axis, "+", color);
  }
View Full Code Here

    public IRenderingElement generate(IAtomContainer ac, RendererModel model) {
        if(hub.getPhantomText()==null)
            return new ElementGroup();
        else
            return new TextElement(hub.getPhantomTextPosition().x, hub.getPhantomTextPosition().y, hub.getPhantomText(), Color.GRAY);
    }
View Full Code Here

TOP

Related Classes of org.openscience.jchempaint.renderer.elements.TextElement

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.