Announcement Announcement Module
Collapse
No announcement yet.
VLDocking View Update Problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Really no idea anyone? I cannot imagine this to be an exotic use case... updating a jpanel in a vldocking view :-/

    Comment


    • #3
      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.

      Comment


      • #4
        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?

        Comment


        • #5
          Are you sure you're working on the EventDispatchThread?

          Comment


          • #6
            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

            Comment

            Working...
            X