Search for all the nodes and sprites contained inside the rectangle (x1,y1)-(x2,y2).
Search for all the nodes and sprites contained inside the rectangle (x1,y1)-(x2,y2).
The graph to search for.
The rectangle lowest point abscissa.
The rectangle lowest point ordinate.
The rectangle highest point abscissa.
The rectangle highest point ordinate.
The set of sprites and nodes in the given rectangle.
Automatic centering of the view.
Automatic centering of the view.
Compute a transformation matrix that pass from graph units (user space) to pixel units (device space) so that the whole graph is visible.
Compute a transformation matrix that pass from graph units (user space) to pixel units (device space) so that the whole graph is visible.
The transformation modified.
The rendering back-end.
The rendering back-end.
The camera center of view.
The camera center of view.
Process each node to check if it is in the actual view port, and mark invisible nodes.
Process each node to check if it is in the actual view port, and mark invisible nodes. This method allows for fast node, sprite and edge visibility checking when drawing. This must be called before each rendering (if the view port changed). Called in pushView. A node is not visible if it is out of the view port, if it is deliberately hidden (its hidden flag is set) or if it has not yet been positioned (has not yet received a (x,y,z) position). If the auto fitting feature is activate the whole graph is always visible.
Search for the first node or sprite (in that order) that contains the point at coordinates (x, y).
Search for the first node or sprite (in that order) that contains the point at coordinates (x, y).
The graph to search for.
The point abscissa.
The point ordinate.
The first node or sprite at the given coordinates or null if nothing found.
Compute the real position of a sprite according to its eventual attachment in graph units.
Compute the real position of a sprite according to its eventual attachment in graph units.
The sprite.
Receiver for the sprite 2D position, can be null.
The units in which the position must be computed (the sprite already contains units).
The same instance as the one given by parameter pos or a new one if pos was null, containing the computed position in the given units.
Compute the position of a sprite if attached to an edge.
Compute the position of a sprite if attached to an edge.
The sprite.
The units the computed position must be given into.
The same instance as pos, or a new one if pos was null.
Compute the position of a sprite if it is not attached.
Compute the position of a sprite if it is not attached.
The sprite.
Where to stored the computed position, if null, the position is created.
The units the computed position must be given into.
The same instance as pos, or a new one if pos was null.
Compute the position of a sprite if attached to a node.
Compute the position of a sprite if attached to a node.
The sprite.
The units the computed position must be given into.
The same instance as pos, or a new one if pos was null.
The graph view port, if any.
The graph view port, if any. The graph view port is a view inside the graph space. It allows to compute the view according to a specified area of the graph space instead of the graph dimensions.
Check if an edge is visible in the current view port.
Check if an edge is visible in the current view port.
The edge to check.
True if visible.
Is the given node visible in the given area.
Is the given node visible in the given area.
The node to check.
The min abscissa of the area.
The min ordinate of the area.
The max abscissa of the area.
The max ordinate of the area.
True if the node lies in the given area.
Is the given sprite visible in the given area.
Is the given sprite visible in the given area.
The sprite to check.
The min abscissa of the area.
The min ordinate of the area.
The max abscissa of the area.
The max ordinate of the area.
True if the node lies in the given area.
Check if a sprite is visible in the current view port.
Check if a sprite is visible in the current view port.
The sprite to check.
True if visible.
True if the element is be visible by the camera view (not out of view).
True if the element is be visible by the camera view (not out of view). The method used is to transform the center of the element (which is always in graph units) using the camera actual transformation to put it in pixel units. Then to look in the style sheet the size of the element and to test if its enclosing rectangle intersects the view port. For edges, its two nodes are used. If auto fitting is on, all elements are necessarily visible, this method takes this in consideration.
The element to test.
True if the element is visible and therefore must be rendered.
Information on the graph overall dimension and position.
Check if a node contains the given point (x,y).
Check if a node contains the given point (x,y).
The node.
The point abscissa.
The point ordinate.
True if (x,y) is in the given element.
Which node is visible.
Which node is visible. This allows to mark invisible nodes to fasten visibility tests for nodes, attached sprites and edges. The visibility test is heavy, and we often need to test for nodes visibility. This allows to do it only once per rendering step. Hence the storage of the invisible nodes here.
Padding around the graph.
Padding around the graph.
Restore the transform that was used before #pushView(Graphics2D)
is used.
Set the camera view in the given graphics and backup the previous transform of the graphics.
Set the camera view in the given graphics and backup the previous transform of the graphics.
Call #popView(Graphics2D)
to restore the saved transform. You can only push one time
the view.
The graphic graph (used to check element visibility).
The rotation angle (along an axis perpendicular to the view).
The rotation angle (along an axis perpendicular to the view).
Enable or disable automatic adjustment of the view to see the entire graph.
Enable or disable automatic adjustment of the view to see the entire graph.
If true, automatic adjustment is enabled.
Set the graphic graph bounds from the graphic graph.
Set the graphic graph bounds (the lowest and highest points).
Set the graphic graph bounds (the lowest and highest points).
Lowest abscissa.
Lowest ordinate.
Lowest depth.
Highest abscissa.
Highest ordinate.
Highest depth.
Set the graph padding.
Set the graph padding. Called in pushView.
The graphic graph.
Set the center of the view (the looked at point).
Set the center of the view (the looked at point). As the viewer is only 2D, the z value is not required.
The new position abscissa.
The new position ordinate.
Set the output view port size in pixels.
Set the output view port size in pixels.
The width in pixels of the view port.
The width in pixels of the view port.
Check if a sprite contains the given point (x,y).
Check if a sprite contains the given point (x,y).
The sprite.
The point abscissa.
The point ordinate.
True if (x,y) is in the given element.
Transform a point in graph units into pixels.
Transform a point in graph units into pixels.
The transformed point.
Return the given point in pixels converted in graph units (GU) using the inverse transformation of the current projection matrix.
Return the given point in pixels converted in graph units (GU) using the inverse transformation of the current projection matrix. The inverse matrix is computed only once each time a new projection matrix is created.
The source point abscissa in pixels.
The source point ordinate in pixels.
The resulting points in graph units.
Compute a transformation that pass from graph units (user space) to a pixel units (device space) so that the view (zoom and center) requested by the user is produced.
Compute a transformation that pass from graph units (user space) to a pixel units (device space) so that the view (zoom and center) requested by the user is produced.
The transformation modified.
The view center (a point in graph units).
The visible portion of the graph.
The visible portion of the graph.
A real for which value 1 means the graph is fully visible and uses the whole view port.
Set the zoom (or percent of the graph visible), 1 means the graph is fully visible.
Set the zoom (or percent of the graph visible), 1 means the graph is fully visible.
The zoom.
The rotation angle in degrees.
The rotation angle in degrees.
The rotation angle in degrees.
Set the rotation angle around the center.
Set the rotation angle around the center.
The rotation angle in degrees.
The camera zoom.
The camera zoom.
Define a view of the graph or a part of the graph.
The camera can be seen as an element in charge of projecting the graph elements in graph units (GU) into rendering space units, often in pixels. It defines the transformation, an affine matrix, to pass from the first to the second (in fact its the back-end that does it).
It also contains the graph metrics. This is a set of values that give the overall dimensions of the graph in graph units, as well as the view port, the area on the screen (or any rendering surface) that will receive the results in pixels (or any rendering units). The two mains methods for this operation are Camera.pushView(Graphics2D,GraphicGraph) and Camera.popView().
The user of the camera must set both the view port and the graph bounds in order for the camera to correctly project the graph view (the Renderer does that before using the Camera, at each frame). The camera model is as follows: the camera defines a center at which it always points. It can zoom on the graph (as if the camera angle of view was changing), pan in any direction by moving its center of view and rotate along the axe going from the center to the camera position (camera can rotate around two axes in 3D, but this is a 2D camera).
There are two modes: - an "auto-fit" mode where the camera always show the whole graph even if it changes in size, by automatically changing the center and zoom values, - and a "user" mode where the camera center (looked-at point), zoom and panning are specified and will not be modified in the bounds of the graph change.
The camera is also able to answer questions like: "what element is visible actually?", or "on what element is the mouse cursor actually?".
The camera is also able to compute sprite positions according to their attachment, as well as maintaining a list of all elements out of the view, so that it is not needed to render them.