I am moving my e4 rcp application( SWT + jface) to pure e(fx)clipse (JavaFX) and I want a splash screen in application with progress bar like eclipse do have.
Can anyone suggest what should i do?
I Checked this answer from tom but I didn't understand where I can load stage in e(fx)clipse application?
[Edit:1]
As of now there is not Progress bar support for e(fx)clipse. And This helps to load splash with minimum efforts for novice.
[Edit:2]
One more thing i have observed as mentioned in forum.
Splash screen is visible at background to application.
First of all yes OSGi-Application built on e4-JavaFX don't implement the Application class themselves because this needs to be done as part of the OSGi-Lifecycle.
Once you accepted this situation you have multiple choices:
you bring up a kind of splash through the lifecycle hook with the caveat that it gets up after JavaFX and OSGi have been initialized which might take some time
if you are on windows/linux you can still use the equinox hook with the only caveat that we bring this one done very early because we can not bring it down on the JavaFX thread
you adjust the bootstrapping of Equinox-OSGi-Applications and do the launch yourself
If you really want to discuss this stuff in depth than I suggest you post to our forum - https://www.eclipse.org/forums/index.php/f/259/
Related
I have an application that is used for data analysis. A big part of the application is the ability to be able to show charts based on the data assembled, and to be able to export a large number of tasks in one batch-operation. Up until now I have used JFreeChart, but I would like to use the native JavaFX Charts so that the exported charts will still look the same as they do on-screen in the application.
I am on JavaFX 2.2.1 (jdk 7u6).
I am able to generate the charts in one batch, but that means that I have to freeze the User Interface (UI), as these charts have to be rendered on the JavaFX Application Thread. I use the Platform.runLater(new Runnable() { ... }); command for this, wrapped around the code that generates the charts.
If I instead wrap each individual chart generation into a Platform.runLater(new Runnable() { ... }); The GUI doesn't freeze up as before, but I will also get no feedback because I am unable to detect when each of the individual charts are generated (they are ran at a later stage, and I have no control over when that might happen, and there is no callback available as far as I know either).
For this particular event I would like to show a progress bar to the user, and I want this progress bar to be updated along with the actual chart generation.
Any suggestions or hints as to how this can be achieved ?
This question was solved in the Oracle JavaFX forum thread: Render charts in background.
The solution was to have a SaveChartsTask with three subtasks:
Create charts in an off screen scene graph.
Take snapshots of each off screen chart to an JavaFX image.
Use imageio routines to export the JavaFX images to files.
The workDone properties on tasks allowed the process of the operations to be monitored. By splitting the total work up into subtasks, keeping work off of the JavaFX application thread when possible and making use of CountDownLatches and BlockingQueues as necessary to synchronize operations, the UI was able to remain responsive.
Since it seems that you are new to JavaFX-2. I recommend you to read the JavaFX-2 Concurrency article from oracle documentation.
Your problem is easily solved by using the Task Object to load your charts individually (One Task per Chart for example). Quoting the tutorial page:
Tasks are used to implement the logic of work that needs to be done on a background thread.
Since Task implements the Work Interface, you can use your Tasks to probe for their Worker.State. Quoting the manual:
A reusable Worker will transition from CANCELLED, SUCCEEDED or FAILED back to READY.
This would solve your problem about feedback since you'll always be able to know if a Task is still Running or not since the Worker.State object has the following possible States:
CANCELLED
FAILED
READY
RUNNING
SCHEDULED
SUCCEEDED
As for your progress bar, you can use the updateProgress(double done, double max) to set your Task progress and then simply set the progress of your progress bar by binding the ProgressBar.progressProperty() to Task.progressProperty().
EDIT
Answering to your comment:
The problem is that the work performed inside the Task in this case in the generation of the JavaFX Chart, and that code needs to be executed inside the JavaFX Application Thread
From the tutorial:
Instead, use the JavaFX APIs provided by the javafx.concurrent package, which takes care of multithreaded code that interacts with the UI and ensures that this interaction happens on the correct thread.
Which means the code executed inside the Task object is already being executed in the JavaFX Thread.
I hope it helped. Cheers
To run a JavaFX Task on the JFX thread, you can schedule the task to be run with Platform.runLater(myJFXTask);.
The new Facebook app seem to have done away with the grid-icon layout, with a more interesting custom navigation layout where the bottom-most view shows all the options (like Profile, News Feed, Messages etc for Facebook) and clicking on one of them brings another view sliding over the top. You can press the 3-lines button to then expose the bottom-view again, but the current view is partially visible. The Path app also recently updated to match this scheme.
What's the best way to recreate this? I've searched for any open-source options but haven't found them. Three20 doesn't seem to support this either.
Another option that I wrote: ECSlidingViewController
It has support for orientation changes like Facebook and sliding to the left like Path.
Video demo: http://vimeo.com/35959384
Code: https://github.com/edgecase/ECSlidingViewController
Try These from Cocoa Controls:
JTRevealSidebar http://cocoacontrols.com/platforms/ios/controls/jtrevealsidebar
clcascade http://cocoacontrols.com/platforms/ios/controls/clcascade
StackScrollView http://cocoacontrols.com/platforms/ios/controls/stackscrollview
Many more on the same site like:
http://cocoacontrols.com/platforms/ios/controls/mfslidingnavigationcontroller
http://cocoacontrols.com/platforms/ios/controls/psstackedview
I found a really nice project on github:
https://github.com/devindoty/DDMenuController
Everything I've seen on the internet and those recommended by Yosi Taguri are all way too complicated. Drawers can be achieved by a very simple category to UINavigationController with no graphics asset whatsoever and no class extension needed, and backwards compatible with iOS 3.0!
Take a look a this:
http://code.google.com/p/drawer-navigation-controller/
Here is a video http://www.youtube.com/watch?v=5T-1-_pFbG0
This project (not mentioned above) looks like the most mature and polished to me: https://github.com/gotosleep/JASidePanels
Also, seems to still be active.
Edit: I have since transitioned to: https://github.com/mutualmobile/MMDrawerController which IMO is an almost perfect implementation.
Check my answer here - SplitView like Facebook app on iPhone - which contains a list of open-source codes.
if anyone's wondering which one to choose among JTReveal and DDMenu, I'd suggest DDMenucontroller over JTRevealSidebar (haven't used the other options listed by #Yosi). Its a lot simpler, lighter and works exactly the way the Path app works (and it is easier to modify to suit your requirements). Havent seen the issue of black background mentioned by #Henning
My project FRLayeredNavigationController on GitHub goes in about the same direction.
(The spacing between the layers is easily configurable and it supports rotation of course).
Have a look at the demo videos/screenshots:
http://youtu.be/v_tXD_mL05E
http://youtu.be/q66HX2td_uc
https://github.com/weissi/FRLayeredNavigationController/raw/master/FRLayeredNavigationControllerScreenshot1.png
https://github.com/weissi/FRLayeredNavigationController/raw/master/FRLayeredNavigationControllerScreenshot2.png
Here's another one: PPSlideDrawer.
http://www.localwisdom.com/blog/2013/05/simple-sliding-drawer-implementation-for-ios/
I checked out #Ephraim's answer (http://code.google.com/p/drawer-navigation-controller/) because it seems pretty easy to work with. The problem, it seems, with drawer-navigation-controller is that the swiping animation does not follow the user's finger--it is automated. PPSlideDrawer aims to solve that. I'm about to try it out in my project and will post some updates.
Might be a dealbreaker for some that the following are still under "TODO:"
Implement auto open functionality.
Implement swipe from edge functionality(rather than just detect panning gesture).
Landscape support.
Here is one thats very easy to implement and use with storyboards. It has control for shrinking, show hide animations, and direction.
https://github.com/HelloMihai/HMSideDrawerDirectional
I'm building a project similar in design/scope to Invoice2Go and was wondering what the appropriate iOS project type would be to start with in XCode.
It doesn't really matter, from the most basic template (Window-based Application) you can setup any app. It seems Invoice2Go makes use of a tab bar, so the Tab Bar application seems most convenient, though you can add a tab bar to the Window-based Application as well.
Personally I like to start with a Window-based Application most of the time, this gives me the most flexible starting-point.
I think the app looks like Tab Bar based application. You can try using that template. Of course you can start with simple Window based app, but you need to wire it all up yourself.
I have a application which is a universal application. On iPhone, it's a Tab Bar application and on iPad its a Split View app. For settings, I really wanted to include the three most important settings in my application, and then launch the Settings Application on demand for minor settings (but Apple screwed us there). So I'm trying to integrate InAppSettingsKit.
Because the application is a universal binary, InAppSettingsKit must be installed in Shared/. Otherwise I will get problems with duplicate symbols (or I have to duplicate and rename everything with *_iPhone and *_iPad).
I'm trying to cut-in InAppSettingsKit on the iPhone. Because its a tab view, there is no NavigationController as IASK expects (so a tap does nothing except highlight the row cell). So the library will need some modifications. In addition, when I tested a purely iPad cut-in, IASK would SIGABRT because it expected a tool bar (IIRC).
The README only has a link to http://www.inappsettingskit.com, which looks like a lot of programmer related marketing. There are no Universal App samples, and the two samples provided are very basic (not reflecting the needs of a Tab Bar/Split View app). In addition, I have not found a place to ask questions (github does not appear to have a bulletin board system [1]) and there does not appear to be contact information.
Has anyone successfully used InAppSettingsKit in a Universal App? If so, was sharing the best method, or was duplicating files and renaming the best method. Was it worth the effort to debug and modify someone else's work in a vacuum? If someone have a better recommendation, I would love to hear it.
[1] https://github.com/futuretap/InAppSettingsKit
First of all, there's an "Issues" area on the GitHub page where you can ask question, too. We don't give individual advice because we wanna avoid duplicate work for a voluntary project.
I don't see why you should need to modify InAppSettingsKit at all depending on whether it's used in a tab bar or split view controller.
Take a look at the sample project where we integrate IASK into a tab bar, a navigation controller and a modal view controller.
Other than that, I'm afraid, I don't have specific advice how to integrate it into a Universal binary.
I just completed the export of my RCP application for Windows and I noticed some strange behavior when testing the app on computer with 2 monitors.
The first time the application is launched, the splash screen and the main apllication windows are displayed on the primary monitor => it's ok !!!
Then I move my application on the second monitor and close it. Relaunch the app displays the splash screen on the second monitor, it's perfect, but it then brings the application window on the first monitor => it's boring and not the expected behavior ...
My Eclipse SDK doesn't have this problem, it simply opens at the last location. I guess I am missing something in my RCP in order to have the same behavior.
Any idea on the subject will be really helpful for me because after many "googling" I was not able to solve my issue.
Thanks in advance for your help
Manu
Did you try some kind of workbench customization, using the IWorkbenchConfigurer like in this example?
// in preWindowOpen(IWorkbenchWindowConfigurer configurer)
Dimension dim = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
configurer.setInitialSize(new Point((int)dim.getWidth(),
(int)dim.getHeight()));
Or:
if you use configurer.setSaveAndRestore(true); in your initialize() then the rcp re-opens in the last used size.
Since it only set the size, it may not be enough in your (double-screen) case though.