jsycamore
JVM | Platform | Status |
---|---|---|
OpenJDK (Temurin) Current | Linux | |
OpenJDK (Temurin) LTS | Linux | |
OpenJDK (Temurin) Current | Windows | |
OpenJDK (Temurin) LTS | Windows |
Java embedded GUI package
License: ISC License
Some events will be delivered to components (key input events, mouse input events). Some events are generated internally by the system and will be published to the screen's events()
publisher, but won't ever be delivered directly to components.
It triggers an assertion failure:
Exception in thread "AWT-EventQueue-0" org.valid4j.errors.RequireViolation: Rendered rectangle height must be positive
at org.valid4j.impl.RequireViolationPolicy.handleViolation(RequireViolationPolicy.java:19)
at org.valid4j.impl.CheckingPolicy.check(CheckingPolicy.java:25)
at org.valid4j.Assertive.require(Assertive.java:150)
at com.io7m.jsycamore.core.renderer.SyEmbossed.rectangle(SyEmbossed.java:83)
A set of panels that are switched between by clicking a tab header.
The component interface contains a method line this:
/**
* Match on the type of component.
*
* @param context A context value passed through to the given functions
* @param on_button A function evaluated if this component is a button
* @param on_panel A function evaluated if this component is a panel
* @param on_label A function evaluated if this component is a label
* @param on_image A function evaluated if this component is an image
* @param on_meter A function evaluated if this component is a meter
* @param <A> The type of opaque context values
* @param <B> The type of returned values
*
* @return The value returned by whichever one of the given functions is evaluated
*/
<A, B> B matchComponent(
A context,
BiFunction<A, SyButtonType, B> on_button,
BiFunction<A, SyPanelType, B> on_panel,
BiFunction<A, SyLabelType, B> on_label,
BiFunction<A, SyImageType, B> on_image,
BiFunction<A, SyMeterType, B> on_meter);
This is obviously a generic visitor, and now the component type should be a sealed interface instead.
Should there be a difference between closing a window and destroying it? Can there actually be a difference?
Determinate and indeterminate.
Each theme must decide the boxes of exactly eight components (n, ne, e, se, s, sw, w, nw)
.
Dragging n
resizes the window upwards.
Dragging ne
resizes the window upwards and rightwards.
Dragging e
resizes the window rightwards.
Dragging se
resizes the window downwards and rightwards.
Dragging s
resizes the window downwards.
Dragging sw
resizes the window downwards and leftwards.
Dragging w
resizes the window leftwards.
Dragging nw
resizes the window upwards and leftwards.
If a theme does not use any of the given components, it can assign a zero width, zero height box.
The current layout()
function declared on the SyComponentType
does the necessary grunt work to lay out the current component, but it then goes on to call layout()
on the child components. While it should do this, some components that override this method are only interested in the first half of the work that the method does. Unfortunately, they only have the option to call the entire method and possibly end up laying out child components twice.
Three methods should be provided: layoutThis
, layoutChildren
and layout
. layout
calls layoutThis
and then layoutChildren
. Overrides of layout
can call layoutThis
and layoutChildren
as necessary.
Wrong colour selection.
They're currently declared as (for example):
<Provide-Capability>
com.io7m.jsycamore.theme.name;type:String=Stride
</Provide-Capability>
But should be:
<Provide-Capability>
com.io7m.jsycamore.theme;name:String=Stride
</Provide-Capability>
This is an unfortunate typo that was copied to each of the provided themes...
Take the image of each window and render it as an OpenGL quad to the screen.
In SyWindowViewportAccumulator
, the accumulate
method assumes that negative offsets are invalid, and it clamps them. Scroll panes use negative offsets inside viewports. This test fails immediately:
@Test
public void testNegativeOffset()
{
final var accum =
SyWindowViewportAccumulator.create();
accum.reset(300, 300);
accum.accumulate(PAreasI.create(-100, -100, 200, 200));
assertEquals(-100, accum.minimumX());
assertEquals(-100, accum.minimumY());
assertEquals(100, accum.maximumX());
assertEquals(100, accum.maximumY());
}
A window's content pane exposes a writable JOTreeNodeType<SyComponentType>
. Let's assume that this is necessary because otherwise the user wouldn't be able to add any components to the content pane. The user can now detach the content pane from the window. The user can traverse up the tree and detach the titlebar from the window, etc.
Let's assume that the content pane wasn't directly exposed as a writable JOTreeNodeType
but instead allowed the user to add components via an API that hides the tree itself. The individual component types do still expose their own nodes as JOTreeNodeType
values, so by getting write access to a single component anywhere, the user can detach or otherwise mess with any other component in the tree.
Buttons that stay pressed when pressed, and then become un-pressed when pressed again.
Currently, it's an error to enable embossing and then set the margin size to 0.
Removing the check that makes it an error instead turns it into a problem of bad rendering.
The newest jnull
release deprecated some methods. Fix calls to these methods.
A theme change may change the dimensions of the content pane, and the pane should be notified that this has happened so that child components can respond to the size change.
The event interfaces are the interfaces used to deliver messages to components. Component implementations of these interfaces are required to pass the messages to child components and so on.
The listener interfaces are the interfaces used by components to react to messages delivered by the event interfaces. They are not responsible for doing anything other than reacting and indicating whether or not they consumed the event in question.
The boxes package has been spun out into a separate jboxes package as code elsewhere requires it. It should be imported as a dependency and used in place of the current original types.
The GUI needs support for popup menus.
Strictly speaking, only one popup menu is ever shown at any given time, and technically exists independently of any given window (although it may be associated in some unspecified manner with the component that caused it to open in the first place).
With PLACEMENT_TOP_OVERLAP_FRAME
, any region of the frame underneath the titlebar will receive mouse events instead of the titlebar. This is in keeping with the component model, but is unfortunate!
A group of buttons similar to #18 but with the restriction that only one button in the group may be pressed at any given time.
With window positions and sizes snapped to a value of some larger value such as 16
, dragging the west resize handles will often result in the right edge of the window snapping to various values and not really resizing correctly.
Currently, keyboard events go nowhere. The screen tracks focused components but doesn't deliver keyboard events.
Horizontal and vertical sliders.
Single line text fields.
This obsoletes #31 as jboxes
has been replaced by jregions
.
By setting a flag on a window, the content pane should be resized to the full bounds of the window and all other components made invisible.
To correctly simulate Haiku, it's necessary to emboss the outlines of UI elements. This is also used by the old Mac OS Platinum UI.
Note how the progress bar in the Haiku image has an embossed outline, and the close button in the Platinum example has an outermost emboss, a black outline inside that, and further embossing inside that!
To implement this, the viewport needs an explicit size and windows need to store an unmaximized box.
Large, multi-line areas for text.
To give people more organizational freedom, the fixed int
-based window layers should be moved to BigInteger
values, and the layer used for menus should become configurable.
Bounds in a measured line should be returned in text-local space (not parent-relative space).
Line numbers should be moved out of the measured line data structure.
With these two changes, text models can avoid recalculating measured lines just because some earlier text section was changed and now all of the line numbers are incorrect. Line numbers should be a property of the structures storing the measured lines, not the measured lines themselves.
Windows that are always focused when open.
This will probably apply to all io7m packages, but jsycamore will be the test bed.
I want stronger checking by findbugs and by the IDE, and it seems like I'm just not going to get it with the jnull annotations. The jnull annotations are also not as powerful as annotations that were written post JSR-308 integration into the JDK.
They're unnecessary and simply mean that a theme gets an often unsuitable default value rather than loudly being told that it has failed to provide one.
Replace valid4j
with jaffirm
.
Somehow, themes need a way to specify the icons for window title bar close/maximize buttons.
The recent move to the primogenitor forgot to add a configuration to produce OSGi bundles.
Themes may change the size of the content area, so components need a chance to respond to this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.