I am working on a geometry program where I need to draw “endless” lines. My class line has a method
public void draw(Graphics2D g){
My idea is to choose large enough coordinates so that they are on the visible surface. But I do not know, and this is my question, how do I know the coordinates of the angles of the visible surface? The getClip () graphical method sounded good, but apparently it only returns the user clip that the user set earlier. Apparently, I need the documents to be named "device clip".
And before you suggest a large length, such as 10000, I do not mean the pixel size. I use transforms to scale and translate, etc., so 10,000 may well be visible.
edit: I just wanted to tell you what I did: I determined large enough constants for the maximum width and height of the screen (they may need to be adjusted after 10 years), then I apply the inverse of my current display transformation to this “screen” to know the required length my "endless" lines. That is, the problem is not solved, it is limited to only one place in the code.
peter source share