Default bind access on class fields?

Hi,
I have a question on binding. Look at the following code:
1 var readyLight = Circle {
2     centerX: 12
3     centerY: 12
4     radius: 12
5     stroke: Color.GRAY
6     fill: bind RadialGradient {
7          centerX: 8
8          centerY: 8
9          radius: 12
10          proportional: false
11          stops: [
12               Stop {
13                    offset: 0
14                    color: Color.WHITE
15               }
16               Stop {
17                    offset: 1
18                    color: if (readyButton.selected) Color.GOLD else Color.GRAY
19               }
20          ]
21     }
22}This circle uses a radial gradient to fill itself. The 18th line uses a condition statement to dynamically determine the color of the second stop of the gradient. However, I think this line should use a "bind" keyword to keep the color dynamic. But when I added a bind the 18th line, an error showed up:"color has script only (default) bind access in javafx.scene.paint.Stop". I am confused about this, I haven't seen any document saying the "default bind access" thing.
This demo is from the official online UI tutorial: http://java.sun.com/javafx/1/tutorials/ui/layout/index.html
Any help on this is appreciated!

This works because you are creating a new RadialGradient instance whenever selected changes. You are not just changing the color.
It would be more efficient to define a selectedGradient and an unselectedGradient and use them:
def selectedGradient  : RadialGradient = RadialGradient {
          centerX: 8
          centerY: 8
          radius: 12
          proportional: false
          stops: [
               Stop {
                    offset: 0
                    color: Color.WHITE
               Stop {
                    offset: 1
                    color: Color.GOLD
def unselectedGradient  : RadialGradient = RadialGradient {
          centerX: 8
          centerY: 8
          radius: 12
          proportional: false
          stops: [
               Stop {
                    offset: 0
                    color: Color.WHITE
               Stop {
                    offset: 1
                    color: Color.GRAY
def readyLight = Circle {
     centerX: 50
     centerY: 50
     radius: 12
     stroke: Color.GRAY
     fill: bind if (selected) selectedGradient else unselectedGradient
}

Similar Messages

  • Accessing entity class field values in a visual JSF page

    There is a convenient way to access a session values into a JSF visual page using the following:
    String mySessionValue = (String) getValue("#{sessionScope.name}");Like the same, are there any ways to access entity class field values into a visual JSF page? Are there any concepts similar to "entityClassDataProvider" that can be linked to a table component in a visual JSF page?
    Thank you.

    My question is about (Netbeans visual pack) Java Persistence API and how to display the information from an entity class to a JSF page. But the above mentioned tutorial is about the ordinary visual table presentation.
    Thank you.

  • Giving Read access to key fields explicitly

    Hi sap gurus,
    How to give read access to key fields explicitly

    Hi and thanks for the response.
    The user has 2 security groups.
    The first allows them "All" access to their entity, default and the RD security class for R&D accounts.
    This group means they have read/write access to all accounts, which for their own entity is acceptable.
    If in the second group I give them read access to all entities then they can read all accounts for all entities.
    I need to stop them from seeing all accounts except the RD accounts for the other entities.
    Is this possible?

  • How to restrict AS02 access to certain fields only

    How to restrict AS02 (Asset Master Record) access to certain fields only. Currently when you assigned AS02 to a certain user, this will enable the user to change all the fields in the asset master record. Suppose i want only the user to restrict the access to certain field eg.NDJAR (Life in Yrs).
    Thanks for your inputs.
    Regards,
    Robert

    hello,
    basis has to assign the proper activity with object A_S_ANLKL. in this case they have to allow activity 03 only with combination of Cocode,asset class. see some more details below.
    This authorization object is the first part of the object "asset master record."
    The definition at this level determines whether the user is authorized to process data in a given company code. The activity type for the transaction is also defined here. This authorization object is used for master data transactions, for the display of value fields, and for reporting.
    Defined Fields
    The following fields are assigned to the authorization object
    Asset class (specified by entering a value in the pop-up window)
    Company code (specified by entering a value in the pop-up window)
    Activity type - there are three different activity types:
    01 = Create
    02 = Change (including blocking and deleting)
    03 = Display

  • How to set default date value to a field on screen

    How to set default date value to a field on screen and allow users to modify it ....

    Hello,
    In the PAI module, you need to save the changes to the database using the command MODIFY.
    Follow an example:
    Create or change a message in database table T100. If there is no message with the number 100 in the MYMSGCLASS message class in English, it will be created. Otherwise only the text is changed.
    DATA message_wa TYPE t100.
    message_wa-sprsl = 'EN'.
    message_wa-arbgb = 'MYMSGCLASS'.
    message_wa-msgnr =  '100'.
    message_wa-text =  'Some new message ...'.
    MODIFY t100 FROM message_wa.
    Regards.

  • Accessing super class  private variables from derived class

    posted November 01, 2005 08:20 PM Profile for kenji mapes Email kenji mapes Send New Private Message Edit/Delete Post Reply With Quote Assume I have a default and a param constructor in both a subclass and a super class. The members are private.
    So after validation logic in the sub class param. constructor, I want to access an instance variable of the super class's default constructor to set the subclass's matching variable to the default in the super class.
    Is there anyway I can do this. Of course, I have inherited setters and getters.
    Thanks.

    posted November 01, 2005 08:20 PM Profile for
    kenji mapes Email kenji mapes Send New Private
    Message Edit/Delete Post Reply With QuoteI suppose this is the result of an attempted crossposting from another forum. :)

  • Access to class-attribute by Interface-reference

    Hi OO-Gurus,
    I use an implementation of BADI ME_PROCESS_REQ_CUST to fill and handle user-defined fields in the MM-Purchase-Requisition, method IF_EX_ME_PROCESS_REQ_CUST~OPEN.
    There I  use a reference variable which refers to an interface (type ref to IF_PURCHASE_REQUISITION_ITEM) to access the item-object. My problem is that I need to have access to the class-attribute my_state. The corresponding class lcl_req_item is defined locally (LMEREQF01). So I can’t use  a reference variable with reference to this class (so widening cast using the interface-reference is not possible) .. Does anyone know a trick how to access the class-attribute anyway?
    Coding:
      data:  l_item_list       TYPE MMPUR_REQUISITION_ITEMS,
               l_item             TYPE MMPUR_REQUISITION_ITEM,
               l_item_akt       TYPE mereq_item,
               l_item_ref        TYPE ref to IF_PURCHASE_REQUISITION_ITEM. 
      l_item_list = im_header->get_items().
      loop at l_item_list into l_item.
        l_item_akt = l_item-item->get_data( ).
        l_item_ref = l_item-item.
      endloop.
    (Debugging the code, I manage by doubleclicking the fieldcontent of l_item_ref (e.g ) to show the content of the class-attribute my_state. This works only if the field “Interface” in the Debugger is empty because then I see the attributes of the class. If the field Interface is filled with “IF_PURCHASE_REQUISITION_ITEM”, there aren’t any attributes shown.)
    Thanks in advance for your kind help!!
    Nicole

    Hello Nicole
    The following sample coding shows you how to solve your problem. Please do not ask me how I came across this solution.
    However, if you are studying it carefully you may stumble across a most beautiful property of field-symbols as I did.
    METHOD if_ex_me_process_req_cust~open.
      DATA: l_item_list TYPE mmpur_requisition_items,
      l_item TYPE mmpur_requisition_item,
      l_item_akt TYPE mereq_item,
      l_item_ref TYPE REF TO if_purchase_requisition_item.
      DATA:
        ld_attr         TYPE string,
        lo_obj          TYPE REF TO object.
      FIELD-SYMBOLS:
        <lo_lcl>        TYPE ANY,
        <ls_item>       TYPE mereq_item,
        <ls_itemx>      TYPE mereq_itemx.
      l_item_list = im_header->get_items( ).
      LOOP AT l_item_list INTO l_item.
        l_item_akt = l_item-item->get_data( ).
        l_item_ref = l_item-item.
        lo_obj     ?= l_item-item.  " casting to root object !!!!!
        ld_attr = 'MY_STATE'.
        ASSIGN lo_obj->(ld_attr) TO <lo_lcl>.
        ld_attr = 'MY_STATE->ITEM'.
        ASSIGN lo_obj->(ld_attr) TO <ls_item>.
    "    ASSIGN l_item_ref->(ld_attr) TO <ls_item>.  " does not work...
        ld_attr = 'MY_STATE->ITEMX'.
        ASSIGN lo_obj->(ld_attr) TO <ls_itemx>.
      ENDLOOP.
      " NOTE: data definition of local class lcl_req_item_state (fg MEREQ)
    **    DATA:  item           TYPE mereq_item,
    **           itemx          TYPE mereq_itemx,
    **           header         TYPE REF TO lcl_req_header,
    **           ref_item       TYPE REF TO lcl_req_item,
    **           acct_container TYPE REF TO lcl_acct_container,
    **           source         TYPE REF TO cl_source_of_supply_mm,
    **           release_state  TYPE REF TO cl_release_state_mm,
    **           text_manager   TYPE REF TO lcl_text_manager,
    **           bom            TYPE REF TO lcl_bom,
    **           funds_mgt_active TYPE mmpur_bool VALUE mmpur_no,
    **           aktyp          TYPE aktyp,
    **           no_auth        TYPE mmpur_bool VALUE mmpur_no,
    **           release_op     type mmpur_bool value mmpur_no,
    **           persistent     TYPE mmpur_bool VALUE mmpur_no,
    **           checked        TYPE mmpur_bool VALUE mmpur_no,
    **           manual_configuration TYPE mmpur_bool,
    **           input_buffer_changed TYPE mmpur_bool VALUE mmpur_no,
    **           changed        TYPE mmpur_bool,
    **           broken_rules   TYPE lty_mask,
    **           referenced_rules TYPE lty_mask,
    **           chp_changes    TYPE mmchp_chp_list,
    **           dcm_manager    TYPE REF TO if_revision_manager_dcm,
    **           "DCM Retrofit
    **           rel_state_after_release TYPE REF TO cl_release_state_mm,
    **           "DCM Retrofit
    **           chdoc_container TYPE REF TO lcl_chdoc_container,
    **           "DCM Retrofit
    **           service_changed TYPE mmpur_bool,
    **           "DCM Retrofit
    **           determinants   TYPE lty_item_determinants.
    ENDMETHOD.
    Regards
      Uwe

  • Default/protected access question

    Why does this work:
    The class below extends TreePath but is in a foreign package to TreePath. The call at *1* is to a constructor in TreePath that has "default" access. Shouldn't this fail to compile since the "default" modifier only allows classes in the same package access? The call at *2* works as I would expect since the TreePath constructor being called there has "protected" access.
    Thanks,
          * Subclass of treepath with needed public constructors.    
         private class ExtendedTreePath extends TreePath {
              public ExtendedTreePath(Object singlePath) {
                   super(singlePath);                                        // *1*
              public ExtendedTreePath(TreePath parent, Object lastElement) {
                   super(parent, lastElement);                               // *2*
         }

    Hmm... That is odd. I get a slightly different, but no more helpful, compiler message. I know that an object has to implement Cloneable in order for the clone to succeed, but that's just a tag interface that should lead to a runtime exception.
    I think a slight adjustment in thinking about "protected" explains it:
    "Protected means it can be called by classes in the same package, and by subclasses, and this class (like every class) is a subclass of object, so why can't it be called?"
    That's what I thought. What I would suspect is the case, though, has to do with clarifying the "and by subclasses" piece of that rather imprecises wording of the rule.public class MyClass extends Object {
        public void meth() {
            Object obj1 = new Object();
            Object obj2 = obj2.clone(); // or, I imagine, any protected method would fail here
            MyClass mine = new MyClass();
            mine.meth2(); // this should work, It think
            super.clone(); // this should work
        protected void meth2() {
    } I don't really know how to word this very well, but it seems that we can only call protected methods on super, or, I would guess, on other members of our class. We can call Object's clone (or other protected) method if we're call it on super, but not on an arbtirary object.
    I don't know if that's correct, but play around with it, or re-read the relevant parts of the JLS and see if it jives.

  • Object class field  mandatory

    Hi,
    I have some requirement where in the object class field should be made mandatory(not defaulted) for a particular project profile. Can this be achieved through standard configuration?
    Regards,
    Laxminarsimha

    Hi,
    Thanks for your quick response
    I have done the following configurations
    1) In OPSA, object calss field is kept blank
    2) In OPUJ, the object class for the project definition is optional
    3) In OPUA, the object class field is 'Reqd' for the network type
    After creating WBS and network, object class is not selected. While saving the project, system prompts to select the object class for the WBS. When I selected object class the project gets saved.Once the project is opened again, the object class on the network is different than on the WBS(selected while saving the project first time).
    Regards,
    Laxminarsimha

  • Hidding java class field and methods

    Hi,
    I'm developing an API and I want to know if there's any way to hide all private class, field and methods when exploring the JAR from eclipse or another IDE. In [this capture|http://i8.photobucket.com/albums/a32/darkskimmer/Sinttulo-1-2.jpg] I can see "extra-information" like return type of private methods, etc. I want to keep this in secret...
    Cheers!
    P.S: I have to improve my english skills, I know... :)

    darkskimmer wrote:
    I'm developing an API and I want to know if there's any way to hide all private class, field and methods when exploring the JAR from eclipse or another IDE. Since the JVM has to be able to see them to access/execute them and and anything it can do you can do then you can't hide them.

  • How do you use Default Resource Access Information?

    I have some 10g Forms & Reports that I want to use with SSO and they will all be connecting to the database with the same connection info. I know how to configure a Default Resource Access Information, but how do you use this with Forms & Reports?

    Douglas,
    the default Resource Access Infomation should be the connection information right? This is used in conjunction with SSO. You need to configure your F&R applications to delegate authentication to SSO by placing ssoMode=true in the config section of formsweb.cfg.
    The Forms Servlet will connect to OID retrieve the Resource Access Information (descriptor) for a given user and automatically log them into the application.
    Users will need a global identity in OID and SSO must be enabled to use resource access info with F&R
    regards,
    tt

  • ACS 5.3 cannot create default network access authorization rule

    Hi, when I click 'Create...' under Access Policies > Default Network Access > Authorization, and then press the 'OK' button, it says 'Please configure at least 1 condition.' However I have no way to configure conditions as the 'Conditions' text is just bold text and not a link or any sort of configurable area. If I go to 'Customize' on the bottom right and add conditions to the right list box, I still have no options when I press Create. Also, the 'green light' next to Default Network Access is grey with a line through it. This is the most cryptic system I have ever used.. anyone have an idea? Thank you!

    Looks like you are using chrome amd it's not a supported browser.
    Supported Web Client/Browsers
    You can access ACS 5.3 administrative user interface using the following Web Client/Browsers:
    •Windows 7 32 bit
    •Windows XP Professional (Service Pack 2 and 3)
    •Windows Vista
    •Internet Explorer version 7.x
    •Internet Explorer version 8.x
    •Internet Explorer version 9.x
    •Mozilla Firefox version 3.x
    •Mozilla Firefox version 4.x
    http://www.cisco.com/en/US/docs/net_mgmt/cisco_secure_access_control_system/5.3/release/notes/acs_53_rn.html#wp222016
    Jatin Katyal
    - Do rate helpful posts -

  • How to change default internet access password in Gateway Max (for cable)

    Hi All, My home boardband (home bundle with cable) connection has just been installed. I am trying to change the default internet access password. But I can not find out where to set the new password in my Gateway Max configuration page (192.168.0.1).Is there anyone having idea about that please? RegardsCheng

    Hi Yeldarb, Maybe I do not describe the issue clearly. The "admin/password" is used for accessing gateway modem configuration page. But it is not what I want now. I am wondering the method for changing the default password which modem use to connect the telstra server. I think every telstra boardband client would have one username/password pair for access internet, right? 

  • Problem with Dynamically accessing EJB Class objects in WL 7.0 SP1

    I am trying to build a component which has the ability to instantiate and execute
    an known EJB method on the fly.
    I have managed to build the component but when I try and execute it I get a ClassNotFoundException.
    I know that the EJB I am trying to invoke is deployed and available on the server,
    as I can see it in the console, I also seen to have been able to get the remote
    interface of the object, my problem occurs when I try and access the class object
    so I can perform a create on the object and then execute my method
    The code I have written is below:
    private Object getRemoteObject(Context pCtx, String pJNDIName, String pHomeBean)
    throws Exception {
         String homeCreate = "create";
         Class []homeCreateParam = { };
         Object []homeCreateParamValues = {};           
    try {  
    //This call seems to work and doesn't throw an exception     
    Object home = pCtx.lookup(pJNDIName);
    //However this call throws a java.lang.ClassNotFoundException
    Class homeBean = Class.forName(pHomeBean);
    Method homeCreateMethod = homeBean.getMethod(homeCreate,homeCreateParam);
    return homeCreateMethod.invoke(home, homeCreateParamValues);
    } catch (NamingException ne) {             
    logStandardErrorMessage("The client was unable to lookup the EJBHome.
    Please make sure ");
    logStandardErrorMessage("that you have deployed the ejb with the JNDI
    name "+pJNDIName+" on the WebLogic server ");
    throw ne;
    } catch (Exception e) {
    logStandardErrorMessage(e.toString());
    throw e;     
    Any advice would be really appreciated, I'm fast running out of ideas, I suspect
    it has something to do with the class loader but I'm not sure how to resolve it
    Regards
    Jo Corless

    Hello Joanne,
    Congratulations! I'm very happy that you've managed to fix your problem. It's
    always essential to understand how to package applications when deploying on BEA
    WebLogic. Usually, by throwing everything into an EAR file solves just about all
    the class loader problems. :-) Let us know if you have any further problems that
    we can assist you with.
    Best regards,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669
    "Joanne Corless" <[email protected]> wrote:
    >
    >
    I've fixed it!!!!!!!!
    Thanks to everyone who gave me help!!!!
    The class loader was the culprit which is what I suspected all along.
    As soon
    as I put the 2 jar files I was using into an EAR file the problem went
    away!!!!!
    Thanks again
    Jo Corless
    "Ryan LeCompte" <[email protected]> wrote:
    Hello Joanne,
    As Mr. Woollen mentioned, I also believe it's a problem with the class
    loader.
    You need to be careful how you arrange your EJBs, because WebLogic has
    a specific
    method in which it loads classes in an EAR, JAR, and WAR file(s). Please
    refer
    to http://dev2dev.bea.com/articles/musser.jsp for more information about
    BEA WebLogic
    class loading mechanisms and caveats. Also, try printing out the various
    methods
    that are available on the object that was returned to you via reflection.
    For
    example, use the getMethods() method, which returns an array of Method
    objects
    that you can subsequently cycle through and print out the various method
    names.
    This way you can discover if the class found/returned to you is indeed
    the one
    you intend to locate.
    Hope this helps,
    Ryan LeCompte
    [email protected]
    http://www.louisiana.edu/~rml7669
    Rob Woollen <[email protected]> wrote:
    I believe the issue is the home interface class for this EJB is not
    available in the class loader which is doing the reflection.
    If you do:
    getClass().getClassLoader().loadClass(homeInterfaceClassName)
    I suspect it will fail. Reflection still requires that the class be
    loadable.
    -- Rob
    Joanne Corless wrote:
    Hi Slava,
    If I make my code look like you describe below I get a compliationerror telling
    me that
    home.getMethod() is not recognised (no such method)
    If I change it slightly and use
    Method homeCreateMethod =
    home.getClass().getMethod(homeCreate,homeCreateParam);
    The code will compile OK but when executed it still throws a NoSuchMethodException
    Any ideas ?
    Thanks for your help so far
    Regards
    Jo Corless
    Your code should look like
    Object home = pCtx.lookup(pJNDIName);
    Method homeCreateMethod =
    home.getMethod(homeCreate,homeCreateParam);
    return homeCreateMethod.invoke(home, homeCreateParamValues);
    Regards,
    Slava Imeshev
    "Joanne Corless" <[email protected]> wrote in message
    news:[email protected]...
    Hi Ryan,
    I also wanted to mention that if you do a "header search" in this
    particular
    newsgroup
    with the search query as "reflection", you will see many previousmessages
    regarding
    reflection and EJBs. I believe you could learn a lot from thedifficulties
    that
    others have faced and solved.I tried that and although there was a number of similar cases noneof them
    actually
    seem to fix my issue. Thanks for the suggestion though
    Are the EJBs that you are trying to access accessible via your
    system
    classpath?
    Try to avoid having them accessible via the main system classpath,and
    only bundle
    them in your appropriate EJB jar files (contained in an EAR file,for
    example).Maybe I should have laid the problem out a little clearer.
    I have a number of EJB's bundled up in a JAR file which is hot deployedto
    the
    server. Within this first JAR file is an EJB (SSB) component that
    needs
    to
    be
    able to invoke a known method on another EJB. This second EJB may
    or
    may
    not be
    within the first JAR file but it also will be hot deployed.
    The component trying to invoke the method on the 2nd EJB has to
    be
    able to
    create
    an instance of the 2nd EJB without actually knowing anything bar
    a
    JNDI
    Name which
    is passed in at runtime.
    I can get as far as doing the
    Object home = pCtx.lookup(pJNDIName);
    This returned a class with the name
    "com.csc.edc.projects.allders.httppostoffice.postman.PostmanBean_mp8qy2_Home
    Impl_WLStub"
    My problem seems to occur when I try and invoke the create method
    Method homeCreate = home.getClass().getMethod("create", new Class[0]);
    My code throws a java.lang.NoSuchMethodException at this point so
    I
    am
    unable
    to progress to the next step of :
    Object bean = homeCreate.invoke(home, null);
    So I can return the instantiated bean back to the calling client.
    Why am I getting the NoSuchMethodException, is is because I am gettinga
    stub
    back rather than the home interface and if so how do I get the truehome
    interface
    from the bean
    Thanks in advance
    Jo Corless

  • How to set default value in Profit Center field of Tcode F-02.

    Hi!
    Is it possible to set a default value for 'Profit Center' field in t.code F-02? Is there a way wherein the value will be copied in reference to the entered Business Area?
    For example, if during parking/posting of document, user input a value of 300 in the Business Area field, the system will automatically put 300 in the Profit Center field. Is there a way to do this?
    Hoping for your feedback.
    Thanks,
    April

    Hi
    Using the substitution this can be achieved.
    TC:GGB1
    Step-1: Prerequiste select the Company code for which this requirement is needed
    Step-2: In Substitution field, select the the "Profit center" field on selection of the field - system'll asks you -  How would you like to substfield BSEG-PRCTR ? with the 3 options
      i.constant value
      ii.exit
      iii.Field-Field assignment
    Select the 3rd option on selecting 3rd option before going to save that substitution it'll ask you to input which field should input the field BSEG-GSBER:Business area
    Step-3: activate the above substitution in TC:OBBH
    With the above settings whenever any value inputs in Business are field then the same value will be substituted in the Profit center field.
    Note: Make sure in all FSG - business area & profit center having the field status optional
    Can you tell me onething why this requirement has came ? Is business area and profit center are same in number and prupose
    regards
    Ramana
    Edited by: Ramana on Jan 8, 2008 9:33 AM

Maybe you are looking for