java - How to make endless (infinite) nodes in Piccolo2D? -


I would like to draw some infinite objects in Piccolo2D, such as endless rectangular (cartesian) grid. It will be indifferent in the graphic editor on the grid as some geometrical object.

Unfortunately, Piccolo determines some kind, even if the color needs to be called and it does not apply to me appropriately.

The program below has yellow objects, which I want to make endless. This type is Pendles . I am adding this cycle as a child.

  Package test. Endless; Import java.awt.color; Import java.awt.geom.Rectangle2D; Import org.piccolo2d.PNode; Import org.piccolo2d.extras.PFrame; Import org.piccolo2d.nodes.PPath; Import org.piccolo2d.util.PPaintContext; The public class Try_PGrid {public static class PENDless PNode extends {@Override protected void paint (PPaintContext paintContext)} (rectangle 2D localclip = paint contact. Tolkoclip (); . PaintContext.getGraphics () setColor (Color.yellow); fill colorContext.getGraphics () filling (localClip). }} Public Static Zero Main (string [] Args) {New Peephr () {@ Override Public Zero Starter () {PPath circle = PPath.createEllipse (0, 0, 100, 100); Pendalece grid = new pandale (); grid.addChild (cycle); //grid.setBounds (Double.NEGATIVE_INFINITY, double. NEGATIVE_INFINITY, double .POSITIVE_INFINITY, double.POSITIVE_INFINITY); // do not work on all //grid.setBounds (10, -10, 50, 50); // Yellow until that grid grid Setbound (-1000, -1000, 2000, 2000); // until the extent of pigeon (yellow) GetLayer () AddBild (grid); }}; Unfortunately, I have found that:  

1) If the limitations are the default (empty) then the yellow paint only happens when the circle is visible

2) If the limitations Large and finite, so the yellow paint with the border

3) It does not support the infinite couple, although it is legal in theory; If there is infinite set, no one is attracted to it.

How to implement?

This is a part of how Java handles drawing.

See more about this and a guide on how to prevent this problem.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -