Visio like object drawing in Java - newbie question

Hi all,
Although a reasonably experienced java programmer I am new to the world of 2D graphics.
I am contemplating writing a tool which includes a diagramming capability for displaying computer systems and interactions between them.
I guess this would not be a million miles from what a UML diagramming tool does, but it would definitely have some differences.
So, for example, in this tool a user would be able to:
Define a computer system and allocate an icon for it.
Drag that system icon onto a diagram.
Draw lines between systems and to represent interactions and define what those interactions were.
Does anyone know if there are any Java API's or tools out there which could get me started?
Thanks in advance, Robin.

wpafbuser1 wrote:
Go fly a kite, Troll. OP said he was new and wanted to know which Java API's to use for 2D graphics. Moreover, there are no Java-related API's with diagramming capability. He can Google for that anyway.He's not new to java as he has stated that he is a "reasonably experienced java programmer". He also knows that he will probably need Java2D else he wouldn't be in this forum. If he is reasonably experienced, there's no doubt that he knows about Swing and how it can be used to create GUIs.
To the OP, you could try to roll your own Visio like flowcharting program through Java2D and Swing, but you will probably get up and running faster if you use tools already created for this purpose. One such is JGraph ^1^. There are probably others as well.
^1^ http://www.jgraph.com/

Similar Messages

  • RFCLIB access from Perl / Java  - newbie question

    Hi folks,
    I am newbie with SAP. I am triying to access the SAP from my web application, wrote in PErl or JAva.
    I am trying to access the librfc, bit I would like to know:
    1) What software I need to install in my client side (the web server that host my web application)??
    2) Which software contains  the RFC SDK? or the RFC LIB?
    3) Should I runt the script to access the rfclib in the SAP server side???
    Please help me with this cruel doubt !!!

    Hi,
    download the SAP JAVA Connector (SAP JCO) from
    service.sap.com
    There are enough examples for java.
    Best Regards
    Frank

  • Java Newbie Question - the import statement

    Hi Geeks,
    I have a problem for importing a java .class in my project. This latter is named "Tedetis_New". Inside it, I created a "src" folder containing all the source code of the application. I import a jar file inside the parent directory of "src" (i.e. at the root of the project). Inside this jar archive, two classes (.class files) are not placed inside a package (default package according to eclipse), let's name one toto.class. So when I want to import toto.class from a file inside the src directory I simply do "import toto.class" but this statement doesn't work ! I don't manage to import my toto.class so ... what do you propose for this ?
    Thanks.

    Don't use the "default" class for anything serious;
    you can't import such a class.Er, package maybe?Yes, I was editing my reply while you replied to my reply so I couldn't
    edit my little blooper in my reply anymore; thank you very much Sir ;-)
    kind regards,
    JosI entered that response as quickly as I could, for just that reason. I
    thought you might notice and try to correct it, and I wanted to preserve
    your fuckupus maximus for all eternity.
    Everyone gather round and taunt Jos! Wave your private parts at his
    auntie! Fart in his general direction!
    Now, aren't you glad you didn't say "Jehovah"?I already knew that you were the one who invented amiability ;-)
    kind regards,
    Jehov^H^H^H^Hos

  • Java newbie questions...Setting the classpath in Unix

    When you set the classpath, how do you include anything already in the classpath? For instance, if your profile sets your classpath to
    "/home/weblogic/:home/weblogic/weblogic.jar, and you want to add MyJar.jar to it, can you enter:
    export classpath=~:MyJar.jar
    My question really boils down to how do you prefix the existing CLASSPATH environment variable to any new classes or jars you want to add to it. I think it's the tilde, but I'm not sure.

    In csh, the CLASSPATH environment variable is modified with the setenv command. The format is:
    setenv CLASSPATH path1:path2
    In sh, the CLASSPATH environment variable can be modified with these commands:
    CLASSPATH = path1:path2:...
    export CLASSPATH
    ====
    (From the Sun documentation)
    or, in sh,
    export CLASSPATH=path1:path2
    should work

  • Threads in Java: Newbie question

    Hi
    I had a doubt regarding Threads. I have implemented a Security Manager which does not allow a thread to write into a file. Now, the problem is when the thread tries to write into a file, the Security Manager calls my function in which I want to immediately terminate the thread. How do i do this? How do I terminate a thread without using the deprecated Stop() function ?
    Thanks in advance
    RG

    The trick is to make the thread die a natural death... One method is have a boolean somewhere which is initially set to true (maybe call it keepRunning?), and the thread that should die have a while loop which periodically checks to see that this boolean is still true.
    The function which should terminate the thread can now set that variable to false and force the thread to die at the next iteration of its while loop.
    There are more examples, more methods, and probably a better explanation at:
    http://java.sun.com/docs/books/tutorial/essential/threads/lifecycle.html
    Good luck!

  • Another java newbie question:  "Link errors"

    In the environments I've attempted compiling in, it seems that there is a just-in-time default, which means that any missing classes are not found until run time.
    Is there any way to to run javac so that what we used to call "link errors" will be displayed at compile time?

    Java has no .h files, so it shouldn't compile at all if a class is missing, unless:
    Someone compiles class Library, they have class Extension available
    They give you Library
    You compile, javac sees theat "Library" exists and checks no further
    At run time, you get errors about Library needs missing class "Extension"
    What class is missing anyhow?

  • Java newbie question

    Hi,
    I have the following code:
    public class Dice {
    public static void main(String []arg){
    Scanner scan = new Scanner(System.in);
    Random ran = new Random();
    public void RollDice(){
         ran.nextInt();
    public int returnDice(){
         return ran.nextInt();
    }And the compiler yells at me that it can't find the symbol variable ran.
    If you create an instance of Dice how would you call it in the methods?

    Gimli wrote:
    Hi,
    I have the following code:
    And the compiler yells at me that it can't find the symbol variable ran.
    If you create an instance of Dice how would you call it in the methods?
    public class Dice {
      private Scanner scan;
      private Random ran;
      public Dice() {
        scan = new Scanner(System.in);
        ran  = new Random();
      public static void main(String []arg) {
        Dice dice = new Dice();
        dice.RollDice();
        dice.returnDice();
      public void RollDice() {
        ran.nextInt();
      public int returnDice() {
        return ran.nextInt();
    }OR
    public class Dice {
      public static void main(String []arg) {
        RollDice(new Random());
        System.out.println(returnDice(new Random()));
      public static void RollDice(Random ran) {
        ran.nextInt();
      public int returnDice(Random ran) {
        return ran.nextInt();
    }Just a few ideas to think about.

  • Newbie question on the Java communications API

    Hi All,
    I found the javax.comm extension package that lets me listen to the serial port of the PC, but am unsure as to how to use it. Well, I've tried running the SimpleRead.java program and I get an error message that says the package is missing in the import (which I assume means that I havent downloaded it and added it to one of the folders in my Java directory). Where can I find the package from? And am I missing anything else?
    In case you're all wondering, I've got a microcontroller attached to the serial port that sends data periodically. I would like to use the Java comm API to read the incoming data (and if possible store it in the form of a text file or something). Any suggestions would be great as I'm still new to Java. More of a C/C++ person (^_^) Thanks in advance.....

    Did you try using that little search field in the upper right hand corner of your browser?

  • Java newbie: java.lang.Object[]

    Hi: I have a method which returns a java.lang.Object[]. I have tried a number of things. But can't seem to How do I print the contents of the object?
    The method I am calling is the following
    ==============
    public java.lang.Object[] getAllUsers() {
    if (super.cachedEndpoint == null) {
    throw new org.apache.axis.NoEndPointException();
    org.apache.axis.client.Call _call = createCall();
    call.setOperation(operations[125]);
    _call.setUseSOAPAction(true);
    _call.setSOAPActionURI("");
    call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11CONSTANTS);
    _call.setOperationName(new javax.xml.namespace.QName("Urn:ApiService", "getAllUsers"));
    setRequestHeaders(_call);
    setAttachments(_call);
    try {        java.lang.Object _resp = _call.invoke(new java.lang.Object[] {});
    if (_resp instanceof java.rmi.RemoteException) {
    throw (java.rmi.RemoteException)_resp;
    else {
    extractAttachments(_call);
    try {
    return (java.lang.Object[]) _resp;
    } catch (java.lang.Exception _exception) {
    return (java.lang.Object[]) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.Object[].class);
    =============
    Thanks
    Ravi

    Where in that code do you claim you are doing that? Post a SSCCE .
    edit: Should you really be trying to work with web services if you don't know the basics of Java?

  • Importing Java Class Question

    Hello,
    Sorry for such a newbie question and such a long post, I did remember how to do this before but now I can't for the life of me remember. Anyhow, I have a simple question about importing custom-made java classes, from another directory in the windows operating system. I have the classpath set, and also I realize that because the two files below are in the same directory theres no need for an import statement as Java will look for the class in the same directory.
    But I would like to know how the import statement is suppose to look to import a custom made java class from another directory, (assuming of course that I set the correct classpath)
    here's the java class location:
    c:\school\csc365\narcus.java
    //narcus.java
    import java.io.*;
    class narcus implements Comparable
    String firstName = "firstName";
    String lastName = "lastName";
         public narcus()
         firstName = firstName;
         lastName = lastName;
         public narcus(String f)
         firstName = f;
         lastName = lastName;
         public narcus(String f, String l)
         firstName = f;
         lastName = l;
    public String getFirst()
    return "first..";
         public int compareTo(Object e)
         return 1;
    Here's the location of the driver program thats suppose to use the narcus.java class
    c:\school\csc365\test.java
    //test.java
    //import statement? maybe import "c:\\school\\csc365\\*"; ?
    import java.io.*;
    class test
    public static void main(String[] args)
         narcus jim = new narcus();
         System.out.println("omg\n");
         System.out.println(jim.getFirst());
    And also, here is my classpath:
    PATH=c:\school\csc365\;c:\school\
    The classpath also points to the jdk libraries and few other directories but I didn't write that above, as it probably isn't relevant.
    I've tried the following import statements.
    import "c:\\school\csc365\\narcus.java";
    import "narcus.java";
    import "c:\\school\\csc365\\*";
    But I keep getting an error that says:
    test.java:1 <identifier> expected
    Any help is appreciated!

    Hi Folks,
    I am new to this forum, heard that interesting discussions always happens on this forum so immediately registered,don't want to miss any oppurtunity to participate in discussions.
    I have pretty much basic question regarding compiling and exceuting files in different packages.I have the following directory structure
    C:\Projects\WDPROEast\Development\CommonService\Code\Java from where java files stored in different packages as follows:
    com\wdpro\commerce\common\crm\dae\nautilus\adapter directory has java files in com.wdpro.commerce.coomon.crm.dae.nautilus.adapter package.
    com\wdpro\commerce\common\dae\exception has java files with package named com.wdpro.commerce.common.dae.exception.
    com\wdpro\commerce\common\dls\exception has java files with corresponding package name.
    com\wdpro\commerce\common\dto has java files under proper package name.
    com\wdpro\commerce\common\exception has java files with appropriate package name.
    com\wdpro\commerce\common\util has java files with package name. I am starting at Java Directory,want to compile and run file named a.java in com.wdpro.commerce.coomon.crm.dae.nautilus.adapter package with having all other java files on classpath as follows
    so I issued command for compilation as follows C:\Projects\WDPROEast\Development\CommonService\Code\Java>javac com/wdpro/commerce/common/crm/dae/nautilus/ada
    pter/a.java com/wdpro/commerce/common/crm/dae/nautilus/adapter/NautilusServiceUtility.java com/wdp
    ro/commerce/common/crm/dae/nautilus/adapter/URLReader.java com/wdpro/commerce/common/crm/dae/nautilus/adapter/
    b.java com/wdpro/commerce/common/dae/exception/*.java com/wdpro/commerce/common/dto/*.java
    com/wdpro/commerce/common/exception/*.java com/wdpro/commerce/common/util/*.java com/wdpro/commerce/common/dl
    s/exception/*.java It compiled greatly but when I issue command to run a.class file as
    C:\Projects\WDPROEast\Development\CommonService\Code\Java>java com/wdpro/commerce/common/crm/dae/nautilus/adap
    ter/UtilityAccesssit's giving following exception
    Exception in thread "main" java.lang.NoClassDefFoundError: com/wdpro/commerce/common/crm/dae/nautilus/adapter/
    UtilityAccesssbut when I run a.java with the following command
    C:\Projects\WDPROEast\Development\CommonService\Code\Java>java com/wdpro/commerce/common/crm/dae/nautilus/adap
    ter/UtilityAccess com/wdpro/commerce/common/crm/dae/nautilus/adapter/NautilusServiceUtility.java com/wdpro/com
    merce/common/crm/dae/nautilus/adapter/URLReader.java com/wdpro/commerce/common/crm/dae/nautilus/adapter/Nautil
    usAccessUtility.java com/wdpro/commerce/common/dae/exception/*.java com/wdpro/commerce/common/dto/*.java com/w
    dpro/commerce/common/exception/*.java com/wdpro/commerce/common/util/*.java com/wdpro/commerce/common/dls/exce
    ption/*.javaSo my question do I need to add all required java files to path when required class files are under different packages?is it manadatory.
    I hope you understand my question,pass me any comments you may have.
    Thanks alot,
    Anu

  • Has anyone created a Visio-like VI app?

    I'm interested in creating a Visio-like app, where I can pick from a predefined set of objects (square, circle, etc.) and place them on a palette (Picture control).  I'd like to be able to use the mouse to select placed objects, either to move them, or to right click on them to look at / modify their properties.
    Has anyone done something like this?  I've created an app like this, but without any mouse interaction on the palette.  The user positions and resizes the object through a cluster control.  It works nicely, but using a mouse would be more natural.  And more user-friendly, especially for those not used to LabView.
    Bonus features that I'd like, but can't imagine that are feasible:  to use resizing boxes (e.g. at the corners of a square, to resize the square), and a ghost outline of the object when dragging it accross the pane or resizing it.
    I've played a bit with incorporating the mouse -- looking up which object is selected, drawing the ghost outline, adding the resizing boxes.  But it seems that I'm trying to make LabView do something that the OS is probably better suited to do....?
    The end goal is to be able to create a Visio-like screen made up of mostly-but-not-completely graphical objects and save its description in a proprietary format.
    I've got LV8, though I'm more familiar with LV7.1.  And I've been a proud user since LV3.0.  If this can be done, I think I can do it. ...   Help?
    Thanks!
    Tom

    "tst" <[email protected]> wrote in message news:[email protected]...
    <a href="mailto:Wiebe@CARYA" target="_blank">Wiebe@CARYA</a> wrote: Draw all the unique ID's as color values in a offscreen buffer (picture control)Use an event to get the mouse down.Lookup the pixel color in the offscreen bufferConvert it to object ID.
    That was my method until someone posted the VI shown in the attachment (I cleaned it up a little, documented it and added an example).
    If you have a series of points for your shape, then this should be a better method.
    That *is* a nice VI.
    But it's not better if you have a lot of objects. The InROI has to be called for each object, so the search time will grow with the number of objects. The offscreen buffer only doesn't have this problem. The InROI method will also be hard to use with lines. And with larger circles you have to use a lot of points, or you'll get incorrect hits or misses.
    One benefit is that you are still able to select objects even if they are totally covered by other objects. Guess a requirement specification is needed to make a choise. Switching from one to the other method will be terrible.
    Also, the picture control is just a string. If you dig into this string, you'll notice that you can make a buffer. In this buffer you can replace one single picture object. So you don't have to redraw all the entire picture. This way you can get a real performance boost. It's convenient to store object info in the same buffer.
    It would seem to me that it would be better to have a buffer of the picture itself (the blue wire) which will depend on the z ordering (i.e. everything "under" the currently selected element will be the base picture and all the other stuff would be redrawn). I haven't done any real examining of the picture control VIs, but I would rather avoid manipulating the string myself if only for the reason that NI might (please?) change the implementation to something more efficient.
    Well, the picture (blue wire) is a string with the length of the string as the first 2 bytes (perhaps 4, I'm not sure). So you can store each object's picture, and replace them one by one whenever you need to. Then, if you need the picture, remove all the sizes, concatenate the string, and put the total size before the string (then cast to picture).
    Or you can remove the size, and store the string, then concatenate, etc. and attach the total size.
    If NI changes the way it works, you only need to remake the "remove size.vi" and "concatenate.vi" (provided that concatenation is possible).
    The principle of the picture control is a virtual machine. The virtual machine itself is not that slow (unless you compare the 3d stuff to serious 3d stuff). It is slow because the subvi's that build the string are slow. Even worse, you need to call them each time anything in the picture changes. It is also slow because each time you draw anything, the pen is set (even if it hasn't changed).
    With the buffer you get a trade off. It will require more memory, but it can be much faster depending on the situation.
    With the standard picture control vi's, you are forced to build slow programs...
    Draw the ghost outline in a separate picture control. Make this picture control transparent, and set it to the same size and position as the "real" drawing. Don't forget to use the events of the top level picture control! This way, you don't have to redraw the entire picture when you move only one object.
    That's an interesting suggestion.
    Tom, if you do create something, it would be nice if you post it. Maybe we can improve it and make it into a general template.
    InROI.vi:
    http://forums.ni.com/attachments/ni/170/194933/1/InROI.vi
    ROI test.vi:
    http://forums.ni.com/attachments/ni/170/194933/2/ROI test.vi

  • Java newbie help (type casting, 64bit unsigned Long)

    Hi I am java newbie and need help on my project. I have a few questions. Can you put strings in a hashtable and test for their being their with the appropriate hashtable method? I want to test for equal strings, not the same object. Second question can you use all 64 bits of an unsigned long? java doesn't seem to allow this. Any packages that do?
    Thanks,
    Dave

    Try casting it to Long instead of long. Long (capital L) is an Object, while long (lower case l) is not. You may also check to make sure the value isn't null. I would have thought that autoboxing would have worked here unless the value was null. But I am no expert on autoboxing.
    Edit >> Checking for null ain't a bad idea but has nothing to do with the problem - this is a compile time problem. Sorry.
    Also>> This code should work:
    long cTime=(Long)session.getAttribute("creationtime");Edited by: stevejluke on Jul 1, 2008 11:00 AM

  • Usage of Object Cache for Java in J2EE apps

    Hi,
    we are investigating on whether we can use the Object Cache for Java
    (OCS4J) for our requirements. The question we have come across is:
    What is the designated way of integration for the Object cache to fit
    into the J2EE environment? Unfortunately, although the current manuals
    group OCS4J into the "Oracle Containers for J2EE Services Guide" and the
    suggested package name for the whole thing in JSR 107 seems to be
    javax.util.jcache, there is very little documentation on how the
    designers would like J2EE programmers to use the cache from within a
    J2EE app and all examples given are not from within a J2EE environment.
    We are in particular thinking about a hierarchy of several cache
    "compartments" (Region->Subregion->group) for different topics and using
    the hierarchical name of the cache (region.subregion.group) as the
    primary key for BMP Entity beans, each of them having their own
    CacheAccess object. Then we would have an API of stateless Session beans
    on top of that, which would be determining the cache "compartment", get
    the appropriate Entity Bean with the Cache Access object and then do the
    required operations on the cache.
    But then we immediately run into the question of how the mapping between
    Cache Objects and CacheAccess objects will be done etc.
    So is there anybody that can give us any hints how to use the OCS4J in
    an EJB scenario?
    Thanks in advance for any help!
    Andreas Loew
    [email protected]

    We have Java client requesting over HTTP to application server. We would like to cache some of the objects created by the servlet while serving the request. Can I use the OCS4J for caching the Java objects. Do I require any software or just copying the JAR file and importing the class would serve the purpose?
    Regards
    Arun

  • Object database for Java

    I've recently got interested in object databases and would like to do my next project using ODB instead of a relational one. Now, since I'm completely new to them, it would be helpful if someone could recommend one to me. Can ODBs be queried with SQL or do they use a different system?
    Please, don't be mad about this type of (barely-java-related) question. I did do some googling and discovered a few useful things (ie db4o), but I'd like a recommendation since I need something easy to adopt as I've alreadu started coding my project.

    jadespirit wrote:
    I've recently got interested in object databases and would like to do my next project using ODB instead of a relational one. Why? Resume building, or is there a technical reason for this decision?
    What do you know today about ODBs?
    Now, since I'm completely new to them, it would be helpful if someone could recommend one to me. Can ODBs be queried with SQL or do they use a different system?
    Not with SQL.
    Please, don't be mad about this type of (barely-java-related) question. I did do some googling and discovered a few useful things (ie db4o), but I'd like a recommendation since I need something easy to adopt as I've alreadu started coding my project.db4o is a fine place to start.
    %

  • Vector file - newb question

    After reading the user manual, I still don't understand how this works. Let's say I use Adobe Illustrator to draw a picture of sayyyyyyyy.......a kitty. Is there any possible way to take my kitty picture, export it out of illustrator as a vector file and import it into Motion so that motion can scale that image more or less indefinitely and maintain the crystal clear image no matter what the size. Like, can I zoom in on kitty's eyeball in Motion and still have the image look good?
    Sorry for the newbie question but I just have not worked with vector images much. Thanks for any help.

    The answer is yes. All you do is save the file as .ai or .pdf, bring it into Motion, and turn off fixed resolution for the underlying media (import the file to the Canvas, select it in the Media tab of the Project Pane, select the Media tab of the Inspector, and uncheck Fixed Resolution). You can now scale it as large as you wish with no loss of resolution.

Maybe you are looking for

  • CS4 Web Gallery, Uploaded gallery does not appear

    I was wondering if anyone can help me with the Web Gallery that Bridge CS4 produces. I have used Bridge CS4 to create a web gallery. After Bridge has finished creating it the result is a folder called Adobe Web Gallery. Inside that folder is an index

  • How to upload and download a file in server side program

    Give me a sample code for the file upload and download using Server side program.

  • Bad iPod Video..

    Well first sorry for my english but I'm from Mexico. OK I used to own a 30GB iPod Photo.. It was almost perfect except for the non video support. Ok so I decided to buy a 60Gb black iPod with Video. First of all it has a lot of very very small dead p

  • Capture costs and revenues - WIP

    In CO module, we have a issue: manage all costs of sale project (Zeetech) For example: The customer has a building, then Zee will install the electric system, air condition systemu2026. The requirement of Zee that: they want to control both revenue a

  • Edited Photos Not Showing in Lighroom

    Good day, First the software apps: LIghtroom 5.3 with Camera Raw 8.3 Photoshop cc (Up to date version) Imac with Lion 10.7.5 1. Importing of the Raw files is completed successfully and I see them in the Catalog and Library. 2. I launch Photoshop CC f