aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphui
Commit message (Collapse)AuthorAgeFilesLines
...
* GraphUI Shape: 'int name' -> 'int id' and add 'String name', change get/set ↵Sven Gothel2023-10-034-23/+60
| | | | methods accordingly
* GraphUI Scene: Add custom one-time GLRunnable disposable action list, ↵Sven Gothel2023-10-031-0/+20
| | | | | | | | allowing to properly take-down user resources at dispose(GLAutoDrawable) Used for UISceneDemo20 to stop and release SimpleSineSynth and its ALAudioSink. The latter causes a bad exit (crash at OpenAL32.dll) on OpenJDK's Window Binary if not stopped!
* Bug 1467 - GraphUI: Don't de-activate a Shape if became active via ↵Sven Gothel2023-09-301-15/+24
| | | | | | | | 'mouseOver' (mouseDragged) When using a mouse, Scene activates a Shape if mouse is over it (mouseOver). Hence don't de-activate such Shape via mouse-button clicked or released.
* GraphUI: Shape: Add missing 'markShapeDirty()' on setBorderColor()Sven Gothel2023-09-301-0/+2
|
* Bug 1454 + Bug 1464: Maintain a Shape local 'zOffset' and only consider it ↵Sven Gothel2023-09-302-35/+43
| | | | | | | | | | for sorting w/o actually modifying the position (enogh to be painted on top and for selection) Also use a simplified comparison using only float relational operations w/o NaN/Inf bit-stuff or epsilon, as it should be accurate enough for this cause. This shall also resolve Bug 1454, as we no more modify the position directly but the local zOffset field .. but this has to be seen (data race).
* GraphUI: Group: Add attribute to allow not to relayout if child Shapes are ↵Sven Gothel2023-09-301-14/+24
| | | | dirty. Only issue validate on childs if theyre shape is dirty
* Bug 1465 - Graph / GraphUI: Render a Region's ColorTexture in proper ↵Sven Gothel2023-09-304-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | aspect-ratio, letter-boxed or zoomed (config) + Bug 1466 Fix color mixing Bug 1465: Region currently simply bloats a given texture to its region AABBox, which renders textures with the wrong aspect ratio. Add facility to program the texture-coordinates to either letter-box or scaled-up (and cut) true aspect-ratio. Default shall be zoom (scale-up and cut), but user shall be able to set a flag in the Region for letter-box. Have the shader clip texture coordinates properly, best w/o branching to soothe performance. See functions.glsl +++ Bug 1466: Current color mix: texture * color_channel * color_static is useless in GraphUI. color_static shall modulate the texture, which works. But in case of color_channel (attribute/varying) we want it to be mixed so it can become the more dominant color for e.g. a border. Desired is: color = vec4( mix( tex.rgb * gcu_ColorStatic.rgb, gcv_Color.rgb, gcv_Color.a ), mix( tex.a * gcu_ColorStatic.a, 1, gcv_Color.a) );
* GraphUI Button: Support toggle'ed labels and fixed font size scaling for ↵Sven Gothel2023-09-261-51/+155
| | | | | | | | | | | | | | | | | | | | | | | | | symbols (see setFixedLabelSize()), This allows convenient instantiation of a Button changing its text (or symbol) when toggled, e.g.: UISceneDemo03: + final Button button = new Button(options.renderModes, fontSymbols, + fontSymbols.getUTF16String("play_arrow"), fontSymbols.getUTF16String("pause"), + buttonWidth, buttonHeight, buttonZOffset); + button.setSpacing(symSpacing, fixedSymSize); +++ setFixedLabelSize(..): Sets fixed label font size clipped to range [0 .. 1], defaults to {@code 0, 0}. Use {@code w=0, h=1} when using single symbols from fixed sized symbol fonts! Use {@link #setSpacing(Vec2f, Vec2f)} to also set spacing. The fixed label font size is used as the denominator when scaling.{@code max(fixedLabelSize, fontLabelSize)}, hence reasonable values are either {@code 1} to enable using the given font-size for the axis or {@code 0} to scale up/down the font to match the button box less spacing for the axis.
* GraphUI Button: Increase default spacing a little: x .12 -> .20, y .42 -> .46Sven Gothel2023-09-261-2/+2
|
* GraphUI Shape: Issue onToggleListener on setToggle(..) to complete user ↵Sven Gothel2023-09-261-0/+7
| | | | experience, add overridable toggleNotify(..) allowing implementations to react before listener.
* GraphUI Shape: Add remaining binary states to bitfield to preserver footprint ..Sven Gothel2023-09-261-26/+28
| | | | See commit e5eadcdaa615dbeb762885b50435a1f79d6ca895
* GraphUI: Mark some more methods final in Shape + GraphShapeSven Gothel2023-09-262-5/+5
|
* GraphUI Shape: Use a bitfield for the many binrary states instead of boolean ↵Sven Gothel2023-09-261-46/+47
| | | | to preserver footprint ..
* GraphUI GraphShape: Factor out static addRectangle(..) to be reused for ↵Sven Gothel2023-09-261-7/+8
| | | | debugging purposes
* GraphUI Layout: Simplify non-centered negative-offset (underline) removalSven Gothel2023-09-262-22/+4
|
* Bug 1462 - Graph Font: Add name + codepoint to ID and Glyph mapping plus ↵Sven Gothel2023-09-246-28/+19
| | | | | | | | | traversing through all Glyphs See UISceneDemo03 new Button(options.renderModes, fontSymbols, " "+fontSymbols.getUTF16String("pause")+" ", buttonWidth, buttonHeight); // pause Unicode codepoint symbol is also contained in FontGlyph
* GraphUI Label: Condense getUnscaledGlyphBounds()Sven Gothel2023-09-241-4/+1
|
* Bug 1460 - GraphUI Shape: Allow keeping aspect-ratio at resizeSven Gothel2023-09-241-6/+25
| | | | For certain shapes the aspect-ratio shall be kept, e.g. MediaButton etc.
* GraphUI Shape: Crossref input modifier funcs in API doc; Condense simple ↵Sven Gothel2023-09-241-26/+26
| | | | setter/getter
* GraphUI MediaButton: Return this for chaining on setterSven Gothel2023-09-241-2/+3
|
* Bug 1459 - GraphUI Shape: Add active (pointer over/left) state and callback ↵Sven Gothel2023-09-242-6/+52
| | | | | | | | | Listener We already track this state within Scene, i.e. a shape is marked active when pointer is over it and released from active-duty when pointer left. Scene shall notify the Shape so it can track this state locally and also forward this event to the user via the typical Shape.Listener callback.
* Bug 1454 - GraphUI Scene: Make active ZOffset scale configurableSven Gothel2023-09-241-2/+7
|
* GraphUI Button: Remove redundant ctors and methods. ZOffset shall be simply ↵Sven Gothel2023-09-241-68/+0
| | | | given, calculated by caller
* Bug 1454 - GraphUI Scene: Elevate active (selected) shape (add z-offset) and ↵Sven Gothel2023-09-232-1/+28
| | | | | | | | | | | | | | | | | select (pick) in Z descending order Picking (select) a shape shall process all shapes in Z descending order, i.e. top shape first. This is a bug currently. Note: Picking (selecting) a shape using a (mouse-)pointer device is active by mouse-moved and not only mouse-clicked. Therefor, we select shapes by mouse-over. The active selected shape shall have an elevated Z offset to be rendered on top of the others on same plane. - This avoids them being rendered below others while moving them around etc. - This also avoids flickering of overlapping shapes with mouse over. - This stabilizes the UI experience
* Bug 1452: GraphUI Shape: Rename setMvTransform(..) -> setTransformMv(..), ↵Sven Gothel2023-09-237-47/+47
| | | | | | | 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 ..
* GraphUI Button.getSubString(): Expose labelZOffsetSven Gothel2023-09-231-1/+1
|
* Bug 1452: GraphUI Scene DefaultPMVMatrixSetup.set(): Fix regression of ↵Sven Gothel2023-09-231-1/+1
| | | | | | | | | | | | | | | | | | | commit 5d6e8a367c03644740187e500c6de5d3ac039d5e - pmv.glMatrixMode(GLMatrixFunc.GL_PROJECTION); - pmv.glLoadIdentity(); - pmv.gluPerspective(angle, ratio, zNear, zFar); - pmv.glTranslatef(0f, 0f, scene_dist); + pmv.loadPIdentity(); + pmv.perspectiveP(angle, ratio, zNear, zFar); + pmv.translateMv(0f, 0f, scene_dist); ^^ Was projection matrix. Fixed. Note: resolved via TraceGL and comparing output -> P matrix differed, here translation.
* GraphUI GlyphShape.addShapeToRegion(): In case the Font.Glyph has no shape, ↵Sven Gothel2023-09-201-0/+3
| | | | at least add an empty region to avoid an NPE
* GraphUI Container: Add getShapeCount() and add API doc ..Sven Gothel2023-09-203-6/+15
|
* Bug 1452 - Decouple math functionality to 'com.jogamp.math' to be toolkit ↵Sven Gothel2023-09-2017-363/+364
| | | | | | | | | | | | | | | | | | | | 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-192-6/+44
| | | | | - 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-192-26/+23
| | | | requested and avoid double-add.
* GraphUI Label: Add convenient methods getUnscaledGlyphBounds(..)Sven Gothel2023-09-171-0/+12
|
* GraphUI Layout: Remove unused leftover var and complete GridLayout ctorSven Gothel2023-09-172-3/+12
|
* GraphUI GlyphShape: Add copy-ctor variantSven Gothel2023-09-161-0/+17
|
* GraphUI BoxLayout: Margin is only ignored for center Alignment w/o Fill ↵Sven Gothel2023-09-165-100/+104
| | | | | | | | | | | | | | | | | | | | | 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 Group.validateImpl(): Pick RenderMode for border from 1st Shape if ↵Sven Gothel2023-09-161-1/+12
| | | | | | required (hasBorder() and null border yet) This avoid changing the RenderMode and hence actual shader rendering the item.
* GraphUI Group: Override isShapeDirty(), performing a deep dirty state update ↵Sven Gothel2023-09-162-1/+14
| | | | on all group member to allow validate to function
* GraphUI Layout: Fix BoxLayout scale, margin and padding; Add same padding ↵Sven Gothel2023-09-054-186/+310
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Layout: Html'ify API header of Gap and PaddingSven Gothel2023-09-052-2/+4
|
* GraphUI Layout Alignment: Separate center alignment to horizontal and verticalSven Gothel2023-09-051-8/+11
|
* GraphUI Shape: Add setScale(..) and scale(..) with Vec3f for convenience; ↵Sven Gothel2023-09-051-2/+20
| | | | Add border-color in toString() if hasBorder()
* GraphUI Scene: Add invoke(boolean wait, GLRunnable) for convenience using ↵Sven Gothel2023-09-051-0/+21
| | | | GLAutoDrawable.invoke(..)
* GraphUI Scene: Only set dbgBorderThickness on shape if not zero and shape ↵Sven Gothel2023-09-051-1/+3
| | | | has no border yet, i.e. don't override
* GraphUI: Use z-top of bounding box for border rectangle, not z-centerSven Gothel2023-09-051-6/+6
|
* GraphUI Margin, Alignment: Reuse ctor for default-ctorSven Gothel2023-09-042-2/+2
|
* GraphUI: Button/Label: Complete String -> CharSequence type change for text, ↵Sven Gothel2023-09-043-6/+6
| | | | rename Button set{Label->Text}(..), adjust demo/text code
* GraphUI GraphShape: Split renderModes -> final renderModesReq + mutable ↵Sven Gothel2023-09-041-2/+26
| | | | renderModes, allowing the latter to be adjusted e.g. in case a color-channel is required
* GraphUI Enhance: API doc; Scene/Button Z-offset and -epsilon; Push temp ↵Sven Gothel2023-09-048-54/+238
| | | | AffineTransform to local method; Simplify BaseButton setCorner(0) -> setPerp(); Protected abstract ctor ..