go to previous page   go to home page   go to next page

Answer:

Yes.


Star replaces Circle

Star with Stars at end of Lines

The picture shows a star, but now at the end of each line is another star.

It sounds like this should be easy: instead of a Circle at the end of each line of the first star, add a star, instead. Something like this:



void addStar( Group root, Color color, double centerX, double centerY, double size )
{ 
 . . . . 
  
// upward slanting line
line  = new Line( startX, centerY, endX, centerY );
line.setStrokeWidth( 2.0 );
line.setStroke( color );

// make a Group 
grp   = new Group( line );   

// STARS at both ends
addStar( grp, color, centerX-size/2, centerY, size*0.3);
addStar( grp, color, centerX+size/2, centerY, size*0.3);

grp.setRotate( -60.0 );
root.getChildren().add( grp );   // add the group to the scene graph

 . . . .

The stars at the ends of the lines are reduced in size by a scale of 0.3.


QUESTION 19:

Looks like a good idea: call addStar( ) to add extra stars where needed.

What could go wrong?


go to previous page   go to home page   go to next page