Sysml - Internal Block Diagram with GEF in Eclipse JAVA - java

I am currently working on a RCP-Application where i can draw an Internal-Block-Diagram.
Maybe most of you know "Papyrus" from eclipse. This modelling tool provides an Internal-Block-Diagram but I think it is a little bit overloaded so I decided to do it on my own.
I found this awesome tutorial :
https://www.vainolo.com/tutorials/gef-tutorials/
It helped me a lot how GEF works but one thing is not explained. How to draw ports. In the picture below you can see what i am capable of.
I am trying to modify my application that a user is able to draw ports. Like in the next picture:
Does somebody know how this is done in GEF ?
As far as I understand it, it has something to do with the figure of a node. Every node has a figure which is displayed inside the diagram. A port is an extension of the edge of a node and it is not possible to exceed the edge of a node. So I think that papyrus uses a different way to make this happen.
I tried to get the source code of Papyrus but i found nothing neither a documentation about it...
I am thankfully for every opinion.

Papyrus use GMF to create these ports.
You may check classes with containing BorderItem, for example AbstractBorderItemEditPart.
Be careful, the tutorial you are following seems to have been written for GEF3.
As far as I know, there is no "easy" way to manage port in pure GEF3.
There was a major change in GEF last year, you should be able to easily create port with the new GEF4 API.

Related

Java 3D Object Rendering with Yaw/Pitch/Roll

Im looking for a way of displaying a 3D Rectangle, which could be moved by the values a gyrosensor delivers from my arduino.
I just don't know where to start with the Implementation of the 3D Space, the communication works fine.
I did not find any useful information online, however, I just need a Window (Don't know, is JFrame enough for this) with a model that I can set x/y/z and yaw/pitch/roll etc.
Are there libraries or code-examples?
I did see one integration with JavaFX which I have never used yet, or the implementations were in other languages.
Unity worked out for this, even though i was getting buggy behaviour.
Therefore i tried out Processing, which turned out to work fine. There are some snippets online where you can pass in the values of your arduino and it just works out.
I cannot provide more details since the project was abandoned.

Using Java WorldWind, but want an alternative

So, I realize this might not be the right site, but I didn't think it would be respectful to ask it on the WorldWind forums. If it should be somewhere else, please let me know.
Anyways...
I have this Java application that currently uses WorldWind to display a globe and place bitmaps corresponding to an item's location. WorldWind was initially picked for the project as an alternative to Google's product and because it had the "3D" effect. However, requirements change, and the 3D Globe is no longer necessary. (Also, WorldWind was a little heavy for the project - we found out that we would really like just a 2 color version if possible.)
My question to you all is:
What would you suggest as an alternative to WorldWind? I'm looking for just a "flat" map (or even just an image of the world...) that is zoomable, and is possible to layer objects on top of it (and those objects can move over time).
I have not really done much with map/image programming so please take that into consideration when replying :)
Have you checked out GeoTools? I believe it should be more than capable for what you are trying to do, though like WorldWind, the actual content is what contributes to things like color and such. Check out the quickstart which even includes some sample shapefile content, and has an example of an application which displays the shapefile content in a map frame. You may have to get your hands a bit dirty to play with geo-referenced bitmaps, though...
EDIT: I also found this on the Google: JXMapViewer
(just for the record, WorldWind has a "FlatMap" option)

Java Remote desktop administration

I m currently working on my project of remote desktop administration. I m using robot class to capture images and send over network. It works well but bit slower.
Because all the time we need to captuure and send image its too costly. Is it possible to detect only a portion of screen which is changed and send only that portion?
Please any one guide me on this. Thank you!!!
The keyword you're looking for (in order to be able to look this up and figure the solution yourself) is dirty rectangles.
You can look into some code here.
I looked into this awhile back, and the image capture is implemented particularly inefficiently. I don't recall the specific detail, but it was pretty bad the way they did it. I felt, at the time, that the only way to do it better would be to implement it in JNI. Which you could use JNA to shortcut.
I don't know if any platform's screen capture routines will allow only changed sections to be sent, but you could implement a decent image diff; although that could get expensive too. You would really need to measure whats going on to see if it works for you.

Possible ways to create console like screen in java

I am trying to create a screen like this one
Initially I was trying to port a console program to java. I have found things like jcurses and charva but there is almost no documentation on them and I really cant understand how to use them.
So I figured that I could create a console like screen that resembled the one above.
what library / framwork would I be best using. Should I use swing as it if fully portable?
what would be the best approach being that I need to be able to navigate and alter the 00 in the picture above?
Easily usable would be great but as long as it has good documentation that I can learn it from that would be fine.
(Answering as if you're looking for a hex editor.)
http://jhecomponent.sourceforge.net/
http://www.fifesoft.com/hexeditor/
http://hexedit-lib.sourceforge.net/
Played a bit with the fifesoft.com offering, kinda cool.
If you're not looking for a hex editor, can you be more specific? If you just want a cursor-addressable window you'll probably have to suck it up and figure out something like jcurses or libjcsi :)
If you prefer to create a full fledged GUI with Java you could certainly use Swing. I would prefer SWT as a matter of personal taste, the widget library of Eclipse. You will find a lot of snippets and tutorials (same for Swing). Here is the Widget Library.
Here is a discussion about SWT versus Swing.
You could use the table layout manager to create the layout shown in your screenshot. If you rewrite the application from scretch, you should be able to handle the GUI events and update the widgets according to your application needs. You will easily find articles when you search for swt and table. If you would like to keep the code base and just exchange the GUI, I 'm not sure about the best approach. Maybe, the libs jcurses and charva are the way to go.
Unless you are looking to run the app on a headless VM (where a console/tty is all you've got), I'd use Swing. Create a JTable with a custom TableModel (to provide the data) and custom renderers (to provide the hex formatting) and everything should just work. Consider deriving from the various DefaultXXX implementations to save a lot of work.

Converting equations to java for android?

I am a cameraman and I want to make an app for my Moto Droid that will
calculate my depth of field given four inputs.
I am literally brand
new to javascript and this programming stuff, so I was wondering if
anyone could help me out.
I have a very basic GUI set up using Droiddraw which allows me to
input my 4 variables, which are:
Focus (#+id/focust)
Focal Length (#+id/flt)
Aperture (#+id/apt)
Circle of Confusion (#+id/coct)
Equations for this calculation are located here
for example...
to get hyperfocal distance I need to get: ((f^2)/(N*c))+f
all of these variables will be drawn from inputs in the GUI, but I don't know how to call them, how to write the actual math, and how to address the results so I can make them appear in the "results area" on the bottom of the screen.
I've never done java before and I only want to make this app because the existing ones don't fit my needs.
Can someone help?
Thanks!
If I'm not mistaken, DroidDraw is a tool for building the XML user interface description used by the Java API. If you want to program for Android in JavaScript, something like PhoneGap might be a better choice. It lets you build real Android application using HTML and JavaScript.
On the other hand, if you want to use the XML and Java APIs, then you should probably run through the Android tutorials. The first one is Hello, World.
Since you're just getting started with programming, I can't stress tutorials enough. It's true that your idea shouldn't be too hard to implement, but you need to understand the basics first.
I don't mean to give the impression that one style (PhoneGap vs. Java and XML) is better. For your purposes, either should be fine. It's more a question of what you prefer. Java/XML is the paradigm supported by Google, and provides access to more functionality. On the other hand, if you already know HTML or JavaScript (or are interested in learning them), PhoneGap will certainly provide everything you need. I think PhoneGap is also intended to make it easier for beginners, though I haven't used it, so I don't know how successful they have been.
The XML file that is generated by DroidDraw can't be used within PhoneGap. If you do choose to use PhoneGap, then you will need to build the interface in HTML. You might be able to use something like DreamWeaver or FrontPage or one of any number of HTML editors to help you with this step.
The XML file is just a description of an interface. When you start your application, the Android platform uses this description to build the user interface that you see. Once that has happened, you can move data from the interface to Java, or from Java to the interface, without any hassle. You certainly won't be limited by the XML interface description - it's pretty flexible.
If you've been going through the Android tutorials, then it might be best to forget that I even mentioned PhoneGap. It's a wildly different alternative that is the right choice for some people and some applications. But the Android tutorials won't help you to understand it. I only brought it up because you mentioned JavaScript in your original post.

Categories

Resources