Rename custom nodes in a JTree

Hi all,
Our problem is that we don't find a way to rename our custom objects that we show in our JTree. We have defined a complete Tree data structure which works fine already ... now we want to be able to rename the nodes in the Tree.
Our JTree displays concrete instances of our self defined interface INode which has a toString method to display in the Tree. Adding and removing INodes dynamically to the tree works fine already, now we are looking for a way to rename those nodes. Those changes should be noticed finally in the 'name' field of each INode. (INode.setName, INode.getName are present).
We read from javadoc that a DefaultTreeCellEditor along with an according DefaultTreeCellRenderer are the starting point, but we can't get these 2 integrated to perform correctly. Now the question. Does anyone have an example or an idea of how to write such a CustomTreeCellEditor ??? It is especially important that a possibly provided solution DOES NOT depend on the use of DefaultTreeModel or DefaultMutableTreeNode. Since we use our own Tree Data Structure to be presented in the JTree, we don't have access to possible gimmicks one can expect from the DefaultXXX implementations ...
Any help very much appreciated!!!

was able to fix it over here:
http://forum.java.sun.com/thread.jspa?messageID=4089777

Similar Messages

  • How to use custom nodes in a JTree without reinventing the wheel?

    Hello,
    Each node contains two JTextAreas in a Box layout and a few JButtons.
    I wish to display these nodes in a JTree.
    Reading the tutorial, it seems I would have to reimplement the TreeModel, TreeCellRenderer/Editor, MutableTreeNode interfaces etc.
    Can I use the DefaultTreeModel, and other standard widgets (great stuff!) to minimize the amount of reimplementation I must do. aka avoid reinventing the wheel? I was thinking of extending my node from the DefaultMutableTreeNode class - however it does not display the nodes with the TextAreas, buttons etc.
    any help appreciated.
    thanks,
    Anil

    was able to fix it over here:
    http://forum.java.sun.com/thread.jspa?messageID=4089777

  • Please Help: Renaming a Node In JTree

    Hi All-
    I'm new to Swing, and am having some luck with this, but am running into a little issue that I'm not sure what is causing it... I am renaming a node in my JTree (which is working successfully), however, when the new name is being displayed, it is being displayed with a blue dot on the left side of it (probably indicating it's a node??) -- which I do not want! How can I get rid of this? I would be really appreciative if some experience eyes could look at this and tell me where I'm going wrong...
    Here is my code:
    private void btnRenameIconActionPerformed(java.awt.event.ActionEvent evt) {
    TreePath currentSelection = treeIcons.getSelectionPath();
    if (currentSelection != null){
    //Message box confirming renaming
    int result = JOptionPane.showConfirmDialog(null, "Are you sure you want to rename the" +
    " selected icon or category?", "Rename", JOptionPane.YES_NO_OPTION);
    //If 'YES' -> Allow user to rename the selection
    if(result == JOptionPane.YES_OPTION){
    String newName = (String)JOptionPane.showInputDialog(null, "Input the new name:", "Rename", JOptionPane.PLAIN_MESSAGE);
    DefaultMutableTreeNode lastNode = (DefaultMutableTreeNode)
    (currentSelection.getLastPathComponent());
    MutableTreeNode parent = (MutableTreeNode)(lastNode.getParent());
    if (parent != null){
    final String categoryName = lastNode.toString();
    lastNode.setUserObject(newName);
    DefaultTreeModel model = (DefaultTreeModel)treeIcons.getModel();
    ((DefaultTreeModel)treeIcons.getModel()).nodeChanged(lastNode);
    return;
    //If 'NO' -> -> Return to Icon Manager window
    else{
    return;
    // If there was no selection
    JOptionPane.showMessageDialog(this, "No icon or category was selected!");
    Thanks in advance for your help, it is very much appreciated!!
    -Jeanna

    My apologies for the code tags; first time posting code, but should have previewed it before posting, my bad.
    And, you're correct that you cannot compile, it's a small snipit of our project; I was just hoping that someone would see something in there that looked out-of-whack and know what was wrong.
    However, I've been in that code some more this week and, after feeling rather silly, realized that 'the blue dot' actually denotes that after renaming, the parent node is getting changed to a child node (those have blue dots next to them under the parents.... See, I even hate to admit that). So, my issue is that, when renaming a parent, it is getting changed to a child node.... Can anyone tell me by looking at my code where I'm messing that up?
    Thanks much.
    Swingily challenged yours,
    -Jeanna

  • Xml in JTree: how to not collpase JTree node, when renaming XML Node.

    Hi.
    I'm writing some kind of XML editor. I want to view my XML document in JTree and make user able to edit contents of XML. I made my own TreeModel for JTree, which straight accesses XML DOM, produced by Xerces. Using DOM Events, I made good-looking JTree updates without collapsing JTree on inserting or removing XML nodes.
    But there is a problem. I need to produce to user some method of renaming nodes. As I know, there is no way to rename node in w3c DOM. So I create new one with new name and copy all children and attributes to it. But in this way I got a new object of XML Node instead of renamed one. And I need to initiate rebuilding (treeStructureChanged event) of JTree structure. Renamed node collapses. If I use treeNodesChanged event (no rebuilding, just changes string view of JTree node), then when I try to operate with renamed node again, exception will be throwed.
    Is there some way to rename nodes in my program without collpasing JTree?
    I'am new to Java. Maybe there is a method in Xerces DOM implementation to rename nodes without recreating?
    Thanks in advance.

    I assume that "rename" means to change the element name? Anyway your question seems to be "When I add a node to a JTree, how do I make sure it is expanded?" This is completely concerned with Swing, so it might have been better to post it in the Swing forum, but if it were me I would do this:
    1. Copy the XML document into a JTree.
    2. Allow the user to edit the document. Don't attempt to keep an XML document or DOM synchronized with the contents of the JTree.
    3. On request of the user, copy the JTree back to a new XML document.
    This way you can "rename" things to the user's heart's content without having the problem you described.

  • URGENT renaming a node in JTree

    I have a JTree with nodes created.Say one such node is named ABC
    I take in String from a JTextField and use this String to rename the node created.Say this String is ABCXYZ
    I use myDefaultMutableTreeNode.setUserObject("ABCXYZ") method to rename.
    The problem I face is as ABCXYZ is lengthier than ABC, the node appears like this ABC..... in JTree and when I select the node again ABCXYZ appears fully.
    How do I do set this right without deleting the node and adding a new one with ABCXYZ as the name??
    Thanks in advance

    Thanks both of you. both solutions work. but since an event gets triggered if I select the node I will use DefaultTreeModel.nodeStructureChanged(node) method

  • How to set up SSO between e-portal employee node & ebill customer node?

    We have a requirement to set up SSO between e-portal employee node & ebill customer node.
    I am told that sso is possible only between 2 employee nodes.
    Please advise.

    Not sure I understand which part is failing.
    Is it the C program calling your packaged function? Or does the error occur in the PL/SQL code, in which case you should be able to pinpoint where it's wrong?
    A few comments :
    1) Using DOM to build XML out of relational data? What for? Use SQL/XML functions.
    2) Giving sample data is usually great, but it's not useful here since we can't run your code. We're missing the base tables.
    3) This is wrong :
    vStrSqlQuery := 'SELECT * FROM ' || vTblName                     || ' WHERE record_update_tms <= TO_DATE(''' || TO_CHAR(vLastPubTms, 'MM/DD/YYYY HH24:MI:SS') || ''', ''MM/DD/YYYY HH24:MI:SS'') ' ;
    A bind variable should be used here for the date.
    4) This is wrong :
    elmt_value := xmldom.createTextNode (doc, l_clob(1));
    createTextNode does not support CLOB so it will fail as soon as the CLOB you're trying to pass exceeds 32k.
    Maybe that's the problem you're referring to?
    5) This is most wrong :
         l_clob(1):=REPLACE(l_clob(1),'&lt;?xml version=&quot;1.0&quot;?&gt;', NULL); 
         l_clob(1):=REPLACE(l_clob(1),'&lt;', '<'); 
         l_clob(1):=REPLACE(l_clob(1),'&gt;', '>'); 
    I understand what you're trying to do but it's not the correct way.
    You're trying to convert a text() node representing XML in escaped form back to XML content.
    The problem is that there are other things to take care of besides just '&lt;' and '&gt;'.
    If you want to insert an XML node into an existing document, treat that as an XML node, not as a string.
    Anyway,
    Anyone that can help me to find out the required magic number
    That would be a bad idea. Fix what needs to be fixed.
    And please clearly state which part is failing : the C program or the PL/SQL code?
    I'd vote for PL/SQL, as pointed out in [4].

  • How to "repaint" a custom node

    Hi everybody.
    I have working with JavaFX for a short time and a problem has come up... I'm developing an application where I dragg and drop elements from one half of the Scene to the other. Each half is represented by a Custom node that shows some thumbnails. When I dragg an element from one side to the other, I managed to insert that element in the sequence belonging to the destiny (Custom node) side.
    What I want is making this change of position visible, Each side of the Scene has a lot of thumbnails and I use a scroll to browse all the elements. When I transfer a thumbnail from one side of the Scene to the other is still the origin custom node scroll which moves the just transferred thumbnail altought it should be managed by the destiny custom node scroll...
    What I would need is a kind of "repaint" method, like the Swing's one...
    Thank's in advanced. Regards.

    Hi Nachy,
      Thanks for your replay,
    Regards,
    Anumaala Kumar

  • How do i expand all the nodes in a jtree

    Hi,
    I am working on a project where i need to expand all the nodes of a jtree i have tried a few different ways but it never seems to expand all the nodes..
    I would be very greatful if someone could point me in the right direction
    cheers
    Mary

    you could use the following method that expands nodes recursively
    expandNode( myTree, myRootNode, new TreePath( myRootNode ) );
    public static void expandNode( JTree tree, TreeNode node, TreePath path ) {
        tree.expandPath( path );
        int i = node.getChildCount( );
        for ( int j = 0; j< i; j++ ) {
            TreeNode child = node.getChildAt( j );
            expandNode( tree, child , path.pathByAddingChild( child ) );
    }

  • How to get total number of nodes in a JTree?

    Hi,
    I am trying to get total number of nodes in a JTree, and cannot find a way to do it.
    The current getRowCount() method returns the number of rows that are currently being displayed.
    Is there a way to do this or I am missing something?
    thanks,

    How many nodes does this tree have?
    import java.awt.EventQueue;
    import javax.swing.*;
    import javax.swing.event.TreeModelListener;
    import javax.swing.tree.*;
    public class BigTree {
        public static void main(String[] args) {
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                    TreeModel model = new TreeModel() {
                        private String node = "Node!";
                        @Override
                        public void valueForPathChanged(TreePath path,
                                Object newValue) {
                            // not mutable
                        @Override
                        public void removeTreeModelListener(TreeModelListener l) {
                            // not mutable
                        @Override
                        public boolean isLeaf(Object node) {
                            return false;
                        @Override
                        public Object getRoot() {
                            return node;
                        @Override
                        public int getIndexOfChild(Object parent, Object child) {
                            return child == node ? 0 : -1;
                        @Override
                        public int getChildCount(Object parent) {
                            return 1;
                        @Override
                        public Object getChild(Object parent, int index) {
                            return node;
                        @Override
                        public void addTreeModelListener(TreeModelListener l) {
                            // not mutable
                    JFrame frame = new JFrame("Test");
                    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                    frame.getContentPane().add(new JScrollPane(new JTree(model)));
                    frame.pack();
                    frame.setLocationRelativeTo(null);
                    frame.setVisible(true);
    }But for bounded tree model using DefaultMutableTreeNode look at bread/depth/preorder enumeration methods to walk the entire tree. Or look at the source code for those and adapt them to work with the TreeModel interface.

  • What is the recommended way to handle mouse click events for custom nodes that subclass Panes?

    Hi,
    I have created a custom node that is a StackPane containing a Label on top of a Polygon.
    import javafx.scene.control.Label;
    import javafx.scene.layout.StackPane;
    import javafx.scene.paint.Color;
    import javafx.scene.shape.Polygon;
    public class CustomHexagon extends StackPane {
        private Polygon hexagon;
        private Label overlayText;
        public CustomHexagon( String text, double... points ) {
            this.hexagon = new Polygon( points );
            this.overlayText = new Label( text );
            overlayText.setStyle( "-fx-font-weight: bold;" );
            hexagon.setStroke( Color.GREEN );
            hexagon.setStrokeWidth( 5.0 );
            hexagon.setFill( Color.WHITE );
            this.getChildren().addAll( hexagon, overlayText );
    // Lays out the node where it should be according to the points provided for the Polygon.
            this.setLayoutX( points[0] - getLayoutBounds().getMinX() );
            this.setLayoutY( points[1] - getLayoutBounds().getMinY() );
    // Show the border of the StackPane.
            this.setStyle( "-fx-border-color: black; -fx-border-width: 1; -fx-border-style: dashed;");
        public String getOverlayText() {
            return overlayText.getText();
    I want to display a tesselation of these custom hexagons. Because a CustomHexagon is a StackPane, not a Polygon, MouseClick events can be picked up when the mouse is clicked outside of the stroke of the hexagon but still within the StackPane (which takes up a rectangle larger than the hexagon). The following program demonstrates this.
    public class Main extends Application {
        @Override
        public void start(Stage primaryStage) {     
            Group root = new Group();
            CustomHexagon[] hexagons = {
                new CustomHexagon( "00", 10.0, 10.0, 30.0, 10.0, 40.0, 27.3205080756, 30.0, 44.6410161512, 10.0, 44.6410161512, 0.0, 27.3205080756 ),
                new CustomHexagon( "01", 70.0, 10.0, 90.0, 10.0, 100.0, 27.3205080756, 90.0, 44.6410161512, 70.0, 44.6410161512, 60.0, 27.3205080756 ),
                new CustomHexagon( "02", 130.0, 10.0, 150.0, 10.0, 160.0, 27.3205080756, 150.0, 44.6410161512, 130.0, 44.6410161512, 120.0, 27.3205080756 ),
                new CustomHexagon( "03", 190.0, 10.0, 210.0, 10.0, 220.0, 27.3205080756, 210.0, 44.6410161512, 190.0, 44.6410161512, 180.0, 27.3205080756 ),
                new CustomHexagon( "04", 250.0, 10.0, 270.0, 10.0, 280.0, 27.3205080756, 270.0, 44.6410161512, 250.0, 44.6410161512, 240.0, 27.3205080756 ),
                new CustomHexagon( "10", 40.0, 27.3205080756, 60.0, 27.3205080756, 70.0, 44.6410161512, 60.0, 61.961524226799995, 40.0, 61.961524226799995, 30.0, 44.6410161512 ),
                new CustomHexagon( "11", 100.0, 27.3205080756, 120.0, 27.3205080756, 130.0, 44.6410161512, 120.0, 61.961524226799995, 100.0, 61.961524226799995, 90.0, 44.6410161512 ),
                new CustomHexagon( "12", 160.0, 27.3205080756, 180.0, 27.3205080756, 190.0, 44.6410161512, 180.0, 61.961524226799995, 160.0, 61.961524226799995, 150.0, 44.6410161512 ),
                new CustomHexagon( "13", 220.0, 27.3205080756, 240.0, 27.3205080756, 250.0, 44.6410161512, 240.0, 61.961524226799995, 220.0, 61.961524226799995, 210.0, 44.6410161512 ),
                new CustomHexagon( "14", 280.0, 27.3205080756, 300.0, 27.3205080756, 310.0, 44.6410161512, 300.0, 61.961524226799995, 280.0, 61.961524226799995, 270.0, 44.6410161512 ),
                new CustomHexagon( "20", 10.0, 44.6410161512, 30.0, 44.6410161512, 40.0, 61.961524226799995, 30.0, 79.2820323024, 10.0, 79.2820323024, 0.0, 61.961524226799995 ),
                new CustomHexagon( "21", 70.0, 44.6410161512, 90.0, 44.6410161512, 100.0, 61.961524226799995, 90.0, 79.2820323024, 70.0, 79.2820323024, 60.0, 61.961524226799995 ),
                new CustomHexagon( "22", 130.0, 44.6410161512, 150.0, 44.6410161512, 160.0, 61.961524226799995, 150.0, 79.2820323024, 130.0, 79.2820323024, 120.0, 61.961524226799995 ),
                new CustomHexagon( "23", 190.0, 44.6410161512, 210.0, 44.6410161512, 220.0, 61.961524226799995, 210.0, 79.2820323024, 190.0, 79.2820323024, 180.0, 61.961524226799995 ),
                new CustomHexagon( "24", 250.0, 44.6410161512, 270.0, 44.6410161512, 280.0, 61.961524226799995, 270.0, 79.2820323024, 250.0, 79.2820323024, 240.0, 61.961524226799995 ),
                new CustomHexagon( "30", 40.0, 61.961524226799995, 60.0, 61.961524226799995, 70.0, 79.2820323024, 60.0, 96.602540378, 40.0, 96.602540378, 30.0, 79.2820323024 ),
                new CustomHexagon( "31", 100.0, 61.961524226799995, 120.0, 61.961524226799995, 130.0, 79.2820323024, 120.0, 96.602540378, 100.0, 96.602540378, 90.0, 79.2820323024 ),
                new CustomHexagon( "32", 160.0, 61.961524226799995, 180.0, 61.961524226799995, 190.0, 79.2820323024, 180.0, 96.602540378, 160.0, 96.602540378, 150.0, 79.2820323024 ),
                new CustomHexagon( "33", 220.0, 61.961524226799995, 240.0, 61.961524226799995, 250.0, 79.2820323024, 240.0, 96.602540378, 220.0, 96.602540378, 210.0, 79.2820323024 ),
                new CustomHexagon( "34", 280.0, 61.961524226799995, 300.0, 61.961524226799995, 310.0, 79.2820323024, 300.0, 96.602540378, 280.0, 96.602540378, 270.0, 79.2820323024 ),
                new CustomHexagon( "40", 10.0, 79.2820323024, 30.0, 79.2820323024, 40.0, 96.602540378, 30.0, 113.9230484536, 10.0, 113.9230484536, 0.0, 96.602540378 ),
                new CustomHexagon( "41", 70.0, 79.2820323024, 90.0, 79.2820323024, 100.0, 96.602540378, 90.0, 113.9230484536, 70.0, 113.9230484536, 60.0, 96.602540378 ),
                new CustomHexagon( "42", 130.0, 79.2820323024, 150.0, 79.2820323024, 160.0, 96.602540378, 150.0, 113.9230484536, 130.0, 113.9230484536, 120.0, 96.602540378 ),
                new CustomHexagon( "43", 190.0, 79.2820323024, 210.0, 79.2820323024, 220.0, 96.602540378, 210.0, 113.9230484536, 190.0, 113.9230484536, 180.0, 96.602540378 ),
                new CustomHexagon( "44", 250.0, 79.2820323024, 270.0, 79.2820323024, 280.0, 96.602540378, 270.0, 113.9230484536, 250.0, 113.9230484536, 240.0, 96.602540378 )
            EventHandler<MouseEvent> mouseClickedHandler = new EventHandler<MouseEvent>() {
                @Override
                public void handle(MouseEvent t) {
                    CustomHexagon h = (CustomHexagon) t.getSource();
                    System.out.println( h.getOverlayText() );
            for ( CustomHexagon hexagon : hexagons ) {
                hexagon.setOnMouseClicked( mouseClickedHandler );
            root.getChildren().addAll( hexagons );
            Scene scene = new Scene(root, 400, 400);
            primaryStage.setTitle("Example");
            primaryStage.setScene(scene);
            primaryStage.show();
        public static void main(String[] args) {
            launch(args);
    After running this program, when one clicks within the intersection of two StackPanes (borders shown by dashed lines), the target of the mouse click event will be the StackPane on top as determined by the order in which they were added to their parent.
    This is a problem because there is only a small "T" shaped area within each hexagon that when clicked will target that hexagon with an event, rather than adjacent nodes.
    I would appreciate any reccomendations to solve this problem.
    Thanks,
    James Giller

    Hello, this is an evergreen. Just call setPickOnBounds(false) on the CustomHexagon.
    An issue tracking this problem is open here: https://javafx-jira.kenai.com/browse/RT-17024

  • Can the name of a specific node in a JTree be returned by MouseEvent?

    I have created a mouseListener for a JTree. When a node in the JTree is clicked it should display the name of the node in a JOptionPane. Currently, I have the following:
    tree.addMouseListener(new MouseAdapter()
    public void mouseClicked(MouseEvent me)
         if(me.getClickCount() % 2 == 0)
         String s = "Blank";
         s = (me.getSource()).toString();
         JOptionPane.showMessageDialog(null, "Double clicked "+ s, "two", JOptionPane.PLAIN_MESSAGE);               
    }//mouseClicked          
    });//MouseListener
    This gives me the class X Y value, border, maxsize, etc.... when a node is double clicked.
    Does anyone know of a better way?

    Don't use MouseListener.
    Instead, make yourself a TreeSelectionListener as follows:
    public class WhererverYourTreeIs implements TreeSelectionListener
         public void valueChanged(TreeSelectionEvent e)
             TreePath path = e.getPath();
             System.out.println(path.getLastPathComponent());
         public void initStuff()
                 tree.addTreeSelectionLIstener(this);
    }

  • Sorting sequence of custom nodes

    How can one sort a sequence of custom nodes based on an arbitrary value?
    For example:
    Say you create a custom node of a person with their favorite number:
    var myNode : CustomNode = CustomNode{
        var personName: "John Smith"
        var personFavoriteNumber: 15
    //Create a sequence of CustomNode with different names and favorite numbers
    var customNodeSequence : CustomNode[] = .....My question is, how can you sort the sequence based off 'personName' (Alphabetically) or by their favorite number 'personFavoriteNumber' sequentially?
    I was reading [this article|http://blogs.sun.com/michaelheinrichs/entry/creating_javafx_sequences_in_java] and I'm curious to know more about this when he mentions the following:
    sort - Creates a new sequence by sorting the elements of a given sequence. The order can be induced either by the natural order of the elements, if they implement java.util.Comparable, or by providing a java.util.Comparator of the elements.+
    I believe it's related to [this thread|http://forums.sun.com/thread.jspa?threadID=5330227&tstart=31] , but I'm trying to figure out how to actually compare a custom node's variable with that of another. I'm not entirely sure how the comparator illustrated in this thread works.

    Found a solution.
    Here's a reference page: click
    var sortSeq = Sequences.sort(customNodeSequence , Comparator{
            public override function compare(o1 : Object, o2 : Object) : Integer{
                (o1 as CustomNode).personName.toLowerCase().compareTo((o2 as CustomNode).toLowerCase().personName);
    var customNodeSequenceSorted = (sortSeq as CustomNode[]); //sortSeq returns as object[], so you may have to type cast if you explicitly casted the destination sequence somewhere else

  • Sorting the nodes of a JTree

    Can anyone tell me how to go about sorting the nodes in a JTree?

    The best way to do it is thru the treemodel. Either adjust the order in a DefaultTreeModel, or create your own TreeModel.

  • OnMouseClicked event with overlapping custom nodes

    I'm having a bit of an issue with overlapping nodes.
    Essentially what I have are rectangular shaped custom nodes which, when an onMouseEntered event occurs, has an extended set of icons that fade in that are located on the above top right portion of the node. If I may use ASCII to illustrate :)
    X
    [ MyCustomNode ]
    +(Blank spaces don't work too well so let's pretend the X is sitting on top of the node on the upper left corner)+
    The X is an icon that simply deletes the node.
    The problem occurs when the nodes are overlapping (i.e. one above the other, where the X icon is overlapping with the node above it). When I click on the X, the onMouseClicked event fires for the node above.
    I've tried mucking around with disabling the node and using toFront() and toBack() as well, but no luck.
    Now that I think about it (I'm sure this is related), I've noticed issues with text/labels interfering with the "click-ability" of an object that it is overlapping. Since the text generally occupies little pixels in terms of the width of the actual text, it just seems to only sometimes interfere with onMouseClicked events - if you click on the right spot that is. If you disable the node, do the pixels the text/label occupy become "dead"? as in that space cannot be used to initiate the onMouseClicked event of an object behind the text? Make sense?
    Any ideas?

    I've put up a picture for your reference: [http://imagebin.ca/view/Lj9C7q.html]
    How it works is that each node can be clicked on, thus increasing its opacity to 1.0. Once "selected" there is a mouse enter/exit event for that particular node which allows the X icon to fade in/out to delete the node.
    What's happening is that if you click on the X of the selected node, the node directly above (1432-1481) is being selected, although the deletion of the original node works fine.
    Also the onMouseEnter event is firing for the "1432-1481" node if you hover over the X. As you can tell in the screenshot, the opacity is increased if you hover over an unselected node. You can see that the "1432-1481" is slightly brighter than the other nodes above it. Obviously the cursor is missing from the screenshot but it should make sense.

  • Custom node not appearing in hbox

    I can insert this custom node into an hbox (I scanned the hbox and verified their existence), but the contents of the frame from the fxz file do not show up.
    My objective:
    -I have a series of fxz files (frames) that I wish to put into an hbox
    -Each frame, when clicked on, will animate, when off screen, the animation will be toggled off (i.e. myCustomNode.action.play();)
    -If I simply insert the contents of an fxz file (which I can) I don't see a universal way to turn animations on/off as I don't want frames eating up cpu cycles if they are off the viewing area
    Custom node is as follows:
    public class frameNode extends CustomNode{
        public var frameNumber;
        public var fxdContent;
        public var actualFrame;
        public var action;
        ///Get image content from fxz file
        public function configureFrame() : Void{
            fxdContent = FXDLoader.loadContent("{__DIR__}testFrame{frameNumber}.fxz");
            actualFrame = fxdContent.getRoot();
            action = fxdContent.getObject("move") as Timeline;
        override function create(): Node {
            def frameNodeGroup : Group = Group {
                content: [ actualFrame  //content from frame ]
            return frameNodeGroup;
    }Using the custom node class I've defined, I can't seem to insert the node itself but only the node's pubic variable 'actualFrame'
            var newFrame : frameNode = frameNode{
                frameNumber: frameNumber
            newFrame.configureFrame(); //fetches the content of the fxz file and assigns it to variable 'actualFrame'
            insert newFrame.actualFrame into myHbox.content; //works
            //insert newFrame into myHbox.content;  //this will NOT workEdit:
    -It turns out that invoking the .configureFrame() method as how I did above was the problem. Instead, I invoked it within the node class itself. As soon as the custom node receives a frame number (i.e. which file to point to) it fetches the FXZ content.

    Hi Ada,
    Please find below a very useful blog on configuring & working with SUS user defined fields.
    Ordering Unit vs Order Pricing Unit in SRM-SUS
    Hope this should solve your problem.
    Regards
    Kathirvel

Maybe you are looking for

  • How do I reinstall Leopard on my mac pro from my mac book pro?

    How do I reinstall my Snow Leopard os into my mac pro from my mac book pro?  I have the disks, both run on Snow Leopard.  I am have a grey screen problem and nothing has fixed it yet, so I was told to reinstall in from another computer because when I

  • Apple remote is not working

    Video froze while watching hulu on Apple TV. I pressed the menu button and play button rapidly numerous times with no response. Now apple remote doesn't work, holding menu and right or left doesn't work either. The remote is barely a month old, what

  • Unable to connect Oracle 10g Express from Visual Studio Server Explorer

    Hello, Please help me out here. I am connecting from Visual Studio 2008 to Oracle 10g Express Edition and the I have installed the ODAC 11 and the ODP.NET as well for Visual Studio(Both include Oracle Developer tools). But whenever I tried to connect

  • NTP Problem

    Hi everybody, I need help about ntp issue on my Cisco MDS (m9100-s2ek9-kickstart-mz.5.0.1a.bin ,  m9100-s2ek9-mz.5.0.1a.bin) All my Cisco network equipements synchronises to my ntp server (Cisco catalyst 6500) without any problem except Cisco MDS equ

  • Where do I find my Library's total size (in term of GB and song total) in the new version of iTunes?

    Where do I find my Library's total size (in term of GB and song total) in the new version of iTunes? Thank you guys very much.