|
sreejat
Newbie
Offline
Posts: 3
|
 |
«
Embed this message
Reply #1 on: January 05, 2006, 09:15:35 pm » |
|
 Plz send me the xml file of this to: sreejat@it.iitb.ac.in
|
|
|
Logged
|
|
|
|
Fu-Kwun Hwang
|
 |
«
Embed this message
Reply #2 on: January 06, 2006, 09:47:08 am » |
|
 You should have received xml file in your email account.
|
|
|
Logged
|
|
|
|
|
lookang
|
 |
«
Embed this message
Reply #4 on: May 07, 2008, 08:42:22 am » posted from:SINGAPORE,SINGAPORE,SINGAPORE |
|
 another work in progress, but i think u will like it. enjoy 
|
|
|
Logged
|
|
|
|
lookang
|
 |
«
Embed this message
Reply #5 on: May 07, 2008, 11:02:07 am » posted from:Singapore,,Singapore |
|
 question: how did u make the resultant to be drawn using the array? i can't figure out the variable assigned to the resultant? i tried PX[2] and PY[2] thinking that is how u loop the adding but the display shows zero.
|
|
|
Logged
|
|
|
|
Fu-Kwun Hwang
|
 |
«
Embed this message
Reply #6 on: May 07, 2008, 12:14:16 pm » posted from:Taipei,T\'ai-pei,Taiwan |
|
 for example: define n=30; R=100.; and declear xp[n],yp[n] at Variable Panel Then I can add the following code at Initialize Panel to draw a circle. double dc=Math.PI/n,c; for(int i=0;i<n;i++){ c=i*dc; xp[i]=R*Math.cos(c); yp[i]=R*Math.sin(c); }
Assign xp,yp as x,y property for polygon, and set the number of point to n
|
|
|
Logged
|
|
|
|
lookang
|
 |
«
Embed this message
Reply #7 on: May 07, 2008, 03:42:34 pm » posted from:Singapore,,Singapore |
|
 ok, thanks for the reply..... i solved the problem by reassigning my own variables. i am thinking of making a 4 check boxes, which only one can be choosen at any time. 0. none 1. style 1 2. style 2 3. style 3 http://www.colorado.edu/physics/phet/simulations/vectormath/vectorMath.swfany simple solution like a drag and drop menu or checkbox? or do i need to write a object code for it? any sample link on the forum ? thanks!!
|
|
« Last Edit: May 07, 2008, 03:44:29 pm by lookang »
|
Logged
|
|
|
|
Fu-Kwun Hwang
|
 |
«
Embed this message
Reply #8 on: May 07, 2008, 10:58:59 pm » |
|
 1. You can select multiple checkboxs (square one), But you only select one from radio buttons. (circle one) 2. Why you need a menu or check box to be able to drag and drop? Do you really mean that you want to be able to drag and drop those vectors. You just create ArrorSet in the view and it can be dragged one at a time. You can also create ArrowSet which is invisible. And when you click on it, make one of the arrow move with the mouse position (You can get mouse coordinate x,y from property of DrawingPanel). Then you have a drag and drop effect. I believe I can give you better suggestion if you write download in detail what you really want to do.
|
|
|
Logged
|
|
|
|
|
Fu-Kwun Hwang
|
 |
«
Embed this message
Reply #10 on: May 12, 2008, 10:49:52 pm » |
|
 I did check out your file. But I am really confused because you have variable named the same as function name (e.g. showComponent). I do not know what the purpose for those functions. Please explain in detail what you want to do and the way you try to implement.
|
|
|
Logged
|
|
|
|
lookang
|
 |
«
Embed this message
Reply #11 on: May 13, 2008, 07:52:49 am » posted from:Singapore,,Singapore |
|
 these pictures may help, that is what i want, only one state at any time. the buttons on the right bottom is my attempt to make the one state show component. my current applet has 4 buttons which allows learner to toggle between the 4 states of components but to turn off, need to recheck the checkboxes. (NOT what i want) 0. None 1. show component 1 2. show component 2 3. show component 3
|
|
« Last Edit: May 13, 2008, 07:59:21 am by lookang »
|
Logged
|
|
|
|
lookang
|
 |
«
Embed this message
Reply #12 on: May 19, 2008, 09:47:47 pm » |
|
 i think u want this to debug? thanks!
|
|
« Last Edit: May 19, 2008, 10:20:03 pm by lookang »
|
Logged
|
|
|
|
|
Fu-Kwun Hwang
|
 |
«
Embed this message
Reply #14 on: May 20, 2008, 09:37:31 pm » |
|
 It is really a nice talk. I like the ideas and we should all start to share our knowledge and collaborate with each other to make a better world for us and for our children. If you can read Chinese, you are welcomed to visit my Chinese physics forum at http://www.phy.ntnu.edu.tw/demolab/phpBB/ . You will also find more educational resources. If you are interested in content management system, visit http://enjoy.phy.ntnu.edu.tw/ (I was modified from moodle + blog + wiki + ... many free tools developed by people around the world.)
|
|
|
Logged
|
|
|
|
lookang
|
 |
«
Embed this message
Reply #15 on: May 20, 2008, 10:10:45 pm » |
|
 yes i will visit....btw can look at my codes on the component thingy? thanks!
|
|
|
Logged
|
|
|
|
Fu-Kwun Hwang
|
 |
«
Embed this message
Reply #16 on: May 20, 2008, 11:14:12 pm » |
|
Registed user can get files related to this applet for offline access.Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list If java program did not show up, please download and install latest Java RUN TIMEThere is some error when I open your xml. However, I create another example for you. I think the effect shown in the following applet is what you want. You can download the xml file and find out what I did. You can also drag the vector. Registed user can get files related to this applet for offline access.Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list If java program did not show up, please download and install latest Java RUN TIME
|
|
|
Logged
|
|
|
|
lookang
|
 |
«
Embed this message
Reply #17 on: May 20, 2008, 11:29:39 pm » |
|
 close enough!!! i will look at the codes soon 
|
|
|
Logged
|
|
|
|
lookang
|
 |
«
Embed this message
Reply #18 on: May 21, 2008, 12:04:43 am » |
|
 i figured out the logic, by trial n error  VIEW2[1]=false; VIEW2[2]=false; VIEW3[1]=false; VIEW3[2]=false; VIEW4[1]=false; VIEW4[2]=false; for None or for(int j=1;j<n;j++) VIEW2[j]=false; VIEW3[j]=false; VIEW4[j]=false; the variables controlling them is VIEW2,VIEW3,VIEW4 and NOT showComponent2,showComponent3,showComponent4.
|
|
« Last Edit: May 21, 2008, 12:08:47 am by lookang »
|
Logged
|
|
|
|
lookang
|
 |
«
Embed this message
Reply #19 on: May 21, 2008, 12:49:37 am » |
|
 what does this code do? public void showComponent () { for(int i=1;i<n;i++) VIEW2[i]=showComponent; }
i was changing it to VIEW3[i]=showComponent; or VIEW4[i]=showComponent; but the applet appears to behave the same way i managed to get the None, and First component to work fine even for 2 vectors A and B But when only one vector A, everything works the way i can understand but when vector A and B, the 3rd and 4th button shows the resultant ?? i not good with array, can explain ? 
|
|
« Last Edit: May 21, 2008, 10:42:29 pm by lookang »
|
Logged
|
|
|
|
Fu-Kwun Hwang
|
 |
«
Embed this message
Reply #20 on: May 21, 2008, 04:51:45 pm » posted from:Taipei,T\'ai-pei,Taiwan |
|
 The following code does not make sense public void showComponent () { for(int i=1;i<n;i++) VIEW2=showComponent; } It is the same as public void showComponent () { VIEW2=showComponent; } Because you are asking java to do the same instruction: VIEW2=showComponent; n-1 times. for loop is used for doing repeated jobs. Normally works better with array. i=1; // is for initialization (Normally, i will be set to 0, because array starts from 0, for example: if you define x[n], then you will have n variables: x[0], x[1],...[x[n-1]) Then it will do whatever inside the for loop, when it is done, it will execute i++ (i++; is the same as i=i+1;). So , i become 2, and it will do whatever inside the for loop again, ... repeate if i<n is satisfied.
|
|
|
Logged
|
|
|
|
lookang
|
 |
«
Embed this message
Reply #21 on: May 21, 2008, 10:37:20 pm » |
|
 i think this forum setting recognize the square bracket as codes like html and /html but strange in earlier posts no problem displaying [i] italics !!!!! i see i had the array i in square bracket when i copy and paste but the forum disable them... no wonder it does not mean sense 
|
|
« Last Edit: May 21, 2008, 10:47:34 pm by lookang »
|
Logged
|
|
|
|
lookang
|
 |
«
Embed this message
Reply #22 on: May 21, 2008, 10:40:02 pm » |
|
 i think firefox got problem with java in new versions, recently java keeps hanging/crashing firefox
|
|
« Last Edit: May 21, 2008, 10:48:07 pm by lookang »
|
Logged
|
|
|
|
Fu-Kwun Hwang
|
 |
«
Embed this message
Reply #23 on: May 22, 2008, 05:18:42 pm » posted from:Taipei,T\'ai-pei,Taiwan |
|
 The php script for this forum was updated to latest version a few days ago. But I think you still can use command between square bracket. For example: i think firefox got problem with java in new versions, recently java keeps hanging/crashing firefox
I have no problem viewing java with my firefox browser. :-)
|
|
|
Logged
|
|
|
|
|