Need a lot of custom JComponents, but Java just too 'slow', other Solution?

Hi folks,
first of all i'll try to explain my problem (although my english is quite bad)
We're programming a tool for visualising graph algorithms (df search, strong connected components, transitive reduction etc.) For that, we got a drawing area (derived from JLayeredPane) which contains the Nodes and the Edges of a graph (for all that don't know what a graphs is, just imagine these nodes as numbered circles, and the edges as directed lines from one node to another).
Both parts (Nodes and Edges) are derived from JComponent, because a) need MouseEvents on these Components and b) we need the ability to add them to a container (like JLayeredPane)
An absolute requirement is that you can directly click on the edges (to mark them, or delete them etc)
Another point which needs to be mentioned, the edges maintain a (invisible) polygon which lies around their line, this polygon is sensitive for mouseEvents.
Now there are two main problems:
* all these edges have (due to JComponent) (possibly) huge invisible rectangles (the only thing that really matters is the line from one corner of this rect. to the other) ...so if i got lets say a graph with 10.000 edges, there are a lot of edges that overlap (nearly 10.000 :) ) ... but only the Edge-object on top receives the MouseEvent (but perhaps the user wanted to cklick a edge that lies below the top-edge!) .. at the moment, the program looks at all edges below that which received the MouseEvent and checks wether the 'mouse'click' hits a polygon, If it does, the top edge dispatches the MouseEvent to that edge. (furthermore, due to the depth-order in a Layer of a JLayeredPane, we only need to look at all edges that are really below the egde that received the mouseEvent)
This all works great for 'small' numbers of edges (approximately 1000-2000) but with a rising number of edges this attempt gets slower and slower (it takes 1-3 seconds to evaluate a single mouseclick on a Sun Ultra 5/333)
* the bigger problem is, that if i got 10k+ JComponents in a Container Java gets really slow, just adding these 10k JComps. (to the JLayeredPane) takes some minutes?! Furthermore java consumes up to 200+ MB main memory in this situation.
One solution we are currently thinking about is to implement these edges as 'pure graphics'-objects (for example the Container just draws all edges).. this probably solves problem # 2 but # 1 gets even worse (no depth-order, some more coordinates hassle)
So, i hope someone can give me a hint for this problem or someone has had a similar problem before and has a good solution? (if the problem isnt clear, just ask)

I worked on an application once that had a similar structure as yours, but we were only scaling up to about 1000-2000 components. The problem that we identified (and that you have, no doubt, also identified) is that you are searching all of the child components on every hit test/overlap test. What we did was to subdivide out outermost container so that it had a couple of dozen children, each of which then parented some of the original child components: this cut our search space for every hit test dramatically. We had the advantage of having collections of child componenents that we knew would not overlap so our first level containers did not overlap -- you may need your first level containers to overlap, but even with this, you'll still be able to much more quickly identify components in the immediate region that should be checked individuall.

Similar Messages

  • New iphone 6 with ios 8.0 crushed and didnt open again. call center told me that use itunes to update 8.0.2 but server is too slow and didnt let me download it. it stopts in the middle of the session. how can i download it from another link or server

    new iphone 6 with ios 8.0 crushed and didnt open again. call center told me that use itunes to update 8.0.2 but server is too slow and didnt let me download it. it stopts in the middle of the session. how can i download it from another link or server. by the way i try to dowload from turkey.

    anyone help me there? )=

  • Love Aperture 3's new features, but finding it too slow to be usable.

    About a year ago I took on photography as a serious hobby, and have been looking for a good photo management program. I have a Nikon D300s camera and started with the nView software, before upgrading to Photoshop CS4. Bridge was fast, but a bit too utilitarian for my liking so I began looking into alternatives like Lightroom 3 and Aperture 3. My goal is to find a program that is quick, responsive, and capable of performing the majority of my basic editing, while allowing me to maintain a nicely organized photo library. I shoot in the .RAW format and have about 7k photos in a referenced library. I have installed all system updates, including the prokit update.
    So as the title suggest, I love almost everything about the new Aperture. Its interface is beautiful, photo organization is a snap, and it has some very powerful editing tools. That being said, it is unbearably slow. Brush edits can take up to 3-5 minutes to show, while the brush tool tip chunks around the screen. Even showing the color overlay can take a few minutes. Zooming into a photo can also take upwards to 2-3 minutes. If I have made more then a few adjustments, toggling them on and off can take a minute or longer.
    During these delays, I don't get a beach balls, but my computer slows to a crawl. According to Apertures activity center it is "processing." Some times it is so many processes behind, that I wonder if it is processing adjustments that I have already changed. Bringing up the activity monitor usually shows that cpu usage is 40% or below, with Aperture rarely taking more than 2.5gb of RAM.
    I have tried all the tricks I have read about online, faces off, places off, preview sized maxed out, preview size minimized, prokit update, deleting cache files, starting new libraries with fewer pictures, and creating Steve Jobs effigies to place around the office. It feels like I have tried it all. I am even willing to format my computer and start from scratch, even though everything but aperture runs great.
    My trial is about to run out again and I am just so frustrated. I want to buy this program, but at the moment the lightroom 3 beta runs circles around it performance wise. Is there anything I haven't tried that might make Aperture useable?

    I share your frustration.
    I am in love with Aperture's features, its workflow, and its OS integration. But I can't live with its behavior. I postponed my final decision to put Aperture on the shelf until this week, when my new MacBook Pro arrived. I bought the latest model, Core i7, 8GB RAM, 1TB HD. I have 700MB of free space on my new HD, and there is no fragmentation. You could say that I have about as snappy a system as Apple makes these days.
    Using A3 on this system is generally OK. But working with the retouching brush, while a lightyear better than my late 2008 MacBook Pro, is still dreadful. I want to use the retouching brush to remove blemishes and wrinkles from photos of women. This usually requires lots of small brush strokes. After the first few brush strokes, A3 slows down to the point of frustration. It takes about 20 seconds for the effects of the brush stroke to appear, which makes it not a productive use of my time.
    I don't understand the constant need for Aperture to be "processing" something in the Activity window, but I've learned that when it's processing, you can't really get anything else done.
    Exporting versions to disk is the final indignity. It's usually the last thing I do before quitting a session in Aperture. Yesterday, I wanted to export two retouched files to JPG for an email proof. This took several minutes for my MBP to complete. Lightroom's beta version completes the task in a few seconds.
    Inexcusably bad performance on my high end hardware.
    Sorry Aperture, but I'm back to Lightroom and Photoshop. I'll check back when Apple releases Aperture 3.1 and hope they figure this out.

  • If I need to get my iPod fixed but I live too far away from an Apple store, can I mail it to them?

    I've been having issues with my iPod Touch 5th generation, not due to wear or abuse, and my search has led me to make an appointment at the Genius Bar at an Apple Store. The nearest Apple Store to me is over 3 hours away. Is there any way I could mail it to them to get fixed or replaced? Or do I have to have to drive all the way there to have it looked at in person?

    Try to contact Apple Service here: /https://expresslane.apple.com/GetproductgroupList.action?PRKEYS=PF3

  • Checked download speed on 'speakeasy', over 5mbs, but site open too slow

    certain web sites like WGT.com open very slow, even when my download speed is at 5mb/s or faster. Why is this?

    Paul,
    can you carry out a speed test and post the result please?
    http://bt.custhelp.com/app/answers/detail/a_id/935​4/~/how-can-i-test-my-broadband-speed%3F
    iechyd da
    sky twitter account a customer ask why sky go streams are worst then sd and yet bt and eurosports apps stream in hd. Reply from mod, oh thats easy the files for hd are some huge that sky go can't play them and no app can stream hd due to this and so when they say they are they're really sd streams, if there was any way around this we would have done it now.

  • I am creating a web form from a template and I need to change a field. It is just a text field at the moment but I need to change it to a field that the customer can fill in. How do I do this?

    I am creating a web form from a template and I need to change a field. It is just a text field at the moment but I need to change it to a field that the customer can fill in. How do I do this?

    See this thread:
    http://answers.acrobatusers.com/Is-add-instructional-text-text-field-disappear-clicked-q19 5078.aspx

  • My hard disk crashed and I cannot find out how to "contact customer service" other than this forum.  The website seems to just take me in a circle. I need to de-activate a license but cannot access the software due to a crashed hard drive.  Please help.

    My hard disk crashed and I cannot find out how to "contact customer service" other than this forum.  The website seems to just take me in a circle. I need to de-activate a license but cannot access the software due to a crashed hard drive.  Please help.

    Hi Anthony ,
    Here is the link to connect with Adobe Chat Support.
    https://helpx.adobe.com/adobe-connect/kb/connect-chat-support.html
    Hope your query gets resolved .
    Regards
    Sukrit Dhingra

  • HT1338 There is a lot of talk about the Java security issues and the ability to download a patch fix, do i need to do this or will software update pick this up for me?

    There is a lot of talk about the Java security issues and the ability to download an apple patch fix, do i need to do this or will software update pick this up for me?

    Thanks for that, how do I establish if I have Java installed as on Safari preferences it indicates the following
    Web content - Enable Java
                        - Enable JavaScript

  • We are using EBS 12.1.3.  When we input a sales order from a customer we input the sales order and specify the date the customer wants it.  This isn't always the date that we intend on manufacturing it though.  I need to put a customer due date in, but be

    We are using EBS 12.1.3.  When we input a sales order from a customer we input the sales order and specify the date the customer wants it.  This isn't always the date that we intend on manufacturing it though.  I need to put a customer due date in, but be able to put a date in another field that MRP can read in the event we choose to manufacture based on another date.  For example, early.
    Any help would be appreciated.

    What you are experiencing is 100% related to Malware.
    Sometimes a problem with Firefox may be a result of malware installed on your computer, that you may not be aware of.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/faq/?qid=208283363 TDSSKiller - AntiRootkit Utility]
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    [http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    Did this fix your problems? Please report back to us!

  • I need to apply for a job but I'm told I need to enable cookies and java script, how do I do that?  I can't find it in system preferences

    I need to apply for a job but I'm told I need to enable cookies and java script, how do I do that?  I can't find it in system preferences
    I just updated to the new operating system which i'm starting to think was a bad idea, because it reset all my settings and I don't know how to fix them.

    so when I go to safari>preferences>security>uncheck box labled enable java script  links on webpages don't work and pictures and links son't want to appear on websites.  this made it so webpages don't want to work past loading the content in text format.  I have to check enable java script to go the webpages to work right so images and links work again but when I try to apply for this job the error message pops up saying I need to enable cookies and java script.
    SO I GUESS MY QUESTION IS IF JAVA SCRIPT IS ALREADY ENABLED HOW TO I ENABLE COOKIES?

  • Lots of existing threads, but no consistent answer - what settings need to be applied to the 2012 (new) Airport Express for it to work at hotels with an ethernet only connection?  Any answers specific to Japan would be helpful.

    Lots of existing threads, but no consistent answer - what settings need to be applied to the 2012 (new) Airport Express for it to work at hotels with an ethernet only connection?  Any answers specific to Japan would be helpful.  I would prefer not to take my old Dell laptop and just be able to use my Ipad 2 via the wireless connection that the Airport Express creates.  However, I can configure the Airport Express at home prior to leaving if that is the best thing to do.

    I have a very similar problem with my AE! My MacBook, MacBook Pro & iPod Touch (1st Generation) all get a GREAT signal from our AE. BUT, our iPod Touch (2nd Generation) and new iPad (WiFi) get terrible signal strength unless we're right next to the AE!! Tech support at Apple is of no help! I'm ready to sell them all! This all started when we got the last OS update for iPod Touch/iPhone/iPad. So it must be a software issue not a hardware one..
    Any ideas?

  • Help needed for translation of custom objects

    Hi All,
    We are currently in the process of upgrading from 11i to R12.1.3. We have a lot of custom reports and forms which needs to be translated based on language preference set at user level. The approach we have taken is as follows:
    1. Created one unique look up type for each of the custom objects.
    2. Each lookup code is mapped to a field of the custom object (report or form).
    3. Entered the translation for each of the lookup codes using Globe icon (Translation Form) available on the lookup form.
    4. When the user logs into his account, we are filterting out the record specific to user environment language using the condition:
    language of fnd_lookup_values = usernev('lang') and getting the translated labels for each of the fields in the custom object.
    Now what we would like to understand is if there is any other better way of doing translation based on user preferred language.
    We have heard about Oracle Translation Manager (OTM) but not sure how the same can be used in our case. Also we would like to know how Oracle does translation for the languages that are enabled in a particular instance. We would like to know if a similar approach can be followed for custom objects as well.
    Thanks & Regards,
    Sreenivasa M

    Implode wrote:
    We had the arrayList/collections lecture today.
    I asked the teacher about sorting objects and he started explaining hashmaps and then he mentioned another thing which we will only be learning next term, I'm sure we must only use what we have learned.
    How exactly can this be done. I have asked a few questions in the post already.
    ThanksWell, there was probably a gap in the communication. Hash maps (or hash tables, etc.) are instance of Map. Those are used to locate a value by its unique key. Generally, to speed up access, you implement a hashing function (this will be explained hopefully in class). Think of name-value pairs that are stored where the name is unique.
    Contrast this with items that are sorted. Any List can be sorted because its elements are ordered. An ArrayList is ordered, generally, by the order you inserted the elements. However, any List can be given its own ordering via Comparable or Comparator. You can't do this with an ordinary Map. The purpose of a Map is speedy access to the name-value pairs, not sorting. The List likewise has different purposes, advantages, disadvantages, etc. List can be sorted.
    A Map is generally similar to a Set. A Set is a vanilla collection that guarnatees uniqueness of each element (note, not name-value pairs, but simple elements). There is one concrete class of Map that can be sorted, TreeMap, but I doubt your professor was referring to that. The values or the keys can be returned from the Map and sorted separately, but again, I doubt he was referring to that.
    Take a look at the Collections tutorial here on this site or Google one. It is fairly straightforward. Just keep in mind that things (generally) break down into Set, Map and List. There are combinations of these and different flavors (e.g., Queue, LinkedHashMap, etc.) But if you can learn how those three differ, you will go a long way towards understanding collections.
    (Oh, and be sure to study up on iterators.)
    - Saish

  • Report RSXMB_RESTART_MESSAGES needs a lot of resources

    Hi,
    we are using PI 7, SPS9.
    When we have a heavy load in XI, we are getting sometimes JavaNullPointer-Exceptions in Java-mappings, so we have to restart these messages - no problem!
    There is the report RSXMB_RESTART_MESSAGES to restart failed messages, but when I defined it as a job (every 1 hr) and during this time we have a lot of messages (but only some are failed), the job never ends and it needs a lot of resources!
    In the queues I can see a lot of entries made by the report.
    Our report still have the field "max restarts" and I entered 5 restarts!
    What can I do?
    Thanks a lot!
    regards
    Wolfgang Hummel

    Hi Sandro,
    thanx for your answer.
    This is a test system and at the moment I just defined jobs for deleting and not for archiving.
    My problem is, that we have a sender with thousands of messages via the same interface for the same receiver and sometimes a message failed ('cause of NullPointerException in java mapping).
    To define a filter in the report RSXMB_RESTART_MESSAGES is no solution 'cause the filter cannot reduce the number of messages (it's always thousands of messages).
    When the job starts during less traffic, I don't have any problems - it's just a problem during heavy traffic.
    regards
    wolfgang

  • Need Information on an Application (intel) called Java VisualVM.

    Need Information on an Application (intel) called Java VisualVM. I dont know where it came from, whats it's for and why it is there? More importantly, how to get rid of it?
    Thanks guys.

    Hello Ram
    regarding "environment parameters" there might be one "disadvantage". If you would have the need to change the parameter you need a transport. May be there are other useful options which could be of interest:
    As you may be now you can store user dependent parameters on the level of the SAP user. One example is:
    You (as the user) can select  a property tree. This selection of a property tree can be stored on userid level (therefore if you log off and log on once again the selection property is your "default" one,)l. Regarding this option you do not need a customizing parameter. The "cons" of this options are:
    a.) you must prepare this "parameter" like a constant in your program to be read from user profile
    b.) you should make sure that the user can only select from a number of values or if the user is using a value which is not allowed you need some "error" handling routine
    So may be this option is not so "robust" but is used very often in SAP and in SAP EH&S.
    With best regards
    C.B.

  • Simple Custom Events in Java

    Hello All
    I am new to Java hailing from C++ and ActionScript. I need to create a custom event system for use with various design patterns I'm using in a project (starting with MVC for the overall structure).
    From what I understand, I need to use the EventObject and EventListener base classes to derive my own custom classes from, in order to do this. In ActionScript, the events system works quite differently, having an EventDispatcher class you inherit from, etc. It also specify types of events as constants. So I'm a little confused as to how to do this.
    The following example seems to explain pretty much what I need:
    [http://exampledepot.com/egs/java.util/CustEvent.html|http://exampledepot.com/egs/java.util/CustEvent.html]
    ...but adapting this is giving me a bit of a headache, maybe because I'm stuck in the ActionScript event paradigm. Am I right in assuming I could simply pass an integer parameter in the event, specifying what type it is?Or do I need to specify a different class for each event type (extending either EventObject, or an interface which extends from EventObject each time)?
    Lastly, can someone tell me whether or not a native List implementation using generics might not work just as well for the given example as the EventListenerList used above ? (I see no reason to use Swing classes when I won't be using Swing at all... it just seems unclean. My app is a socket server and needs no UI functionality.)
    Thank you in advance.
    -Nick

    NickZA wrote:
    ...but adapting this is giving me a bit of a headache, maybe because I'm stuck in the ActionScript event paradigm. Am I right in assuming I could simply pass an integer parameter in the event, specifying what type it is?Or do I need to specify a different class for each event type (extending either EventObject, or an interface which extends from EventObject each time)?Noone forces you to use EventObjects of any kind. If you like (and it's sufficient for you), then you can simply pass any value you want or even no value to the event method in the Listener interface.
    So an event that's represented by the worldIsCollapsing() method might not need any additional information.
    Lastly, can someone tell me whether or not a native List implementation using generics might not work just as well for the given example as the EventListenerList used above ? (I see no reason to use Swing classes when I won't be using Swing at all... it just seems unclean. My app is a socket server and needs no UI functionality.)Basically yes, it would work just as well. The difference is that the EventListenerList can handle Listeners of different types (i.e. you can manage your FooListeners and your BarListeners using a single object, if you used simple Lists instead, you'd need two of those).

Maybe you are looking for

  • How can I fix a dynamic zoom tool issue for users of Reader v8?

    I am publishing a PDF to be posted on the internet for downloading by end-users. The PDF is designed to open in full screen view, that is, without tool or menu bars visible. This means it would be helpful for me to embed additional functionality onto

  • Can't Download Maps To X6 With Ovi

    Hi there. I've had my X6 for a few days now, and I'll be going on a trip, so I want to try out the Ovi Maps. I have installed  all software from the CD that came with my X6 and I have the latest versions of Ovi Suite and PC Suite on my Computer. The

  • Web layout on indesign export as PSD

    Hello, I'm creating an ipad ibook. I'm just doing the graphic side and a develloper will take care of technical. It's easyer for me to work on indesign because there is a lot of text is there a way to export it as psd for the developper ? There is a

  • SAFARI WILL NOT LOAD GMAIL

    Safari will not load gmail unless I go to my router, power it off and power it on.  Gmail will then load in a flash ... for about an hour and then progressively take longer until it will not load at all.  I've taken it to a "specialist" for a clean-u

  • Wth? dl'd $100 in music last week

    wth? dl'd $100 in music last week...and ITunes can't locate files? WIndows8