What loop should I use for this?

for (int j=0; j<8; j++) {
                            source.setBackground(EXIT_COLORS[j]);
                            if (j==7)
                                 break;
                            }[/code
okay, what i'm trying to do here, is display a color object from an array EXIT_COLORS[], which has 8 colors in it. Now I only want to display all of these colors 8 times. right now I can only diplay the last color or the first...I tried double for loops, and it didn't seem to work either...if you have an idea please help                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

sorry about that...I dont' need a break...I'm just trying different things to see if it'll work...
see, the problem is, that every time my method runs i want one specific color to be displayed on a button, the next time it is ran, i want the next color in the array to be displayed...until the end of the array is reached, then I don't want any more to be displayed...But I can't figure out how to do this...
here is my method:
     private void updateTiles() {     
             // Now draw the tiles accordingly
        for (int r=0; r<size; r++) {
             for (int c=0; c<size; c++) {
                  JButton aButton = view.getFloorTileButton(r*size + c);
                      if ((aButton.isSelected()) && (mode == EDIT_WALL_MODE)){
                           aButton.setBackground(Color.gray);
                  else if((aButton.isSelected()) && (mode == SELECT_EXITS_MODE)){
                      for (int j=0; j<8; j++){
                            aButton.setBackground(EXIT_COLORS[j]);
                   else if(mode == WAIT_MODE)
                       aButton.setBackground(Color.white);
             // Set the text for the floor tile if it needs to be set
                 // Set the background color for the floor tile
        // Display the path if necessary (in Part C)
     }

Similar Messages

  • Is Flash what I should be using for this simple animation?

    Hi I have a fairly simple question...
    Im working on a project which started with simple drawings of
    a particular animal. One of the drawings ive done involves the
    motion of part of this animal. The next portion of this assignment
    requires me to begin working digitally, and recreating these
    drawings precisely in Autocad.
    The problem is that I need essentially create a storyboard of
    images showing the motion of this animal in detail. So essentially
    im going to need 40+ frames showing this motion. It would be the
    equivalent of creating a flip book animation, but im going to be
    tiling all these frames next to eachother.
    Now as opposed to drawing 40+ separate images I had the idea
    to use Flash to produce these images for me.
    Heres essentially what I want to do:
    - Scan the drawings ive done
    - Reproduce them digitally through Autocad
    - Import these drawings into Flash (either as Autocad files
    or I can convert them to Illustrator files)
    - Basically have two images... 1 at the start of the motion
    and 1 at the end of the motion, and use flash tween's to
    extrapolate the motion in between.
    So ideally I could create 40 frames, with the 1st keyframe
    showing the beginning of the motion, the 40th showing the final
    stage of motion, and each frame in between providing me with the
    separate drawing that I need.
    Any thoughts or advice on how I can go about doing this? I
    havent used Flash in years so im still relatively unskilled with
    it...
    Thanks so much for your help!!

    I agree with Gibbah. Flash doesn't do magic with tweens. Of
    course, you can try. But if you're looking for NATURAL motion, then
    it needs to be drawn naturally-by hand.
    Sure, you can try it in Flash, but at best it will help you
    to tween every 4th drawing or so (so you'll still need 10 key
    drawings), and you'll spend ages tweaking the tweens, since (I
    repeat) Flash doesn't do magic with tweens, nor does any other
    software. You're talking of 4-legged animal movement, which I
    assume includes walking, which is a pretty complicated thing: 4
    legs, each double-jointed, plus the feet, then a body which bends,
    and the head and neck which move up and down. You'll have to
    separate each leg, the body and the head, at the very least, tween
    each of these, then go back and fix where the tweens come out all
    screwy.
    As for scanning, you can scan line artwork (preferably very
    clean lines done with pen or dark pencil) and then vectorize them
    directly in Flash. No need for the Autocad stage.
    To be honest, I think you'll find it faster to do the 40
    drawings individually. Check a good reference book such as the
    famous Eadweard Muybridge (yes, I spelled it correctly) photos of
    animal movements, and then you can rotoscope these (that is, trace
    them). You'll end up with less frustration and a gorgeous animation
    which looks natural, not machine-made. You could do the tracing
    directly in Flash as well, using the onion skin mode to help
    you.

  • What t_code should be used for migration?

    Hello there,
    our user wants to  migrate  "output vat" account after being audited.
    actually , they start using SAP from 1st. January.2009 but now needs to migrate for reconciliation purpose.
    Journal should be 40) output VAT   /      50) Beginning Balance-BS.
    Since this output VAT does not need any tax code and base amount, i think normal FI transaction like F-02 is not an answer.
    Furthermore, LSMW is not strongly recommended at this time, considering line item to be created.
    Could you let me know what t_code should be used for this case?
    BR.
    J.
    Edited by: Jimmy Choi on Jun 30, 2009 5:41 PM

    Hi
    Note down the G/L accounts you are posting.
    Option 1 :In OBD4 see the account group. change the tax category mandatory to optional field for running the lsmw. afte completion, set the status as earlier.
    Option 2: goto fs00-> see the field status group.-> double click on the FSG-> see the taxes -> make the fields optional.
    with regards
    siva
    Edited by: Siva Rama Krishna Yanamandra on Jul 2, 2009 1:12 AM

  • My requirement is to update 3 valuesets daily based on data coming to my staging table. What is the API used for this and how to map any API to our staging table? I am totally new to oracle and apps. Please help. Thanks!

    My requirement is to update 3 valuesets daily based on data coming to my staging table. What is the API used for this and how to map any API to our staging table? I am totally new to oracle and apps. Please help. Thanks!

    Hi,
    You could use FND_FLEX_LOADER_APIS.UP_VALUE_SET_VALUE to upload them from staging table (I suppose you mean value set values...).
    You can find a sample scripts if you google around.
    What do you mean "how to map any API to our staging table" ?
    You should do at least the following mapping (which column(s) in the staging table will provide these information):
    - the 3 value sets name which you're going to update/upload (I suppose these are existing value sets or which have been already created)
    - the value set values and  description
    Try to start with something and if there is any issues the community could then help... but for the time being with the description of the problem you have provided, that's the best I can do...

  • What setting should I use for Abbey Road drums?  Getting a cpu overload issue

    What setting should I use for Abbey Road drums (i.e. multi-output, stereo, etc)?  Getting a cpu overload issue.  I have a macbook pro, 4 gb ram, running Logic Pro 9.  Just 3 tracks of drums and a few real instrument tracks.  Can't find a guide in the manual for either Kontakt or Logic.  Thanks in advance!

    Hi
    AR drums are complete resource (CPU) hogs. They work better if you turn off as many of the AR internal plugins as you can.
    See section 4 (?) of the AR manual, which you can find within Kontakt (In the library area of Kontakt click hold the small "i" on the right of the "AR drummer" Library).
    Alternatively, your only solution is to increase the I/O buffer in Preferences:Audio, with the associated increase in latency
    CCT

  • What are the tables used for this Report

    hi all..
    i am a fresher for ABAP. i need the help.
    what r the tables used for this report.
    Reports provide pending order details according to Material wise and customer wise for particular month.
    thanks in advance
    RK.Ashokkumar.
    9994262112.

    hi
    good
    try with these tables,
    MARA
    KNA1
    thanks
    mrutyun^

  • What method should be used for resizing the particular JTable Column width

    I have a four table. Only one table which are on top have a table header. I want that when user resize the topmost table with a mouse other table colume also be resized automatically. So I want to know that what method should be used for resizing the particular JTable Column width.
    Thanks
    Lalit

    maybe you can implement a interface ComponentListener as well as ComponentAdapter with your topmost Table.
    for example:
    toptable.addComponentListener(
    new ComponentAdapter(){
    public void componentResized(ComponentEvent e){
    table1.setSize(....);
    table2.setSize(....);
    /*Optionally, you must also call function revalidate
    anywhere;*/
    );

  • What r the tables used for this report.

    hi all..
    i am a fresher for ABAP. i need the help.
    what r the tables used for this report.
    Reports provide pending order details according to Material wise and customer wise for particular month.
    thanks in advance
    RK.Ashokkumar.

    Hi Ashok,
    this is easy to do.
    Open Two SAP Screen with same user ID.
    Run SQL trace using ST05 transaction.Open ST05 transaction in One and make
    Trace on ,Run the report in another screen.
    Once report run is over.End the trace process and click on display trace in same ST05 transaction.There is a click button on ST05 Transaction screen to start trace
    process,End trace process and Display track process.
    The SQL trace will  give you all the table details which is used in that particular report.
    You have not mentioned about the report name so I have suggested this way.
    regards,nishant
    Please reward if this helps

  • I have adobe creative suite 5.5 and have just bought a Sony Video Recorder with 4K. What preset should I use for importing video footage? Alternatively do I need a more recent version of the software?

    I have adobe creative suite 5.5 and have just bought a Sony Video Recorder with 4K. What preset should I use for importing video footage? Alternatively do I need a more recent version of the software? If so, what version do I need and can I download it from Adobe.

    I have adobe creative suite 5.5 and have just bought a Sony Video Recorder with 4K. What preset should I use for importing video footage? Alternatively do I need a more recent version of the software? If so, what version do I need and can I download it from Adobe.

  • Need Help..what should i use for this

    hello friends, i have to write a program which will load an xml file reader class at run time and depending on the content of xml file i'm going to generate mapping.. e.g xml file- <MyMapping> <ATO> <security type=int> </ATO> <FIX> <symbol type=String> </FIX> </MyMapping> Now i want to change the content of xml file without restarting my running application..changes should be reflected at runtime... also my xml file will contain nearly 1000 lines..so in this case which technique should i use whether i use JAXB which will give the classes of my xml file or any other ?? Also if i use JAXB whether JAXB gives classes corrsponding to my xml nodes (e.g ATO.java as per above example).

    daitkarsachin wrote:
    hi ,
    here is my question again..my xml will have
    <Message>
    <ATO>
    <somefiled="X" type=int value=35 />
    </ATO>
    <FIX>
    <somefiled="Y" type=String value=50 />
    <FIX>
    </Message>
    Now first i have to parse this xml ..then my java program is going to accept value from user ..and depending on user specified value i've to use either ATO or FIX fields...e.g if user value is 35 then my program should use fields within ATO node.
    You will read the XML structure into some kind of memory model. When the user supplies a value you will search for a matching value (likely from a collection such as a map or list) and return the value in that object that you locate.
    what should be done for this ..
    See above.
    and what if i change values in my xml file..will i have to restart my application to load xml again ?
    If you change the file on the filesystem, you should simply be able to re-parse the XML file and update your in-memory model. If you instead update your in memory-model, you can serialize the model back to XML on the filesystem. Neither needs to necessarily have anything to do with application start-up (other than the fact that you would normally read in the XML model then, but updating is a separate concern, as would re-reading it).
    - Saish

  • What format should I use for new  FCP slide show to DVD project?

    I want to edit a slide show movie. I have all of the high resolution images. I plan on authoring the project to DVD 16:9 anamorphic with DVD SP. Later I would like to author to 1920 x 1080 HD on Blu-Ray. ( I can't afford Adobe BR authoring software at this time, I want to start with the DVD) I am looking for advice. I want the quality of DVD and future Blu-Ray to be best possible quality. I'm thinking there are two options I might use:
    1. Edit the FCP project in HD 1920 x 1080. Use Compressor to convert the sequence to 16:9 anamorphic for DVD SP input. I am thinking I will have the HD sequence ready for the Blu Ray in the future. I like this approach. Is the conversion possible with compressor? What exact format and frame rate should I use for the FCP project?
    2. Edit the FCP project in 16:9 Anamorphic. Compress for DVD SP input. I am not fond of this option. I don't look forward to making rectangular pixel images in Photoshop for one. That will be a lot of work for this project. I won't have an HD sequence ready for Blu Ray in future, I will have to start a new project from scratch to make the HD version.
    Thanks in advance for any advice!

    Edit in a 1920x1080/30p Pro Res sequence settings.
    Export that to a self contained movie current settings, and use which ever SD DVD preset to encode for use in DVD SP.
    The self contained movie can eventually be used in Adobe Encore for blu ray authoring.
    But having "high resolution" images/photos means nothing in video.
    1 dpi is sufficient at 1920x1080 unless you plan to pan and zoom, in which case double the pixel size, not the dpi.
    300 dpi produces no better image than 1 dpi.

  • What programs should I use for creating a children's ebook with animated illustration?

    I'd like to create children's book for iPad with hand-drawn illustrations that are animated but in a simple way (like bubbles flying and popping). What programs should I use?
    Thanks in advance,
    Bibi

    Impossible to answer, I’m afraid. There’s just not enough details here and the very fact that you’re asking tells me that you should be very careful in choosing how to get this project done.

  • H.264 What is the best use for this? H.264 Pros & Cons?

    I wanted to know since I am using DV what if any role can H.264 play in my workflow? What are the intended or best uses for this? What are H.264 pros and cons? Will it produce higher quality than DV?
    As always thanks in advance for reading and replying to my post,
    Sebastian

    It will not make DV look better, it is a MPEG4 based compression format for material to be delivered over the web. As such, encoding your material to it it is the last step in the editing process.
    x

  • What Extractor can be used for this purpose?

    Hi all
    I have a requirement for a new report. The user wants to get a report regarding inbound cost saving including materials, material group, MRP controller, vendor, date, qty, actual inbound transportation cost, standard transportation cost which is fixed in SAP and variance between actual and standard.
    Can any one advice me what Extractor and Extract Structure can be used for this purpose?
    Thanks in advance
    Ishi
    Edited by: eletter on Sep 28, 2009 11:11 AM

    Hi
    Extract structure
    The extract structure, data from a DataSource is staged in the source system. The extract structure contains the amount of fields that are offered by an extractor in the source system for the data loading process.
    Extractors
    Extractors is a data retrieval mechanisms in the SAP source system. Which can fill the extract structure of a data source with the data from the SAP source system datasets. The extractor may be able to supply data to more fields than exist in the extract structure.
    Hope this helps you
    santosh

  • What class should I extend for this custom control?

    The code below is my attempt at a mxml control to replace a custom context-menu  that my app needs on certain textInput controls.  Characters not on the keyboard are inserted into the text, replacing any selection, if applicable.  Flex AIR apps (which I need for local access to SQLite) don't let me do custom contextmenus when the control is not top-level.
    The custom component is encapsulated now in a Panel but I would like to have the composite control be nothing more than a textInput and a PopUpMenuButton right next to it.  Is that possible—not to have a container?  If so,  what class should I extend, if creating this as an ActionScript component?
    Thanks for the advice.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="228" height="64"  creationComplete="onInit();" >
        <mx:TextInput id="mytextinput"   height="20"></mx:TextInput>   
        <mx:PopUpMenuButton id="mybutton" itemClick="onCharSelected(event);" x="159" y="-2" label="æ" width="41"  />
        <mx:Script>
         <![CDATA[
             import mx.utils.StringUtil;
             import mx.events.MenuEvent;
             import mx.events.ItemClickEvent;
             import mx.controls.TextArea;
            import mx.controls.Alert;
            import flash.events.*;
            import flash.display.Sprite;    
            import mx.collections.ArrayCollection;
                // use a point to track the selection-start and selection-end position for the text field
                private var pt:Point=new Point;
                private var chars:ArrayCollection = new ArrayCollection(
                    [ {label:"ð", data : "ð"},
                      {label:"æ", data:"æ"},
                      {label:"þ", data:"þ"} ]);
                    // track the selection positions as the mouse is moved or text is entered
                  private function onMouseEvent(e:MouseEvent): void{
                      pt.x=this.mytextinput.selectionBeginIndex;
                      pt.y=this.mytextinput.selectionEndIndex;
                  private function trackSelectionIndices(e: Event):void {
                     pt.x=this.mytextinput.selectionBeginIndex;
                      pt.y=this.mytextinput.selectionEndIndex;  
                private function onInit():void {
                    this.mytextinput.addEventListener(Event.CHANGE, trackSelectionIndices);
                    this.mytextinput.addEventListener(MouseEvent.MOUSE_DOWN, onMouseEvent);
                    this.mytextinput.addEventListener(MouseEvent.MOUSE_UP, onMouseEvent);
                    this.mybutton.dataProvider = chars;                     
                private function onCharSelected(e:MenuEvent):void {               
                    doInsert( e.item.data.toString(), this.mytextinput);
            // insert the character chosen from the popup into the text field, replacing any selection, and then reset the insertion point
             private function doInsert(s:String, trgt:Object):void {
                var v:String = TextInput(trgt).text;
                var pre:String =v.substr(0,TextInput(trgt).selectionBeginIndex);
                var post:String=v.substr(TextInput(trgt).selectionEndIndex, v.length-TextInput(trgt).selectionEndIndex);
                var result:String = pre + s + post;
                TextInput(trgt).text=result;
                TextInput(trgt).setSelection(TextInput(trgt).selectionBeginIndex+s.length,TextInput(trgt) .selectionBeginIndex+s.length);
              ]]> 
        </mx:Script>        
    </mx:Panel>

    Wiping perspiration from my brow as I abandon the difficult approach.
    Here is the simpler approach where HBox encapsulates the TextInput and PopUpMenuButton. I am trying to figure out how to let the TextInput keep its selection highlight when it loses focus to the PopupMenuButton: setSelection does not cause the repaint.
    package Search
        import flash.events.*;
        import flash.geom.Point;
        import mx.collections.ArrayCollection;
        import mx.containers.HBox;
        import mx.controls.PopUpMenuButton;
        import mx.controls.TextInput;
        import mx.events.MenuEvent;
        public class UnicodeCharPopupMenu extends HBox
            public function UnicodeCharPopupMenu()        {   
                        super();   
                        Init();
            private var mytextinput:TextInput = new TextInput;
            private var mybutton:PopUpMenuButton = new PopUpMenuButton;
            private function Init():void {
                mytextinput.width=100;
                mytextinput.height=22;
                mybutton.width=44;           
                this.width=200;
                this.height=20;
                visible=true;
               mybutton.addEventListener(FocusEvent.FOCUS_IN, onMenuGotFocus;
                mytextinput.addEventListener(Event.CHANGE, trackSelectionIndices);
                mytextinput.addEventListener(MouseEvent.MOUSE_DOWN, onMouseEvent);
                mytextinput.addEventListener(MouseEvent.MOUSE_UP, onMouseEvent);
                mybutton.addEventListener( MenuEvent.ITEM_CLICK, onCharSelected);
                //mybutton.addEventListener(MenuEvent.MENU_HIDE, onMenuHide);
                //mybutton.addEventListener(MenuEvent.MENU_SHOW, onMenuShow);
                mybutton.dataProvider = chars;  
                addChild(mytextinput);
                addChild(mybutton);           
            // use a point to track the selection-start and selection-end position for the text field
            private var pt:Point=new Point;
              private var chars:ArrayCollection = new ArrayCollection(
                    [ {label:"ð", data : "ð"},
                      {label:"æ", data:"æ"},
                      {label:"þ", data:"þ"} ]);
          //button got focus, repaint selection highlight
            private function onMenuGotFocus(e:FocusEvent): void {           
                 mytextinput.setSelection(pt.x, pt.y);
            // nothing selected, menu closed
            private function onMenuHide(e:MenuEvent): void {
                if (e.item.data==null) {
                    mytextinput.setFocus();
            private function onCharSelected(e:MenuEvent):void {             
                    doInsert( e.item.data.toString(), mytextinput);
           public function getText():String {
                    return mytextinput.text;
                // track the selection positions as the mouse is moved or text is entered
                 private function onMouseEvent(e:MouseEvent): void{
                     pt.x=mytextinput.selectionBeginIndex;
                     pt.y=mytextinput.selectionEndIndex;
                 private function trackSelectionIndices(e: Event):void {
                    pt.x=mytextinput.selectionBeginIndex;
                     pt.y=mytextinput.selectionEndIndex;  
                 private function doInsert(s:String, trgt:Object):void {
                 var v:String = TextInput(trgt).text;
                 var pre:String =v.substr(0,pt.x);
                  var post:String=v.substr(pt.y, v.length-pt.y);
                var result:String = pre + s + post;
                TextInput(trgt).text=result;
                TextInput(trgt).setFocus();
                TextInput(trgt).setSelection(pt.x+s.length,pt.x+s.length);
                pt.x = pt.x + s.length;
                pt.y = pt.x;          

Maybe you are looking for

  • I-Pad 4 will not sync to itunes using a PC

    My ipad and my iphone will not sync to itunes.  when i plug it in the devices do not appear in itunes and itunes does not pop up automatically.  on my ipad under itunes wi-fi sync it says that sync will resume when "india-PC" is available.

  • Query regarding  differences in R11 & R12 standard form of ASTRCALL.fmb

    Hi All, I am currently working on ASTRCALL.fmb , I am currently facing issue that some common elements found in the standard form ASTRCALL.fmb given with R11 are not to be found withR12 (i.e. like data block ASOOTHIS_CONTROL). Can you please tell how

  • Yet another dzen2 bar, icon and clickable tags for DWM

    I just switched to dwm and it's really awsome so I customized it a bit: A script to display dzen2 on top of dwm status bar which show: tags icons and these tags are really clickable, and even highlight the active tags. It's quite simple though and lo

  • Trouble with method and compiling, probably a dumb bracket

    import java.util.Scanner;      public class Rainfall        public static void main(String[]args)              double []mrt;               mrt = new double[12];               int month;               int menu;               Scanner keyboard=new Scann

  • Search Broken

    I have a standalone Sharepoint 2013 and search was working on it.  However now it returns this error: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+msbin1). If using