CustomNode not recognized as its class type but as class javafx.scene.Node

In the following code...
Stage {
    title: "Circles"
    scene: Scene {
        width: 200
        height: 100
        content: Box {}
class Circle1 extends CustomNode {
    public var Name: String = "Circle1";
    public var Radius: Integer = 50;
    override function create(): Node {
        return Group {
                    content: Circle {
                        radius: Radius;
                        fill: Color.rgb(50, 50, 50)
class Box extends CustomNode {
    public var Name: String = "Box1";
    var c1: Circle1 = Circle1 {Name: "c1"};
    var c2: Circle1 = Circle1 {Name: "c2"};
    var c_all = [c1, c2];
    def hbox = HBox {content: c_all};
    override function create(): Node {
        return Group {
                    content: hbox
    public function ChangeRadius(p_value: Integer): Void {
        for (i in [0..sizeof hbox.content - 1]) {
            //hbox.content.Radius = p_value; // ERROR: cannot find symbol - symbol: variable Radius - location: class javafx.scene.Node
println("{hbox.content[i]}");
var box: Box = new Box;
box.ChangeRadius(120);
... I get an error (see code comment).
I think actually should it be not class "javafx.scene.Node" but "Circle1"?
The println writes the correct types.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

It is indeed a bit perplexing... At runtime, we get Circle1, so it should work.
I think the problem is that the 'content' variable of HBox is defined as Node[] and that's all the compiler sees.
So the solution is to cast the object we get to tell the compiler it is a specialized node. If the node isn't of the right type, we will get a runtime error instead...
    public function ChangeRadius(p_value: Integer): Void {
        for (c in hbox.content) {
            // Checking type...
            if (c instanceof Node)
                println("Node");
            if (c instanceof CustomNode)
                println("CustomNode");
            if (c instanceof Circle1)
                println("Circle1");
            if (c instanceof Circle)
                println("Circle");
            if (c instanceof Group)
                println("Group");
            println("");
            (c as Circle1).Radius = p_value;
//~             println("{c.Name}");
    }

Similar Messages

  • We had a MacBook Pro stolen from our home when we were out of town and I am pretty sure we never activated the LoJack type of function on it not sure if its called lojack but you get what I am saying is there any way we can activate such  hardware/app now

    to
    We had a MacBook Pro stolen from our home when we were out of town and I am pretty sure we never activated the LoJack type of function on it not sure if its called lojack but you get what I am saying is there any way we can activate such  hardware/app now so we can possibly recover our laptop? Any one who can point us in the right direction that would be great and we would be very grateful. Thanks So Much

    Lojack for laptops - if that is the product you purchased and installed, you will need to read the user manual or contact the manufacturer as it is 3rd party.  You did file a police report right?

  • I got an itunes giftcard for my birthday and when i tried to add it on my balance on my ipod touch it says the code you entered is not  recognized as a valid code. but i just got this card brand new for my birthday.

    i got an itunes giftcard for my birthday and when i tried to add it on my balance on my ipod touch it says the code you entered is not  recognized as a valid code. but i just got this card brand new for my birthday.

    Make sure you're using the correct code. For most iTunes cards, the code is under the scratchoff area on the back of the card. For more information, see this support article:
    http://support.apple.com/kb/TS1292
    If you can't get to work after perusing that page, contact the iTunes Store Support; instructions are at the bottom of that article.
    Regards.

  • Iphone 3gs shows activation required, hocked up to iTunes and it is not recognized. Did the restore but just gets to the end and gives an error message it could not be restored, an unknown error occurred (-1). Can someone assist me in next steps please?

    iphone 3gs shows activation required, hooked up to iTunes and it is not recognized. Did the restore but just gets to the end and gives an error message it could not be restored, an unknown error occurred (-1). Can someone assist me in next steps please?

    Instructions to get the phone back working temporary.. till there is a real fix.
    1. turn off the phone
    2. fire up iTunes
    3. press and hold the home button, plug in the cable, hold till you get to see the recovery mode
    4. iTunes will the allow to choose restore the phone back to 5.0.1 ( no other choice)
    5. iTunes will then ask you to choose which previous backup to would like to recover.
    (note: please do not reboot your phone unless necessary, i realize at times after reboot, it goes back to sq1)

  • I reinstalled photoshop elements 11 becourse he asked for a serial number en did not recognized  de given number. But still de serialnumber is not , please help.

    I reinstalled photoshop elements 11 becourse he asked for a serial number en did not recognized  de given number. But still de serialnumber is not regonized, please help.

    After some serious hunting I finally found a link for live chat (that hunting also included switching to Internet Explorer where I had been using Chrome; I don't know if that's what made the difference). I gave the person at chat my redemption code; soon they came back and told me they had validated the code.
    I went to the code redemption page and put in the code, and AGAIN it came back invalid! A second visit to chat yielded a similar promise, but with instructions to go to my Adobe ID page and check for the serial number there, under Products and Plans. I went there, checked Products and Plans, and found no serial number.
    I was borderline homicidal at this point.
    Still on the ID page, out of desperation I clicked on the Other Products link, and there, FINALLY, I found the serial number. It worked when I ran the install program, and now PS 11 Elements is up and running on my computer.
    I would compare getting a serial number to PS 11 Elements to trying to find the Ark of the Covenant, except that finding the Ark is a cinch by comparison. I'm sure the difficulties I encountered were not of your making, but were the result of some horrible brain farts of those above you. Thanks for your help.
    John

  • Why iPhone 5 not charge with its own charger but will with iPhone 4 charger

    why iPhone 5 not charge with its own charger but will with iPhone 4 charger. Thanks to the member who posted that fix.

    It sounds to me like the charger that came with the iPhone 5 is defective, or the cable is if you've been switching the cables when you switch the chargers.
    Regards.

  • HT1600 atv not recognizing the 5.3 update, but is obviously connected. Help

    atv not recognizing the 5.3 update, but is obviously connected. Help

    Hello Chucanuka,
    I suggest a couple of things. First restart your Apple TV in this manner from Apple TV (2nd and 3rd generation): How to restart your Apple TV, found here http://support.apple.com/kb/ht3180.
    Restarting your Apple TV (2nd or 3rd generation) using the onscreen menu
    If you have Apple TV software 5.0 or later installed, you can restart your Apple TV using the onscreen menu. To restart your Apple TV choose Settings > General > Restart.
    If after that you still cannot see the update on the Apple TV, then I recommend restoring it using iTunes.
    Apple TV (2nd and 3rd generation): Restoring your Apple TV
    http://support.apple.com/kb/ht4367
    Regards,
    Sterling

  • Compiler is not recognizing MDM jar classes

    hi Experts,
                      I am trying to cretae  a java wrapper on top of MDM using Java API's. I created a simple java program and i was able to access the MDM repository. But when I created a Java DC I am getting the build errors in the same code.
    the steps I followed.
    1) added all the five jars in the java build path.
    2) cretaed a classpath variable which points to the location of the jar files in (window->preferences->java->classpathvariables)
    3) wrote a program which uses the classes mentiond in the jar files (without compilation errors)
    Now I build the program and build gets failed.
    The errors shown are
    package com.sap.mdm.data does not exist
    package com.sap.mdm.extension does not exist
    i.e whatever packages I have used in the programs are not recognized by the java compiler.
    Best Regards
    Pramod

    hi,
         I got the solution for above problem.
    DC's doesn't recognize added jars in the java build path. You have to add them in the external library and than expose these jars to the other DC by adding them in the public part of the external library DC.
    Enjoy.

  • Ipod Nano not recognized by computer (or itunes) but charging.. so connected

    worked until this am (though I think I had this once before, a couple years ago, too often follows itunes updates)
    connected to computer (win 7) this morning and it is not recognized by computer (or itunes)
    can't find it looking in Explorer
    but, it is charging so... it is connected
    have tried everything except re-installing itunes... if the computer is not seeing it, and it shows the connection when itunes isn't open...
    would that make any difference?

    diagnostic shows....
    **** Device Connectivity Tests ****
    iPodService 11.3.1.2 (x64) is currently running.
    iTunesHelper 11.3.1.2 is currently running.
    Apple Mobile Device service 3.3.0.0 is currently running.
    Universal Serial Bus Controllers:
    Intel(R) 82801G (ICH7 Family) USB Universal Host Controller - 27C8. Device is working properly.
    Intel(R) 82801G (ICH7 Family) USB Universal Host Controller - 27C9. Device is working properly.
    Intel(R) 82801G (ICH7 Family) USB Universal Host Controller - 27CA. Device is working properly.
    Intel(R) 82801G (ICH7 Family) USB Universal Host Controller - 27CB. Device is working properly.
    Intel(R) 82801G (ICH7 Family) USB2 Enhanced Host Controller - 27CC. Device is working properly.
    No FireWire (IEEE 1394) Host Controller found.
    Most Recent Devices Not Currently Connected:
    iPod nano (4th Generation) running firmware version 1.0.4
    Serial Number:       Y(I removed info)
    **** Device Sync Tests ****
    No iPod, iPhone, or iPad found.
    it looks like everything is fine, except it can't find the ipod... why?
    when I plug in a thumb drive, it recognizes that, why not the ipod?

  • IPOD 3rd Gen not recognized by itunes on firewire but it does on USB

    Hi,
    I have a 3rd gen Ipod (the one with the buttons) since its release date.
    It worked perfectly with FIREWIRE.
    Months ago i restore it and now it's a mess.
    I have to connect it via USB to sync it with my itunes library, to
    delete music, to add new one, or use it as a hard disk. But,
    the battery doesn't charge (actually the battery now only lasts for 1 hour)
    If i want to charge the battery i have to connect the ipod to the computer
    via FIREWIRE, but it doesn't get recognized by itunes, so i cant update
    it.
    I wanted to restore the ipod but if i connect it via USB, itunes send me a message
    that i have to connect it via firewire in order to restore it. But if I connect it
    via FIREWIRE i can't restore it because ITUNES doesn't recognize it.
    I hope someone can help me.
    thanks a lot
    IPOD 3rd Gen 15 gb
    Powerbook G4 with Panther 10.5.8

    If I were you, I will solve from the root i.e. replace the battery, you can do it with quite reasonable price here
    http://www.ifixit.com/iPod-Parts/iPod-3rd-Gen

  • IPod not recognized by Computer or iTunes (but it used to be)

    Okay, I have an iPod, I had problems, and I fixed them, but what's making me mad is that my grandpa got one, and he's having the exact same problems and they can't be fixed in the same way. So here's what's happening:
    iTunes doesn't recognize the iPod,
    it doesn't appear at all in "My Computer,"
    but when you go to "Safely Remove Hardware" it comes up there.
    Tried resetting the iPod; restarting the computer, iPod plugged in, iPod unplugged; downloaded iTunes version 7; did a million things I found in the forums; there's nothing wrong with my OS or USB ports (yes they're 2.0), so what do I do now?

    I'm having the same problem...iPod doesn't appear in iTunes and it isn't recognized by PC.Tried all 5 problem solvers with no luck. My iPod shows a sad face. It somehow went into an accessories test and went thru a bunch of downloads and option all on it's own?? Then it said - No USB cable detedted......then another bunch of accessories which appeared to fine.....then- Please plug FW, LCD ID:2, FWPWR:0
    Does anyone a a clue what this is all about and why it won't appear in iTunes????
    hp pavillion laptop   Windows XP  

  • 3.6.16 can chain Verisign code signing intermediate certificate ("2010 CA") in an xpi file even though it is not installed int its cert store, but 4.0 does not. Why does 4.0 not chain this cert?

    Certs that are in FF 4.0 on the signing workstation using Key Manager (I imported the "2010 CA"cert):
    Company cert
    VeriSign Class 3 Code Signing 2010 CA
    52 00 e5 aa 25 56 fc 1a 86 ed 96 c9 d4 4b 33 c7
    VeriSign Class 3 Public Primary Certification Authority - G5
    25 0c e8 e0 30 61 2e 9f 2b 89 f7 05 4d 7c f8 fd
    Verisign Class 3 Public Primary Certification Authority
    70 ba e4 1d 10 d9 29 34 b6 38 ca 7b 03 cc ba bf

    Turns out that Key Manager is apparently not compatible with 4.0. I uninstalled 4.0 from the signing workstation, installed 3.6.x and Key Manager again, then signings contained the chain for the client running either 3.6 or 4.0.

  • Blank screen, not recognized when pluged into laptop but if u call me it rings to the other person

    i tried to update the software but it failed 5hrs later my iphone turns itself off and has remained that way because it even when i plugged it into my laptop it did nothing infact my laptop said no device found. when someone calls me it rings their end but does nothin my end .please can someone help me i feel lost without my iphone

    facebook?  or facetime?

  • My iPod touch is not turning on its fully charged but it just shut off and won't work i connected it to my mac desktop and it still isn't

    what do i do? do i go get it fixed or what?

    Try:                                               
    - iOS: Not responding or does not turn on           
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try another cable                     
    - Try on another computer                                                       
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
      Apple Retail Store - Genius Bar                              

  • Hp officejet pro 8600 connected wirelessly but not recognized

    I have an hp officejet 8600 n911a which is connected to my wireless internet. I have run wireless network test results and printer status reports which both show connected. when you touch the internet icon it shows connected also with an ip address. However it will not connect to my computer, ipod, ipad, or any other device to print. The product software will not even ping the device to connect to the printer. It is like it will accept an incoming connection from my router but not send out a connection signal or recieve a signal to print on the same wireless connection. I have verified that it is set up on the same internet connection but the device is not recognized and when I type in the ip address in the address bar of chrome or explorer it says page cannot be opened. However I can email wirelessly to my printer to eprint by using the email given to me by my printer. I am very confused. Any help would be great.
    Melody

    With the network does the 5Ghz wirless have a different name to the 2Ghz network?
    If they have the same network name then you should change the ssids to be different so then you can tell which networks its on.
    From what you have told me it sounds like a 5Ghz 2 Ghz mismatch
    JonW
    I work for HP

Maybe you are looking for

  • Error ( while instantiating a class)

    I encountered the following errors ...plz help..Click and Clicka are two public classes which i have written ..Both of them have actionPerformed function defined .. gui.java:14: cannot resolve symbol symbol  : class Click location: class gui ActionLi

  • Interface Mappings in BPM Collect Pattern

    Hello I am new to XI development and currently facing problems while implementing collect pattern of BPM. I am trying to map IDoc structure with target legacy format.In BPM I had a block with infinite loop where I am transforming IDocs to target lega

  • Clone Mac Book hard drive onto Mac Mini

    Hi All, I own a 2009 MacBook Pro and have very recently bought a Mac Mini. I would like to clone the MacBook Pro's hard drive onto the Mac Mini, so that, when switching it on, the Mini is an exact replicate of the MacBook Pro, including all content,

  • Having Trouble Opening TIFF Files

    I'm having trouble opening TIFF files into Camera Raw. I have checked all my settings in Adobe Bridge and everything seems to be saying that TIFF files should open in Camera Raw when I click on then int and then into photoshop when finished editing i

  • Speakable items help

    this is completely pointless but i think it would be cool. I like to use the speech tools to just talk to my mac and have it open things for me. It would be cool if after doing something I could say "Thank you" and my mac would say "You're welcome".