Colours are not changing when a certain value is used

Hi all. This might look strange. But anywayz...
I am developing a game related to controlling trains and preventing them from clashing into one another. Naturally, my game allows the user to control the colour of the signals present at each station. My game has 3 layers: the first one does the game calculations, the second does the rendering aspects of the game, and the third constantly passes latest game data to the rendering layer.
Now, the data for the signals comes from the first layer as an array of Integers. The array is named 'aspect'. Below is the code:
      switch(aspect.intValue())
case 1:
objGraphics.setColor(java.awt.Color.RED);
break;
case 2:
objGraphics.setColor(java.awt.Color.ORANGE);
break;
case 3:
objGraphics.setColor(java.awt.Color.GREEN);
System.out.println("green");     
The default colour of all the signals is red. Now while the game is in progress, if the user changes the colour of the signal to, for example, green, the change is not reflected on-screen. However, the SOP call works fine - the word 'green' is printed in the console.
What further surprises me is that if I change the statement 'case 1' to 'case 4', and then while the game is in progress, change the colour to green, then the change is reflected on the console.
I placed SOPs to find out if the values inside 'aspect' are correct. Ya they are correct - they contain values '1' at the start of the game, and when the user changes to green, then they contain '3'.
So what could be the problem?

Jeez... sorry.. my mistake.
What I was doing was this: for drawing the signals, I take all the signals from the Calculations layer and store them in a Vector. Now this becomes a Vector of Integer arrays.
In the Rendering layer, I have a loop which draws the stations. I also have a method which draws the aspects for each station. Inside the loop, for each station, I call this method. But I don't know what I was thinking while writing the method - I wrote it such dat it draws all the signals for all stations. Thus, for each call, it would redraw all the signals, not the ones for the current station.
I have changed dat now, and it works. When the user selects a station and then selects the signal he wants, the change is rendered onscreen. Yippee!!
sabre150, u were right after all!!! Also, thanks to all those who stopped by to rack ur brains over an issue that shouldn't have been one in the first place.
But what I don't understand is this: Even with my wrong code, shouldn't the change be rendered? Ya, I know it was rendering the signals repeatedly, but then it should have rendered them rightly, isn't it? Or am I not getting something?

Similar Messages

  • Contract Prices are not changing when upload from PC to SRM

    Hi all,
    We have local contracts in SRM and downloaded this contracts to local PC. We changed price of this contracts and uploaded again into SRM, But the prices are not getting changed in SRM.
    We downloaded in text format, opened in excel,changed prices and saved in text format.
    did anyone faced this problem?
    Thanks
    Ravi

    Hi Ravi,
    please refer OSS note 734060. You have to use the commands D=Delete, U=Change and I=Insert to modify the downloaded document.
    Rgds,
    RRK
    Reward Points for helpful responses*

  • I cannot find information to help me change the orientation of a video filmed in portrait format but only able to be played back lying on its side  (landscape) instead of upright. All the rotation buttons for iPhoto are not 'engaged' when it is in video .

    I cannot find information to help me change the orientation of a video filmed in portrait format but it can only able to be played back lying on its side  (landscape) instead of upright. All the rotation buttons for iPhoto are not 'engaged' when it is in video .

    Thanks OT,
    I tried the Export function but it would not allow me to choose the option of exporting to iMovie. I think you are right about needing Quicktime Pro. I opened iMovie and imported the clip from iPhoto and with some searching found the 'cropping, rotation' mechanism. So I now have a copy in the correct orientation. I plan to import/export it back to iPhoto because I want to have a copy on my iPhone to show people and I wanted to have it available as part of a slideshow I am making in iPhoto of my recent overseas trip. It is a pain that there is no simple orientating tool for the movie clips downloaded to iPhoto with the photos from the one camera.

  • Changes are not reflected when objects transported from Quality to Productn

    Hi
    In case of moving some Transport requests from Quality to Production, some times the changes made to the selection screen of a report program doesn't reflect in Production. Also we don't see any Transport error while transporting. Moreover, we can see the changes by regenerating the Program in production.
    Would any one help me out in this with the reason for this.
    Pls suggest what needs to be done.
    Satish.

    HI,
    Thanks for the reply.
    - I have checked the respective transport too, and every thing seems to be fine.
    - Recently we went to go live, for the next release, so earlier before go live, we didnt faced any proble.. Only now we are facing this problem, that we find the changes relating to selection screen are not reflected when the object / prog is moved from qty to Prd.
    - Only problem is with the selection screen.(not getting reflected in PRD. In Qty we are able to see those changes.
    - Then in order to reflect these changes in PRD, we have to re generate the object, then only it get s updated..
    Satish.
    Edited by: satish c on Sep 22, 2009 3:35 PM

  • Change pointers are not generated when creating a material master

    Dear Experts,  
    Change pointers are not generated when creating a material master. 
    However, when a change is made to the already created material, the change pointers are created according the fields in BD52.  
    Am I missing any settings?
    I need to create change pointers immediately when I create the material master in MM01.  
    Please suggest. 
    Regards,
    Shetty

    did you follow the steps given in
    http://help.sap.com/saphelp_nw73/helpdata/en/4a/6dcbe9c95261a3e10000000a421937/frameset.htm

  • My sistem preferences are not working, when I try to change the photo of the desk It stop working, what can i do?

    my sistem preferences are not working, when I try to change the photo of the desk It stop working, what can i do? I'm dieing cause I'm afraid

    Have you tried resetting your device by pressing and holding the Home button and power button until the silver apple appears?

  • Down pmnts with taxes are not permitted when processing with jur.code (Message no. FS206)

    Hi Guys,
    I am facing very critical issue on down Payment request, to process with saperate Tax Value.
    We are supporting on Roll-out for Germany. We have implemented all standard SAP processes in the Project. We have also implemented many interfaces and one of the Interface is Sabrix Tax Engine (Tax Jurisdiction Code).
    As per the Germany legal requirement, the Tax has to get calculated whenever the funds gets transfered from one Bank Account to Another Bank Account.
    Coming to the issue: In the Customer Down Payment scenario, we are creating the Down payment request for Customer and as per Germany local requirement the Tax of 19% has to get calculated on Down payment.
    For an Example: We have the Sales Order Contract Value of 100,000.00 EUR and we are creating the Down Payment reqeust of 10% which is 10000 EUR + Tax 19% 1900 EUR.
    We are trying to post the Down Payment request in F-37 and we get the issue "Down pmnts with taxes are not permitted when processing with jur.code". This error is appearing due to Sabrix Tax engine (Tax Jurisdiction Code) has implemented in our System.
    We have gone through the SAP notes 97288 and 213567 and understood that the Standard SAP does not support us to post the Down Payment request with Separate Tax Value, when the External Tax Engine has implemented.
    I request you to suggest me, if you have already seen this issue in any of your Projects and fixed through the work-around solution. We have been working on work-around since 2 weeks, however no result.
    Below is the error message:
    Down pmnts with taxes are not permitted when processing with jur.code
    Message no. FS206

    HI Preeti,
    Thanks for your response. We have already seen the similar SAP notes and the SAP notes explains that the "Down pmnts with taxes cannot be done along with with jur.code". The only solution is to post the DP without Tax.
    However there might be some workaround which can be done in SAP, to process the Down Payment/Advance Payments with Tax Value along with Jurisdiction Code. I would like to know this.
    Did any one seen this case in your experiece, if yes, what is the work-around solution?.
    Need your help guys!,...
    Regards,
    Damodar Naidu

  • Visited link color is not changing when there is no page redirection

    Visited link color is not changing when i just open a popup on clicking the hyperlink.. whereas visited link color gets changed when i redirect to a new page on clicking the hyperlink
    I want to have my visited link color to change even if i show a popup on clicking the hyperlink
    This works fine with IE..

    Hi,
    Have a look at the user status table TSOCM_STAT_PROP and see if there are any unwanted PROCESS_TYPE <> STSMA combinations.
    For your process type there should only be one kind of status schema assigned.

  • MetaData operations are not supported when

    Dear Experts
    I am facing below error when trying to run my add-on in Windows  Server 2008 R2 and SQL Server 2008 service pack 2.
    Error: MetaData operations are not supported when a user transaction is active
    It runs fine in Sql Server 2005.
    Kindly tell me a solution to sort this out.
    Regards
    Shibin

    Can we see your code, it looks to me like the error is quite descriptive - its saying you can't do any metadata operation (creating/updating user fields, user tables using userfieldsMD or usertablesMD objects) while in a transaction.
    Previous SDK examples have shown that you can do it, but they it is not possible - it may be that SQL 2008 has a tighter control over this. (Did you also do a B1 upgrade, or just change SQL version?)
    Are you running a transaction?

  • In my iPhone the images and videos are not changing into landscape mode

    In my iPhone the images and the videos are not changing into landscape mode. And it is switching off  automatically

    Hi vijenderreddy,
    Thanks for using Apple Support Communities.  This article has some steps to try if your iPhone is unexpectedly powering off:
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/ts2802
    Will not turn on, will not turn on unless connected to power, or unexpected power off
    Verify that the Sleep/Wake button functions. If it does not function, inspect it for signs of damage. If the button is damaged or is not functioning when pressed, seek service.
    Check if a Liquid Contact Indicator (LCI) is activated or there are signs of corrosion. Learn about LCIsand corrosion.
    Connect the iPhone to the iPhone's USB power adapter and let it charge for at least ten minutes.
    After at least 30 minutes, if:
    The home screen appears: The iPhone should be working. Update to the latest version of iOS if necessary. Continue charging it until it is completely charged and you see this battery icon in the upper-right corner of the screen . Then unplug the phone from power. If it immediately turns off, seek service.
    The low-battery image appears, even after the phone has charged for at least 20 minutes: See "iPhone displays the low-battery image and is unresponsive" symptom in this article.
    Something other than the Home screen or Low Battery image appears, continue with this article for further troubleshooting steps.
    If the iPhone did not turn on, reset it while connected to the iPhone USB power adapter.
    If the display turns on, go to step 4.
    If the display remains black, go to next step.
    Connect the iPhone to a computer and open iTunes. If iTunes recognizes the iPhone and indicates that it is in recovery mode, attempt to restore the iPhone. If the iPhone doesn't appear in iTunes or if you have difficulties in restoring the iPhone, see this article for further assistance.
    If restoring the iPhone resolved the issue, go to step 4. If restoring the iPhone did not solve the issue, seek service.
    For the issue of images not changing orientation, see this article:
    iOS: Screen does not rotate
    http://support.apple.com/kb/ts3805
    Cheers,
    - Ari

  • Cache, cookies and history are not clearing when I close Firefox even though they are set to do so and have been for ages

    I recently had an update (or upgrade?) for FF 16. Today (and I believe the update was done a day or two ago?) my cache, cookies and history are not clearing when I close FF. Also, certain links are not working. Not links for full web pages but for site pop-ups (like the smilie window on a message board). They worked a few days but are not working today. I click the link and nothing happens. I noticed the problem with the cookies not clearing for a few weeks ago but it was only on one site not all sites which is what's happening now.
    My apologies if that's a little confusing. Thanks!

    At any rate, have you tried running Firefox in Private Browsing mode? This will ensure that no infromation from your session is saved once you exit Private Browsing mode and/or exit Firefox.
    You can set Firefox to always start in Private Browsing mode: https://support.mozilla.org/en-US/kb/private-browsing-browse-web-without-saving-info#w_how-do-i-always-start-firefox-in-private-browsing

  • Control Flow task colors are not changing in SSIS

    Hi,
    When I am running my SSIS package colors of "Control Flow" task are not changing from Yellow to Green or Yellow to Red however when I double click on dataflow task I found that colors are getting change for the components available inside dataflow
    task. This mean only colors of my control flow task are not changing.
    Can anyone help me with this issue. Because of this issue I am not able to find out whether any of my control flow task is running successfully or not espicially in case of "Execute SQL Task"
     Thanks

    Related thread:
    http://stackoverflow.com/questions/9473121/yellow-on-the-control-flow-no-color-within-the-data-flow-whats-going-on
    Kalman Toth Database & OLAP Architect
    Free T-SQL Scripts
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • My security answers are not accepted when downloading movies. Why

    My security answers are not accepted when downloading movies.TRIED restting the security question that did not work.  Called apple support --- no help.
    I'm at a lost PLEASE HELP

    Reset Security Questions
    Frequently asked questions about Apple ID
    Manage My Apple ID
    Or you can email iTunes Support at iTunes Store Support.
    If all else fails:
    Go to: Apple Express Lane;
    Under Product Categories choose iTunes;
    Then choose iTunes Store;
    Then choose Account Management;
    Press Continue;
    Now choose iTunes Store Security and answer the bullet questions, then click Continue;
    Sign in with your Apple ID and press Continue;
    Under Contact Options fill out the information and advise iTunes that you would like your security/challenge questions reset;
    Click Send.
    You should get a response within 24 hours by email.
    Presently there appears to be problems on Apple's end, so it may be quite some time before they respond.
    Another user had success doing the following:
    I got some help from an apple assistant on the phone. It is kind of round about way to get in.
    Here is what he said to do and it is working for me...
    on the device that is asking you for the security questions go to "settings", > "store" > tap the Apple ID and choose view"Apple ID" and sign in.
    Tap on payment information and add a credit/debit card of your preference then select "done", in the upper right corner
    sign out and back into iTunes on the device by going to "settings"> "store" > tap the Apple ID and choose "sign-out" > Tap "sign -in" > "use existing Apple ID" and you should be asked to verify your security code for the credit /debit card and NOT the security questions.
    At this time you can remove the card by going back in to edit the payment info and selecting "none" as the card type then saving the changes by selecting "done". You should now be able to use your iTunes store credit without answering the security questions.
    It's working for me ...I just have to put in my 3 digit security pin from the credit card I am using.
    Good Luck friends!

  • Security question answers are not accepted when renting movies. Why? How do you correct?

    Correct Security answer are not accepted when renting movies.
    Why? How do I correct the problem so I can watch movies?

    Reset Security Questions
    Frequently asked questions about Apple ID
    Manage My Apple ID
    Or you can email iTunes Support at iTunes Store Support.
    If all else fails:
    Go to: Apple Express Lane;
    Under Product Categories choose iTunes;
    Then choose iTunes Store;
    Then choose Account Management;
    Press Continue;
    Now choose iTunes Store Security and answer the bullet questions, then click Continue;
    Sign in with your Apple ID and press Continue;
    Under Contact Options fill out the information and advise iTunes that you would like your security/challenge questions reset;
    Click Send.
    You should get a response within 24 hours by email.
    Presently there appears to be problems on Apple's end, so it may be quite some time before they respond.
    Another user had success doing the following:
    I got some help from an apple assistant on the phone. It is kind of round about way to get in.
    Here is what he said to do and it is working for me...
    on the device that is asking you for the security questions go to "settings", > "store" > tap the Apple ID and choose view"Apple ID" and sign in.
    Tap on payment information and add a credit/debit card of your preference then select "done", in the upper right corner
    sign out and back into iTunes on the device by going to "settings"> "store" > tap the Apple ID and choose "sign-out" > Tap "sign -in" > "use existing Apple ID" and you should be asked to verify your security code for the credit /debit card and NOT the security questions.
    At this time you can remove the card by going back in to edit the payment info and selecting "none" as the card type then saving the changes by selecting "done". You should now be able to use your iTunes store credit without answering the security questions.
    It's working for me ...I just have to put in my 3 digit security pin from the credit card I am using.
    Good Luck friends!

  • BBM display name are not changing

    Hi, I'm using blackberry Q10 and the BBM display name of my contacts are not changing whatever it says in the updates that they change their name but in contacts list and chat list it still the same! This problem have been appeared since 10 days ago
    Solved!
    Go to Solution.

    nawara-sh wrote:
    I found that this is only happen with one contact which the most one I talk with!!
    But I have my device from 3 months ago,, it's not new any more
    So when did the last update come in?
    If my post has helped you, give it a LIKE

Maybe you are looking for

  • Dragging Icons stops working after organizing using drag and drop. Why?

    On the newest MBA (2013) While organizing my music I was creating new folders within the artists' folder in order to seperate things into albums. sometimes when im dragging the songs into this newly created folder ( I drag them in  like groups of 10

  • Itunes accounts credit card details

    We have two iphones which are using the same apple id, we have created a second apple id but how do we change one phone to the other id  And i do not want to put any payment methods eg credit cards or gift cards numbers on the account  please advise

  • How to install struts application in a real web server

    I have a problem about installing my struts application into web server.. I can run my application under eclipse websphere development studio 5.0 web server but I don't know How I install it a real webserver (Apche,Unix,Tomcat or etc.) under location

  • DDIC_TYPELENG_INCONSISTENT

    Hi experts,             When I run SM66 in my IDS system , the system issued an error DDIC_TYPELENG_INCONSISTENT. The error information is : Short text     Inconsistency in length of DDIC data type "SWNCGLAGGTASKTYPE". What happened?     Runtime erro

  • Material request download error

    Hello Experts, I am facing typical material download issue, please help me out to overcome this: - material number in ERP has lot of speical characters say e.g. - : = - DNL_CUST_PROD0 / PROD1 / PROD 3 / TAX all has bee done - Materials are already do