Icon for a Custom Component

Hi --
I am building a custom component and I have tried to create
the icon for the
component using
[IconFile("iconMaskInput.png")]
but its not working. Can someone help me out?
Rich

Hi --
I followed your instructions and updated the icon for the
movie clip inside
my FLA file that I compiled into a SWC file. However, when I
installed the
SWC file the icon did not update in the palette. Is this
because I had
already installed the component once? Or did I do something
wrong?
Thanks
Rich
"gnfontaine" <[email protected]> wrote in
message
news:fm4dqs$or1$[email protected]..
> You need to add it to the component inspector first,
then copy it into the
> same
> folder where you create the install package.
>
> 1.) Under the component definition found in the library,
click the default
> icon You will be present with a list, the last choice is
custom.
> 2.)Check the box display in components panel.
> 3.)If you are going to distribute the component using
mxp package, make
> sure a
> copy of the component is in the same folder as the mxi
file and that you
> add it
> to the files node in the mxi definition.
>
> Hope this helps
>

Similar Messages

  • UI delegate for a custom component

    Hello folks,
    I am trying to write (as said in the subject) a UI delegate for a custom component. I found the following in a Java FAQ (http://www.mindspring.com/~scdrye/java/faq.html#plaf_delegate):
    8.3. How do I create a UI delegate for my custom component?
    Have your component extend from JComponent (or a descendant of JComponent). Create a subclass of ComponentUI for your custom component, overriding at least the createUI() and paint() methods. To enable the new UI, override four methods of your JComponent subclass:
    public class MyComponent extends JComponent {
    public void updateUI() {
    setUI((MyComponentUI)UIManager.getUI(this));
    public void setUI(MyComponent newUI) {
    super.setUI(newUI);
    public MyComponentUI getUI() {
    return (MyComponentUI)ui;
    public String getUIClassID() {
    return "MyComponentUI";
    Well, it turns out that this is not enough. I also had to add during application start (just before initComponents()) the following:
    UIManager.put(uiClassID, uiClassName);
    to avoid exceptions during start of the program.
    Well, now my component is painted (paintComponent()) is called, but the paint() method in my new UI delegate class is not called when the application starts.
    It just gets called when I explicitily (in this case, using a menu item) change the L&F of the application.
    If this informatio is not enough, I can add some excerpts of my code for the ease of understanding!!
    Thanks a lot!

    If I code a new custom component (extending JComponent, or extending the UI delegate of a standard component) and pretend it to be laf aware then I must create the corresponding UI delegate for each laf, like it happens to be with standard swing components. But I'm not sure it is feasible to create the UI delegates for all unknown existing custom lafs.You are right, this is never going to work. I suggest if you want to make your custom component look & feel aware, you design the way it displays around the l & f of other components that are part of j2se and have l&f implementations.
    http://download.oracle.com/javase/7/docs/api/javax/swing/plaf/ComponentUI.html
    There are instructions here:
    http://download.oracle.com/javase/7/docs/api/javax/swing/LookAndFeel.html
    >
    On the other side, if I create a custom laf then I will also create a custom UI delegate for each standard component, but I can not create UI delegate for all unknown existing custom components.
    The point here is that standard components and standard lafs are universally known, while custom components (or custom ui delegates) and custom lafs are not.
    So the question is: How does a swing developer deal with the case of a new custom component that will be used in an unknown custom laf?
    For instance:
    1. Custom text UI delegate for dealing with styled documents in JTextField. See {thread:id=2284487}.
    2. JTabbedPane with custom UI delegate that paints no tab if the component only contains one tab.
    In both cases I need a UI delegate for each known laf, but what happens if the application is using a laf that certainly will not be aware of this custom functionally?
    Thank you!

  • Is it worth it to make custom icons for a custom control/indicator?

    I was making custom icons (well not very custom, but still at least somet ext) for controls and indicators, when I realized that the only times you see them are when you open the control, itself, ot if you hover over it in the project with context help on.
    So the question is:
    Is it worth it to create a custom icon for each custom control you make, if it will be seen only rarely?  (The exception being a cluster, since, in the later versions of LabVIEW, you can actually represent your cluster on the BD as the icon you made for it, so it definitely IS worth it to make an icon for it.)
    Thanks!
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
    Solved!
    Go to Solution.

    Hooovahh wrote:
    I'd like to add another time that you see the control's icon, is when it is a type def cluster, and you have it as a constant on the block diagram.  Then double click the border to shrink the cluster.  It will shrink to the size of the control's icon.
    I also hardly ever make a control icon.  Only when it is on the palette in a reuse package.
    Yeah,t hat's what I meant in my original post, although you CAN represent a cluster constant on the BD as an icon - but it's just the little thing on the bottom of the typdef'd cluster because it obviously has no actual icon. 
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Decode function not called for a custom component

    I know this problem happened in the past - in the EA2, EA4 and I believe the beta version as well, but does anyone know if it has been solved for the release ?
    In short - I'm working with the release, created a menuBar component and the decode method in the renderer is not called after I submit the page. In the past, there were rumors that this happened due to relative paths in the JSP (for js files, images, etc.).
    Does anyone else have this problem ? or better , know how to solve it ?
    Thanx,
    Netta.

    It's not that simple - The component is getting rendered, all the encode methods are called and the decode is called also , but only the first time the form is submitted.
    I added this custom component to the guessNumber application, and I have a menuBar in the greeting.jsp that leads to the response.jsp and vice versa. it looks like this in the greeting.jsp page -
    <!-- Start Menu -->
    <t:MenuBar id="bar1" styleClass="myClass" >
    <t:Menu id="menu1" name="menu1">
    <t:Menu id="menu2" name="menu2">
    <t:MenuItem id="item2_1" name="item2_1" action="/mytest/guess/response.jsp"/>
    <t:MenuItem id="item2_2" name="item2_2" action="http://www.msn.com"/>
    <t:Menu id="menu3" name="menu3">
    <t:MenuItem id="item3_1" name="item3_1x" action="http://www.msn.com"/>
    </t:Menu>
    </t:Menu>
    </t:Menu>
    <t:MenuItem id="item3" name="item3" action="http://www.cnn.com"/>
    </t:MenuBar>
    <!-- End Menu -->
    In the response it looks like this -
    <!-- Start Menu -->
    <t:MenuBar id="bar2" styleClass="myClass" >
    <t:MenuItem id="item3" name="item3" action="/mytest/guess/greeting.jsp"/>
    </t:MenuBar>
    <!-- End Menu -->
    and every time a menuItem is clicked on, the JS calls submit form.
    Since the menus are rendered, I assume there's nothing wrong with the rendererType and any other renderer problem. Since the decode is called only once, I assume the right form is being submitted.
    So, what can cause it to stop calling the decode ???
    Could it be that becase I go directly to the page and not through the navigation rules ( I call window.open directly from the JS), it creates a problem ??
    Please help, I've been wasting so much time on this !
    Netta.

  • Custom Validator for a Custom Component

    I am having troubling passing values from my custom component
    to my custom validator (via a model). For some reason when the
    validate() function is called for the validator the value parameter
    passed to the validator is not showing the value from my custom
    component.
    I have attached some example code to illustrate.
    Here is my model:
    <mx:Model id="myModel">
    <root>
    <mod>
    <name>{myTextInput.text}</name>
    <date>{myDateField.selectedDate.getTime()}</date>
    <length>{myComp.getLength()}</length>
    </mod>
    </root>
    </mx:Model>
    When I update the value of myTextInput or myDateField the
    model (as sent to the validator) shows the correct value. When I
    change the value of myComp the change is not reflected.
    Is there a particular event (or something) being dispatched
    in the other components to cause the model to get the new value
    that I need to include in my custom component? I am pretty stuck
    and would appreciate any help.
    Many thanks

    Does myComp extend EventDispatcher (or any class which does)?
    You need to flag the getLength() function as bindable and to
    dispatch an event:
    [Bindable('getLengthChange")]
    public function getLength() : Number
    // does whatever it does
    When you update myComp have it dispatchEvent( new
    Event("getLengthChange") ) and I think it will work.

  • Custom Icon for Lync Custom Menus

    We can create custom menus in LYNC Client by setting some  registry values.  But we are not able set custom icons fro the same(instead of default ICON). Is there any to set custom Icon for Custom Menus.
    Thanks in advance,

    No the icon is not configurable via the registry values.

  • Can I define a constructor for a Custom Component?

    I have a custom component which I instantiate through ActionScript.  For the sake of clean code, I would like to be able to assign the variables through the constructor like any other class:
    var myComp:CustomComponent = new CustomComponent(arg1, arg2, ...);
    However, when I try to write a constructor in the Script block for the component, it gives me a compile error telling me that I have multiple constructors:
    //In Script tag//
    public function CustomeComponent(arg1, arg2 ...):void { ... }
    Are we not able to define constructors for Custom Components?

    If this post helps, please mark it as such.
    If you create an array variable in your MXML component, and then set it with myVar="[val1, val2, val3]" in the opening tag of your component, then you basically have a constructor in MXML.
    You can use the [Bindable] metadata tag in three places:
    Before a public class definition.
    The [Bindable] metadata tag makes usable as the source of a binding expression all public properties that you defined as variables, and all public properties that are defined by using both a setter and a getter method. In this case, [Bindable] takes no parameters, as the following example shows:
    [Bindable]
    public class TextAreaFontControl extends TextArea {}
    The Flex compiler automatically generates an event named propertyChange, of type PropertyChangeEvent, for all public properties so that the properties can be used as the source of a data binding expression.
    If the property value remains the same on a write, Flex does not dispatch the event or update the property, where not the same translates to the following test:
    (oldValue !== value)
    That means if a property contains a reference to an object, and that reference is modified to reference a different but equivalent object, the binding is triggered. If the property is not modified, but the object that it points to changes internally, the binding is not triggered.
    Note: When you use the [Bindable] metadata tag before a public class definition, it only applies to public properties; it does not apply to private or protected properties, or to properties defined in any other namespace. You must insert the [Bindable] metadata tag before a nonpublic property to make it usable as the source for a data binding expression.
    Before a public, protected, or private property defined as a variable to make that specific property support binding.
    The tag can have the following forms:
    [Bindable]
    public var foo:String;
    The Flex compiler automatically generates an event named propertyChange, of type PropertyChangeEvent, for the property. If the property value remains the same on a write, Flex does not dispatch the event or update the property.
    You can also specify the event name, as the following example shows:
    [Bindable(event="fooChanged")]
    public var foo:String;
    In this case, you are responsible for generating and dispatching the event, typically as part of some other method of your class. You can specify a [Bindable] tag that includes the event specification if you want to name the event, even when you already specified the [Bindable] tag at the class level.
    Before a public, protected, or private property defined by a getter or setter method.
    You must define both a setter and a getter method to use the [Bindable] tag with the property. If you define just a setter method, you create a write-only property that you cannot use as the source of a data-binding expression. If you define just a getter method, you create a read-only property that you can use as the source of a data-binding expression without inserting the [Bindable] metadata tag. This is similar to the way that you can use a variable, defined by using the const keyword, as the source for a data binding expression.
    The tag can have the following forms:
    As far as binding, you can add the [Bindable] tag before the class declaration to make bindable all public properties defined as variables, and all public properties defined by using both a setter and a getter method.

  • Dynamic visibility for a custom component

    Hi everybody,
    I have implemented dynamic visibility for my component and try to use it with the Xcelsius checkbox.
    At preview my component is visible as the checkbox is checked.
    I unchecked the checkbox then my component is no more visible,  and it is works fine.
    But when I checked the checkbox again, my compoenent doesn't appear any more...
    Any idea ?

    Hi Evan,
    I am developing a component which requires "Dynamic Visibility" property.
    Its an Icon component where I have to bind a value for Icon. (i.e 0-30 Smiley, 31-70 dash, 71-100 Frown)
    The dynamic visibility works fine only when I bind both (Value for Icon,  Dynamic Status) to the same excel cell.
    Looks like Xcelsius wants all the bindings to be done to same cell in the Excel.
    [Here|http://docs.google.com/View?id=dzf62p8_35gc73brzm] is my code for your review.
    Please help me. Your timely respose would be of great help for me.
    Thanks
    Ravi.

  • How to handle children of custom component

    Hi,
    does anybody know an example of how to develop a custom UIComponent which is able to render any kind of child? For example:
    <x:mycomponent columns="3" valu="#{list-of-items} var="item">
    <h:graphicImage url="#{item.url}/>
    <h:selectBooleanCheckbox />
    </x:mycomponent>
    The result should be a table with 3 columns where each table-cell contains the result of the rendering process of its children, in this case a picture with a checkbox.
    I have tried it and managed to get the correct html-result. But I do not get the input of the checkbox if the above code snippet is a part of a html-form.
    So what I realy like to have is the sourcecode of some kind of UIComponent which does something like this.
    Kind Regards,
    Tobias

    Thanks for the swift reply Craig
    My custom component has 3 elements hence the currentTarget
    could be either the folder icon, the status icon or the text field.
    Is there some way of finding the parent of which ever of
    these sub items of the cusom component is clicked?
    Here is the code for my custom component
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="240" height="60" cornerRadius="15" borderStyle="none"
    backgroundColor="#ffffff" themeColor="#ff0000">
    <mx:Script>
    <![CDATA[
    [Bindable]
    public var studentName:String ="Student Name";
    ]]>
    </mx:Script>
    <mx:Text x="64" y="24" text="{studentName}" />
    <mx:SWFLoader x="10" y="10" width="32" height="24"
    source="@Embed('assets/folderIcon.swf')" />
    <mx:SWFLoader x="19" y="42" width="11" height="11"
    source="@Embed('assets/cfStatusIcon.swf')" />
    </mx:Canvas>

  • JPanel won't display my custome component

    Hi,
    I made a custome component class that in its paint method at this stage is suppose to paint a white rectangle on screen. However the when I add this custome component to my JPanel it doesn't show up. Does anybody have a solution for this?
    My code for the custome component is,
    public spaceMediaDisplayObject(mediaObject mo){
         x = mo.getSpaceX();
         y = mo.getSpaceY();
         height = mo.getHeight();
         width = mo.getWidth();
         name = mo.getName();
         System.out.println("Constructor");
         this.repaint();
    public void paint(Graphics g){
         System.out.println("Draw");
         g.setColor(Color.white);
         g.drawRect(x, y, height, width);
    And the fragment of code I am using to try and display in on the panel is as follows,
    spaceMediaDisplayObject smdo = new spaceMediaDisplayObject(toDisplay);
         spaceBodyPanel.add(smdo);
    Please help if able.

    If it's null then you need to set the size of each component explicitly:
    JPanel panel = new JPanel(null);
    Component customComponent = new CustomComponent();
    panel.add(customComponent);
    customComponent.setBounds(0, 0, 100, 100); // For exampleA simple layout manager could be used to make the component fill the panel, for example:
    JPanel panel = new JPanel(new GridLayout(1, 1));
    panel.add(new CustomComponent());Hope this helps.

  • How do I tie a custom-component to a class?

    In flash there's this great way of seperating code from
    content: In the properties menu of a movieclip in your library, you
    can assign a class name to the movie. So something I very regularly
    do is:
    class MyMovieClip extends MovieClip{
    //etc..
    so I'd have all the code that manages my movies nicely tucked
    away in some .as files, no code in the fla. That's the way I like
    it.
    So I was wondering if you can do a similar thing in Flex. I
    most definitely don't want the code for my application in the .mxml
    file, I actually want to inherit the Application class. Similarly,
    I'd like to inherit the Canvas class, yet have the nice gui for
    dragging all the visuall elements in place. Is there a way?
    Regard, and thanks in advance,
    Karel

    If you look in the library panel, there should be an entry for your custom component - probably something like CustomComponent1.mxml. Drag this out onto the artboard to create a new instance of the component.
    In the case of a custom component, you can't change much on the second instance. If you have something like a text input skin though, you can change the text it is displaying for each instance.
    We are working on making this sort of thing easier in the future, so stay tuned

  • How do I reuse a custom component in Flash Catalyst?

    All-
    I'm sure this is easy, I simply can't figure it out.  I've created a custom component in Flash Catalyst with two states, open and closed.  I'd like to reuse this component in my app with different text assest.  How is this done?  Duplicating the component isn't available in this version...do I need to recreate the whole thing with different text?
    Cheers,
    `me

    If you look in the library panel, there should be an entry for your custom component - probably something like CustomComponent1.mxml. Drag this out onto the artboard to create a new instance of the component.
    In the case of a custom component, you can't change much on the second instance. If you have something like a text input skin though, you can change the text it is displaying for each instance.
    We are working on making this sort of thing easier in the future, so stay tuned

  • Actionscript in a Custom Component

    Can anyone tell me if you can put actionscript inside of a
    custom component? It throws errors anytime I try to do it.
    I have a horizontallist component that is being populated
    with an itemrenderer which holds an image component. The
    horizontallist takes fifteen images and loads them into the
    itemrenderers, creating a scrollable image slideshow.
    I am trying to get it to check to see if the image loaded
    successfully, and if not, either set the visibility of that image
    component to false, or remove it.
    Here is the code for the horizontallist:
    <mx:HorizontalList
    id="imageBar"
    itemRenderer="listingImage"
    height="330"
    width="925"
    paddingLeft="5"
    paddingRight="5"
    rollOverColor="#FFFFFF"
    selectionColor="#FFFFFF"
    >
    And the code for the custom component.....
    <mx:Canvas
    xmlns:mx="
    http://www.adobe.com/2006/mxml"
    height="320"
    width="400"
    verticalScrollPolicy="off"
    horizontalScrollPolicy="off"
    >
    <mx:Image
    source="
    http://www.urladdress.com/idx/rmls/images/resimages/{data.id}_{data.imageNum}.jpg"
    height="300" scaleContent="true"
    />
    </mx:Canvas>
    I'm pretty new to Flex, so any help would be great!

    just insert the script tags in the custom component and place
    your actionscript within those script tags. So in your case just
    insert the following script tags above the image control...
    <mx:Script>
    <![CDATA[
    // actionscript goes here
    ]]>
    </mx:Script>
    - Tony

  • Custom Component in CREF

    Hi everybody!
    I am trying to deploy an applet which contains a Custom Component using CREF as simulator. That means I run CREF to be waiting for incoming APDUs. By means of apdutool I run the script which contains the APDUs for the deployment of the applet. The whole CAP file is deployed properly until the custom component is tried to be deployed. Then I receive the status word 0x6424.
    That means, according to the specification:
    Exception occurred.
    * Cause: General purpose error in the installer or applet code.
    * Solution: Check your applet code for errors.
    The applet works properly without the custom component, so the problem is not in the applet code.
    The line of the script which fails is the following (where 10 is the tag chosen for the custom component): 0x80 0xB2 0x10 0x00 0x00 0x7F;
    It is the one used to prepare the Installer to receive the component whose tag is 0x10, that is what 0xB2 means.
    The response is: CLA: 80, INS: b2, P1: 10, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 24
    The following APDUs, after that one, return 0x6421 that means the Installer is in an error state.
    So, I was wondering if someone had the same problem. Or if someone knows if CREF does not accept custom components.
    Thanks in advance, I don't reach to find where the error is. May be I am missing something...
    Best regards,
    E_L

    I would be surprised if CREF supports custom components. It would know how to use them so it would not make any sense. What is it that your custom component does?
    Cheers,
    Shane

  • How do I automate a custom component not implementing UIComponent?

    I have tried using Adobe's instructions for automating custom components by creating a delegate class to use as a mixin, but
    1)  the super() statement in the delegate of the constructor is not recognized by the compiler,
    2) I am not able to use a DisplayObject as an argument to init(),
    3) I am not able to return the custom component as a IAutomationObject from the parent component's getAutomationChildAt method.
    Is it simply not possible to automate a custom component not implementing UIComponent?

    If you look in the library panel, there should be an entry for your custom component - probably something like CustomComponent1.mxml. Drag this out onto the artboard to create a new instance of the component.
    In the case of a custom component, you can't change much on the second instance. If you have something like a text input skin though, you can change the text it is displaying for each instance.
    We are working on making this sort of thing easier in the future, so stay tuned

Maybe you are looking for

  • Report for the list of materials with component & assembly scrap

    Dear Experts , I have been told to generate a report for the materials which are subjected to component and assembly scrap . Please guide me for the same . Many thanks in advance. Yours Aman Khan

  • Issue in itunes apple id in app store

    hello i am using my itunes id in my iphone for downloading apps in app store. due to some reasons now i could not continue with my old apple id so i create a new apple id and remove my previous account by performing the following steps goto settings

  • Just bought a dv7 and subwoofer isn't working.

    Just bought a new dv7 computer and the laptop does not seem to be working, i don't hear any sound coming from the subwoofer at all. Anyone have any idea how to activate it, or even how to check to make sure if it is on or off. I can't seem to find an

  • SRGB or Adobe RGB for stills?

    When preparing photos in PS to bring into PP, does the color space matter? 1. For HD video which color space should I use? 2. For 4K video which color space should I use? Thanks.

  • Loading a new MainSequence in ProcessSetup callback ...

    TS version 3.5 Can someone provide a LabView or TestStand example of loading a new MainSequence? I don't want to change the process model to do this. I would like to change it in the ProcessSetup callback. I am having trouble understanding the steps