Save Parent window

Hi,
          I had question regarding parent and child window. If i create many child windows in a single parent window, is it possible to save the parent windows and load the same again? I don't need the values of particular control or a indicator in a child window, which is done using config file. So, how to do it? any examples please do post.

Well, first the proper way to do child windows in a main windo is really to use sub panels. They are the LabVIEW native way of embedding VI front panels in other VI front panels and work across all LabVIEW platforms the same. Using Windows API calls, if you do that, is cumbersome, likely to cause all kinds of troubles if you do not know EXACTLY what you are doing and a maintenance nightmare as you will keep running into strange effects with new Windows versions sooner or later.
That said, whatever you do, LabVIEW subpanels or Windows parent-child windows, they are setup at runtime and you as the programmer are the sole responsible person to load them at the right time in the right plkace and with the right content. If you want to have an ability to rebuild a particular constallation of UI, you will have to program a way to save the current constellation into some config file and on reopening that constellation rebuilding that from the config file.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions

Similar Messages

  • CSV file replacing the parent window

    Joined: Dec 16, 2011
    Posts: 5
    posted    Friday, December 16, 2011 3:35:15 PM
    0
    Hi,
    I'm trying to download a .csv file from my web application using Content-Disposition
    here is my code
    response.setContentType("application/octet-stream");
    filename = filename.concat(downloadType);
    response.setHeader("Content-Disposition","attachment; filename="+filename+";");
    //response.setHeader("Content-Disposition","application/octet-stream; filename="+filename+";");
    String source = (String)ivHttpRequest.getAttribute("downloadFile");
    if(downloadType.equals(".txt")) {
    source = Utils.decodeHtmlEntities(source);
    byte [] byteArray;
    if(source == null)
    // use ivRequest instead
    String source2 = (String)ivRequest.getAttribute("downloadFile");
    if(downloadType.equals(".txt")){
    source2 = Utils.decodeHtmlEntities(source2);
    byteArray = source2.getBytes();
    else
    byteArray = source.getBytes();
    ServletOutputStream out = response.getOutputStream();
    out.write(byteArray);
    out.close();
    I'm able to download the file in all the browsers, But while using IPAD the content of the file replaces the existing window (Parent Window) without asking for Save or Open option.
    Please let me know is there any special content type or anythinmg else i have to change.. So that i could be able to open the csv file in a new tab without replacing the parent window.The problem i faced only with IPAD

    You are probably better off asking in the developer forums : https://devforums.apple.com/index.jspa

  • CSV file downloading replaces the parent window

    Hi,
    I'm trying to download a .csv file from my web application using Content-Disposition
    here is my code
    response.setContentType("application/octet-stream");
    filename = filename.concat(downloadType);
    response.setHeader("Content-Disposition","attachment; filename="+filename+";");
    //response.setHeader("Content-Disposition","application/octet-stream; filename="+filename+";");
    String source = (String)ivHttpRequest.getAttribute("downloadFile");
    if(downloadType.equals(".txt")) {
    source = Utils.decodeHtmlEntities(source);
    byte [] byteArray;
    if(source == null)
    // use ivRequest instead
    String source2 = (String)ivRequest.getAttribute("downloadFile");
    if(downloadType.equals(".txt")){
    source2 = Utils.decodeHtmlEntities(source2);
    byteArray = source2.getBytes();
    else
    byteArray = source.getBytes();
    ServletOutputStream out = response.getOutputStream();
    out.write(byteArray);
    out.close();
    I'm able to download the file in all the browsers, But while using IPAD the content of the file replaces the existing window (Parent Window) without asking for Save or Open option. So i'm unable to get the parent window again.
    Please let me know is there any special content type or anythinmg else i have to change.. So that i could be able to open the csv file in a new tab without replacing the parent window.The problem i faced only with IPAD

    Hi,
    For pdf file if we choose adhoc or by giving the proper name, we can able to get the options like OPEN or SAVE. This will work fine for pdf.
    But here im trying with csv file /html file, so the file is replacing the existing screen itself when i click the csv link. In my web application, i cannot get the parent window by using back button once i get the csv file instead page gets expired.
    So my best suggestion is should we able to open the csv file in new Tab of safari instead of replacing the parent window where im clicking to open the csv file.
    Suggestions pls.

  • Close popup window and refresh the parent window

    Hello,
    I have a button in a normal report, when clicked opens up an popup window which is a form containing some items and here in this form (i have some editable text items) I make some changes and click on the apply changes button -- this should update the form, close the popup window and should refresh the parent window.
    can anyone please help me out with this issue.
    Thanks,
    Orton

    you have your popup window. When they apply the changes you want it to close the window, right?
    Modify the button (save, apply changes) and give it url redirect to the custom function you create (See below): javascript:saveChanges();
    in the page header, add a new function:
    <script type="text/javascript">
    function saveChanges(){
         doSubmit('SAVE');//this is the line to save the current form on the popup window. (This assumes SAVE is the request value that should udpate the db)
         window.close();//close the popup window
         window.opener.doSubmit('REFRESH');//call doSubmit function on the parent window to cause the page to refresh.
    </script>

  • Parent window not specified for canvas.View

    I am getting the following error in custom form which has developed based on a vennila form QPXPRLST.FMB.
    "Parent window not specified for canvas.View"
    for the following canvases
    1.FOLDER_SORT_DATA
    2.FOLDER_TOOLS
    3.SAVE
    and some more
    According Metalink, Apply a path : 1815485
    But would it support Custom form ??
    Pl give me solution if any body knows

    My Dear Friend,
    For all the canvases, you will have to define the Window property. Since you didn't define the window property for your Login_canvas, you r getting the problem. You must launch the properties window for the canvas and set the window property for the canvas, then you will not get the problem again.
    Regards,
    Senthil .A. Perumal.

  • Image displayed by child window captured by parent window.

    This is a rather peculiar problem.
    My application starts with a JFrame which takes some file as an input and then open another window and plot the graph.What happens is whatever is drawn on the child window(graph) is captured by the parent window which looks quite odd.Could anyone help me out the how to solve this problem??

    sure... here are the codes......
    //parent window:
    package igib.genebrowser;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import igib.genebrowser.menu.*;
    import igib.genebrowser.plot.*;
    public class GeneBrowserMain extends JFrame
         public GeneBrowserMain()
              super("GenomeBrowser-1.0");
              Container cp = this.getContentPane();
              cp.setLayout(new BorderLayout());
              DrawFeature df = new DrawFeature();
              cp.add(df, BorderLayout.CENTER);
         public static void main(String args[])
              Point p = new Point(400,300);
              GeneBrowserMain gbm = new GeneBrowserMain();
              GeneBrowserMenu menu = new GeneBrowserMenu();
              gbm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              gbm.setSize(300,200);
              gbm.setLocation(p);
              gbm.setJMenuBar(menu);
              gbm.setResizable(false);
              gbm.setVisible(true);
    //GeneBrowserMenu file
    package igib.genebrowser.menu;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import igib.genebrowser.plot.*;
    import igib.genebrowser.menu.*;
    import igib.genebrowser.*;
    public class GeneBrowserMenu extends JMenuBar implements ActionListener
         JMenu fileMenu;
         JMenuItem open;
         JMenuItem quit;
         GeneBrowserMain gbm;
         public GeneBrowserMenu()
              this.gbm = gbm;
              fileMenu = new JMenu("File");
              this.add(fileMenu);
         open = new JMenuItem("open");
              fileMenu.add(open);
              quit = new JMenuItem("quit");
              fileMenu.add(quit);
              open.addActionListener(this);
              quit.addActionListener(this);
         public void actionPerformed(ActionEvent e)
              if(e.getSource() == open)
                   try
                             Point p = new Point(300,200);
                             FileOpenWindow f = new FileOpenWindow();
                             f.setSize(450,250);
                             f.setLocation(p);
                             f.setVisible(true);
                   catch(Exception ex)
              if(e.getSource() == quit)
                   System.exit(1);
    //FileOpenWindow which takes file as input and opens GBMainFrame and plot graphs
    package igib.genebrowser.menu;
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.colorchooser.*;
    import javax.swing.tree.*;
    import javax.swing.event.*;
    import javax.swing.filechooser.*;
    import java.io.FileWriter;
    import java.io.BufferedReader.*;
    import java.io.File;
    import igib.genebrowser.util.*;
    import igib.genebrowser.plot.*;
    import igib.genebrowser.*;
    //import java.io.*;
    public class FileOpenWindow extends JFrame implements ActionListener, ItemListener
         public JTabbedPane tPane ;
         public File seqFile, repeatFile, snpFile, geneFile;
         JLabel sequenceFile, repeatfile, snpfile, genefile, jb, winsize, shiftsize;
         JButton browse1, browse2, ok1, ok2, browse3, browse4, browse5, browse6;
         JTextField jtf1, jtf2, jtf3, jtf4, jtf5, jtf6;
         File f;
         PlotGraph pg;
         GBMainFrame gb;
         GeneBrowserMain gbm;
         JComboBox shiftSize, winSize;
         public FileOpenWindow()
              super("Open File");
              ImageIcon icon = new ImageIcon("images/middle.gif");
              Container cp = this.getContentPane();
              tPane = new JTabbedPane();
              JPanel jp1 = addNCBI();
              JPanel jp2 = addOther();
              tPane.addTab("NCBI", icon, jp1);
    tPane.setSelectedIndex(0);
              tPane.addTab("Other", icon, jp2);
    tPane.setSelectedIndex(0);
              //tPane.add(jp1);
              cp.add(tPane,BorderLayout.CENTER);
              this.setResizable(false);
         private JPanel addNCBI()
              JPanel cp = new JPanel();
              cp.setLayout(new GridLayout(8,5));
    //***********************1st row*************************************************//
              for(int i = 0; i < 5; i++)
                   jb = new JLabel(" ");
                   cp.add(jb);
    //***********************1st row*************************************************//
    //***********************2nd row*************************************************//
              for(int i = 0; i < 5; i++)
                   jb = new JLabel(" ");
                   cp.add(jb);
    //***********************2nd row*************************************************//
    //***********************3rd row*************************************************//
              jb = new JLabel(" Sequence");
              cp.add(jb);
              sequenceFile = new JLabel(" File :");
              cp.add(sequenceFile);
              browse1 = new JButton("browse");
              cp.add(browse1);
              jtf1 = new JTextField(" ");
              cp.add(jtf1);
              jb = new JLabel(" ");
              cp.add(jb);
    //***********************3rd row*************************************************//
    //***********************4th row*************************************************//
                   jb = new JLabel(" Repeat");
                   cp.add(jb);
                   repeatfile = new JLabel(" File :");
                   cp.add(repeatfile);
                   browse2 = new JButton("browse");
                   cp.add(browse2);
                   jtf2 = new JTextField(" ");
                   cp.add(jtf2);
                   jb = new JLabel(" ");
                   cp.add(jb);
    //***********************4th row*************************************************//
    //***********************5th row*************************************************//
              for(int i = 0; i < 5; i++)
                   jb = new JLabel(" ");
                   cp.add(jb);
    //***********************5th row*************************************************//
    //***********************1st row*************************************************//
                   winsize = new JLabel("Window Size: ");
                   cp.add(winsize);
                   winSize = new JComboBox();
                   winSize.addItem("100");
                   winSize.addItem("500");
                   winSize.addItem("1000");
                   winSize.addItem("5000");
                   cp.add(winSize);
                   jb = new JLabel(" ");
                   cp.add(jb);
                   shiftsize = new JLabel("Shift Size: ");
                   cp.add(shiftsize);
                   shiftSize = new JComboBox();
                   shiftSize.addItem("25");
                   shiftSize.addItem("50");
                   shiftSize.addItem("100");
                   shiftSize.addItem("500");
                   cp.add(shiftSize);
    //***********************1st row*************************************************//
    //***********************5th row*************************************************//
              for(int i = 0; i < 5; i++)
                   jb = new JLabel(" ");
                   cp.add(jb);
    //***********************5th row*************************************************//
    //***********************6th row*************************************************//
                   for(int i = 0; i < 2; i++)
                        jb = new JLabel(" ");
                        cp.add(jb);
                   ok1 = new JButton("OK");
                   cp.add(ok1);
                   for(int i = 0; i < 2; i++)
                        jb = new JLabel(" ");
                        cp.add(jb);
    //***********************6th row*************************************************//
                   browse1.addActionListener(this);
                   browse2.addActionListener(this);
                   ok1.addActionListener(this);
                   shiftSize.addItemListener(this);
                   winSize.addItemListener(this);
                   return cp;
         private JPanel addOther()
              JPanel cp = new JPanel();
              cp.setLayout(new GridLayout(9,5));
    //***********************1st row*************************************************//
              for(int i = 0; i < 5; i++)
                   jb = new JLabel(" ");
                   cp.add(jb);
    //***********************1st row*************************************************//
    //***********************2nd row*************************************************//
              jb = new JLabel(" ");
              cp.add(jb);
              sequenceFile = new JLabel("sequenceFile :");
              cp.add(sequenceFile);
              browse3 = new JButton("browse");
              cp.add(browse3);
              jtf3 = new JTextField(" ");
              cp.add(jtf3);
              jb = new JLabel(" ");
              cp.add(jb);
    //***********************2nd row*************************************************//
    //***********************3rd row*************************************************//
                   jb = new JLabel(" ");
                   cp.add(jb);
                   repeatfile = new JLabel("RepeatFile :");
                   cp.add(repeatfile);
                   browse4 = new JButton("browse");
                   cp.add(browse4);
                   jtf4 = new JTextField(" ");
                   cp.add(jtf4);
                   jb = new JLabel(" ");
                   cp.add(jb);
    //***********************3rd row*************************************************//
    //***********************4th row*************************************************//
              jb = new JLabel(" ");
              cp.add(jb);
              snpfile = new JLabel("SNP File :");
              cp.add(snpfile);
              browse5 = new JButton("browse");
              cp.add(browse5);
              jtf5 = new JTextField(" ");
              cp.add(jtf5);
              jb = new JLabel(" ");
              cp.add(jb);
    //***********************4th row*************************************************//
    //***********************5th row*************************************************//
              jb = new JLabel(" ");
              cp.add(jb);
              genefile = new JLabel("Gene File :");
              cp.add(genefile);
              browse6 = new JButton("browse");
              cp.add(browse6);
              jtf6 = new JTextField(" ");
              cp.add(jtf6);
              jb = new JLabel(" ");
              cp.add(jb);
    //***********************5th row*************************************************//
    //***********************6th row*************************************************//
              for(int i = 0; i < 5; i++)
                   jb = new JLabel(" ");
                   cp.add(jb);
    //***********************6th row*************************************************//
    //***********************1st row*************************************************//
                   winsize = new JLabel("Window Size: ");
                   cp.add(winsize);
                   winSize = new JComboBox();
                   winSize.addItem("100");
                   winSize.addItem("500");
                   winSize.addItem("1000");
                   winSize.addItem("5000");
                   cp.add(winSize);
                   jb = new JLabel(" ");
                   cp.add(jb);
                   shiftsize = new JLabel("Shift Size: ");
                   cp.add(shiftsize);
                   shiftSize = new JComboBox();
                   shiftSize.addItem("25");
                   shiftSize.addItem("50");
                   shiftSize.addItem("100");
                   shiftSize.addItem("500");
                   cp.add(shiftSize);
    //***********************1st row*************************************************//
    //***********************6th row*************************************************//
              for(int i = 0; i < 5; i++)
                   jb = new JLabel(" ");
                   cp.add(jb);
    //***********************6th row*************************************************//
    //***********************7th row*************************************************//
                   for(int i = 0; i < 2; i++)
                        jb = new JLabel(" ");
                        cp.add(jb);
                   ok2 = new JButton("OK");
                   cp.add(ok2);
                   for(int i = 0; i < 2; i++)
                        jb = new JLabel(" ");
                        cp.add(jb);
    //***********************7th row*************************************************//
              browse3.addActionListener(this);
              browse4.addActionListener(this);
              browse5.addActionListener(this);
              browse6.addActionListener(this);
              ok2.addActionListener(this);
              return cp;
         public void actionPerformed(ActionEvent e)
              if(e.getSource()==ok1)
                   String ncbi = "";
                   String repeat= "";
                   try
                        ncbi = jtf1.getText();
                        repeat = jtf2.getText();
                        System.out.println("NCBI" + ncbi + "www");
                        if( ncbi.equals(" ") && repeat.equals(" "))
                             System.out.println("NCBI333" + ncbi);
                             DisplayInfo di = new DisplayInfo("Sorry!, Please select some file", "");
                             di.setSize(450,100);
                             di.setLocation(600,600);
                             di.setVisible(true);
                             GBFileProp.snpFile = "";
                             GBFileProp.geneFile = "";
                             return;
                   catch(Exception ex)
                   GBFileProp.fileFormat="NCBI";
                   GBFileProp.fileName = ncbi;
                   GBFileProp.repeatFile = repeat;
                   ReadNCBI readFile1 = new ReadNCBI(ncbi);
                   ReadRepeatFile rrf = new ReadRepeatFile(repeat);
                   try
                        gb = new GBMainFrame();
                        gb.setSize(1200,750);
                   catch(Exception ex)
                        DisplayInfo di = new DisplayInfo("Sorry!, Wrong File", "Enter file in \".gbk\" format");
                        di.setSize(450,100);
                        di.setLocation(600,600);
                        di.setVisible(true);
                   setVisible(false);
                   setDefaultCloseOperation(DISPOSE_ON_CLOSE);
              if(e.getSource()==ok2)
                   String sequence= "";
                   String repeat= "";
                   String snp= "";
                   String gene= "";
                   try
                        sequence = jtf3.getText();
                        repeat = jtf4.getText();
                        snp = jtf5.getText();
                        gene = jtf6.getText();
                        if( sequence.equals(" ") && repeat.equals(" ") && snp.equals(" ") && gene.equals(" "))
                                                      DisplayInfo di = new DisplayInfo("Sorry!, Please select some file", "");
                             di.setSize(450,100);
                             di.setLocation(600,600);
                             di.setVisible(true);
                             System.out.println("File " + GBFileProp.repeatFile);
                             return;
                   catch(Exception ex)
                   GBFileProp.fileFormat="Other";
                   GBFileProp.fileName = sequence;
                   GBFileProp.repeatFile = repeat;
                   GBFileProp.snpFile = snp;
                   GBFileProp.geneFile = gene;
                   ReadGeneFile a = new ReadGeneFile(gene);
                   ReadSNPFile rsp = new ReadSNPFile(snp);
                   GCReadFile grf = new GCReadFile(sequence);
                   ReadRepeatFile rrf = new ReadRepeatFile(repeat);
                   try
                        gb = new GBMainFrame();
                        gb.setSize(1200,800);
                   catch(Exception ex)
                        DisplayInfo di = new DisplayInfo("Sorry!, Wrong File", "Enter file in corresponding format");
                        di.setSize(450,100);
                        di.setLocation(600,600);
                        di.setVisible(true);
                   setVisible(false);
                   setDefaultCloseOperation(DISPOSE_ON_CLOSE);
              if(e.getSource()==browse1)
                   String w;
                   Fselect(1);
                   try
                   w=f.toString();
                   jtf1.setText(w);
                   catch(Exception ex)
              if(e.getSource()==browse2)
                   String w;
                   Fselect(4);
                   try
                   w=f.toString();
                   jtf2.setText(w);
                   catch(Exception ex)
              if(e.getSource()==browse3)
                   String w;
                   Fselect(3);
                   try
                   w=f.toString();
                   jtf3.setText(w);
                   catch(Exception ex)
              if(e.getSource()==browse4)
                   String w;
                   Fselect(2);
                   try
                   w=f.toString();
                   jtf4.setText(w);
                   catch(Exception ex)
              if(e.getSource()==browse5)
                   String w;
                   Fselect(4);
                   try
                   w=f.toString();
                   jtf5.setText(w);
                   catch(Exception ex)
              if(e.getSource()==browse6)
                   String w;
                   Fselect(2);
                   try
                   w=f.toString();
                   jtf6.setText(w);
                   catch(Exception ex)
              if(e.getActionCommand().equals("sequence_ncbi"))
                   final JFileChooser chooser = new JFileChooser();
                   FileFilter type1 = new ExtensionFilter ("Fasta File(.faa)", new String[] {".faa",".txt"});
                   chooser.addChoosableFileFilter (type1);
                   chooser.setFileFilter (type1);
                   int returnVal = chooser.showOpenDialog(this);
                   if (returnVal == JFileChooser.APPROVE_OPTION)
                        seqFile = chooser.getSelectedFile();
              else if(e.getActionCommand().equals("sequence_other"))
                   final JFileChooser chooser = new JFileChooser();
                   FileFilter type1 = new ExtensionFilter ("Fasta File(.faa)", new String[] {".faa",".txt"});
                   chooser.addChoosableFileFilter (type1);
                   chooser.setFileFilter (type1);
                   int returnVal = chooser.showOpenDialog(this);
                   if (returnVal == JFileChooser.APPROVE_OPTION)
                        seqFile = chooser.getSelectedFile();
         public void itemStateChanged (ItemEvent e)
              GBFileProp.windowsize = (int)Integer.parseInt(winSize.getSelectedItem().toString());
              GBFileProp.shiftsize = (int)Integer.parseInt(shiftSize.getSelectedItem().toString());
         public void Fselect(int sel)
                   final JFileChooser chooser = new JFileChooser();
         ImageIcon openIcon = new ImageIcon("images/open.gif");
                   FileFilter type1 = new ExtensionFilter ("NCBI File(.gbk)", new String[] {".gbk",".txt"});
                   FileFilter type2 = new ExtensionFilter ("ptt File(.ptt)", new String[] {".ptt",".txt"});
                   FileFilter type3 = new ExtensionFilter ("Fasta File(.faa)", new String[] {".faa",".txt"});
                   FileFilter type4 = new ExtensionFilter ("Text File(.txt)", new String[] {".txt",".txt"});
                   chooser.setCurrentDirectory (new File (System.getProperty ("user.dir")));
                   if(sel == 1)
                        chooser.addChoosableFileFilter (type1);
              chooser.setFileFilter (type1);
                   if(sel == 2)
                        chooser.addChoosableFileFilter (type2);
              chooser.setFileFilter (type2);
                   if(sel == 3)
                        chooser.addChoosableFileFilter (type3);
              chooser.setFileFilter (type3);
                   if(sel == 4)
                        chooser.addChoosableFileFilter (type4);
              chooser.setFileFilter (type4);
         int returnVal = chooser.showOpenDialog(this);
                   if (returnVal == JFileChooser.APPROVE_OPTION)
                        f = chooser.getSelectedFile();
                        //System.out.println("path of open "+ f);
    //GBMainFrame file
    package igib.genebrowser;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import igib.genebrowser.menu.*;
    import igib.genebrowser.plot.*;
    import igib.genebrowser.util.*;
    public class GBMainFrame extends JFrame
         GBMainMenu gb;
         PlotGraph pg;
         JPanel jf = new JPanel();
         JPanel jf1;
         LineGraph lg, lg1;
         JPanel jp1, jp2;
         JLabel jl;
         public GBMainFrame()
              super("File: " + GBFileProp.fileName + " " + GBFileProp.repeatFile + " " + GBFileProp.snpFile + " " + GBFileProp.geneFile);
              Container cp = this.getContentPane();
              cp.setLayout(new BorderLayout());
              cp.setSize(1024,600);
              Color c1=new Color(255,100,100);
              jf = new JPanel(new GridLayout(1,15));
    cp.add(jf, BorderLayout.NORTH);
              pg = new PlotGraph();
              pg.setBackground(Color.white);
              cp.add(pg, BorderLayout.CENTER);
              GBFileProp.jsb.setUnitIncrement(5);
              cp.add(GBFileProp.jsb, BorderLayout.SOUTH);
              lg1 = new LineGraph();
              lg1.setBackground(Color.white);
              lg1.setSize(50, 1000);
              cp.add(lg1, BorderLayout.EAST);
              lg = new LineGraph();
              lg.setBackground(Color.white);
              cp.add(lg, BorderLayout.WEST);
              gb = new GBMainMenu();
              jf.add(gb);
              setVisible(true);
              repaint();
    //PlotGraph File
    package igib.genebrowser.plot;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.util.*;
    import java.awt.image.*;
    import java.io.*;
    //import Acme.JPM.Encoders.*;
    //import Acme.*;
    import java.awt.print.*;
    import java.awt.Component;
    import java.awt.print.PrinterJob;
    import igib.genebrowser.menu.*;
    import igib.genebrowser.util.*;
    import igib.genebrowser.*;
    public class PlotGraph extends JPanel implements MouseListener,MouseMotionListener
         int xcoordinate;
         JScrollBar scrollBar;
         int mouseX;
         int mouseY;
         String st1 = " ";
         JScrollPane jsp;
         int check;
         int n;
         double base;
         int value;
         String repeatSymbol = "!";
         int position[] = new int[1500];
         public PlotGraph(String st)
              check = 0;
              GBFileProp.check = false;
         setVisible(true);
              ToolTipManager.sharedInstance().setInitialDelay(0);
              addMouseListener(this);
              addMouseMotionListener(this);
         public PlotGraph()
              check = 0;
              //System.out.println(GBFileProp.gcmax + "max y");
              if(GBFileProp.genescore>5)
              GBFileProp.filesize = GBFileProp.readGeneEnd[GBFileProp.genescore - 6];
              //System.out.println(GBFileProp.seqscore + " GBFileProp.seqscore");
              if(GBFileProp.filesize < GBFileProp.seqscore)
                   GBFileProp.filesize = GBFileProp.seqscore;
              if(GBFileProp.snpscore>5)
                   if(GBFileProp.filesize < GBFileProp.readSNPPosition[GBFileProp.snpscore-6])
                        GBFileProp.filesize = GBFileProp.readSNPPosition[GBFileProp.snpscore-6];
              if(GBFileProp.repeatscore>2)
                   if(GBFileProp.filesize < GBFileProp.endRepeatPosition[GBFileProp.repeatscore-2])
                        GBFileProp.filesize = GBFileProp.endRepeatPosition[GBFileProp.repeatscore-2];
              GBFileProp.scrollsize = (int)GBFileProp.filesize/285;
              GBFileProp.check = true;
         setVisible(true);
              addMouseListener(this);
              addMouseMotionListener(this);
              try
              AdjustmentListener lst = new AdjustmentListener()
                   public void adjustmentValueChanged(AdjustmentEvent e)
                        int i = e.getValue();
                        value = i;
                        GBFileProp.defaultStartCoordinate = (int)(e.getValue()*10*base);
                        GBFileProp.defaultEndCoordinate = GBFileProp.defaultStartCoordinate + (int)(10000*base);
                        repaint();
              GBFileProp.jsb.addAdjustmentListener(lst);
              catch(Exception e)
                   System.out.println("error here" + e);
    //******************** For Painting all the graph**********************************//
         public void paintComponent(final Graphics g)
              super.paintComponent(g);
              Font f = new Font("Times-Roman", Font.PLAIN, 16);
              g.setFont(f);
              GBFileProp.scrollsize = (int)GBFileProp.filesize/285;
              base = (double)(100.0/GBFileProp.zoomSize);
              n = (int)(GBFileProp.filesize/base);
              GBFileProp.jsb.setMaximum(n/10);
              if(GBFileProp.checkSave)
                   GBFileProp.checkSave = false;
                   Image img = this.createImage(1200,800);               
                   Graphics gph = img.getGraphics();
                   this.paint(gph);
                   try
                        OutputStream os = new FileOutputStream(GBFileProp.save);
                        GifEncoderTest ge = new GifEncoderTest(img,os);
                        ge.encode();
                        os.close();
                        catch(Exception e){}
              if(GBFileProp.checkPrint)
                   try
                        GBFileProp.checkPrint = false;
                        RepaintManager.currentManager(this).setDoubleBufferingEnabled(false);
                        PrinterJob pj=PrinterJob.getPrinterJob();
                        pj.printDialog();
                        pj.print();
                   catch (Exception PrintException)
                        System.out.println("print error" + PrintException);
                        GBFileProp.checkPrint = false;
              if(SetVisibleClass.isMerge)
                        GBFileProp.snpposition = 500;
                        GBFileProp.geneposition = 500;
                        GBFileProp.repeatposition = 500;
                        GBFileProp.userdefinedpoint = 500;
                   else
                        GBFileProp.snpposition = 450;
                        GBFileProp.geneposition = 400;
                        GBFileProp.repeatposition = 150;
                        GBFileProp.userdefinedpoint = 500;
              if(GBFileProp.check)
                   try
                        if(SetVisibleClass.isSNP)
                        drawSNPPage(g);
                   catch(Exception e)
                        System.out.println("Error in snp plotting");
                   try
                        drawGenePage(g);
                   catch(Exception e)
                        System.out.println("Error in gene plotting");
                   try
                        if(SetVisibleClass.isGC)                    
                        drawGCPage(g);
                   catch(Exception e)
                        //System.out.println("Error in GC plotting");
                   try
                        drawUserDefinedPage(g);
                   catch(Exception e)
                        System.out.println("Error in User Defined plotting");
                   try
                        if(SetVisibleClass.isRepeat)                    
                             drawRepeatPage(g);
                   catch(Exception e)
                        System.out.println("Error in Repeat plotting");
    //******************** For Painting all the graph**********************************//
    //***************************** For Painting Gene**********************************//
         public void drawGenePage(Graphics g1)
              Graphics2D g = (Graphics2D)g1;
              g1.setColor(Color.darkGray);
              g.drawLine(0,650,(int)10000,650);
              //g1.setColor(Color.b);
              BasicStroke pen = new BasicStroke(3.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND);
    g.setStroke(pen);
    //****************************** X coordinate *************************************//
              for(int i = 0; i < 10000; )
                   int xcor = (GBFileProp.defaultStartCoordinate + (int)(i*base));
                   String xCoordinate = "" + xcor;
                   g.drawLine((int)(i/10),645,(int)(i/10),655);
                   g.drawString(xCoordinate,(int)(i/10),665);
                   i = i + 1000; //+ (int)(1000/base);
    //****************************** X coordinate *************************************//
              if(SetVisibleClass.isGene)
                   g1.setColor(Color.darkGray);
                   g1.drawString("Gene:", 10, (GBFileProp.geneposition - 25));
                   g1.setColor(GBColorSymbol.cGene);
                   for (int i = 0; i < GBFileProp.genescore ; i++) // - 5 to b subtracted from genescore
                        int basestart = (int)((GBFileProp.readGeneStart[i] - (int)(GBFileProp.defaultStartCoordinate))/base); ///10;
                        int baseend = (int)((GBFileProp.readGeneEnd[i] - (int)(GBFileProp.defaultStartCoordinate))/base);
                        if(basestart >=0 && baseend <=(int)(10000))
                             checkGenePosition(i);
                             g.drawLine((int)((basestart/10)),GBFileProp.geneposition,(int)((baseend/10)),GBFileProp.geneposition);
                             arrow(true,true,i, g, basestart, baseend);
                        if(basestart >=0 && baseend > (int)(10000))
                             checkGenePosition(i);
                             g.drawLine(basestart/10,GBFileProp.geneposition,1000,GBFileProp.geneposition);
                             arrow(true,false,i, g, basestart, 10000);
                        if(basestart < 0 && baseend <= (int)(10000))
                             checkGenePosition(i);
                             g.drawLine(0,GBFileProp.geneposition,baseend/10,GBFileProp.geneposition);
                             arrow(false,true,i, g, 0, baseend);
                        if(basestart < 0 && baseend > (int)(10000))
                             checkGenePosition(i);
                             g.drawLine(0,GBFileProp.geneposition,1000,GBFileProp.geneposition);
                   //System.out.println("GeneSt: " + GBFileProp.readGeneStart[i] + " GeneEd: " + GBFileProp.readGeneEnd[i] + " No " + i + "GeneScore " + GBFileProp.genescore);     
    //*****************************End For Painting Gene**********************************//
    //*****************************Start For Painting snp**********************************//
         public void drawSNPPage(Graphics g1)
              //System.out.println(GBFileProp.snpscore + "for snp");
              Graphics2D g = (Graphics2D) g1;
              BasicStroke pen = new BasicStroke();
              g.setStroke(pen);
              //g.setColor(Color.Red);
              g.drawString("SNP", 20, GBFileProp.snpposition);
              g.setColor(GBColorSymbol.cSnp);
              for(int i = 0; i < GBFileProp.snpscore; i++)
                   int basePosition = (int)((GBFileProp.readSNPPosition[i] - GBFileProp.defaultStartCoordinate)/base);
                   //System.out.println(" position " + (basePosition/10));
                   //g.drawString("|",(basePosition/10),GBFileProp.snpposition);
                   g.drawString(GBColorSymbol.snpSymValues[GBColorSymbol.snpSym],(basePosition/10),GBFileProp.snpposition);
                                                                                                                  //Line SNP score
              //System.out.println(GBFileProp.snplinescore);
              for(int i = 0; i < GBFileProp.snplinescore-1; i++)
                   int basePosition = (int)((GBFileProp.readSNPStartPosition[i] - GBFileProp.defaultStartCoordinate)/base);
                   //g.drawString("|",(basePosition/10),GBFileProp.snpposition);
                   g.drawString(GBColorSymbol.snpSymValues[GBColorSymbol.snpSym],(basePosition/10),GBFileProp.snpposition);
              for(int i = 0; i < GBFileProp.snplinescore-1; i++)
                   int basestart = (int)((GBFileProp.readSNPStartPosition[i] - (int)(GBFileProp.defaultStartCoordinate))/base); ///10;
                   int baseend = (int)((GBFileProp.readSNPEndPosition[i] - (int)(GBFileProp.defaultEndCoordinate))/base);
                   System.out.println(basestart + "     " + baseend);
                   if(basestart >=0 && baseend <=(int)(10000))
                             g.drawLine((int)((basestart/10)),GBFileProp.snpposition,(int)((baseend/10)),GBFileProp.snpposition);
                   if(basestart >=0 && baseend >(int)(10000))
                             g.drawLine((int)((basestart/10)),GBFileProp.snpposition,(int)((1000)),GBFileProp.snpposition);
                   if(basestart < 0 && baseend <=(int)(10000))
                             g.drawLine((int)((0)),GBFileProp.snpposition,(int)((baseend/10)),GBFileProp.snpposition);
                   if(basestart < 0 && baseend > (int)(10000))
                             g.drawLine((int)((0)),GBFileProp.snpposition,(int)((1000)),GBFileProp.snpposition);
    //*****************************Start For Painting GCPlotting**********************************//
         public void drawGCPage(Graphics g1)
              Graphics2D g = (Graphics2D) g1;
              g1.setColor(Color.darkGray);
              g.drawString("GC Percentage", 20, 20);
              BasicStroke pen = new BasicStroke();
              g.setStroke(pen);
              g1.setColor(Color.black);
              //System.out.println(GBFileProp.seqscore + " score");
              for(int i = 0; i < (int)((10000)*base); )
                   //System.out.println(GBFileProp.defaultEndCoordinate + " " i" " + GBFileProp.defaultStartCoordinate);
                        //System.out.println(GBFileProp.gcposition);
                        int firstPosition = (int)GBFileProp.GCPercentage[(int)((((int)(i) + GBFileProp.defaultStartCoordinate)/GBFileProp.shiftsize))] * (3*100)/GBFileProp.gcmax;
                        int secondPosition = (int)GBFileProp.GCPercentage[(int)((((int)((i+GBFileProp.shiftsize)) + GBFileProp.defaultStartCoordinate)/GBFileProp.shiftsize))] * (3*100)/(GBFileProp.gcmax);
                        g.drawLine((int)((i/10)/base), GBFileProp.gcposition - firstPosition, (int)(((i+GBFileProp.shiftsize)/10)/base), GBFileProp.gcposition - secondPosition);
                        i = i + GBFileProp.shiftsize;
              for(int i = 0; i < GBFileProp.seqscore -1; i++)
                   int firstPosition = (int)Integer.parseInt(GBFileProp.GCPoint.elementAt(i).toString()) * 3;
                   int secondPosition = (int)Integer.parseInt(GBFileProp.GCPoint.elementAt(i+50).toString()) * 3;
                   //int secondPosition = (int)GBFileProp.GCPercentage[i+50] * 3;
                   //g.drawString("|",basePosition,300);
                   g.drawLine((int)(i/10), 300 - firstPosition, (int)(i+50)/10, 300 - secondPosition);
                   i = i + 49;
    //*****************************End For Painting GCPlotting**********************************//
    //*****************************Start For Painting Repeat File**********************************//
         public void drawRepeatPage(Graphics g1)
              int check = 0;
              Graphics2D g = (Graphics2D) g1;
              g.setColor(Color.darkGray);
              g.drawString("Repeat", 10, 480);
              for (int i = 0; i < GBFileProp.repeatscore ; i++)//- 1 to b subtracted from repeatscore
                   int basestart = (int)((GBFileProp.startRepeatPosition[i] - (int)(GBFileProp.defaultStartCoordinate))/base); ///10;
                   int baseend = (int)((GBFileProp.startRepeatPosition[i] - (int)(GBFileProp.defaultStartCoordinate))/base);
                   if(basestart > 0 && basestart < 10000)
                        try
                             if(GBFileProp.repeatFamily.equals("LINE"))
                                  System.out.println(" Line" );
                                  GBFileProp.repeatposition = 575;
                                  repeatSymbol = GBColorSymbol.repeatSymValues[GBColorSymbol.lineSym];
                                  if(GBFileProp.repeatName[i].length() >= 2)
                                       if(GBFileProp.repeatName[i].substring(0,2).equals("L1"))
                                            g.setColor(GBColorSymbol.cL1);
                                            g.drawString(repeatSymbol, (int)(basestart/10), GBFileProp.repeatposition);
                                       else if(GBFileProp.repeatName[i].substring(0,2).equals("L2"))
                                            g.setColor(GBColorSymbol.cL2);
                                            g.drawString(repeatSymbol, (int)(basestart/10), GBFileProp.repeatposition);
                                       else if(GBFileProp.repeatName[i].substring(0,2).equals("L3"))
                                            g.setColor(GBColorSymbol.cL3);
                                            g.drawString(repeatSymbol, (int)(basestart/10), GBFileProp.repeatposition);

  • How to disable parent window while popup window is coming

    Hi,
    I am working on Oracle Applications 11i.
    I am able to get the popup window using the Java script in the controller.
    Please see the below code for the reference.
    String pubOrderId = pageContext.getParameter("orderId");
    StringBuffer l_buffer = new StringBuffer();
    StringBuffer l_buffer1 = new StringBuffer();
    l_buffer.append("javascript:mywin = openWindow(top, '");
    l_buffer1.append("/jct/oracle/apps/xxpwc/entry/webui/AddAttachmentPG");
    l_buffer1.append("&retainAM=Y");
    l_buffer1.append("&pubOrderId="+pubOrderId);
    String url = "/OA_HTML/OA.jsp?page="+l_buffer1.toString();
    OAUrl popupUrl = new OAUrl(url, OAWebBeanConstants.ADD_BREAD_CRUMB_SAVE );
    String strUrl = popupUrl.createURL(pageContext);
    l_buffer.append(strUrl.toString());
    l_buffer.append("', 'lovWindow', {width:750, height:550},false,'dialog',null);");
    pageContext.putJavaScriptFunction("SomeName",l_buffer.toString());
    But here the problem is, even though popup window is there, i am able to do the actions on the parent page.
    So how to disable the parent page, while getting the popup window.
    Thanks in advance.
    Thanks
    Naga

    Hi,
    You can use javaScript for disabling parent window as well.
    Refer below link for the same:
    http://www.codeproject.com/Questions/393481/Parent-window-not-disabling-when-pop-up-appears-vi
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • I'm using Firefox version 3.6 on my '02 Mac G4. When I installed it, it worked fine, But then all of a sudden the "save" and "save as" windows stopped coming up at all when I selected "save" anywhere in Firefox. What happened and how do I fix it?

    I downloaded and installed Firefox on my '02 Mac G4. It worked great. Now I have version 3.6. But my weird problem is one day when I ran it, the "save" and "save as" windows stopped popping up at all. I'd left click a picture and select "save as" and nothing would happen. I'd go to the menu and select "save" and still no window would pop up. It would just act as if nothing had been clicked. No loading icon or anything and no "save as" window. I've never been able to get it to work. The volunteer in the live support chat typed "That IS weird.." I tried his suggestion but it did nothing. I may have deleted the plist preferences file in the preferences library folder to get it started again after a freeze up threw it out of whack but I've never had this happen before.And i've tried doing that again to see if that would restore it. But the plist always regenerates itself and the "save as " window still never appears when I run Firefox. The "save" window works just fine in every other program on my Mac, but not in Firefox. Weird..

    Leliforever, cheek you list of installed add-ons, the Ask toolbar can be installed without the users knowledge.
    For checking other extensions that may cause this, follow the procedure in this link - https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Open URL in a new window by closing the parent window

    Hi Friends,
    Is there any option to open URL in a new window by closing the parent window on a button click?
    Already implemented the logics suggested in /people/mohammed.anzys/blog/2007/06/05/how-to-close-parent-window-in-webdynpro-applications , the thread ' URL in same window '  and the standard component WDR_TEST_EXIT_PLUG .But button is not triggerring any actions .plz help me  ..............
    Regards,
    Radhika

    hi,
    Do the following steps :
    -> Make an Outbound Plug to the Window.
    ->Make the type of Outbound plug to Exit Type.
    ->Add URL of type String as a parameter to the outbound plug of Window.
    ->Do remember to add Component Name in the Properties Tab of View ( othervs Calling Outbound plug of window from view wont b possible ).
    To open a new URL with closing the previous one write this Code in OnAction of Button : ( this Code can be get from Code Wizard too ).
    DATA lo_zexit TYPE REF TO ig_zexit .   <zexit is name of my Component>
    lo_zexit =   wd_this->get_zexit_ctr( ).
      lo_zexit->fire_out_window_plg(
        url =   'http://www.google.com'                            " string
    I hope it helps.
    Thanx.

  • How to populate a Value in popup based on value selected in Parent window

    Hi Gurus,
    I have done a custumization to generate a PDF report for a given DocType and Document ID.
    I have 2 fields in xxxQuoteDevPG.xml (Parent Window) called DocType and Document Number.
    Doctype is dropdown list which has 2 values i.e. Sales Quote and Manual SOW Number and Document Number is a text field with search option.
    when i select the doctype as Sales Quote and search for docnumber , i will get a popup where i have "Search By" dropdown list in this i have 2 values i.e "Quote Number" and "Customer PO".
    When i select a Sales Quote as Doctype i need to populate Quote Number as defualt in Search by dropdown list.
    and When i select Manual SOW Number from parent window i need to defualt Customer PO in popup.
    Now it is always shows Quote Number as defualt one for the doctypes.
    Actually thr is only one controller atatched to xxxQuoteDevPG.xml and popup is a OA Region.
    Can somebody help me on this issue.
    Thanks,
    MMR

    This should be a custom java class containing that method.
    Try on java or jdbc forum - Java Database Connectivity (JDBC) , Java Programming

  • Closing Report Preview window closes all parent windows

    I have a form 6.0 calling a report 6.0 with several user parameters using run_report_object in preview mode. After the finishing previewing, the user closes the report preview window. Then the preview window closes all the parent windows.
    Need help!
    1) The parameters are char, date and number types.
    2) I don't have a parameter form. I take out the high-light of the parameters on the parameter form and the parameter form title.
    3) I have several user parameters and without the parameter form i'm still able to pass the parameters from the Form.
    Thanks
    null

    report_other parameter can only take 255? characters.
    I use create parameter list and add_parameter instead.

  • Three links to open in parent window

    I have built a slider that includes three different links (one for each slide) that need to open in the parent window.  When I apply the Action using Open URL and target the parent window they still open in a new window. 
    Is there a way to configure the window.open action to target the parent window when an Edge Animate object is placed into an index file?
    Any help would be appreciated.

    1st, thank you so much for trying to help me with this.  I truly appreciate it.
    Window.location did not work either.  Left the target as parent too, still a new window.
    This is within a CMS editor that I have an iframe surrounding the index.html page holding the edge animate object for within our intranet.
    Jennie Lane
    Web Developer
    Fidelity Bank | Oklahoma Fidelity Bank
    P:  316.749.4412
    www.fidelitybank.com<http://www.fidelitybank.com/>

  • How to pass the data from a pop up window to the parent window

    Hi All,
    I have a jsp page which contains a add button, while clicking it a popup will come out(which is a another jsp page). There are some input fieldsand a submit button. Now how could I send the data from the pop up to the parent winow. Also I have to check that if the pop up is open and I click add button then another pop up must not open.
    Plz reply its urgent
    Thanks and Regards
    Rajib Sharma

    Thanks for the reply
    But it not worked
    I have a jsp page and the popup is also a jsp page the data that is passed from the popup window to the parent must be send to the server from the parent window to get a data from the data base as search result. Its of no use to get it as js data
    Thanks and regards
    Rajib Sharma

  • Options Startup Show my Windows & Tabs from last time,but upon exit FF doesn't ask to save tabs & windows. When restarting FF I have a home pape,but no Bookmark tabs show. Why

    Upon starting FF and going to my Home Page, I have no Bookmarks or Tabs showing. I have to Re-load the Bookmark Tabs. My options at Startup are "Show my Windows & Tabs from last time" Also using the Firefox exit,it does not ask to save tabs & windows on Exit. I'm getting tired of adding Bookmark Tabs each time I want to use FF.

    It is possible that there is a problem with the files sessionstore.js and sessionstore.bak in the Firefox Profile Folder.
    Delete the files sessionstore.js and sessionstore.bak in the Firefox Profile Folder.
    * Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    * http://kb.mozillazine.org/Profile_folder_-_Firefox
    * http://kb.mozillazine.org/sessionstore.js
    If you see files sessionstore-##.js with a number in the left part of the name like sessionstore-1.js then delete those as well.<br />
    Deleting sessionstore.js will cause App Tabs and Tab Groups to get lost, so you will have to create them again (make a note).
    See:
    * http://kb.mozillazine.org/Session_Restore

  • Save As window comes up when saving a WebI document another user modified

    When trying to save a Web Intelligence document in the "Web" mode (not the java "Rich Internet Application" mode), users get a "Save As" window if another user was the last one to save the document.  The user can simply select the same location and "overwrite" the existing report.  They can also use the Rich Internet Application mode instead, since this does not have the same issue.  After that, the same user can continue to save the report as usual, until another user saves it.  The user has full control permissions to the document and to the folder.
    This doesn't seem like it would be a big deal, but most of our users access reports using hyperlinks from other websites, which opens the document directly in the web mode; and they just make simple changes like selecting a different value in an input control.  If the Save As window comes up, it takes them to their Favorites folder, and they usually don't know which public folder the report is stored in.

    I can not print anything from Firefox but on IE everything prints just fine. I happen to like Firefox a whole lot better so would appreciate a solution to my problem.

Maybe you are looking for