Пример #1
0
 /*
  * When paint is called, draw all the shapes currently in the model and draw a string showing the name of the shape
  * (non-Javadoc)
  * @see java.awt.Container#paint(java.awt.Graphics)
  */
 public void paint(Graphics g) {
   shapesToDraw = model.getShapeArray();
   for (Shape shape : shapesToDraw) {
     if (shape != null) {
       shape.draw(g); // draw shape at index i
       g.drawString(
           "Shape " + (shapesToDraw.indexOf(shape) + 1),
           shape.getX1(),
           shape.getY1()); // Draw labels on each shape
     }
     System.out.println(model);
     System.out.println(shape);
   }
 }
Пример #2
0
 public String toString() {
   String s = "Crystal idx: " + (int) idx;
   s += "\nShape: " + shape.toString();
   s += "\n\tAxial growth rates: " + Arrays.toString(axialGrowthRates);
   s += "\n\tInitial dimensions: " + Arrays.toString(initDims);
   s += "\n\tNucleation time: " + ne.getTime();
   s += "\n\tNucleation location: " + ne.getLocation().toString();
   return s;
 }
Пример #3
0
 public boolean isInside(JVector pos) {
   return shape.isInside(curAxes, pos);
 }
Пример #4
0
 public JVector[] getNucOrient() {
   return shape.getUnitAxes();
 }