Vbox resize w/ nested children

If I dynamically add items to a vbox control in my flex app,
the vbox automatically adjusts it's height to accomodate the
additional height needed to house the items I added.
I am creating a custom control that uses a vbox as the parent
control. I find that if I add controls to the vbox, then add
controls to those controls (nested controls), the vbox does not
adjust it's height. It seems to only adjust for it's own children,
and not it's children's children.
Can anyone direct me to the event or method in the vbox that
I need to call for it to "auto-adjust" its height?
I know I can use a Resize, but I'd rather not get into
calculating what the new height should be. It'd be nice to just
have the vbox do it itself if there is a method I can call to cause
this to happen.

Hmm, I'm thinking now that it could be that the parent vbox
controls are being resized by flex before the child vbox controls.
I can see that the children do get the proper height adjustment as
I nest deeper, but the primary child does not adjust. The
appearance is that the bottom portion of the nested child remains
hidden behind it's parent.
I'm going to try to dig a bit deeper and see if this is
happening.

Similar Messages

  • Skew, Warp, Resize and Nest a video in Photoshop???

    I would like to know how to skew, warp and resize a video inside of photoshop cs4.  I would also like to know how to nest multiple video files into one file.
    I am new to Photoshop, I am looking for some tutorials but unable to find any.
    Thanks

    Marian, thanks for the advice.
    Thou I understand your point, very well about screwdriver vs hammer, that was not my question in my post.  I asked a straight forward question about how to Skew, Warp, Resize and Nest a video in Photoshop.  Not which is the best software to use for this task.
    If you know the answer, share the knowledge, is this not what this forum is for or am I in the wrong place???  Before suggesting which tool is best for me to use, try understanding what I want to build first.  This makes all the difference. 
    As I have already proven to myself I don’t need a new tool to accomplish the task I had at hand.  If I took your advice, I and my company would have wasted money on a software that we did not need in the first place.
    Understand your client needs first before giving advice.  Sometimes a hammer is all it takes, if you use right.
    I don’t need to study more on video production, this is not my job.  All I wanted to know was how to edit a video in Photoshop.
    I hope we are not off on the wrong foot because I feel I could learn a lot from you but you need to take the time to understand the question before shooting from the hip with an answer.

  • JAXP DOM - I can get children fine, just not nested children!

    Hi,
    I have a problem with JAXP dom. I cannot get the nested children associated.
    Here is my code:
    try {
    DOMParser parser = new DOMParser();
    String url = "file:/myxml.xml";
    parser.parse(url);
    Document doc = parser.getDocument();
    //Get the filename
    NodeList FileNameNodeList = doc.getElementsByTagName("filename");
    //Get the duration
    NodeList DurationNodeList = doc.getElementsByTagName("duration");
    //Get the headline
    NodeList HeadLineNodeList = doc.getElementsByTagName("headline");
    //Get the description
    NodeList DescriptionNodeList = doc.getElementsByTagName("description");
    //Get the keywords
    NodeList KeyWordsNodeList = doc.getElementsByTagName("keywords");
    //Get the link order
    //Read all values for every "File Name"
    for(int i=0; i<FileNameNodeList.getLength(); i++){          
    //Get the values
    Node FileNameNode = FileNameNodeList.item(i);
    Node DurationNode = DurationNodeList.item(i);
    Node HeadLineNode = HeadLineNodeList.item(i);
    Node DescriptionNode = DescriptionNodeList.item(i);
    Node KeyWordsNode = KeyWordsNodeList.item(i);
    //File name
    if(FileNameNode.getFirstChild() != null){
    Message += "<br><b>Filename:</b> " + FileNameNode.getFirstChild().getNodeValue();
    //Duration
    if(DurationNode.getFirstChild() != null){
    Message += "<b>Duration:</b> " + DurationNode.getFirstChild().getNodeValue();
    //Head line
    if(HeadLineNode.getFirstChild() != null){
    Message += "<b>Head Line:</b> " + HeadLineNode.getFirstChild().getNodeValue();
    //Description
    if(DescriptionNode.getFirstChild() != null){
    Message += "<b>Description:</b> " + DescriptionNode.getFirstChild().getNodeValue();
    //Key words
    if(KeyWordsNode.getFirstChild() != null){
    Message += "<b>Key Words:</b> " + KeyWordsNode.getFirstChild().getNodeValue();
    //Build the string
    String MessageTemp = Message;
    Message = "<font size=-1>" + MessageTemp + "</font>";
    return Message;
    } catch (Exception ex) {
    System.out.println(ex);
    return Message + ex.toString();
    Here is part of my XML File:
    - <article storyorder="1" pubdate="11/6/02 3:28:27 AM" source="MSNBC Video" topnews="1">
    <filename>vh</filename>
    <duration>00:01:58</duration>
    <headline>MSNBC&#146;s Video Headlines</headline>
    <description>The latest news from MSNBC.com</description>
    <keywords>headlines, news headlines</keywords>
    <photographer />
    <aspect>4:3</aspect>
    - <linkinfo>
    - <link order="1">
    <linkurl>http://www.msnbc.com/news/828323.asp</linkurl>
    <linktext>Republicans win control of Congress</linktext>
    </link>
    - <link order="2">
    <linkurl>http://www.msnbc.com/news/828325.asp</linkurl>
    <linktext>Republicans widen House majority</linktext>
    </link>
    - <link order="3">
    <linkurl>http://www.msnbc.com/news/828326.asp</linkurl>
    <linktext>Democrats retake some statehouses</linktext>
    </link>
    </linkinfo>
    - <categories>
    - <category id="News">
    - <topics>
    <topic>International</topic>
    <topic>US</topic>
    </topics>
    </category>
    </categories>
    </article>
    I can get filename, duration, etc. But I cannot get the multiple link URLs associated with the filename. How can I get that?
    Thanks

    Call getDocumentElement() on the document to obtain the root node. Then call getChildNodes() on the root node to get its children, each individual child can be accessed by looping, as follows :
    // Get the Document object.
    Node node = document.getDocumentElement();
    NodeList childNodes = node.getChildNodes();
    for(int i = 0; i < childNodes.getLength(); i++) {
        Node childNode = childNodes.item(i);
        // Perform some action on the node, or get its children to burrow
        // further down the DOM tree.
    }If you know how many levels you need to go down then you'll need that many nested for loops but recursion is a far more elegant solution.

  • XML - Filtering on nested children

    Hi,
    Let's say I have some XML like this...
    <cars>
         <car id="1">
           <options>
                <option id="100"/>
                <option id="200"/>
           </options>
         </car>
         <car id="2">
           <options>
                <option id="100"/>
           </options>
         </car>
         <car id="3">
           <options>
                <option id="200"/>
           </options>
         </car>
    </cars>
    I want to query for a list of all cars that have option #200.  Here's what I've tried.
    var list:XMLList = cars.car.(options.option.@id = 200)  // returns nothing
    var list:XMLList = cars.car.options.option.(@id = 200)  // returns option elements, not car elements of course
    var list:XMLList = cars.car.options.option.(@id = 200).parent().parent()  // throws an error
    How can I get the cars?  I've also tried getting the list of matching option elements, then manually looping over them and adding their parents to a new XMLListCollection... but performance was very bad (lots of elements)
    Any ideas?  Thanks!

    Hi,
    Let's say I have some XML like this...
    <cars>
         <car id="1">
           <options>
                <option id="100"/>
                <option id="200"/>
           </options>
         </car>
         <car id="2">
           <options>
                <option id="100"/>
           </options>
         </car>
         <car id="3">
           <options>
                <option id="200"/>
           </options>
         </car>
    </cars>
    I want to query for a list of all cars that have option #200.  Here's what I've tried.
    var list:XMLList = cars.car.(options.option.@id = 200)  // returns nothing
    var list:XMLList = cars.car.options.option.(@id = 200)  // returns option elements, not car elements of course
    var list:XMLList = cars.car.options.option.(@id = 200).parent().parent()  // throws an error
    How can I get the cars?  I've also tried getting the list of matching option elements, then manually looping over them and adding their parents to a new XMLListCollection... but performance was very bad (lots of elements)
    Any ideas?  Thanks!

  • Resizing a node and make children appear/disappear on its "visibility"

    I guees I could wrap the question within a smaller sample code snippet. On the other side I put the whole thing in here, so you can see what I am working on (should be complete an runnable).
    I am playing around with some sort of windowing within JavaFX (building my own windows).
    It does not look nice so far, but it works somehow. Anyhow, when I minimize the window by dragging the frame it will be minimized till the size of its children. I would like to get it as small as I want. Uncommenting the Line " //window.setMinSize(0.0, 0.0);" will let me make it as small as possible, BUT the children stay visible too, but they should dissapear as soon as the frame hits their bounds.
    Anybody having any idea for a nice/slick solution ?
    Here is the code:
    package org.rob.javafx.framework;
    import javafx.application.Application;
    import javafx.event.EventHandler;
    import javafx.geometry.Point2D;
    import javafx.scene.Cursor;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.control.ButtonBuilder;
    import javafx.scene.control.Label;
    import javafx.scene.control.LabelBuilder;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.*;
    import javafx.stage.Stage;
    import javafx.stage.StageStyle;
    public class Tests  extends Application {
        private Stage primaryStage;
        private double titleBox_initX;
        private double titleBox_initY;
        private Point2D titleBox_dragAnchor;
        private boolean resize_dragStart = false;
        private double resize_initWidth;
        private double resize_initHeight;
        private double resize_initX;
        private double resize_initY;
        private int resize_edge = EDGE_NONE;
        private Point2D resize_dragAnchor;
        private boolean izing_isMax = false;
        private double izing_X;
        private double izing_Y;
        private double izing_Width;
        private double izing_Height;
        private void init(Stage primaryStage) {
            this.primaryStage = primaryStage;
            Group root = new Group();
            primaryStage.setResizable(true);
            primaryStage.setScene(new Scene(root, 500,500));
            primaryStage.initStyle(StageStyle.TRANSPARENT);
            final VBox centerContent = VBoxBuilder.create().children(new Label("Label1"), new Label("Label2")).build();
            final BorderPane windowContent = BorderPaneBuilder.create().center(centerContent).build();
            final Region windowContentBox = HBoxBuilder.create().children(windowContent).build();
            final Region window = createWindow("Blue circle", windowContentBox, root);
            window.setTranslateX(200);
            window.setTranslateY(80);
        private Region createWindow(final String title, final Region content, final Group parent) {
            final StackPane window = StackPaneBuilder.create().prefHeight(300).cursor(Cursor.HAND).prefWidth(200).style("-fx-background-color:#b0c4de; -fx-border-style:solid; -fx-border-width:6px; -fx-border-color: linear-gradient(to bottom right, gray, gray 50%, black 50%, black);").build();
            // Without : minimizing stops at the space the children need, with this you can make it as small as possible,
            // BUT the children are still visible. -> ToDo: Make the children dissapear, but keep the titlebar.
            //window.setMinSize(0.0, 0.0);
            // Title-Bar
            final Label titleLabel = LabelBuilder.create().text(title).style("-fx-text-fill:yellow;").build();
            final Region titleBoxSpring = new Region();
            titleBoxSpring.setPrefWidth(20);
            titleBoxSpring.setMinWidth(Region.USE_PREF_SIZE);
            final Button titleMinBtn = ButtonBuilder.create().text("_").cursor(Cursor.DEFAULT).build();
            final Button titleMaxBtn = ButtonBuilder.create().text("+").cursor(Cursor.DEFAULT).build();
            final Button titleCloseBtn = ButtonBuilder.create().text("X").cursor(Cursor.DEFAULT).build();
            HBox.setHgrow(titleBoxSpring, Priority.ALWAYS); // make the "spring" always grow, so the buttons are always on the right.
            final HBox titleResizeButtonBox = HBoxBuilder.create().spacing(2).children(titleMinBtn, titleMaxBtn, titleCloseBtn).style("-fx-alignment:center-right;").build();
            final HBox titleBox = HBoxBuilder.create().children(titleLabel,titleBoxSpring,titleResizeButtonBox).prefHeight(30).cursor(Cursor.HAND).spacing(4.0).style("-fx-alignment:center-left; -fx-background-color:blue; -fx-border-style:dashed; -fx-border-width:1px; -fx-border-color: linear-gradient(to bottom right, gray, gray 50%, black 50%, black);").build();
            final BorderPane windowContentPane = BorderPaneBuilder.create().top(titleBox).center(content).build();
            titleMinBtn.setOnMouseClicked(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    // -------- Minimizing-Handling ------
                    if(izing_isMax)
                        maximizeItRevert(window);
                    else
                        minimizeIt(window);            }
            titleMaxBtn.setOnMouseClicked(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    // -------- Maximize-Handling ------
                    if(izing_isMax)
                        maximizeItRevert(window);
                    else
                        maximizeIt(window);
            titleCloseBtn.setOnMouseClicked(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    parent.getChildren().remove(window);
            titleBox.setOnMouseClicked(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    switch(me.getClickCount()){
                        case 1:
                            break;
                        case 2:
                            // -------- Maximize-Handling ------
                            if(izing_isMax)
                                maximizeItRevert(window);
                            else
                                maximizeIt(window);
                            break;
                        default:
                            break;
                    //when mouse is pressed, store initial position
                    titleBox_initX = window.getTranslateX();
                    titleBox_initY = window.getTranslateY();
                    titleBox_dragAnchor = new Point2D(me.getSceneX(), me.getSceneY());
            titleBox.setOnMousePressed(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    //when mouse is pressed, store initial position
                    titleBox_initX = window.getTranslateX();
                    titleBox_initY = window.getTranslateY();
                    titleBox_dragAnchor = new Point2D(me.getSceneX(), me.getSceneY());
            titleBox.setOnMouseDragged(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    if(!izing_isMax){
                        double dragX = me.getSceneX() - titleBox_dragAnchor.getX();
                        double dragY = me.getSceneY() - titleBox_dragAnchor.getY();
                        double newXPosition = titleBox_initX + dragX;
                        double newYPosition = titleBox_initY + dragY;
                        window.setTranslateX(newXPosition);
                        window.setTranslateY(newYPosition);
            window.setOnMouseExited(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    if(window.getCursor() != Cursor.DEFAULT)
                        window.setCursor(Cursor.DEFAULT);
            window.setOnMouseMoved(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    // ------ Resize-Handling ------
                    int resize_edge = getRESIZE_EDGE(me, window);
                    switch(resize_edge){
                        case EDGE_NORTH:
                            if (window.getCursor() != Cursor.N_RESIZE)
                                window.setCursor(Cursor.N_RESIZE);
                            break;
                        case EDGE_NORTH_EAST:
                            if (window.getCursor() != Cursor.NE_RESIZE)
                                window.setCursor(Cursor.NE_RESIZE);
                            break;
                        case EDGE_EAST:
                            if (window.getCursor() != Cursor.E_RESIZE)
                                window.setCursor(Cursor.E_RESIZE);
                            break;
                        case EDGE_SOUTH_EAST:
                            if (window.getCursor() != Cursor.SE_RESIZE)
                                window.setCursor(Cursor.SE_RESIZE);
                            break;
                        case EDGE_SOUTH:
                            if (window.getCursor() != Cursor.S_RESIZE)
                                window.setCursor(Cursor.S_RESIZE);
                            break;
                        case EDGE_SOUTH_WEST:
                            if (window.getCursor() != Cursor.SW_RESIZE)
                                window.setCursor(Cursor.SW_RESIZE);
                            break;
                        case EDGE_WEST:
                            if (window.getCursor() != Cursor.W_RESIZE)
                                window.setCursor(Cursor.W_RESIZE);
                            break;
                        case EDGE_NORTH_WEST:
                            if (window.getCursor() != Cursor.NW_RESIZE)
                                window.setCursor(Cursor.NW_RESIZE);
                            break;
                        default:
                            if (window.getCursor() != Cursor.DEFAULT)
                                window.setCursor(Cursor.DEFAULT);
                            break;
            window.setOnMousePressed(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    // ------ Resize-Handling ------
                    resize_edge = getRESIZE_EDGE(me, window);
                    if(resize_edge != EDGE_NONE){
                        resize_initX = window.getTranslateX();
                        resize_initY = window.getTranslateY();
                        resize_initWidth = window.getWidth();
                        resize_initHeight = window.getHeight();
                        resize_dragAnchor = new Point2D(me.getSceneX(), me.getSceneY());
                        resize_dragStart = true;
                    } else
                        resize_dragStart = false;
            window.setOnMouseDragged(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    // ------ Resize-Handling ------
                    if(resize_dragStart){
                        double dragX = me.getSceneX() - resize_dragAnchor.getX();
                        double dragY = me.getSceneY() - resize_dragAnchor.getY();
                        System.out.println("DraxX = " + dragX + " ; DragY = " + dragY);
                        double newWidth = window.getPrefWidth();
                        double newHeight = window.getPrefHeight();
                        switch(resize_edge){
                            case EDGE_NORTH:
                                newHeight = resize_initHeight - dragY;
                                window.setTranslateY(resize_initY + dragY);
                                break;
                            case EDGE_NORTH_EAST:
                                newHeight = resize_initHeight - dragY;
                                window.setTranslateY(resize_initY + dragY);
                                newWidth = resize_initWidth + dragX;
                                break;
                            case EDGE_EAST:
                                newWidth = resize_initWidth + dragX;
                                break;
                            case EDGE_SOUTH_EAST:
                                newHeight = resize_initHeight + dragY;
                                newWidth = resize_initWidth + dragX;
                                break;
                            case EDGE_SOUTH:
                                newHeight = resize_initHeight + dragY;
                                break;
                            case EDGE_SOUTH_WEST:
                                newHeight = resize_initHeight + dragY;
                                newWidth = resize_initWidth - dragX;
                                window.setTranslateX(resize_initX + dragX);
                                break;
                            case EDGE_WEST:
                                newWidth = resize_initWidth - dragX;
                                window.setTranslateX(resize_initX + dragX);
                                break;
                            case EDGE_NORTH_WEST:
                                newHeight = resize_initHeight - dragY;
                                window.setTranslateY(resize_initY + dragY);
                                newWidth = resize_initWidth - dragX;
                                window.setTranslateX(resize_initX + dragX);
                                break;
                            default:
                                break;
                        System.out.println("New-Width = " + newWidth + " ; New-Height = " + newHeight);
                        System.out.println("Content-Width = " + content.getWidth() + " ; Content-Height = " + content.getHeight());
                        window.setPrefWidth(newWidth);
                        window.setPrefHeight(newHeight);
            window.getChildren().addAll(windowContentPane);
            parent.getChildren().add(window);
            return window;
        private void maximizeItRevert(Region window){
            window.setTranslateX(izing_X);
            window.setTranslateY(izing_Y);
            window.setPrefWidth(izing_Width);
            window.setPrefHeight(izing_Height);
            izing_isMax = false;
        private void maximizeIt(Region window){
            izing_X = window.getTranslateX();
            izing_Y = window.getTranslateY();
            izing_Width = window.getWidth();
            izing_Height = window.getHeight();
            window.setTranslateX(0);
            window.setTranslateY(0);
            if(primaryStage.getStyle() == StageStyle.TRANSPARENT){
                window.setPrefWidth(window.getScene().getWindow().getWidth());
                window.setPrefHeight(window.getScene().getWindow().getHeight());
            } else {
                window.setPrefWidth(window.getScene().getWindow().getWidth() - 16);     // ToDo: 16 is hardcoded, since I do not know how to get the window border size. Still to do.
                window.setPrefHeight(window.getScene().getWindow().getHeight() - 38);   // ToDo: same
            izing_isMax = true;
        private void minimizeIt(Region window){
            izing_X = window.getTranslateX();
            izing_Y = window.getTranslateY();
            izing_Width = window.getWidth();
            izing_Height = window.getHeight();
            window.setTranslateX(0);
            if(primaryStage.getStyle() == StageStyle.TRANSPARENT)
                window.setTranslateY(window.getScene().getWindow().getHeight() - 50);
            else
                window.setTranslateY(window.getScene().getWindow().getHeight() - 88);
            window.setPrefWidth(60);
            window.setPrefHeight(30);
            izing_isMax = true;
        private final static int EDGEWITH = 8;
        private final static int EDGE_NONE = 0;
        private final static int EDGE_NORTH = 1;
        private final static int EDGE_NORTH_EAST = 2;
        private final static int EDGE_EAST = 3;
        private final static int EDGE_SOUTH_EAST = 4;
        private final static int EDGE_SOUTH = 5;
        private final static int EDGE_SOUTH_WEST = 6;
        private final static int EDGE_WEST = 7;
        private final static int EDGE_NORTH_WEST = 8;
        private int getRESIZE_EDGE(MouseEvent me, Region region){
            if(isN_RESIZE(me, region)){
                return EDGE_NORTH;   
            } else if(isNE_RESIZE(me, region)){
                return EDGE_NORTH_EAST;
            } else if(isE_RESIZE(me, region)){
                return EDGE_EAST;
            } else if(isSE_RESIZE(me, region)){
                return EDGE_SOUTH_EAST;
            } else if(isS_RESIZE(me, region)){
                return EDGE_SOUTH;
            } else if(isSW_RESIZE(me, region)){
                return EDGE_SOUTH_WEST;
            } else if(isW_RESIZE(me, region)){
                return EDGE_WEST;
            } else if(isNW_RESIZE(me, region)){
                return EDGE_NORTH_WEST;
            } else
                return EDGE_NONE;
        private boolean isN_RESIZE(MouseEvent me, Region region){       // North
            double recentXPos = me.getX();
            double recentYPos = me.getY();
            double xMin = EDGEWITH;
            double xMax = region.getWidth() - EDGEWITH;
            double yMin = 0;
            double yMax = EDGEWITH;
            return recentXPos > xMin && recentXPos < xMax && recentYPos > yMin && recentYPos < yMax;
        private boolean isNE_RESIZE(MouseEvent me, Region region){      // North-East (Upper-Right Corner)
            double recentXPos = me.getX();
            double recentYPos = me.getY();
            double xMin = region.getWidth() - EDGEWITH;
            double xMax = region.getWidth();
            double yMin = 0;
            double yMax = EDGEWITH;
            return recentXPos > xMin && recentXPos < xMax && recentYPos > yMin && recentYPos < yMax;
        private boolean isE_RESIZE(MouseEvent me, Region region){       // East
            double recentXPos = me.getX();
            double recentYPos = me.getY();
            double xMin = region.getWidth() - EDGEWITH;
            double xMax = region.getWidth();
            double yMin = EDGEWITH;
            double yMax = region.getHeight() - EDGEWITH;
            return recentXPos > xMin && recentXPos < xMax && recentYPos > yMin && recentYPos < yMax;
        private boolean isSE_RESIZE(MouseEvent me, Region region){      // South-East (Lower-Right Corner)
            double recentXPos = me.getX();
            double recentYPos = me.getY();
            double xMin = region.getWidth() - EDGEWITH;
            double xMax = region.getWidth();
            double yMin = region.getHeight() - EDGEWITH;
            double yMax = region.getHeight();
            return recentXPos > xMin && recentXPos < xMax && recentYPos > yMin && recentYPos < yMax;
        private boolean isS_RESIZE(MouseEvent me, Region region){      // South
            double recentXPos = me.getX();
            double recentYPos = me.getY();
            double xMin = EDGEWITH;
            double xMax = region.getWidth() - EDGEWITH;
            double yMin = region.getHeight() - EDGEWITH;
            double yMax = region.getHeight();
            return recentXPos > xMin && recentXPos < xMax && recentYPos > yMin && recentYPos < yMax;
        private boolean isSW_RESIZE(MouseEvent me, Region region){      // South-West (Lower-Left Corner)
            double recentXPos = me.getX();
            double recentYPos = me.getY();
            double xMin = 0;
            double xMax = EDGEWITH;
            double yMin = region.getHeight() - EDGEWITH;
            double yMax = region.getHeight();
            return recentXPos > xMin && recentXPos < xMax && recentYPos > yMin && recentYPos < yMax;
        private boolean isW_RESIZE(MouseEvent me, Region region){      // West
            double recentXPos = me.getX();
            double recentYPos = me.getY();
            double xMin = 0;
            double xMax = EDGEWITH;
            double yMin = EDGEWITH;
            double yMax = region.getHeight() - EDGEWITH;
            return recentXPos > xMin && recentXPos < xMax && recentYPos > yMin && recentYPos < yMax;
        private boolean isNW_RESIZE(MouseEvent me, Region region){      // North-West (Upper-Left Corner)
            double recentXPos = me.getX();
            double recentYPos = me.getY();
            double xMin = 0;
            double xMax = EDGEWITH;
            double yMin = 0;
            double yMax = EDGEWITH;
            return recentXPos > xMin && recentXPos < xMax && recentYPos > yMin && recentYPos < yMax;
        @Override
        public void start(Stage primaryStage) throws Exception {
            init(primaryStage);
            primaryStage.show();
        public static void main(String[] args) { launch(args); }
    }

    Hmm~ in your case I think you have to compute it by yourself
    I would use the width and height of the content as dependency.
    Add this to the hande-method of your MouseDragged-EventHandler:
    HBox center = (HBox) ((BorderPane) ((StackPane) window).getChildren().get(0)).getCenter();
    HBox top = (HBox) ((BorderPane) ((StackPane) window).getChildren().get(0)).getTop();
    /** @todo: compute the border of the window into this */
    if (newWidth < center.getWidth() || (newHeight - top.getHeight()) < center.getHeight()) {
        center.setManaged(false);
        center.setVisible(false);
    else {
        center.setManaged(true);
        center.setVisible(true);
    }

  • How to control stage resizing

    My main file displays a large number of dynamically generated graphics. I have a listener to remove and then re-position the graphics if the browser is re-sized:
    stage.addEventListener(Event.RESIZE, stageResized)
    //When stage is resized, remove all children from the main component.
    //When empty, refresh the stage content
    public function stageResized(e:Event):void{
       while(mainUIComponent.numChildren>0){
            mainUIComponent.removeChildAt(0)
            addContentToStage()
    My problem is that the function works perfectly if I use the Browser Maximize/ Minimize buttons, but not if the window is re-sized manually by dragging the browser window at the bottom-right side. If I drag the window to resize, many graphics are left unerased on the stage, but all the new graphics are drawn leaving a terrible mess. If I go back to select the Maximize/ Minimize again, the screen is cleaned properly once more.
    Can anyone recommend an approach to clear out all the old graphics on a manual drag?

    Maybe add your event listeners to the Application object, and ensure width and height are 100%?
    If this post answers your question or helps, please mark it as such.

  • Accessing nested UIComponents

    The aim of the script is to be able to access component's
    chldren, and their children, and their children, etc... by their
    index.
    I've tried the following:
    // script
    public function deployNesting():void {
    var container:Canvas= new Canvas();
    var chldA:Canvas = new Canvas();
    var chldB:Canvas = new Canvas();
    var chldC:Canvas = new Canvas();
    this.addChild(this.container);
    this.container.addChild(chldA);
    this.container.addChild(chldB);
    this.container.addChild(chldC);
    return;
    public function accessNesting():void {
    trace(this.childAt(0).childAt(0))
    // error 1119*
    trace(this.childAt(0).numChildren)
    // error 1119*
    return;
    *1119 : Access of possibly undefined property numChildren
    through a reference with static type
    flash.display:DisplayObject.
    I'm aware that such nesting is not usually a best practice,
    but in some cases it is required, and I would appreciate an advice
    on this issue.
    a.neko

    Well... It's time to assume the therapeutical values of this
    forum in my particular case : ) One more time, just after recurring
    to all posiible ways to solve it, and afterwards posting a topic
    here, I change my approach and find the solution...
    In this case it is required to cast the return of all the
    getChildAt() in the nesting structure, except the last one.
    You can access a nested child to add a new child to it's
    display list as follows:
    Canvas(this.getChildAt(0)).addChild(chldC);
    Accessing a deeply nested child's name property looks as
    follows:
    Canvas((Canvas(this.getChildAt(0))).getChildAt(0)).getChildAt(0).name;
    etc...
    Somewhat complicated, but solves the problem of accessing
    nested children when, for instance, the variables used to create
    them are gone, or to freely iterate through nested display lists...
    (Verified with Flex 2.0 Builder mx.* components, but I
    suppose it works also for flash.display.* objects.)
    a.neko

  • Controlling scrollbars and container sizes

    We are having this exact problem. This is a pretty crazy
    problem. It seems like inner containers are not "pushing" the outer
    containers out far enough. The only resolution that I can find is
    to set a bunch of static sizes for containers, but then we lose the
    flexibility. Any ideas? The scrollbars are ridiculous cause they
    are constantly getting cut off by the browser or are there when
    they shouldn't be. Is there a better way for apps with multiple
    layers that are larger than the normal height of a screen?

    Thanks Jake,
    Reducing containers is surely a good thing. Unfortunately the
    application I'm working on is pretty large and at places there are
    easily between 5 and 10 nested containers. I'm not using
    AbsoluteLayout though and mostly a combination of HBox/VBox/Forms.
    One problem I ran into is with the use of HDividedBox, which
    when resizing caused its children to contain double scrollbars. The
    child would have a scrollbar and one of the child's children would
    have a scrollbar. If you get small enough then the parent also has
    a scrollbar. It ain't a pretty picture.
    Sofar I've found that HDividedBox has a problem with resizing
    a child component if that child is a container holding more
    components/containers. Its difficult to debug but my impression is
    that when the layout manager pass takes place, the child
    container's size hasn't been updated yet. As a result the deeper
    level is set larger than it should, causing an extra scrollbar.
    My workaround (bit hack) that helped somewhat is to catch the
    resize event in the HDividedBox child and set its minWidth to be
    the max of the measuredMinWidth of the child's children. This only
    affects how HDividedBox resizes its child, and isn't a general
    solution unfortunately.
    For those interested:
    eg:
    quote:
    function onResize(event:Event):void
    if ((child1 != null) && (child2 != null))
    this.minWidth = Math.max( child1.measuredMinWidth,
    child2.measuredMinWidth);

  • Help needed: HTTPService, XML, Repeater

    Hi there
    I am very much new to Flex 2 technology and require help
    regarding HTTPService and XML.
    In my main application (NestedRepeater.mxml), I have the
    following code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    xmlns:comps="component.*" layout="absolute"
    creationComplete="userRequest.send()">
    <mx:HTTPService id="userRequest"
    url="/Users/ronnyk/Sites/book.xml" useProxy="false" method="POST"
    />
    <mx:VBox>
    <mx:Repeater id="Repeater1"
    dataProvider="{userRequest.lastResult.book.section}">
    <comps:Section
    sectionNumber="{Repeater1.currentItem.sectionnumber}"
    xmlSection="{Repeater1.currentItem}" />
    </mx:Repeater>
    </mx:VBox>
    </mx:Application>
    In my real app, I have a PHP script as the url for the
    HTTPService, but for the sake of simplicity, I'll just use
    book.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <book>
    <section>
    <sectionnumber>s1</sectionnumber>
    <chapter>
    <chapternumber>c1</chapternumber>
    </chapter>
    <chapter>
    <chapternumber>c2</chapternumber>
    </chapter>
    </section>
    <section>
    <sectionnumber>s2</sectionnumber>
    <chapter>
    <chapternumber>c3</chapternumber>
    </chapter>
    </section>
    </book>
    As you can see as well, I have a custom component called
    Section.mxml within the repeater of the main app, the custom
    component is as follows:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script>
    <![CDATA[
    [Bindable]
    public var xmlSection:XML;
    [Bindable]
    public var sectionNumber:String;
    ]]>
    </mx:Script>
    <mx:VBox>
    <mx:Panel id="panel1" layout="absolute" title="Section"
    width="166" height="70">
    <mx:VBox>
    <mx:Label text="{this.sectionNumber}"/>
    </mx:VBox>
    </mx:Panel>
    <mx:Repeater id="Repeater2"
    dataProvider="{xmlSection.chapter}">
    <mx:Panel layout="absolute" title="Chapter" height="100"
    width="166">
    <mx:Label text="{Repeater2.currentItem.chapternumber}"
    />
    </mx:Panel>
    </mx:Repeater>
    </mx:VBox>
    </mx:Canvas>
    I am passing xmlSection="{Repeater1.currentItem}" to the
    custom component so that I can correctly create nested children for
    each parent. But anyway, my problem happens when I include
    xmlSection="{Repeater1.currentItem}" to the custom Section
    component, it always displays only one section (the label "s1"
    doesn't even appear), but if I exclude
    xmlSection="{Repeater1.currentItem}", when I run it, it displays
    correctly:
    s1
    s2
    Any help/suggestion would be greatly appreciated as I am at
    my wits end regarding my project.
    Let me know if you need any more info.
    Thanks!

    Hi again,
    After going through the HTTPService topic forum, I should be
    using resultHandler for my HTTPService, so I change my main mxml
    app into:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    xmlns:comps="component.*" layout="absolute"
    creationComplete="userRequest.send()">
    <mx:Script>
    <![CDATA[
    import mx.rpc.events.ResultEvent;
    [Bindable]
    private var myData:XML;
    private function resultHandler(event:ResultEvent):void {
    myData = event.result.book.section as XML;
    ]]>
    </mx:Script>
    <mx:HTTPService id="userRequest"
    url="/Users/ronnyk/Sites/book.xml" resultFormat="e4x"
    result="resultHandler(event)" useProxy="false" method="POST" />
    <mx:VBox>
    <mx:Repeater id="Repeater1" dataProvider="{myData}">
    <comps:Section
    sectionNumber="{Repeater1.currentItem.sectionnumber}"
    xmlSection="{Repeater1.currentItem}" />
    </mx:Repeater>
    </mx:VBox>
    </mx:Application>
    But now, when I run it, it displays nothing, just a blank
    browser. Can someone please help? Maybe because I shouldn't use
    creationComplete="userRequest.send()" in the Application tag?
    Thanks!

  • Dynamically building web content using XML file(s)

    Hello All!
    I was recently tasked with a project to design a monitoring web application for our "in-house" built web applications. There is a certain set of modules and parameters that we need to monitor: GSLB --> Web Tier --> App Tier --> Database.
    Almost all (80%) of our applications share the same parameters that need to be monitored, but there are about a hundred of them. So here is what I'm thinking of doing....
    1. Create an XML document for each application (An example layout is included at the end of this post) and save it in the Applications directory.
    2. Setup a Spring Framework project, and create code to dynamically go through the Applications directory and kick-off the monitoring logic for each <application/> item. Basically, the code will just traverse through all of the xml files (I might even create just 1 xml file with all of the <application/> items in it), read the "metadata" for each application, and start the backend processing, as well as display the data in a dynamically-generated web GUI (based on the XML structure and data).
    Again, most of our applications (80%) have the same modules/parameters, therefore adding an application would only require us adding another <application/> element to the already-existing xml document (or adding an additional XML document). The code would do the rest...In regards to the rest 20% of applications, I would create a customize XML document with additional metadata (the code, in that case, would be able to handle the additional metadata).
    So here are my questions:
    1. What do you think of the idea itself? I'm sure that I'm not the only one who's thought of this, so are there any best-practices in this regard?
    2. The reason I thought of using Spring is that it is XML-based (there are many reasons for me using Spring actually -- Security, ORM integration, etc), and it might facilitate my efforts. I'm thinking that even if reading through the Applications directory isn't such a good idea, I can somehow utilize Spring's dependency injection & AOS to create the appropriate solution. Have anybody tried this before and willing to share ideas, implementation approach, etc?
    3. Other than Spring, what might help me accomplish this task?
    4. Is this feasible (from a time and effort stand-point), or should I just do it the old-fashioned way?
    Thanks in advance!
    Vladimir
    I am including a sample (very rough-draft) XML file of what the input might look like:
         <applications>
              <application name="Remote Application">
                   <vip>somethingUNIQUE.mycompany.com</vip>
                   <sys-level>LAB</sys-level>
                   <lb-type>GTM</lb-type>
                   <farms>
                        <farm name="Farm 1" id="1">
                             <member-name>sslname.mycompany</member-name>
                             <ip-address>34.34.24.242</ip-address>
                             <application-servers>
                                  <application-server name="Some Name1">
                                       <ip-address>
                                            34.983.238.32
                                       </ip-address>
                                  </application-server>
                                  <application-server name="Some Name 2222">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </application-server>
                                  <application-server name="Some Name 3425">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </application-server>
                             </application-servers>
                             <web-servers>
                                  <web-server name="Some Name1">
                                       <ip-address>
                                            34.983.238.32
                                       </ip-address>
                                  </web-server>
                                  <web-server name="Some Name 2222">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </web-server>
                                  <web-server name="Some Name 3425">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </web-server>
                             </web-servers>
                        </farm>
                        <farm name="Farm 2" id="2">
                             <member-name>sslvpn01.downingtown</member-name>
                             <ip-address>34.34.24.250</ip-address>
                             <application-servers>
                                  <application-server name="Some Name 3425">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </application-server>
                             </application-servers>
                             <web-servers>
                                  <web-server name="Some Name1">
                                       <ip-address>
                                            34.983.238.32
                                       </ip-address>
                                  </web-server>
                                  <web-server name="Some Name 3425">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </web-server>
                             </web-servers>
                        </farm>
                   </farms>
              </application>
              <application name="Tech Tools">
                   <vip>technicalUNIQUE.tools.mycompany.com</vip>
                   <sys-level>LAB</sys-level>
                   <lb-type>GTM</lb-type>
                   <farms>
                        <farm name="Farm 1" id="1">
                             <member-name>tools.tech</member-name>
                             <ip-address>34.34.24.214</ip-address>
                             <application-servers>
                                  <application-server name="Some Name 2222">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </application-server>
                                  <application-server name="Some Name 3425">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </application-server>
                             </application-servers>
                             <web-servers>
                                  <web-server name="Some Name1">
                                       <ip-address>
                                            34.983.238.32
                                       </ip-address>
                                  </web-server>
                                  <web-server name="Some Name 2222">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </web-server>
                             </web-servers>
                        </farm>
                        <farm name="Farm 2" id="2">
                             <member-name>tools.tech222</member-name>
                             <ip-address>34.34.24.415</ip-address>
                             <application-servers>
                                  <application-server name="Some Name1">
                                       <ip-address>
                                            34.983.238.32
                                       </ip-address>
                                  </application-server>
                                  <application-server name="Some Name 2222">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </application-server>
                                  <application-server name="Some Name 3425">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </application-server>
                             </application-servers>
                             <web-servers>
                                  <web-server name="Some Name1">
                                       <ip-address>
                                            34.983.238.32
                                       </ip-address>
                                  </web-server>
                                  <web-server name="Some Name 2222">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </web-server>
                                  <web-server name="Some Name 3425">
                                       <ip-address>
                                            34.343.248.32
                                       </ip-address>
                                  </web-server>
                             </web-servers>
                        </farm>
                   </farms>
              </application>
         </applications>

    Hello jschell!
    Again, the question was more about the overall architecture and design rather than monitoring implementation.
    So here is what I have now:
    1. A spring application that will do the following:
    Read in the "architecture.xml" file (a portion is shown below). This file will dictate not only the type of monitoring but also the layout (explained later).
    The architecture.xml is marshalled to entity objects -- Model (s), with nested Model "children"
    This array of Model(s) is what the server-side application will use to populate the monitoring parameters.
    When the Impl gets a hold of the Model(s), it traverses through all of these entities and does whatever processing it needs to do (Health check, routing check, etc), and produces Item(s) objects, which are similar in structure to the Model(s) entities, but have actual values that need to be displayed on the front-end. Each item might have an array of other, children, Item(s)
    2. A GWT application asks for the Items array, and displays them on the front-end.
    What I did already:
    *1. Created a base Spring project that accepts GWT requests and returns a set of Item(s) (statically-generated, since I don't have the proper Impl yet).*
    *2. Created the GWT project and the layout. GWT communicates with the Spring app (which runs on tomcat for now) and upon retrieving the Item(s) it recursively renders them into displayable items, with different background, borders colors, width, etc (based on the populated values and their nested children, if any) . The last code snippet is the definition of the Item class.*
    Basically, the architecture is setup and the next step is the actual implementation of the monitoring and routing logic -- which wasn't the point of this post, since I already did most of it for a different project :)
    Thanks for the replies though....
    Vladimir
    <serviceView name="YYYYYYYY XXXX">
         <item layout="vertical">
              <!-- The top level application name -->
              <item name="Routing XXXXXXX  (RX)"/>
              <!-- The GSLB name and Active Farms printout -- Work in Progress-->
              <item  name="RX GSLB - xxxxxxx.xx.xxxxxxxx.com" layout="vertical">
                   <dynamicText type="gslb_farms">
                        <param name="vip" value="xxxxxxxx.xx.xxxxxxxxx.com"/>
                   </dynamicText>
              </item>
              <!-- The farms Row -->
              <item layout="horizontal">
                   <!-- The 1st Farm -->
                   <item name="Farm 1" layout="vertical">
                        <operationalState name="xxxxxxx.xx.yyyyyyy.com" type="gslb_farm">
                             <param name="vip" value="activate.g.comcast.com"/>
                             <param name="farmName" value="RX.WT.F1.VIP">
                        </operationalState>
                        <hc name="RX.WT.F1.VIP" type="poller"/>
                        <!-- DataCenter name -->
                        <item name="PDX" value="PDX"/>
                        <!-- Web Tier -->
                        <item layout="horizontal">     
                             <item name="WEB1" description="WEB1" detailedView="someservice_level_xmlname.xml">
                                  <hc name="RE.WT.F1.rdw01" type="poller"/>
                             </item>
                             <item  name="WEB2">
                                  <hc name="RE.WT.F1.rdw02" type="poller"/>
                             </item>
                        </item>
    public class Item implements Serializable{
         private static final long serialVersionUID = 1L;
         public final static String _ROUTING_STATUS_ENABLED = "_ROUTING_STATUS_ENABLED";
         public final static String _ROUTING_STATUS_DISABLED = "_ROUTING_STATUS_DISABLED";
         public final static String _ROUTING_STATUS_UNKNOWN = "_ROUTING_STATUS_UNKNOWN";
         public final static String _HEALTH_STATUS_GOOD = "_HEALTH_STATUS_GOOD";
         public final static String _HEALTH_STATUS_BAD = "_HEALTH_STATUS_BAD";
         public final static String _HEALTH_STATUS_UNKNOWN = "_HEALTH_STATUS_UNKNOWN";
         // This is what will be printed out -- the static text
         private String name = null;
         // If detailedView is not empty, then a link for this item shows up
         // that opens up a Dialogue Box
         private String detailedView = null;
         // If detailedView is not empty, then a link for this item shows up
         // that opens up a completely new Service View
         private String serviceView = null;
         // Layout Information
         private boolean verticalLayout = true; // VERTICAL or HORIZONTAL
         // Coloring Information
         private String routingStatus = _ROUTING_STATUS_UNKNOWN; // ENABLED, DISABLED, UNKNOWN
         private String healthStatus = _HEALTH_STATUS_UNKNOWN; // HEALTHY or NOT-HEALTHY
         // Children
         private Item children[] = null;

  • TableView updates not working when ValueFactory returns a new Binding

    Hi,
    When a cell value factory returns a newly created expression or Binding cell values will stop receiving updates at some point. It seems that the cell that requests the observable value from the value factory does not keep a strong reference to the returned value so the cell will only receive updates from the the Observable value as long as it has not been garbage collected. The code below reproduces this issue:
    import javafx.application.Application;
    import javafx.beans.property.DoubleProperty;
    import javafx.beans.property.ReadOnlyStringWrapper;
    import javafx.beans.property.SimpleDoubleProperty;
    import javafx.beans.value.ObservableValue;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.control.TableColumn;
    import javafx.scene.control.TableColumn.CellDataFeatures;
    import javafx.scene.control.TableView;
    import javafx.scene.layout.HBox;
    import javafx.scene.layout.HBoxBuilder;
    import javafx.scene.layout.StackPane;
    import javafx.scene.layout.VBox;
    import javafx.scene.layout.VBoxBuilder;
    import javafx.stage.Stage;
    import javafx.util.Callback;
    * Reproduce cell update bug. Compile and run the class. Press the update button a
    * couple of times and note how the values in the total column update. Press the
    * GC button a couple of times and then press the update button again. Note how
    * the values in the total column do not update anymore.
    * The Value Factory for the total column does not return a property that is
    * held by the Order object, it returns a Binding that is created on the fly.
    * The cell does not hold a strong reference to this object so it can be gc'd 
    public class CellUpdateTest2 extends Application {
         static class Order {
              String name;
              DoubleProperty price = new SimpleDoubleProperty();
              DoubleProperty qty = new SimpleDoubleProperty();
              Order(String n, double p) {
                   name = n;
                   price.set(p);
                   qty.set(1);
         final Order items[] = {
                   new Order("Item 0", 4.0),
                   new Order("Item 1", 5.0),
                   new Order("Item 2", 6.0),
                   new Order("Item 3", 7.0),
                   new Order("Item 4", 8.0),
                   new Order("Item 5", 9.0),
                   new Order("Item 6", 10.0),
                   new Order("Item 7", 11.0)
         @Override
         public void start(final Stage primaryStage) throws Exception {
              final Button updateButton = new Button("Update Values");
              updateButton.setOnAction(new EventHandler<ActionEvent>() {
                   @Override
                   public void handle(final ActionEvent actionEvent) {
                        for (Order i: items) {
                             i.qty.set(i.qty.get() + 1);
              final Button gcButton = new Button("System.gc()");
              gcButton.setOnAction(new EventHandler<ActionEvent>() {
                   @Override
                   public void handle(final ActionEvent actionEvent) {
                        System.gc();
              final TableView<Order> tv = new TableView<Order>();
              final TableColumn<Order, String> nameCol = new TableColumn<Order, String>("Item");
              final TableColumn<Order, Number> priceCol = new TableColumn<Order, Number>("Price");
              final TableColumn<Order, Number> qtyCol = new TableColumn<Order, Number>("Quantity");
              final TableColumn<Order, Number> totalCol = new TableColumn<Order, Number>("Total");
              nameCol.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Order, String>, ObservableValue<String>>() {
                   @Override
                   public ObservableValue<String> call(final CellDataFeatures<Order, String> d) {
                        return new ReadOnlyStringWrapper(d.getValue().name);
              priceCol.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Order, Number>, ObservableValue<Number>>() {
                   @Override
                   public ObservableValue<Number> call(final CellDataFeatures<Order, Number> cellData) {
                        return cellData.getValue().price;
              qtyCol.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Order, Number>, ObservableValue<Number>>() {
                   @Override
                   public ObservableValue<Number> call(final CellDataFeatures<Order, Number> cellData) {
                        return cellData.getValue().qty;
              totalCol.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Order, Number>, ObservableValue<Number>>() {
                   @Override
                   public ObservableValue<Number> call(final CellDataFeatures<Order, Number> cellData) {
                        return cellData.getValue().price.multiply(cellData.getValue().qty);
              tv.getColumns().addAll(nameCol, priceCol, qtyCol, totalCol);
              tv.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
              tv.getItems().addAll(items);
              final HBox hb = HBoxBuilder.create().children(updateButton, gcButton).build();
              final VBox vb = VBoxBuilder.create().children(tv, hb).build();
              primaryStage.setScene(new Scene(vb));
              primaryStage.setHeight(200.0);
              primaryStage.show();
         public static void main(final String args[]) {
              launch(args);
    } Is this expected behaviour?
    If so - what would the correct way to approach this?
    If not - is there an easy workaround?

    this seems to have worked....
         static class Order {
              String name;
              DoubleProperty price = new SimpleDoubleProperty();
              DoubleProperty qty = new SimpleDoubleProperty();
                    DoubleProperty total = new SimpleDoubleProperty();
              Order(String n, double p) {
                   name = n;
                   price.set(p);
                   qty.set(1);
                    public void updateTotal() {
                        total.set(price.get() * qty.get());
         }with
              qtyCol.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Order, Number>, ObservableValue<Number>>() {
                   @Override
                   public ObservableValue<Number> call(final CellDataFeatures<Order, Number> cellData) {
                                    System.out.println("in qty column");
                                    cellData.getValue().updateTotal();
                        return cellData.getValue().qty;
              });and finally
              totalCol.setCellValueFactory(new Callback<TableColumn.CellDataFeatures<Order, Number>, ObservableValue<Number>>() {
                   @Override
                   public ObservableValue<Number> call(final CellDataFeatures<Order, Number> cellData) {
                                    System.out.println("in total column");
                        return cellData.getValue().total;
              });I cannot explain why what you did did not work. I have a mistrust towards binding and I avoid it when ever possible.
    thanks
    jose

  • Problem with automated height/width after applying effect

    Hey guys,
    I have a panel that automatically resizes after some other contents is being added. All the time there is a scale-effect. Whenever I move the mouse over any of those children they zoom in and there the height & width of the parent container automatically resizes.
    However I have a minimize button for that one along with a resize effect. I can resize the complete container to a minimize size (e.g. 40x40), but when I resize back with the same effect, the panel does not automatically resizes with added children anymore.
    I did not set any special properties on the panel from the beginning, but some property must be different now. It is not "autoLayout" and also the "percentageWidth/Height" does not work properly as that command will cause the panel to stretch over the complete stage. Any suggestions here?

    Mmmh...that does not seem to solve the issue for me. Even when setting the width and height to NaN before the effect is played, it will still lead to a fixed height and width of the parent panel container. When I add new children the parent container is not properly resized, means that the chiildren just go beyond the parent container's border.
    Setting these parameters after the effect is done leads to the following crash: ArgumentError: Error #2004: One of the parameters is invalid.
    at flash.display::Graphics/drawRect()
    at spark.accessibility::PanelAccImpl/eventHandler()[E:\dev\4.0.0\frameworks\projects\spark\s rc\spark\accessibility\PanelAccImpl.as:361]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.core::UIComponent/dispatchEvent()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\co re\UIComponent.as:12266]
    at mx.core::UIComponent/dispatchResizeEvent()[E:\dev\4.0.0\frameworks\projects\framework\src \mx\core\UIComponent.as:9641]
    at mx.core::UIComponent/commitProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx \core\UIComponent.as:7866]
    at spark.components.supportClasses::SkinnableComponent/commitProperties()[E:\dev\4.0.0\frame works\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:414]
    at mx.core::UIComponent/validateProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\ mx\core\UIComponent.as:7772]
    at mx.managers::LayoutManager/validateProperties()[E:\dev\4.0.0\frameworks\projects\framewor k\src\mx\managers\LayoutManager.as:572]
    at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.0.0\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:730]
    at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.0.0\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1072]
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()
    Here is my code...anything wrong here.
    private function recreateWindow(e:MouseEvent)//thrown once the user moves his mouse over the minimized panel
         myResizeEffect.heightFrom = 40;
         myResizeEffect.heightFrom = 40;
         myResizeEffect.heightFrom = lastHeight;
         myResizeEffect.heightFrom = lastWidth;
         myResizeEffect.play();
         myResizeEffect.addEventListener(EffectEvent.EFFECT_END,resetMinimizeValues);
    private function resetMinimizeValues(event:EffectEvent):void
         myResizeEffect.removeEventListener(EffectEvent.EFFECT_END,resetMinimizeValues);
         //adding the old listeners before the panel was minimized
         this.width = NaN;//crash
         this.height = NaN;//crash
    Any suggestions?
    ...and how can I remove the "Question answered"-tag...?

  • 4:3 to 16:9 - the easiest way after it's too late....

    Ok Kids, I think I screwed up and I need help from you all once again!
    I have a project I have already imported and nearly completed when I reazied that it is going to be displayed on a 16:9 plasma. I never thought about the aspect ratio but what will be the best way to get it to 16:9 at this point? I know I could just check anamorphic and render it as such with compressor, but is there anyway to add the 16:9 matte in FCP and manage to output it 16:9 that way (without matte visible) so as not to stretch the image?
    Even if I had to reimport that would be ok I suppose, it's not THAT detailed of a project.
    Any thoughts and input as always are, as always, more than appreciated.
    Thanks!

    if the source is 4:3 and the target is 16:9 then you will need to blow-up the image so that the horizontal axis fills the 16:9 image width ... that means you will have to crop the image either top or bottom or a bit of both.
    simplest is to nest the 4:3 sequence into a 16:9 one and then resize the nest to 133% using the motion tab scale attribute and accept the default centre cut cropping of top and bottom of the image.
    for more control you may want to reframe each shot for best placement

  • How to increase the height of a tabbed layout

    How to increase the height of a tabbed layout? I do have a form inside a panelTabbed layout which is not fitting inside.Is there any css class available ?
    Thanks
    Suneesh

    Hi,
    +"My panel tabbed layout is inside a detailStamp facet of a table"+
    you can set the StretchChildren property on the ShowDetailItem components to make the panel tab to resize the contained children. I set the inline style on a paneltab and the result shows in the rendered output
    Frank

  • Layout with Effects Problem

    Hi
    I have working on a flex application that involves extensive adding/removal of display objects in containers like VBox, HBox.
    Each children has showEffect, removedEffect, and moveEffect,
    when application add and removes some children, layout gets messed up.
    please take a look at the attached image
    1- is normal view
    2- is the HBox layout after adding and deleting some children
    Is there any validateLayout or something to solve that problem?
    Thanks

    You may need to boil this down to simplified yet complete code exhibiting the issue.
    I can't see how an HBox could be displaying items as in the second screen shot.

Maybe you are looking for

  • Signing a jar file

    Guys, I've googled the crap out of this one. I need some help signing a jar file. Here is what I'm doing: 1. Generating a key: keytool -genkey -keystore myKeyStore -alias myName2. Trying to sign the jar file: jarsigner -keystore myKeyStore -storepass

  • Creating radio buttons and text box in the screen

    Hi Guys, Need help asap. I am writing a report and I have to create text box for user to input GL account numbers for two types of customer. I have to make these fields required and take the data back from the screen and write it in a file. The secon

  • Exporting Content from Weblogic Portal 8.1.sp2

    I have many developers needing to hare content and content types amongs eachother and also eventually migrate the content and content types to a UAT environment. Any Idea how to export the content and content types. Thanks

  • Drag layers from layers panel to document tab

    On this page http://www.photoshopuser.com/cs5/cs5-features I have read that Adobe finally have implemented "Drag a layer from Layers panel to another open document tab". Is this true, cause I can't make it work? I can do that in floated windows inter

  • Generic Data Source with Function Module data mismatch in BI

    Hi All, I'm using Generic Data Source with Function Module, When I execute the Function Module (Which I have Created), I'm getting 16000 records and when run extractor(in RSA3) im getting different no.of records(infact they are more no.). when I run