Equivalent to JGraph for JavaFX8? - javafx

I want to port an old swing tool which uses an also old version of JGraph to JavaFX8. However, since JGraph is a Swing-Based library, is thought about replacing it, too. So, is there something equivalent to JGraph, but working with JavaFX8?

So, is there something equivalent to JGraph, but working with JavaFX8?
Following Jonathan Giles Blog, I can't remember having read anything about a JavaFX based graph library yet -> so, most likely, no
But you should be able to use Swing controls in JavaFX: https://docs.oracle.com/javase/8/javafx/api/javafx/embed/swing/SwingNode.html

Related

Quartz 2D substitude for graphicsPort in SDK 10.10

The scenario:
I'm editing some CGImages and strangely enough until now I was first creating NSImages from those CGImages before drawing them. So I tried to change the code so that I would draw the CGImages directly in into NSGraphicsContext.currentContext().graphicsPort. As you see I'm using Swing here but the same problem goes for Objective-C I presume.
Having a look into the documentation I saw that graphicsPort will be deprecated in 10.10, but I couldn't find another way to the current CGContext from NSGraphicsContext nor is there a way to create the CGContext from an NSGraphicsContext.
The Question:
Does anybody know what the proper way to retrieve the context would be? If not - Is there a way to cast the graphicsPort's COpaquePointer, which apparently is an initialized NSPipeObject, to a CGContextRef? Although using code that has already been marked deprecated would be quite unsatisfactory I would consider it until there is a better solution.
After spending a half hour digging around for information on this, I realized I should just check out the header file for NSGraphicsContext. Turns out there's a new property on NSGraphicsContext that's apparently not documented yet: CGContext. The header also notes that this should be used instead of graphicsPort.

Sketchup API for navigating around a model (eventually to integrate with Leap Motion)

I'm trying to use to SketchUp API to navigate around 3D models (zoom, pan, rotate, etc). My ultimate aim is to integrate it with a Leap Motion app.
However, right now I think my first step would be to figure out how to control the basic navigation gestures via the Sketchup API. After a bit of research, I see that there are the 'Camera' and the 'Animation' interfaces, but I think they would be more suited to 'hardcoded' paths and motions within the script.
Therefore I was wondering - does anyone know how I can write a plugin that is able to accept inputs from another program (my eventual Leap Motion App in this case) and translate it into specific navigation commands using the Sketchup API (like pan, zoom, etc). Can this be done using the 'Camera' and the 'Animation' interfaces (in some sort of step increments), or are there other interfaces I should be looking at.
As usual, and examples would be most helpful.
Thanks!
View, Camera and the Animation class is what you are looking for. Maybe you don't even need the Animation class, you might just be ok with using the time in the UI class. Depends on the details of what you will be doing.
You can set the camera directly like so:
Sketchup.active_model.active_view.camera.set(ORIGIN, Z_AXIS, Y_AXIS)
or you can use View.camera= which also accept a transition time argument if you find that useful.
For bridging input you could always create a Ruby C Extension that takes care of the communication between the applications. There are some quirks in getting C Extensions work for SketchUp Ruby as oppose to regular Ruby though - depending on how you compile it.
I wrote a hello world example a couple of years ago: https://bitbucket.org/thomthom/sketchup-ruby-c-extension
Though note that I have since found a better solution for Windows, using the Development Kit from Ruby Installers: http://rubyinstaller.org/
This answer is related to my comment above regarding the view seemingly 'jumping' when I assign a new camera to the current view using camera=, but not if I use camera.set.
I figured out this was happening because the camera FOV for the original camera was different, and the new camera was defaulting to an FOV of 30. By explicitly creating the camera with the optional perspective and FOV arguments from the initial camera solves this problem:
new_camera = Sketchup::Camera.new new_eye, new_target, curr_camera.up, curr_camera.perspective?, curr_camera.fov
Hope people find this useful!

Is there something like .NET Reflector for Qt?

Once I've seen a nice tool called .NET Reflector. It can show the entire object hierarchy of .Net binaries/apps (sorry if the term is wrong).
Is there something like this for Qt? As Qt has very good QMetaObject abilities, it should be possible to traverse object-trees, call methods(slots), change properties, etc.
I am currently re-factoring a Qt project. The naming of variables is very domain specific and I am not the expert in this domain. So, it is difficult for me to map a widget-variable to the widget on the screen. Such tool would be a great help for me to understand the code.
Thank you very much in advance!
For simple uses you might want to take a look at QObject::dumpObjectTree()
If you need something more advanced there's kspy
kspy: examines the internal state of a
Qt/KDE app KSpy is a tiny library
which can be used to graphically
display the QObjects in use by a
Qt/KDE app. In addition to the object
tree, you can also view the
properties, signals and slots of any
QObject. Basically it provides much
the same info as
QObject::dumpObjectTree() and
QObject::dumpObjectInfo(), but in a
much more convenient form. KSpy has
minimal overhead for the application,
because the kspy library is loaded
dynamically using KLibLoader. See /usr
/share/doc/kspy/README for usage
instructions. This package is part of
the KDE Software Development Kit.
It depends on KDE's klibloader so if you are not under KDE you have to modify it but it should be rather easy. Sources are here.
There's QSpy project. It inspects all QWidgets of running application. I'm not sure how well it works, because I couldn't use it on Mac OS X. Maybe on Windows it works better. https://github.com/sashao/martlet
http://qt-apps.org/content/show.php/QSpy?content=102287

SQLite with MFC

I want to use SQLite within my MFC application.
for that, i'll create an object whose job is to interact directly with the DB(SQLite) to insulate the rest of the app from the DB code.
can anyone point me to a good tutorial ?
i'll need operations such as (create,delete,insert,update,createdb,dropdb and so on...)
Thanks.
There's a page in the SQLite site that lists many available wrappers - here. The C++ wrapper Daniel mentions in his answer is probably the most common one, though it does not support Unicode and the SQLite dll that comes with it is quite dated. There's a Unicode version of that wrapper here, but it's a bit buggy and requires some more work. It could, however, save you the trouble of writing the whole thing from scratch.
Have a look at this. This was really easy to port to MFC classes, but it will get you started.
http://www.codeproject.com/KB/database/CppSQLite.aspx
Or you can just do #include "sqlite3.h", add sqlite3.lib to your linker and use sqlite3.dll directly with the C api. That's what I did in my MFC app.
And you can even statically link sqlite3 into your app. Download the amalgamation and include it! It adds about 400 k.
Please define your problem more clearly.
sqlite can be coding with c, and you can read the sample in their site.

Checkstyle for ActionScript (Flex)

HI,
I'm currently working on a project that uses Flex and Java. In Java we easily enforced a coding standard with Checkstyle, and we want to do this for Flex.
Does anybody know of a tool similar to Checkstyle that would allow coding standard checks?
(I've googled for this but found only one project written in python and it seams abandoned)
Thanks
The long and the short is that there is... kind of, but only for Actionscript, and you have to test it yourself... There is a prototype of an Actionscript 3 version, but it is not even in Beta yet (and I admit that I haven't had the time to test it). I haven't found anything similar for XML, let alone MXML. This is in at least one list of feature requests for Flex 4, however.
I'm working too on a project uses Flex and Java. Like you, in Java, we easily use plugins like checkstyle, findBug, javaNcss or PMD. My personal project is to do this for Flex. I have test the prototype 'checkStyleas3' but it just verify the code source en returns you 0 or -1 as result. So you will have (me too in fact), to implement this prototype if you want to do more than that.
Keep an eye on this : http://blog.joa-ebert.com/2009/05/20/as3v-preview/

Resources