aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphui/classes/com/jogamp/graph/ui/layout/GridLayout.java
Commit message (Collapse)AuthorAgeFilesLines
* GraphUI Layout: Emphasize whether a value/parameter is scaled or unscaled in ↵Sven Göthel2024-01-261-11/+13
| | | | API doc to ease usage
* Math Vec*: Rename {scale->mul}(..) for non-scalar types (n-dim); Add div(..)Sven Göthel2024-01-261-2/+2
|
* Bug 1490 - GraphUI Group: Resolve Performance Issues with Shape Mv Transform ↵Sven Göthel2024-01-221-1/+1
| | | | | | | | | | | | | | | | | | | | -> PMVMatrix4f Shape.setTransformMv() is called for each renderer frame and for each shape, involving 6 Matrix4f.mul() and set*() operations. Since mutation of shape's position, rotation or scale is less frequent than rendering one frame (for all shapes), it is more efficient to maintain a local Matrix4f and update it on such single mutations. Rendering then only needs to perform one Matrix4f.mul() operation using this internal matrix. +++ Also changes name from setTransformMv(PMVMatrix4f) to applyMatToMv(PMVMatrix4f), as its name might be misleading.
* GraphUI Group/BoxLayout/GridLayout: Handle empty Group, i.e. detect ↵Sven Göthel2024-01-201-2/+10
| | | | zero-size and avoid scale=Infinity and zero-sized resulting AABBox
* GraphUI Margin/Padding: Rename zeroSum*() -> zero*()Sven Göthel2024-01-121-1/+1
|
* GraphUI Padding, Margin, Gap: Use zero value constant None instead of ↵Sven Gothel2023-12-181-2/+2
| | | | default ctor
* GraphUI Layout: Simplify non-centered negative-offset (underline) removalSven Gothel2023-09-261-11/+2
|
* Bug 1452: GraphUI Shape: Rename setMvTransform(..) -> setTransformMv(..), ↵Sven Gothel2023-09-231-1/+1
| | | | | | | aligning w/ PMVMatrix4f naming .. Original name was simply setTransform(..), so now let's keep using the suffix denominating the matrix while keep the main subject/verb upfront. Was an off reading ..
* Bug 1452 - Decouple math functionality to 'com.jogamp.math' to be toolkit ↵Sven Gothel2023-09-201-12/+12
| | | | | | | | | | | | | | | | | | | | agnostic (PMVMatrix, Matrix4f, Vec4f, ..) Math functionality (PMVMatrix, Matrix4f, Vec4f, ..) - shall be used toolkit agnostic, e.g. independent from OpenGL - shall be reused within our upcoming Vulkan implementation - may also move outside of JOGL, i.e. GlueGen or within its own package to be reused for other purposed. The 'com.jogamp.opengl.util.PMVMatrix' currently also used to feed in GLUniformData via the toolkit agnostic SyncAction and SyncBuffer shall also be split to a toolkit agnostic variant. An OpenGL PMVMatrix specialization implementing GLMatrixFunc can still exist, being derived from the toolkit agnostic base implementation. +++ Initial commit .. compile clean, passing most unit tests.
* GraphUI Layout (Box/Grid): Adjust bottom-left offset according to center-axisSven Gothel2023-09-191-3/+22
| | | | | - Remove the negative or positive delta on centered axis. - Only remove negative offset of non-centered axis (i.e. underline)
* GraphUI GridLayout: Disable TRACE_LAYOUTSven Gothel2023-09-191-1/+1
|
* GraphUI GridLayout: Fix scaled non-center: Only add center offset if ↵Sven Gothel2023-09-191-17/+14
| | | | requested and avoid double-add.
* GraphUI Layout: Remove unused leftover var and complete GridLayout ctorSven Gothel2023-09-171-2/+12
|
* GraphUI BoxLayout: Margin is only ignored for center Alignment w/o Fill ↵Sven Gothel2023-09-161-28/+23
| | | | | | | | | | | | | | | | | | | | | scale. {Box,Grid}Layout: Always remove Bottom-Left delta and refine API doc of incl scale behavior GraphUI BoxLayout: Margin is only ignored for center Alignment w/o Fill scale. Margin outside of a shape is not scaled and hence must be considered when using Fill scale. {Box,Grid}Layout: Always remove Bottom-Left delta Previously we were only dropping the negative extend. However, since our scale and center algo uses the AABBox width and height, which excludes the bottom-left delta, we have to drop such offset. TODO: Otherwise, we would need adjust for the bottom-left extend when NOT centering for each direction! This might be a useful enhancement in case one likes to drop shapes as-is w/o centering. {Box,Grid}Layout: Refine API doc of incl scale behavior
* GraphUI Layout: Fix BoxLayout scale, margin and padding; Add same padding ↵Sven Gothel2023-09-051-44/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | behavior to BoxLayout and GridLayout. For all: - Padding is applied to each {@Shape} via {@link Shape#setPaddding(Padding)} if passed in constructor BoxLayout: - Optionally centered {@link Alignment.Bit#CenterHoriz horizontally}, {@link Alignment.Bit#CenterVert vertically} or {@link Alignment#Center both}. - Optionally scaled to cell-size if given and {@link Alignment#Fill} - Margin is ignored on dimension with center {@link Alignment} - Not implemented {@link Alignment}: Top, Right, Bottom, Left GridLayout: - Optionally centered {@link Alignment.Bit#CenterHoriz horizontally}, {@link Alignment.Bit#CenterVert vertically} or {@link Alignment#Center both}. - Optionally scaled to cell-size if given and {@link Alignment#Fill} - Without cell-size behaves like a grid bag using individual shape sizes including padding - Can be filled in {@link Order#COLUMN} or {@link Order#ROW} major-order. - Not implemented {@link Alignment}: Top, Right, Bottom, Left Changes to Group.Layout interface: - Added preValidate(Shape) allowing to prepare the shape before validation, used to inject Padding Changes to Margin: - Removed the complex CENTER property and using Alignment in BoxLayout as well Changes to BoxLayout: - Using Alignment +++ Tested via UILayoutBox01 and UILayoutGrid01, try the tooltip by clicking on the group's description label.
* GraphUI GridLayout: Handle 'diffBL' in 2nd path, no need to store as we ↵Sven Gothel2023-04-291-10/+10
| | | | don't use PMVMatrix for computation
* GraphUI GridLayout: Remove old unused layout0(..) methodSven Gothel2023-04-291-134/+0
|
* GraphUI Working GridLayout w/ and w/o cell-size and alignment; Added BoxLayout.Sven Gothel2023-04-291-30/+326
|
* GraphUI GridLayout: Also adjust potential bottom-left delta when centering ↵Sven Gothel2023-04-131-2/+3
| | | | shape to cell (like GlyphShape w/ underline)
* GraphUI GridLayout: Functional Grid Layout w/ Padding, demo'ed in ↵Sven Gothel2023-04-121-26/+118
| | | | | | | | | | UISceneDemo20 with button Groups All layout magic is simply performed in Group.Layout.layout(..) @ validate, incl. updating the bounding box to have the padding included. This demonstrates GraphUI's capability to be used with correct layout, i.e. its pure matrix based position, scale and rotation.
* GraphUI: Adopting Vec*f API; Adding Group; Scene + Group are Container, ↵Sven Gothel2023-04-051-0/+69
traversing the PMVMatrix throughout childs (-> see TreeTool). Utilizing the Vec*f (and Matrix4f) API w/ AABBox et al renders our code more clean & safe, see commit 15e60161787224e85172685f74dc0ac195969b51. A Group allows to contain multiple Shapes, hence the PMVMatrix must be traversed accordingly using TreeTool for all operations (draw, picking, win->obj coordinates, ..). Hence Scene + Group are now implementing Container and reuse code via TreeTool and a Shape.Visitor*. This will allow further simplification of user code.