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);
}

Similar Messages

  • HOW DO I SEND AN EMAIL ON MY IPHONE OR IPAD AND MAKE IT APPEAR ON THE MAIL APPLICATION ON MY MAC?   IT ONLY WORK THE OTHER WAY ---SENDING AN EMAIL ON MY COMPUTER ---APPEARS IN SENT ITEMS ON MY IPHONE AND IPAD.

    HOW DO I SEND AN EMAIL ON MY IPHONE OR IPAD AND MAKE IT APPEAR ON THE MAIL APPLICATION ON MY MAC?   IT ONLY WORK THE OTHER WAY ---SENDING AN EMAIL ON MY COMPUTER ---APPEARS IN SENT ITEMS ON MY IPHONE AND IPAD.

    IT IS FOR GMAIL.

  • Transport CRs and make them appear as CRs in dest. system

    Dear all,
    I have a question about Change Request (CR).
    Suppose that I have system DE1, system DE2, and system PRD.
    Developers/customizers make changes in system DE1. CRs are then created in DE1.
    Next, because system DE1 is temporary (will be deleted later), developers/customizers request me to transport CRs in DE1 to DE2.
    My question is after transporting CRs in DE1 to DE2, is it possible that CRs in system DE1 will appear as CRs in system DE2 so that after DE1 is deleted, developers/customizers can go on making change these CRs in DE2 and then these CRs will be transported from DE2 to PRD? I know that normally, when transporting CRs in DE1 to DE2, changes are applied to DE2 but not appear as CRs in DE2.
    Thanks,
    Toan Do

    Yes, assume in DE1 we have CR "DE1K00002" which has made change to object A, B, C. After transporting this CR to DE2 & delete DE1, in DE2 a customizer makes change to object A (so makes CR "DEV2K00002"), not make change to object B & C. When transporting CR "DEV2K00002" from DE2 to PRD, in PRD we miss changes in object B & C.
    So by this way, the solution is to backup CR files in DE1, later we import these CR files to DE2, PRD and then import CRs in DE2 to PRD?
    Hi,
    I guess you made some typo in the above reply. If I've interpreted correctly..
    DE1 > DE1K900002 (changes to A, B, C) .. it goes to DE2 with the same transport number. So DE1K900002 exists in DE2.
    Now you're saying some developer changes the object A in another transport which will be something like DE2K9xxxxx. If you transport this to PRD, the obviously the contents of DE1K9xxxxx will be moved to PRD. not B, C which are there in DE1K900002.
    If you move DE1K900002 to PRD as well, then all A,B,C will be in PRD. if you want to move it to PRD later then you've to keep the datafile and cofile of the transport.
    Regards,
    Debasis.

  • How do I insert a node and make the node below the inserted one it's child

    Example: '+' indicates a parent and '�' indicates a chialed
    root
    + a   
    + b
        - 1
        - 2
    after insert:
    root
    + a
    + B    <----- new insert
      + b
         - 1
         - 2

    treeModel.insertNodeInto(node, (MutableTreeNode) parent, parent.getIndex(nodeToInsertAt));thanks,
    Anil

  • Resize 4000 images and make sure they have 3 sizes of canvas

    Hi,
    I require 4000 images in 3 different sizes.
    All of the images are different sizes but they need to be resized to be a specific size.
    I know that you can set a maximum width and height, but what i want is when they are resized, to be put onto a canvas that is my specific dimension.
    Anyone know how i can do this?
    Thanks!

    You can certainly use ACDSee Pro to do this job.  4000 images is a lot to process for any computer so it will take some time but ACDSee is up to the task.  You can constrain proportions or set them to be specific pixel dimensions.
    I do not know how to use the batch functions in Fireworks since I seldom use that program.  You can check to see if Adobe Bridge can do it but it might want to open Photoshop to do the batch processing which can take some time to do.

  • How can I read an audiobook and make it appear on iTunes?

    ?

    Record yourself reading a book, then put it into itunes
    Adding music and other content to iTunes - Apple Support

  • How to make tornado appear at a distance in a video.

    I made an energy torndo effect with CC particle world, its on a black solid with the blend mode on screen (two weeks in learning this stuff haha). How can I add it to the video and make it appear as if its right in front of me on the far distance?

    I might also consider using a different method to create the tornado.  If you're looking for realism I'm not sure CC Particle World will do it for you.  Personally I would create this effect practically by building a tornado box, like the ones kids make for elementary school science fares.  Then I would light your tornado in a black room, and film it.  Then take it into After Effects, mask it out, flip it vertically, set the blend mode to screen and composite it using the same suggestions Rick has offered.  There are plenty of links that will show you how to create a tornado box using dry ice.  Here's the first one I found:
    Also this is a very useful tutorial for doing horizon replacement using Mocha AE:

  • Expanded node and children are seen only after second expansion

    Hi,
    I am using a simple JTree control. I am populating children of nodes dynamically when the node is expanded. For this, I first add a "dummy" item for each node under the root, so that the "+" sign appears next to the node. When a node is expanded, I delete the "dummy" node and add children to it. However, the first time I expand the node, the node actually doesn't expand, though treeExpanded() gets called and all children are added correctly (I verified by debugging). When I expand the tree the second time, I can see the expanded node.
    I am using TreeModel's removeNodeFromParent(childNode) and insertNodeInto(childNode, parentNode, childIndex) method to remove and add children respectively.I believe we don't have to explicitly call TreeModel's nodeChanged(), nodesWereInserted() etc?
    Could you please let me know if I am missing something fundamental here?
    Thanks in advance,
    Praneeth

    Hi db,
    I didn't realize that there was a response to my earlier thread. I added the thread to my watchlist. I was under the impression that I would be notified via email in case of a reply to the thread. However, I didn't receive any. Anyway, I did reply to that response there now.

  • Add a root node and namespace declaration

    According to the requirement,I have a large appended .txt file.
    This .txt file is created by appending various xml files (without the namespace and root node).
    I need to add a root node and namespace declaration to the large appended .txt file so that it can be read as .xml.
    Please provide the pointers for the same.
    Thanks & Regards,
    Rashi

    My appended file looks like following.
    <input>
       <Store>
          <StoreHeader>
             <StoreNbr>56</StoreNbr>
             <StoreType>Retail</StoreType>
             <StoreSite>2004</StoreSite>
          </StoreHeader>
          <Transactions>
             <Transaction>
                <Item>A</Item>
                <ItemPrice>4</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>C</Item>
                <ItemPrice>56</ItemPrice>
             </Transaction>
          </Transactions>
       </Store>
    </input>
    <input>
       <Store>
          <StoreHeader>
             <StoreNbr>123</StoreNbr>
             <StoreType>Retail</StoreType>
             <StoreSite>2004</StoreSite>
          </StoreHeader>
          <Transactions>
             <Transaction>
                <Item>A</Item>
                <ItemPrice>4</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>B</Item>
                <ItemPrice>8</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>C</Item>
                <ItemPrice>56</ItemPrice>
             </Transaction>
          </Transactions>
       </Store>
    </input>
    Now according to the requirement, I need to add namespace and root node and make it like follows:
    <ns0:output xmlns:ns0="http://xxx">
       <input>
       <Store>
          <StoreHeader>
             <StoreNbr>56</StoreNbr>
             <StoreType>Retail</StoreType>
             <StoreSite>2004</StoreSite>
          </StoreHeader>
          <Transactions>
             <Transaction>
                <Item>A</Item>
                <ItemPrice>4</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>C</Item>
                <ItemPrice>56</ItemPrice>
             </Transaction>
          </Transactions>
       </Store>
    </input>
    <input>
       <Store>
          <StoreHeader>
             <StoreNbr>123</StoreNbr>
             <StoreType>Retail</StoreType>
             <StoreSite>2004</StoreSite>
          </StoreHeader>
          <Transactions>
             <Transaction>
                <Item>A</Item>
                <ItemPrice>4</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>B</Item>
                <ItemPrice>8</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>C</Item>
                <ItemPrice>56</ItemPrice>
             </Transaction>
          </Transactions>
       </Store>
    </input>
    </ns0:output>

  • My muse website, when uploaded, jumbles quotation marks, bullet points and apostrophes to appear as • and â€? Why?

    My muse website jumbles quotation marks, bullet points and apostrophes to appear as ’.
    Its fine when I preview in browser, only once it's been uploaded do the marks become jumbled. Why?

    Thanks Zak..The server host said that the jumbled marks are appearing as binary code while the rest of the text is appearing as "text".
    They believe that the problem may be occurring at the FTP. The server host is configured to host binary and unicode.
    They advised me to upload a zipped folder containing the site and they will try and open it at their end. Also, not sure if this is unique
    to Adobe font kits. Its from Adobe Font kit.

  • How can I click on a button and make a text box appear or disappear

    How can I click on a button and make a text box appear or disappear?
    Thanks ahead of time for your help,
    Doug

    Hi Denes,
    I just thought that the example you pointed the OP to, is far more complex than what I understood he needs. The OP was talking about using a button, which I thought was a very basic and simple case. Your example is much more complicated. If memory serves, the radio group item, at the time (prior to 3.1 fieldset) behaved differently, so you needed to create a new value retrieving function, and then was the need to preserve the items show/hide status upon reloading the page. In short, I thought maybe I didn’t see the complexity in the OP post, but it seems that his requirement was indeed a simple one.
    Regards,
    Arie.

  • Make a Panel disappear and appear again

    Hi Team
    I have a frame with Grid Layout where I have 3 Panels - P1, P2 and P3. I want that on the click on a button "+" P2 should disappear and P1 and P2 should align together. Again when the user click "-" button, P2 panel should appear again in its place between P1 and P3.
    The problem with the visible(false) method is that it makes P2 Panel disappear but the space between P1 and P3 panels is still there.
    Could anybody help me with this trivial issue
    Thanks,
    Mo

    user13019661 wrote:
    Hi Team
    I have a frame with Grid Layout where I have 3 Panels - P1, P2 and P3. I want that on the click on a button "+" P2 should disappear and P1 and P2 should align together. Again when the user click "-" button, P2 panel should appear again in its place between P1 and P3.
    The problem with the visible(false) method is that it makes P2 Panel disappear but the space between P1 and P3 panels is still there.
    Could anybody help me with this trivial issue
    Thanks,
    MoIn stead of making the panel invisible, remove it from the frame and trigger the frame to layout again (for example by calling pack() or revalidate()).

  • Launchpad has disappeared from the Dock. Launchpad is present in Applications but refuses to activate. How to activate and make available in Dock? iMac 21.5 mid 2010. os X v10.7.2.

    Launchpad had disappeared from Dock. Launchpad is present in Applications but refuses to activate. How to activate and make available in Dock?
    iMac 21.5 mid 2010. os x v10.7.2.

    You should be able to put Launchpad back in the Dock by dragging it from the Applications folder to the left section of the Dock.  As to why it won't launch, run the Console utility, try to run Launchpad, and see if any messages appear in the Console window.

  • I found the operating system very confusing and hard to use. No tutorial. Manual and online help were outdated.  Tool bars, programs and documents randomly appeared and disappeared. Programs I installed completely disappeared. Anyone else experience this?

    I found the operating system very confusing and hard to use. No tutorial. Manual and online help were outdated.  Tool bars, programs and documents randomly appeared and disappeared. Programs I installed completely disappeared. Anyone else experience this?

    No need to apologize, Jim.  I think your rant was justified.  For years people have been telling me how easy the Mac was to use.  Imagine my frustration when I finally learned from friends and users that it takes weeks or months to make the transition from Windows to Mac.
    Still, I agree that I acted to too hastily when I returned my mini-mac to the store only three days after I bought it.
    I'm going to try again, this time with an iMac.  This time I'll keep it.  Since this thread is for the mini-Mac only, I'll probably be starting a new one for the iMac.
    Why did I decide to try again?  Well, I do like the faster speed and compact hardware of the Macs.  I also like the fact that I can install Windows and use that for my programs until I transition completely to Mac, IF I make the complete transition.
    Thank you all for your suggestions and advice.  I have paid attention to what you said.
    Andy

  • I have a problem with Safari in IOS 8 on my iPad 3. The bookmarks take up a third of the screen and I can't seem to make the bookmarks disappear until I need them. The useful part of the screen is therefore very small. Any suggestions gratefully appr

    I have a problem with Safari in IOS 8 on my iPad 3. The bookmarks take up a third of the screen and I can't seem to make the bookmarks disappear until I need them. The useful part of the screen is therefore very small. Any suggestions gratefully appreciated.

    OK, it now sort of works. A couple of problems here:
    After updating IOS, Safari iCloud was "automatically" switched off
    Switching it on had no effect
    resetting my iPad automatically switched off safari iCloud again
    after switching it back on, it said "turning off safari data"
    switched it off and on again, now it said : "turning on safari data" and the sync worked
    On IOS 7 no problems
    The bookmarks not being displayed was because after pressing the book icon, it defaulted to showing the history and I had to press "Back" to get to the other options

Maybe you are looking for