Results 1 to 6 of 6

Thread: VLDocking View Update Problem

  1. #1
    Join Date
    Feb 2011
    Posts
    3

    Default VLDocking View Update Problem

    Hi guys,

    hope you can help me.

    I set up a view using the VLDockingViewDescriptor. The view should be initialized upon a certain event. However, the view will only be updated after I resized it.

    This is the relevant code:

    Code:
        protected JComponent createControl() {    	
    
            panel = getComponentFactory().createPanel(new BorderLayout());
    		
            return panel;
        }
    
    
       private void init() {
    
        	ForceDirectedGraph fdg = new ForceDirectedGraph(goGame.getConfiguration().getAdjacencies(), 100, 0.1, 10);
        	fdg.initialize();    	
        	map = new ForceDirectedGraphLayouter(0.0001, 1.0, 200, 10, new Timer(), fdg);    	
        	map.run();    	
        	edges = map.getGraph().getEdges();
    	nodes = map.getGraph().getNodes();
    
    		
    	graphPanel = getGraphPanel();
    		
    	scrollPane = new JScrollPane(graphPanel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    	this.getControl().add(scrollPane);
    		
    		
    	System.out.println("I wanna repaint now!");
    	
    	//doesn't work:	
    	this.getControl().repaint();
    		
        }
    
    	private JPanel getGraphPanel() {
    		System.out.println("visualizationView.getGraph() called.");
    		
    		graphPanel = new JPanel() {
    
    			private static final long	serialVersionUID	= 1L;
    
    			protected void paintChildren( Graphics g )
    			{
    			System.out.println("visualizationView.getGraphPanel().paintChildren() called.");
    			//draw the stuff...
    			/* [...] */
    
    			}
    		};
    		
    		return graphPanel;
    	}

    Any help is highly appreciated and will be mentioned in my thesis.

    Kind regards,
    Mario

  2. #2
    Join Date
    Feb 2011
    Posts
    3

    Default

    Really no idea anyone? I cannot imagine this to be an exotic use case... updating a jpanel in a vldocking view :-/

  3. #3
    Join Date
    Sep 2010
    Posts
    19

    Default

    This is going to sound lame, but have you just tried calling the repaint method?
    You probably shouldn't have to, but I am only just starting myself and haven't got any other better suggestions off the top of my head.

  4. #4
    Join Date
    Feb 2011
    Posts
    3

    Default

    I'm sorry the AbstractView interface doesn't provide a repaint method...
    But it requires a JComponent createControl method which I use to create the basic view. And it provides a JComponent getControl method, which in turn provides a repaint method, but it doesn't work. But it should, I guess. Is this a bug?

  5. #5
    Join Date
    Mar 2007
    Location
    Oudenaarde
    Posts
    294

    Default

    Are you sure you're working on the EventDispatchThread?
    MSN: PM me please
    Skype: doclo_lieven

    Spring Rich Client Project Lead

  6. #6
    Join Date
    Nov 2011
    Location
    USA
    Posts
    4

    Default VLDocking View Update Problem

    Habe gerade folgendes Problem beim Update:

    Bei etwa 80 des Updates beendet er und folgende Meldung kommt:

    Während des Updates ist ein Fehler aufgetreten Unbekannter Fehler .
    Falls der Fehler weiterhin auftritt kontaktieren sie bitte den Bitdefender
    Support......

    Habe es jetzt schon mehrmals versucht.
    Wann wird das Update richtig geschrieben oder ist es ein Fehler bei mir
    was ich nicht glaube.
    Vielen Dank für eine Antwort

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •