NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

[platform-dev] Re: Visual Library - Refresh problem

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users
View previous topic :: View next topic  
Author Message
Divya
Posted via mailing list.





PostPosted: Wed Mar 14, 2012 10:22 am    Post subject: [platform-dev] Re: Visual Library - Refresh problem Reply with quote

I am also facing the same problem.
I tried using repaint(), but no use.
The image that i want to be displayed as a widget returns a value, but due
to scene.validate() not working; the image does not get dispalyed on the
scene.
Can some one suggest a solution?

--
View this message in context: http://netbeans-org.1045718.n5.nabble.com/Visual-Library-Refresh-problem-tp3400444p5564093.html
Sent from the Netbeans RCP/Platform Users (Open API) mailing list archive at Nabble.com.
Back to top
Milo
Posted via mailing list.





PostPosted: Wed Mar 14, 2012 7:53 pm    Post subject: [platform-dev] Re: Visual Library - Refresh problem Reply with quote

Hi
,
I looked up it in my sources and I found this line
// after widgets adding must call scene.validate() to set bounds
scene.validate();

Try it please. I don't use Visual Library for one year.

------------ Původní zpráva ------------
Od: Divya <address-removed>
Předmět: [platform-dev] Re: Visual Library - Refresh problem
Datum: 14.3.2012 11:05:24
----------------------------------------
I am also facing the same problem.
I tried using repaint(), but no use.
The image that i want to be displayed as a widget returns a value, but due
to scene.validate() not working; the image does not get dispalyed on the
scene.
Can some one suggest a solution?

--
View this message in context:
http://netbeans-org.1045718.n5.nabble.com/Visual-Library-Refresh-problem-tp3400444p5564093.html
Sent from the Netbeans RCP/Platform Users (Open API) mailing list archive at
Nabble.com.
Back to top
Divya
Posted via mailing list.





PostPosted: Thu Mar 15, 2012 4:41 am    Post subject: [platform-dev] Re: Visual Library - Refresh problem Reply with quote

Yes, i am using it the same way.
After adding widgets to the scene, i use scene.validate() but the scene
doesnot get validated.
If i use scene.addChild(widget), i get "java.lang.AssertionError"
Not able to find out a way with the problem. :(

--
View this message in context: http://netbeans-org.1045718.n5.nabble.com/Visual-Library-Refresh-problem-tp3400444p5566984.html
Sent from the Netbeans RCP/Platform Users (Open API) mailing list archive at Nabble.com.
Back to top
Fr
Posted via mailing list.





PostPosted: Thu Mar 15, 2012 8:06 am    Post subject: [platform-dev] Re: Visual Library - Refresh problem Reply with quote

Hello,

To "repaint" the scene, I use the following code:
scene.validate();
scene.repaint();//I'm sure about this line
if (scene.getView() != null) {
scene.getView().repaint();
}

Fred


On 15/03/2012 05:22, Divya wrote:
Quote:
Yes, i am using it the same way.
After adding widgets to the scene, i use scene.validate() but the scene
doesnot get validated.
If i use scene.addChild(widget), i get "java.lang.AssertionError"
Not able to find out a way with the problem. :(

--
View this message in context: http://netbeans-org.1045718.n5.nabble.com/Visual-Library-Refresh-problem-tp3400444p5566984.html
Sent from the Netbeans RCP/Platform Users (Open API) mailing list archive at Nabble.com.
Back to top
Divya
Posted via mailing list.





PostPosted: Thu Mar 15, 2012 9:15 am    Post subject: [platform-dev] Re: Visual Library - Refresh problem Reply with quote

Ok, that seems to make sense...
But in my case, the it doesnot enter the loop. The code fails at this
condition itself:
"if (scene.getView() != null)"

I also tried some code like:
LayerWidget baseLayer = new LayerWidget(scene);
LabelWidget helloLabel1 = new LabelWidget(scene, "hello1");
helloLabel1.setPreferredLocation(new Point(10, 50));
scene.repaint();
baseLayer.addChild(helloLabel1);
scene.validate();
scene.repaint();
But the Label did not appear onto the screen. Seems like i am missing
something... :(

--
View this message in context: http://netbeans-org.1045718.n5.nabble.com/Visual-Library-Refresh-problem-tp3400444p5567385.html
Sent from the Netbeans RCP/Platform Users (Open API) mailing list archive at Nabble.com.
Back to top
Monezz



Joined: 18 Feb 2009
Posts: 255

PostPosted: Thu Mar 15, 2012 11:59 am    Post subject: [platform-dev] Re: Visual Library - Refresh problem Reply with quote

Quote:

I also tried some code like:
Back to top
Eric Barboni
Posted via mailing list.





PostPosted: Thu Mar 15, 2012 2:42 pm    Post subject: [platform-dev] Re: Visual Library - Refresh problem Reply with quote

Hi Divya

Did you add the layer baseLayer to your "scene" somewhere in your code ?

scene.addChild(baseLayer) after
LayerWidget baseLayer = new LayerWidget(scene);

may help if not done

Eric

-----Message d'origine-----
De
Back to top
Divya
Posted via mailing list.





PostPosted: Fri Mar 16, 2012 10:44 am    Post subject: [platform-dev] Re: Visual Library - Refresh problem Reply with quote

Timon - Yes, i had a look at the article you mentioned.
And i am now doing repaint() on view instead of scene, also
removed the repaint() that i was using twice.

Barboni - I did add the line:
LayerWidget baseLayer = new LayerWidget(scene);
*scene.addChild(baseLayer)*
But still the widget doesnot get displayed onto the scene. What else could
be the problem, or missing link?
I feel all your suggestions are atleast taking me further closer to the
solution.

--
View this message in context: http://netbeans-org.1045718.n5.nabble.com/Visual-Library-Refresh-problem-tp3400444p5570836.html
Sent from the Netbeans RCP/Platform Users (Open API) mailing list archive at Nabble.com.
Back to top
Eric Barboni
Posted via mailing list.





PostPosted: Tue Mar 20, 2012 1:20 pm    Post subject: [platform-dev] Re: Visual Library - Refresh problem Reply with quote

Hi Divya,

As it's complicated to help with only limited code. I may suggest to take a
look at the following links containing lots of sample of visual library.

http://hg.netbeans.org/main/contrib/file/616e5810d496/visual.examples/src/te
st

SceneSupport.java give some setup for the library.



-----Message d'origine-----
De
Back to top
Divya
Posted via mailing list.





PostPosted: Thu Mar 22, 2012 6:42 am    Post subject: [platform-dev] Re: Visual Library - Refresh problem Reply with quote

Hi Barboni,

(I referred to *sceneserialization-->SceneSerializer.java* from the list of
*main/contrib / files * that you provided)

I am trying to serialize and deserialize a scene that i am creating.
The serialization works perfectly, and i am able to create a scene
containing widgets.
The problem occurs when i try to deserialize it upon IDE restart.
During deserialization, the image icon that i want to display onto the scene
returns a proper value, but somehow the widget doesn't get displayed on the
screen.

This is the problem code snippet:
Widget nodeWidget_new = scene.addNode (value for node to be
added);//Getting proper value for nodeWidget_new
nodeWidget_new.setPreferredLocation(new Point (x, y)); // Defining
location for display of widget
nodeWidget_new.setPreferredBounds(new Rectangle(w, h));//Defining
bounds for display of widget
nodeWidget_new.setPreferredSize(new Dimension(w, h));//Defining size
of widget
nodeWidget_new.setVisible(true); // Setting visiblity to true


--
View this message in context: http://netbeans-org.1045718.n5.nabble.com/Visual-Library-Refresh-problem-tp3400444p5584844.html
Sent from the Netbeans RCP/Platform Users (Open API) mailing list archive at Nabble.com.
Back to top
Divya
Posted via mailing list.





PostPosted: Thu Apr 05, 2012 6:10 am    Post subject: [platform-dev] Re: Visual Library - Refresh problem Reply with quote

Hi Purav14,

Geertjan's tutorials are really useful for information and ideas.
I guess you should take a look at the url below, might help you a lot.
https://blogs.oracle.com/geertjan/entry/drag_drop_snippets_into_palette

Regards
Divya

--
View this message in context: http://netbeans-org.1045718.n5.nabble.com/Visual-Library-Refresh-problem-tp3400444p5619567.html
Sent from the Netbeans RCP/Platform Users (Open API) mailing list archive at Nabble.com.
Back to top
purav14
Posted via mailing list.





PostPosted: Thu Apr 05, 2012 8:29 pm    Post subject: [platform-dev] Re: Visual Library - Refresh problem Reply with quote

hiee i am new developer in netbeans platform and jst now i am using visual
library ,,using it want to load images with palette entry but got error null
exception during retrieving palette so can u suggest me what can i do simply
so that i can load image...

--
View this message in context: http://netbeans-org.1045718.n5.nabble.com/Visual-Library-Refresh-problem-tp3400444p5619552.html
Sent from the Netbeans RCP/Platform Users (Open API) mailing list archive at Nabble.com.
Back to top
purav14
Posted via mailing list.





PostPosted: Mon Apr 09, 2012 12:14 pm    Post subject: [platform-dev] Re: Visual Library - Refresh problem Reply with quote

thanx Divya i already surf it...bt during run time i get noclassdefexception error when i add to palette by windows menu?? so is ther in jar file mission problem or class loading problem??


From: Divya [via Netbeans.org] <[url=/user/SendEmail.jtp?type=node&node=5626885&i=0][hidden email][/url]>
To: purav14 <[url=/user/SendEmail.jtp?type=node&node=5626885&i=1][hidden email][/url]>
Sent: Thursday, April 5, 2012 11:19 AM
Subject: Re: Visual Library - Refresh problem


Hi Purav14,

Geertjan's tutorials are really useful for information and ideas.
I guess you should take a look at the url below, might help you a lot.
https://blogs.oracle.com/geertjan/entry/drag_drop_snippets_into_palette

Regards
Divya

If you reply to this email, your message will be added to the discussion below:
http://netbeans-org.1045718.n5.nabble.com/Visual-Library-Refresh-problem-tp3400444p5619567.html
To unsubscribe from Visual Library - Refresh problem, [url]click here[/url].
NAML






View this message in context: Re: Visual Library - Refresh problem Sent from the Netbeans RCP/Platform Users (Open API) mailing list archive at Nabble.com.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo