Replies: 8 comments 9 replies
-
For SWT in general I thin the FAQ gives a good insigth about common questions of newcommers. About the threading I'm not aware of a "normative" document but its not very special here, if you know AWT you'll find many concepts in common. The basics boil down to the following (see the HelloWorldSnippet):
The main difference to AWT is that SWT has a policy that each public method of a widget checks that the current thread is the Main-Thread and throws an exception otherwise. This ensures that all UI work always happens in the Main/UI Thread. Even though some OS (mainly windows) support to create more than one Display (and thus might have two or more "Main Threads") thats a very rare use-case and is not platform dependent. This is also reflected by the fact, that the Display has a static accessor If code is running in the Main thread it should of course leave it ASAP (as no async event processing happens), or must take actions to dispatch the events itself but that's rarely required (mainly to implement blocking dialog calls for example). I think that it what is relevant for the usecase here in essence. |
Beta Was this translation helpful? Give feedback.
-
Here you find an example where a BufferedImage is converted into an SWT ImageData (that could then be used to draw an Image to the GC (SWTs equivalent to Graphics2D)). |
Beta Was this translation helpful? Give feedback.
-
SWT Fonts supports one "System font" and one can create fonts by name. A font can be Bold/Italic underline could be emulated by drawing a line I think more advanced formatting can be done with https://www.eclipse.org/articles/StyledText%201/article1.html |
Beta Was this translation helpful? Give feedback.
-
@laeubi I just made the 2.0.0 release version. This will probably be helpful to you as the master branch was changing a lot in the previous weeks. |
Beta Was this translation helpful? Give feedback.
-
@jzy3d I'm looking closer at the code and have noticed that |
Beta Was this translation helpful? Give feedback.
-
I was now able to produce some image output using the bezcurve example! That's amazing as in general I didn't seem to need any AWT specific classes directly (don't checked the jgl internals) and could copy the pixel buffer relative straigth away! |
Beta Was this translation helpful? Give feedback.
-
@jzy3d what do you think about my proposed changes? |
Beta Was this translation helpful? Give feedback.
-
I created #193 but it needs approval from a maintainer. |
Beta Was this translation helpful? Give feedback.
-
As discussed here, we are willing to make jGL rendering for SWT
Project Layout
GLCanvas
then might be an abstract class with glFlush() the responsibility of the actualAWTGLCanvas
/SWTGLCanvas
/...GLCanvas
GL
/GLUT
would need, for each windowing toolkitSide discussions
Fonts
Jzy3D
IPainter.Font
will be refactored to a standalone class trying to carry the same properties thanjava.awt.Font
(e.g. adding style to allow bold/underline etc). It will be used for configuringTextRenderer
s (TextBitmapRenderer
,JOGLTextRenderer
). jGL-awt will allow reusing such font properties. Suggestions on SWT font properties to support are welcome. In case underline/italic/bold are carried by int values different from AWT, then a Style enum for such generic core font would be useful.This Font class is here to allow :
TextRenderer
, then alternative/default font should be provided (TextBitmapRenderer
supports two fonts with three size,JOGLTextRenderer
supports fonts defined byjava.awt.Font
)Beta Was this translation helpful? Give feedback.
All reactions