Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (404)
games submitted by our members
Games in WIP (289)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Accelerating graphics updates  (Read 1011 times)
0 Members and 1 Guest are viewing this topic.
Offline Surfy

JGO Visitor



Java games rock!


« Posted 2002-12-06 10:28:40 »

Hi all,

I've developing a Map component at present and I'm experiencing problems when updating the Map and it's contents to reflect the user's interaction.

At present I have a Map (JPanel) that contains Nodes (JLabel) and Edges (JComponent). The Edge component is basically a line between 2 Nodes.

When the Map is lightly populated with 5-10 Nodes and a several Edges the updates (painting), triggered from a user dragging a Node to a new location, are within the perceived scope of real-time. But as the number of Nodes increases 50+ the dragging operation really suffers; the Node stutters around the screen behind the cursor.

I wondered if I was doing anything obviously wrong, or there is a natural point at which Java can't handle the repainting. I need to use Swing for the components to acknowledge the mouse events, tooltips and other UI details.

Any thoughts ?

Thanks,
Peter
Offline Harley Rana

Junior Member




Java games rock!


« Reply #1 - Posted 2002-12-15 06:12:42 »

Hi that sounds like an iteresting problem.
When you say a Map component, im not sure what you mean.  Nodes and edges, sounds like your making a Tree.  

So as a node is being moved its kids position is also being updated, and this is whats sucking time?

Its hard to say what the problem is with out some more details of your programs stucture.

The only thing i could think is to update the kids only at the end of the dragging, if your not doing it already.  Mabye setDoubleBuffered(false) might help.

Share some of the code or design and we might be able to help more.
Harley.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars and Titan!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (49 views)
2013-05-18 05:29:12

alaslipknot (58 views)
2013-05-17 05:24:48

gouessej (88 views)
2013-05-16 08:53:38

gouessej (86 views)
2013-05-16 08:17:58

theagentd (95 views)
2013-05-15 23:01:13

theagentd (88 views)
2013-05-15 23:00:54

StreetDoggy (133 views)
2013-05-14 23:56:26

kutucuk (154 views)
2013-05-13 01:10:36

kutucuk (154 views)
2013-05-12 23:36:09

UnluckyDevil (164 views)
2013-05-12 13:09:57
Complex number cookbook
by Roquen
2013-04-24 20:47:31

2D Dynamic Lighting
by Oskuro
2013-04-18 00:46:12

2D Dynamic Lighting
by Oskuro
2013-04-18 00:45:57

2D Dynamic Lighting
by Oskuro
2013-04-18 00:23:20

Noise (bandpassed white)
by Roquen
2013-04-06 01:36:01

Noise (bandpassed white)
by Roquen
2013-04-04 00:17:38

Java Data structures
by Roquen
2013-03-29 21:21:12

Topic Request
by kutucuk
2013-03-23 05:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.139 seconds with 20 queries.