Trouble with the javafx 8 sample 3D application - actionlistener

Since the release of javafx 8 is coming up right around the corner, I figured now would be a good time to get better acquainted with a few of the new features. First on my list: enhanced (true) 3D shapes and rendering! Working for an engineering company, being able to integrate a rich 3d environment into some of our visualizations will be great!
In any case, I was working through the 'getting started' here and all was well. Able to compile everything, getting familiar with how they structure all of their layouts in 3d, etc. etc. It was great! After familiarizing myself with some of the more advanced translations, I decided to take a look at their final 'sample 3d application' that had things like mouse and keyboard listeners to set the angle and orientation of the camera, which was the only thing I hadn't done yet. (you can find a link to the source code I downloaded for it, complete with a nbproject here It's called MoleculeSampleApp.zip and it's in the top right corner of the page).
So I go to compile it, everything shows up just fine, the molecule, the axis, and then I try to initiate any action at all, a mouse click, drag, a recognized keyboard input, etc. Everything on the scene simply vanishes.
Well that's strange, I think to myself, so I take a look at the code. Everything looks to be in order, and a few print lines later, I find out that the contents of the graph aren't disappearing until the very END of the listener, whenever that happens to be. Nothing inside of the listener is actually causing the disappearing (unless of course it's the hide/show keyboard shortcuts).
To be honest, I'm a bit baffled by this. There are no exceptions being thrown, no errors printing out. It just disappears, and that's the end of it.
If anyone has any idea why this is happening I would be immensely grateful. It's worth noting, I'm using the javafx 8 developer preview b132.
(if you would like me to post the entire source here, let me know, it's only about 600 lines altogether, but that's pretty heavy for a SO question so I'm just going to leave the links for now).
tl;dr
The moleculesimpleapp.zip located here makes everything disappear on any action it knows to listen for, with no clear reason, why?
-Will

Related

Adding a text box in Android Studo

Trying to use AndroidStudio (3.4.2) for the first time and it appers to be substantially different to the tutorial at
https://developer.android.com/training/basics/firstapp/building-ui
For example:
There is no layout editor toolbar let alone a show button.
There is no autoconnect button
It doesn't show any wiggly lines from the middle of the blue square to its edges.
When adding a text box it goes to the top left and can't be moved.
WTF is going on? This is awful!
So I know this may sound like the hard answer, but in the long run it will make life 1000x easier.
You need to learn XML to design the activities. It's fairly simple and really easy to research. The reason the textbox can't be moved is because the default layout is ConstraintLayout. In order to fix this, go to the xml file and change the Constraint layout to either Relative layout or Linear Layout. In the end, its more simple to learn straight xml.
I suggest you learn Android programming from here or somewhere else because the Android documentation can be confusing especially for a beginner like yourself and trust me, I've been there.

Green square on game canvas using Phaser

Can someone please tell me why I'm getting a green square on my Phaser game canvas as below?
Without seeing any code I can tell you that you'll see that when an image can't be loaded by the Phaser framework.
Open developer tools in your browser of choice and refresh after opening the Network tab. You should see a 404 for one of your images.
I believe if you look at the standard browser console you may also see messages about the name of the asset that it failed to load.
I had a slightly different case. Images were being loaded in the init function, which apparently doesn't work. I renamed that function to preload and suddenly the green squares are gone and the images show up.
My case was also a little different too; it appeared that all my image resources were loaded, but I think I was trying to create the sprites a little too quickly - in order words, I was trying to create and add sprites to my scene before the scene was properly loaded.
I'm going to try waiting until 'scene.scene.isActive(key);' returns a boolean of true.....maybe that's what will solve my issue. Failing that, I might just put in some sort of sleep/await promise of 1 second or something (not ideal, but might work)
ALSO NOTE: Part of the reason I was able to create my sprites too quickly was because I was doing so in my own custom function, not the typical create() function. Actually, the best solution is probably to create my sprites in the create() function and not a custom function...

Custom Magnific Popup Arrows

So this is going to be kinda silly, but I don't like the arrows for Magnific Popup, and I want to use some png arrows that I created, even moreso I don't want them the default way where they are miles apart, and I don't want them to obstruct content (cause I am using Magnific Popup to gallery some ajax). I really want them bound in div/big square buttons on the side of the image (the height of the image as well) like the first example here:
and those big black bars on a tv
I have no idea where the code is to change this, or how to edit the basic construction of the lightbox but I really want to change the arrows (and the x) if someone could direct me to the code where I can do this I will be glad to do it but I feel like I am working blind.
Alternatively, if anyone knows any other lightboxes that allow you to position and design your own arrows and close button, and have a gallery of ajax based items (that is responsive and scrolls) I will gladly switch (I basically want to be behance ha ha)
(also is there anyway we can generate a swipe effect to go through a gallery?)
Feel free to tell me to go to hell if it is impossible :D
Thanks.

Custom navigation Titanium

I need do a very special nav or tab bar for a app, I looked this but I not have idea how to make some similar, I work with Titanium mobile, someone with experience could tell me how to make some similar with Titanium, or if someone have other navigation bar more complex that the examples on the kitchensink.
This is where I'd start. Understand that that video is obviously a complex interface and will definitely take work on your part.
This (http://softlywired.com/ticustommenu/) piece of code will get you started, but you will need to go way beyond it writing that interface control. I'd then move on to creating the boxes that pop up, without animation, down the center. After that was working, I'd look at animating them and adding the event listeners to it.
You'd be a star in the Titanium community if you got it working and released the source code to it.

How to write an X11 app that follows the cursor

I'd like to write a Linux screen magnifier that's customized to my liking. Ideally, the magnified window would be a square about 150 pixels wide that follows the mouse cursor wherever it goes.
Is it possible to do this in X11? Would it be easier to have an application window that follows the mouse around, or would it be better (or possible) to forget about the window altogether and just make the mouse pointer a 150x150 square that magnifies whatever's underneath?
Look at the source to xeyes?
This actually already exists, it's called Xmag (do a Google search for additional info). You might want to check out the source code for it if you want to know how it works.
EDIT: looks like I misread your question a little bit... if you want a magnified square to follow the mouse pointer around, I suppose it should be possible, but I don't know the technical details of how you'd do it. Regardless, the place to start is probably by looking at Xmag as a starting point.
I am unsure if this can run as its own app or would have to be integrated into your window manager. Either way, you would need libx11 (might have a different name from distro to distro). Also, I would suggest taking a look at swarp. I know this is not even close to what you are talking about, but the source code is only 35 lines and it shows what can be done with libx11.
I would personally make that a frameless window that always stays atop with a 1px hole in the middle. The events that the user makes (Mouse clicks, keypresses, whatever) is passed to the window below.
And when the user moves it's cursor it is ought to be visible to your window and you just move it over a bit. For the magnifying part, well - that is left as an exercise to the reader (Because I do not know how to do that as of yet ;-).
Texworks comes with such a feature to inspect the pdf resulting from typesetting a latex source. You can also choose between a square or a circular magnifier. See https://www.tug.org/texworks/ for access to the code which can serve a launchpad.

Resources