TRIGGER avec Fenetre POP UP

Bonjour à tous,
évoluant sous Labview depuis peu, je rencontre un probleme sur un programme de trigger. En effet, tout par d'un programme plus grand d'acquisition de données analogiques suivant certaines conditions définies par un experiment que l'on peut creer sauvegarder et charger. Jusque là, tout va bien. L'acquisition des données se passe aussi bien. Seulement l'ajout de la fonction trigger se fait comme suit:
- A la page des graphes d'acquisition simple des données analogiques, il y'a un bouton qui sur appui fait apparaitre une fenetre pop up du trigger.
-A l'apparition de cette fenetre, on peut choisir les parametres de trigger que l'on souhaite ( pretrigger, condition trigger, samples,..) puis en appuyant sur Trigger la recherche du trigger commence.
-Il y'a 3 graphes sur cette fenetre ( 1 graphe pour la visualisation en cours de toutes les voies analogiques disponibles, 1 graphe pour visualisation des voies analogiques que l'on souhaite suivant l'experiment chargé plus haut ( VI principal) et 1 troisieme graphe qui fera apparaitre les variables que lorsque la condition de trigger est remplie.
-Une fois qu'on visualise les données trigguées, en appuyant sur le bouton Triggered , une autre fenetre POP UP doit apparaitre pour montrer un graphe plus grand mais qui est celui du 3e gaphe des données triguées.
-Puis, on doit pouvoir refermer les fenetre une à une pour revenir au VI principal.
Seulemnt voici les problemes que j erencontre:
1-La 2e fenetre pop up ne me donne pas un graphe plus avec les données trigguées sur tout le graphe mais que le debut
2- en refermant cette fenetre en appuyant sur quitter, j'ai plus acces à la premiere fenetre pop up.
3- J'arrive pas faire autant de trigger sur ma premiere fenetre pop up avant de repasser dans mon VI principal.
4- les condition de trigger ( Rising edge, failling edge,...) ne sont pas parfaits il me donne pas toujours ce qui est juste.
J'ai mis en piece jointe la partie trigger ( les 2 fenetres POP UP) sans le main  VI parce qu'il est trop lourd compliqué et volumineux 
Merci de me donner votre point de vue sur les erreurs que j'aurais dans mon code ainsi que des problemes à resoudre.
Attachments:
projet_trigger.zip ‏171 KB

It is very difficult to see what your code does because it takes up so much space on the screen. However, it looks like you need to better understand how to pass data to a subVI, and how the event structure works.
I think you are expecting the graph to update inside your pop-up window. When you open the second pop-up window, it makes a copy of the graph data at that moment, and that's the data that is displayed. If you need to send new data to the subVI while it is running, use a queue.
An event structure only executes once per loop iteration, and it doesn't finish until everything inside it finishes, so a loop can't proceed to the next iteration if an event case is running. When you click the "Triggered" button, it opens the pop-up, and then it sits there until the pop-up is closed. The parallel acquisition loop keeps running, but the user interface will not respond because you have checked "Lock the front panel until this event case completes" in the event structure. When you close the pop-up, you cannot then click the triggered button again until the acquisition loop finishes, which will let the big overall loop.

Similar Messages

  • Calendar pop-ups not available in portal but appearing in BAB

    Hi,
    When I execute Sales Order transaction through BAB, certain fields with Date values are having pop up icon through which calender opens up, but same thing when executed through protal does not show such icon through which calendar can be opened, only the text field appears.
    What could be the problem ? same thing I am executing
    through BAB, it goes fine and in Portal its not showing
    Vishal

    Vishal, can you check the data type of the fields that do not show the date picker pop-up. I think these fields are not of type 'DATS' which prevents the trigger the actual pop-up. EIther you have to add the date picker functionality ourself (not easy), for more information on the actual date picker fuctionality have a look at the BSP Application: "HTMLB_samples". Hope this helps, Tiest.

  • BADI in VA02 at SAVING and function module for POP where i enter email id

    Hi All,
    Its urgent.
    1. I want a BADI name for VA02 at the time of saving .
    2. a POP up where i can enter email id .
    in SALES ORDER in SHIPPING TAB when i select DELIVERY BLOCK BADI should trigger and a pop up should come.
    I will enter the mail id and mail will go to a concern person.
    Sending a mail i can do , but BADI name and POPUP with entering mail id is the PROBLEM.
    Please friends i want it ASAP.
    Regards,
    Kumar.

    Problem is solved .
    I have created the POP box using CALL SCREEN..
    It worked .
    Thank you all

  • Ref. Operation Set for Trigger Point

    Friends,
    I m doing Trigger points in CO11N. Production Order quantity is 10. While confirmation yield qty. 7 & rework qty is 3. After saving trigger point function pop up but after pop up of ref. operation set, i m selecting Group and Task list type, system displayed *Ref. operation set ********** is not valid according to selection conditions.*
    In CA02 change  routing I hav done all settings of trigger points and created Ref. op. set by CA11.
    Pl. guide.......

    Dear,
    Kindly change order type dependent parameters(TCode OPL8), and check routing selection (3 Routing/ref. op. set optional (automatic selection))
    and task list type S     Reference Operation Set.
    check and revert back.
    Thanks
    Muhammad Ashfaq
    Edited by: Muhammad Ashfaq on Sep 10, 2011 1:46 PM

  • Triggering pop-up event through drag & drop?

    Hi everyone, I'm a newly registered member of this forum.
    I've roughly browsed though this forum to seek a solution for my problem, but I can't seem to find a suitable solution (perhaps i should continue looking).
    Scenario:
    Anyway, I'm facing some technical challenges in flex as I'm relatively new to it.
    I'm trying to create a web application, where users use drag & drop to input information.
    I visualize this process:
    User selects icon from a list
    User drags the icon onto target area
    User releases icon over target area
    Pop-up appears with a form for users to input information.
    Users input information and submits
    Information is stored in the database.
    Present knowledge:
    Because I'm new to Flex, I tried to break this down and learn by components:
    I'm able to:
    Create a drag & drop effect
    Create connection to database using HttpService
    Main Problem:
    I'm able to use the drag and drop functionality but I cannot trigger a pop-up event when the icon is dropped onto the target area.
    Sorry if the problem seems a little insignificant due to my lack in knowledge.
    I'm just a student trying to learn. Hope that someone can help me out here, or provide me with relevant links to learning resources.
    Thanks in advance,
    Jord

    Hi,
    thanks so much for replying, but I would really appreciate a little bit more help.
    I vaguely understand the concepts of DragEvent.DRAG_DROP, but I'm not really familiar with the syntax of how to cause allow a pop-up to appear.
    This is how my script look like:
    <mx:Script>
            <![CDATA[
                import mx.events.DragEvent;
                import mx.containers.Box;
                import mx.managers.DragManager;
                import mx.core.DragSource;
                import mx.collections.ArrayCollection;
                import mx.rpc.events.ResultEvent;
                [Embed("IconAssets/1.gif")]
                [Bindable]
                public var personalAsset:Class;
                [Embed("IconAssets/2.gif")]
                [Bindable]
                public var investment:Class;
                [Bindable]
                private var iconValue:uint;          
                private function iconDrag (event:MouseEvent, value:uint):void
                        var dragInitiator:Image = event.currentTarget as Image;
                        var dragSource:DragSource = new DragSource();
                        dragSource.addData(value, 'value');
                        var dragProxy:Image = new Image();
                        dragProxy.source = event.currentTarget.source;
                        DragManager.doDrag(dragInitiator, dragSource, event, dragProxy);
                private function dragOver(event:DragEvent):void
                        var dropTarget:Box=event.currentTarget as Box;
                        if (event.dragSource.hasFormat('value'))
                                dropTarget.setStyle("borderThickness", 5);
                                DragManager.acceptDragDrop(dropTarget);
                private function dragAway(event:DragEvent):void
                        var dropTarget:Box=event.currentTarget as Box;
                        revertTarget();             
                private function dragAccept(event:DragEvent):void
                        var value:uint = event.dragSource.dataForFormat('value') as uint;
                        The trigger for the Pop-up should be placed here.
                        revertTarget();
                private function revertTarget():void
                    fStatement.setStyle("borderThickness", 1);
            ]]>
        </mx:Script>
    I'm not sure whether I'm correct to state (in bold, italic, & underline) above that the event trigger for the pop-up should be within that particular function.
    The difficulty I'm facing now is that the (structure of the) popup should be written in MXML and yet I have to place them in the ActionScript.
    (I sense that I have a fundamental misconception of how this works,so please correct me to the best of your knowledge.)
    I would greatly appreciate it if anyone is able to provide me with an example/sample of how this should be done.
    With Thanks,
    Jord

  • Almost finished with site, really need help with pop up window!!!!!

    I've got one last thing to finish up on this site I've been working on.  I've posted what I've worked up so far at:
    http://truetilldeathhq.com/main8_v7/main8_v7.html
    I still have to finish linking the actual banner swfs on the Online Banners page, which will display animated banner ads for the portfolio.  Ideally, when the user clicked the View Banner link, I wanted to have the banners display in a similar pop up window like the other examples of the work (with same title area, close button, etc., click the Detailed View button on Merchandise page for example).  That was problematic due to different frame rates of the banner swfs, getting the pop up window to contain just the stage area of the swf and not the working area, getting the window to pop up in the middle and not get cut off at the right side, etc.  Like I said, ideally I'd like to do this, so if anyone has a relatively quick fix, I'm all ears.
    I figured my best route now is to somehow have Flash trigger an html pop up window when the link is clicked and have it display in the middle of the page at the exact dimensions of the banner.  Anybody know the best way to do this?  I'm at my wits end and I really have to have this finished for Monday so any help is more than appreciated, thank big time in advance!

    Forgive me for my ignorance, but I'm new to Flash and any kind of scripting and I didn't quite follow that page you directed me to.  Right now I'm working up a Flash template and the action on the link for the banner pages looks like this:
    on(rollOver) {
    this.gotoAndPlay("s1");
    on(rollOut, releaseOutside) {
    this.gotoAndPlay("s2");
    on (release) {
    _root.popup_pressed=1;
    _root.scrHEIGHT=240
    _root.scroller.scroller.gotoAndStop(2);
    _root.TM_title = "Work 1 read more";
    _root.READ = 1;
    _root.scroller.gotoAndPlay("s1");
    How can I work up the on (release) so I'll get a simple pop up window, say 728x90, no scrollbars or resizing, that will open somewhere in the middle of the site?  If I wanted a title to the pop up window, how would I do that?
    Again, thanks so much for your time and excuse my newbieness.

  • Bouton// Masquer et faire réapparaitre = Edge ou Dps ??

    Bonjour,
    Svp qu'elle est la meilleur façon de creer un bouton pour masquer et  faire réapparaitre une image, vidéo ... ou un élément avec un bouton de fermeture en haut a droite. est ce on utilisant les boutons dps ou edge est comment.
    Très GRD merci pour votre aide.
    Joe

    Bonjour Joe,
    Ce n'est pas une vidéo, mais ça devrait pouvoir vous aider.
    http://pixelformation.ca/creer-une-fenetre-pop-up-pour-dps/
    Évidemment, il existe d'autres façon de faire et vous pouvez adapter cette méthode à vos besoins, mais vous devriez avoir l'idée.

  • Storing Shape Information IN a Table-Like Structure

    Hi All,
    I have a Program which displays shape (rectangle,oval,etc) in the panel which is enclosed in a frame.. shape can be dragged and dropped anywhere on panel... also one can delete shape... Now I Want To Store All The Exiting Shapes (as they are added on panel ) in some structure say a table, and alongwith it, i also want to store additional information about shape, say its location currently on panel, its present color, etc so that i can use this information later in the program... how do i do implement this ?? Plz Help Me.. It would be great if you include the changes in the source code itself...
    thanks
    Here is the source code :
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.ArrayList;
    public class ShapeDrawFrame extends javax.swing.JFrame {
        JCheckBoxMenuItem addLargeShapes;    
       JCheckBoxMenuItem addBorderedShapes; 
       JRadioButtonMenuItem red, green, blue,      
                            cyan, magenta, yellow, 
                            black, gray, white;  
       JPopupMenu popup;
        public ShapeDrawFrame() {
            super("Shape Draw");
            //initComponents();        
          ShapeCanvas canvas = new ShapeCanvas();
          setContentPane(canvas);
          /* Create the menu bar and the menus */
          JMenuBar menubar = new JMenuBar();
          setJMenuBar(menubar);
          JMenu addShapeMenu = new JMenu("Add");
          addShapeMenu.setMnemonic('A');
          menubar.add(addShapeMenu);
          JMenu shapeColorMenu = new JMenu("Color");
          shapeColorMenu.setMnemonic('C');
          menubar.add(shapeColorMenu);
          JMenu optionsMenu = new JMenu("Options");
          optionsMenu.setMnemonic('O');
          menubar.add(optionsMenu);
          /* Create menu items for adding shapes to the canvas,
             and add them to the "Add" menu.  The canvas serves
             as ActionListener for these menu items. */     
          JMenuItem rect = new JMenuItem("Rectangle");
          rect.setAccelerator( KeyStroke.getKeyStroke("ctrl R") );
          addShapeMenu.add(rect);
          rect.addActionListener(canvas);
          JMenuItem oval = new JMenuItem("Oval");
          oval.setAccelerator( KeyStroke.getKeyStroke("ctrl O") );
          addShapeMenu.add(oval);
          oval.addActionListener(canvas);
          JMenuItem roundrect = new JMenuItem("Round Rect");
          roundrect.setAccelerator( KeyStroke.getKeyStroke("ctrl D") );
          addShapeMenu.add(roundrect);
          roundrect.addActionListener(canvas);
          /* Create the JRadioButtonMenuItems that control the color
             of a newly added shape, and add them to the "Color"
             menu.  There is no ActionListener for these menu items.
             The canvas checks for the currently selected color when
             it adds a shape to the canvas.  A ButtonGroup is used
             to make sure that only one color is selected. */
          ButtonGroup colorGroup = new ButtonGroup();
          red = new JRadioButtonMenuItem("Red");
          shapeColorMenu.add(red);
          colorGroup.add(red);
          red.setSelected(true);
          green = new JRadioButtonMenuItem("Green");
          shapeColorMenu.add(green);
          colorGroup.add(green);
          blue = new JRadioButtonMenuItem("Blue");
          shapeColorMenu.add(blue);
          colorGroup.add(blue);
          cyan = new JRadioButtonMenuItem("Cyan");
          shapeColorMenu.add(cyan);
          colorGroup.add(cyan);
          magenta = new JRadioButtonMenuItem("Magenta");
          shapeColorMenu.add(magenta);
          colorGroup.add(magenta);
          yellow = new JRadioButtonMenuItem("Yellow");
          shapeColorMenu.add(yellow);
          colorGroup.add(yellow);
          black = new JRadioButtonMenuItem("Black");
          shapeColorMenu.add(black);
          colorGroup.add(black);
          gray = new JRadioButtonMenuItem("Gray");
          shapeColorMenu.add(gray);
          colorGroup.add(gray);
          white = new JRadioButtonMenuItem("White");
          shapeColorMenu.add(white);
          colorGroup.add(white);
          /* Create the "Clear" menu item, and add it to the
             "Options" menu.  The canvas will listen for events
             from this menu item. */
          JMenuItem clear = new JMenuItem("Clear");
          clear.setAccelerator( KeyStroke.getKeyStroke("ctrl C") );
          clear.addActionListener(canvas);
          optionsMenu.add(clear);
          optionsMenu.addSeparator();  // Add a separating line to the menu.
          /* Create the JCheckBoxMenuItems and add them to the Options
             menu.  There is no ActionListener for these items because
             the canvas class will check their state when it adds a
             new shape. */
          addLargeShapes = new JCheckBoxMenuItem("Add Large Shapes");
          addLargeShapes.setSelected(true);
          optionsMenu.add(addLargeShapes);
          addBorderedShapes = new JCheckBoxMenuItem("Add Shapes with Border");
          addBorderedShapes.setSelected(true);
          optionsMenu.add(addBorderedShapes);
          optionsMenu.addSeparator();
          /* Create a menu for background colors, and add it to the
             "Options" menu.  It will show up as a hierarchical sub-menu. */
          JMenu background = new JMenu("Background Color");
          optionsMenu.add(background);
          background.add("Red").addActionListener(canvas);
          background.add("Green").addActionListener(canvas);
          background.add("Blue").addActionListener(canvas);
          background.add("Cyan").addActionListener(canvas);
          background.add("Magenta").addActionListener(canvas);
          background.add("Yellow").addActionListener(canvas);
          background.add("Black").addActionListener(canvas);
          background.add("Gray").addActionListener(canvas);
          background.add("White").addActionListener(canvas);
          /* Create the pop-up menu and add commands for editing a
             shape.  This menu is not used until the user performs
             the pop-up trigger mouse gesture on a shape. */
          popup = new JPopupMenu();
          popup.add("Delete Shape").addActionListener(canvas);
          popup.add("Bring to Front").addActionListener(canvas);
          popup.addSeparator();
          popup.add("Make Large").addActionListener(canvas);
          popup.add("Make Small").addActionListener(canvas);
          popup.addSeparator();
          popup.add("Add Black Border").addActionListener(canvas);
          popup.add("Remove Black Border").addActionListener(canvas);
          popup.addSeparator();
          popup.add("Set Color to Red").addActionListener(canvas);
          popup.add("Set Color to Green").addActionListener(canvas);
          popup.add("Set Color to Blue").addActionListener(canvas);
          popup.add("Set Color to Cyan").addActionListener(canvas);
          popup.add("Set Color to Magenta").addActionListener(canvas);
          popup.add("Set Color to Yellow").addActionListener(canvas);
          popup.add("Set Color to Black").addActionListener(canvas);
          popup.add("Set Color to Gray").addActionListener(canvas);
          popup.add("Set Color to White").addActionListener(canvas);
          /* Set the "DefaultCloseOperation" for the frame.  This determines
             what happens when the user clicks the close box of the frame.
             It is set here so that System.exit() will be called to end
             the program when the user closes the window. */
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          /* Set the size and location of the frame, and make it visible. */
          setLocation(20,50);
          setSize(550,420);
          show();       
       class ShapeCanvas extends JPanel
                         implements ActionListener, MouseListener, MouseMotionListener {
             // This class represents a "canvas" that can display colored shapes and
             // let the user drag them around.  It uses an off-screen images to
             // make the dragging look as smooth as possible.
          ArrayList shapes = new ArrayList();
               // holds a list of the shapes that are displayed on the canvas
          ShapeCanvas() {
               // Constructor: set background color to white
               // set up listeners to respond to mouse actions
             setBackground(Color.white);
             addMouseListener(this);
             addMouseMotionListener(this);
          public void paintComponent(Graphics g) {
               // In the paint method, all the shapes in ArrayList are
               // copied onto the canvas.
             super.paintComponent(g);  // First, fill with background color.
             int top = shapes.size();
             for (int i = 0; i < top; i++) {
                Shape s = (Shape)shapes.get(i);
                s.draw(g);
          public void actionPerformed(ActionEvent evt) {
                 // Called to respond to action events from the
                 // menus or pop-up menu.
             String command = evt.getActionCommand();
             if (command.equals("Clear")) {
                shapes.clear(); // Remove all items from the ArrayList
                repaint();
             else if (command.equals("Rectangle"))
                addShape(new RectShape());
             else if (command.equals("Oval"))
                addShape(new OvalShape());
             else if (command.equals("Round Rect"))
                addShape(new RoundRectShape());
             else if (command.equals("Red"))
                setBackground(Color.red);
             else if (command.equals("Green"))
                setBackground(Color.green);
             else if (command.equals("Blue"))
                setBackground(Color.blue);
             else if (command.equals("Cyan"))
                setBackground(Color.cyan);
             else if (command.equals("Magenta"))
                setBackground(Color.magenta);
             else if (command.equals("Yellow"))
                setBackground(Color.yellow);
             else if (command.equals("Black"))
                setBackground(Color.black);
             else if (command.equals("Gray"))
                setBackground(Color.gray);
             else if (command.equals("White"))
                setBackground(Color.white);
             else if (clickedShape != null) {
                    // Process a command from the pop-up menu.
                if (command.equals("Delete Shape"))
                   shapes.remove(clickedShape);
                else if (command.equals("Bring to Front")) {
                   shapes.remove(clickedShape);
                   shapes.add(clickedShape); 
                else if (command.equals("Make Large"))
                   clickedShape.setSize(100,60);
                else if (command.equals("Make Small"))
                   clickedShape.setSize(50,30);
                else if (command.equals("Add Black Border"))
                   clickedShape.setDrawOutline(true);
                else if (command.equals("Remove Black Border"))
                   clickedShape.setDrawOutline(false);
                else if (command.equals("Set Color to Red"))
                   clickedShape.setColor(Color.red);
                else if (command.equals("Set Color to Green"))
                   clickedShape.setColor(Color.green);
                else if (command.equals("Set Color to Blue"))
                   clickedShape.setColor(Color.blue);
                else if (command.equals("Set Color to Cyan"))
                   clickedShape.setColor(Color.cyan);
                else if (command.equals("Set Color to Magenta"))
                   clickedShape.setColor(Color.magenta);
                else if (command.equals("Set Color to Yellow"))
                   clickedShape.setColor(Color.yellow);
                else if (command.equals("Set Color to Black"))
                   clickedShape.setColor(Color.black);
                else if (command.equals("Set Color to Gray"))
                   clickedShape.setColor(Color.gray);
                else if (command.equals("Set Color to White"))
                   clickedShape.setColor(Color.white);
                repaint();
          } // end actionPerformed()
          void addShape(Shape shape) {
                 // Add the shape to the canvas, and set its size, color
                 // and whether or not it should have a black border.  These
                 // properties are determined by looking at the states of
                 // various menu items.  The shape is added at the top-left
                 // corner of the canvas.
             if (red.isSelected())
                shape.setColor(Color.red);
             else if (blue.isSelected())
                shape.setColor(Color.blue);
             else if (green.isSelected())
                shape.setColor(Color.green);
             else if (cyan.isSelected())
                shape.setColor(Color.cyan);
             else if (magenta.isSelected())
                shape.setColor(Color.magenta);
             else if (yellow.isSelected())
                shape.setColor(Color.yellow);
             else if (black.isSelected())
                shape.setColor(Color.black);
             else if (white.isSelected())
                shape.setColor(Color.white);
             else
                shape.setColor(Color.gray);
             shape.setDrawOutline( addBorderedShapes.isSelected() );
             if (addLargeShapes.isSelected())
                shape.reshape(3,3,100,60);
             else
                shape.reshape(3,3,50,30);
             shapes.add(shape);
             repaint();
          } // end addShape()
          // -------------------- This rest of this class implements dragging ----------------------
          Shape clickedShape = null;  // This is the shape that the user clicks on.
                                      // It becomes the draggedShape is the user is
                                      // dragging, unless the user is invoking a
                                      // pop-up menu.  This variable is used in
                                      // actionPerformed() when a command from the
                                      // pop-up menu is processed.
          Shape draggedShape = null;  // This is null unless a shape is being dragged.
                                      // A non-null value is used as a signal that dragging
                                      // is in progress, as well as indicating which shape
                                      // is being dragged.
          int prevDragX;  // During dragging, these record the x and y coordinates of the
          int prevDragY;  //    previous position of the mouse.
          public void mousePressed(MouseEvent evt) {
                // User has pressed the mouse.  Find the shape that the user has clicked on, if
                // any.  If there is no shape at the position when the mouse was clicked, then
                // ignore this event.  If there is then one of three things will happen:
                // If the event is a pop-up trigger, then the pop-up menu is displayed, and
                // the user can select from the pop-up menu to edit the shape.  If the user was
                // holding down the shift key, then bring the clicked shape to the front, in
                // front of all the other shapes.  Otherwise, start dragging the shape.
             if (draggedShape != null) {
                  // A drag operation is already in progress, so ignore this click.
                  // This might happen if the user clicks a second mouse button before
                  // releasing the first one(?).
                return;
             int x = evt.getX();  // x-coordinate of point where mouse was clicked
             int y = evt.getY();  // y-coordinate of point
             clickedShape = null;  // This will be set to the clicked shape, if any.
             for ( int i = shapes.size() - 1; i >= 0; i-- ) { 
                    // Check shapes from front to back.
                Shape s = (Shape)shapes.get(i);
                if (s.containsPoint(x,y)) {
                   clickedShape = s;
                   break;
             if (clickedShape == null) {
                   // The user did not click on a shape.
                return;
             else if (evt.isPopupTrigger()) {
                  // The user wants to see the pop-up menu
                popup.show(this,x-10,y-2);
             else if (evt.isShiftDown()) {
                  // Bring the clicked shape to the front
                shapes.remove(clickedShape);
                shapes.add(clickedShape);
                repaint();
             else {
                  // Start dragging the shape.
                draggedShape = clickedShape;
                prevDragX = x;
                prevDragY = y;
          public void mouseDragged(MouseEvent evt) {
                 // User has moved the mouse.  Move the dragged shape by the same amount.
             if (draggedShape == null) {
                    // User did not click a shape.  There is nothing to do.
                return;
             int x = evt.getX();
             int y = evt.getY();
             draggedShape.moveBy(x - prevDragX, y - prevDragY);
             prevDragX = x;
             prevDragY = y;
             repaint();      // redraw canvas to show shape in new position
          public void mouseReleased(MouseEvent evt) {
                 // User has released the mouse.  Move the dragged shape, and set
                 // draggedShape to null to indicate that dragging is over.
                 // If the shape lies completely outside the canvas, remove it
                 // from the list of shapes (since there is no way to ever move
                 // it back on screen).  However, if the event is a popup trigger
                 // event, then show the popup menu instead.
             if (draggedShape == null) {
                   // User did not click on a shape. There is nothing to do.
                return;
             int x = evt.getX();
             int y = evt.getY();
             if (evt.isPopupTrigger()) {
                   // Check whether the user is trying to pop up a menu.
                   // (This should be checked in both the mousePressed() and
                   // mouseReleased() methods.)
                popup.show(this,x-10,y-2);
             else {
                draggedShape.moveBy(x - prevDragX, y - prevDragY);
                if ( draggedShape.left >= getSize().width || draggedShape.top >= getSize().height ||
                        draggedShape.left + draggedShape.width < 0 ||
                        draggedShape.top + draggedShape.height < 0 ) {  // shape is off-screen
                   shapes.remove(draggedShape);  // remove shape from list of shapes
                repaint();
             draggedShape = null;  // Dragging is finished.
          public void mouseEntered(MouseEvent evt) { }   // Other methods required for MouseListener and
          public void mouseExited(MouseEvent evt) { }    //              MouseMotionListener interfaces.
          public void mouseMoved(MouseEvent evt) { }
          public void mouseClicked(MouseEvent evt) { }
       }  // end class ShapeCanvas
       // ------- Nested class definitions for the abstract Shape class and three -----
       // -------------------- concrete subclasses of Shape. --------------------------
       static abstract class Shape {
             // A class representing shapes that can be displayed on a ShapeCanvas.
             // The subclasses of this class represent particular types of shapes.
             // When a shape is first constructed, it has height and width zero
             // and a default color of white.
          int left, top;      // Position of top left corner of rectangle that bounds this shape.
          int width, height;  // Size of the bounding rectangle.
          Color color = Color.white;  // Color of this shape.
          boolean drawOutline;  // If true, a black border is drawn on the shape
          void reshape(int left, int top, int width, int height) {
                // Set the position and size of this shape.
             this.left = left;
             this.top = top;
             this.width = width;
             this.height = height;
          void setSize(int width, int height) {
                // Set the size of this shape
             this.width = width;
             this.height = height;
          void moveBy(int dx, int dy) {
                 // Move the shape by dx pixels horizontally and dy pixels vertically
                 // (by changing the position of the top-left corner of the shape).
             left += dx;
             top += dy;
          void setColor(Color color) {
                 // Set the color of this shape
             this.color = color;
          void setDrawOutline(boolean draw) {
                 // If true, a black outline is drawn around this shape.
             drawOutline = draw;
          boolean containsPoint(int x, int y) {
                // Check whether the shape contains the point (x,y).
                // By default, this just checks whether (x,y) is inside the
                // rectangle that bounds the shape.  This method should be
                // overridden by a subclass if the default behavior is not
                // appropriate for the subclass.
             if (x >= left && x < left+width && y >= top && y < top+height)
                return true;
             else
                return false;
          abstract void draw(Graphics g); 
                // Draw the shape in the graphics context g.
                // This must be overridden in any concrete subclass.
       }  // end of class Shape
       static class RectShape extends Shape {
             // This class represents rectangle shapes.
          void draw(Graphics g) {
             g.setColor(color);
             g.fillRect(left,top,width,height);
             if (drawOutline) {
                g.setColor(Color.black);
                g.drawRect(left,top,width,height);
       static class OvalShape extends Shape {
              // This class represents oval shapes.
          void draw(Graphics g) {
             g.setColor(color);
             g.fillOval(left,top,width,height);
             if (drawOutline) {
                g.setColor(Color.black);
                g.drawOval(left,top,width,height);
          boolean containsPoint(int x, int y) {
                // Check whether (x,y) is inside this oval, using the
                // mathematical equation of an ellipse.
             double rx = width/2.0;   // horizontal radius of ellipse
             double ry = height/2.0;  // vertical radius of ellipse
             double cx = left + rx;   // x-coord of center of ellipse
             double cy = top + ry;    // y-coord of center of ellipse
             if ( (ry*(x-cx))*(ry*(x-cx)) + (rx*(y-cy))*(rx*(y-cy)) <= rx*rx*ry*ry )
                return true;
             else
               return false;
       static class RoundRectShape extends Shape {
              // This class represents rectangle shapes with rounded corners.
              // (Note that it uses the inherited version of the
              // containsPoint(x,y) method, even though that is not perfectly
              // accurate when (x,y) is near one of the corners.)
          void draw(Graphics g) {
             g.setColor(color);
             g.fillRoundRect(left,top,width,height,width/3,height/3);
             if (drawOutline) {
                g.setColor(Color.black);
                g.drawRoundRect(left,top,width,height,width/3,height/3);
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                         
        private void initComponents() {
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 400, Short.MAX_VALUE)
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 300, Short.MAX_VALUE)
            pack();
        }// </editor-fold>                       
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new ShapeDrawFrame().setVisible(true);
        // Variables declaration - do not modify                    
        // End of variables declaration                  
    }

    Sure. In your original post, you had a sort of a design. The general idea was right. And then you asked us to implement it. Well, that's the wrong approach. You need to make the sort-of-a-design into a real design. Don't implement anything until you know what you are going to implement.

  • How to change the Height of item....!!!! in multi record block

    Here is the problem I want to change one item height in multiple records block..
    I tried to do the following
    set_item_instance_property(:system.mouse_item,:system.current_record,height,50);
    But this didn't work as the property for height couldn't be used with this built in..
    Can any one tell me any other suggestion to move around
    Thanks and best regares

    If you just have two sizes to display - e.g. normally the item is 1 line high but in the current item you want to show more information and want to make it say 2 lines high, then you can use a Mirror item to do this.
    Create another item in the block - set the Synchronize With Item property to the base item you want to "Resize".
    Set the Records Displayed property to 1 for this extra field.
    Put this field on a stacked canvas that is just big enough to hold it.
    The in your When-New-Record Instance trigger you can pop the stacked canvas up over the normal version of the field.
    That should do the trick.

  • Free Course Offered by Garritan

    For those interested in symphony orchestration, Garritan, the makers of Garritan Personal Orchestra just posted an excellent tutorial on creating orchestral peices as originally developed by "the man" himself, Nikolay Rimsky-Korsakov.

    Ok then, assuming your list is complete, I managed to find them all.  Thanks!
    Shouldn't there have been a way to re-trigger that notification pop-up?
    I downloaded and installed all of those apps from the App Store on my iPhone.  Everything was there and installed.  Now after doing a routine sync with iTunes, five of those apps are now showing as "Loading..." and "Waiting..." as if something re-triggered them to download and install again... this is weird... those were already installed.  And it should not have been iTunes that caused it since "Automatic Downloads" was activated and those apps were already in my iTunes Apps tab.

  • Storing shape information in table

    Hi All,
    I have a Program which displays shape (rectangle,oval,etc) in the panel which is enclosed in a frame.. shape can be dragged and dropped anywhere on panel... also one can delete shape... Now I Want To Store All The Exiting Shapes (as they are added on panel ) in some structure say a table, and alongwith it, i also want to store additional information about shape, say its location currently on panel, its present color, etc so that i can use this information later in the program... how do i do implement this ?? Plz Help Me.. It would be great if you include the changes in the source code itself...
    thanks
    Here is the source code :
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.ArrayList;
    public class ShapeDrawFrame extends javax.swing.JFrame {
        JCheckBoxMenuItem addLargeShapes;    
       JCheckBoxMenuItem addBorderedShapes; 
       JRadioButtonMenuItem red, green, blue,      
                            cyan, magenta, yellow, 
                            black, gray, white;  
       JPopupMenu popup;
        public ShapeDrawFrame() {
            super("Shape Draw");
            //initComponents();        
          ShapeCanvas canvas = new ShapeCanvas();
          setContentPane(canvas);
          /* Create the menu bar and the menus */
          JMenuBar menubar = new JMenuBar();
          setJMenuBar(menubar);
          JMenu addShapeMenu = new JMenu("Add");
          addShapeMenu.setMnemonic('A');
          menubar.add(addShapeMenu);
          JMenu shapeColorMenu = new JMenu("Color");
          shapeColorMenu.setMnemonic('C');
          menubar.add(shapeColorMenu);
          JMenu optionsMenu = new JMenu("Options");
          optionsMenu.setMnemonic('O');
          menubar.add(optionsMenu);
          /* Create menu items for adding shapes to the canvas,
             and add them to the "Add" menu.  The canvas serves
             as ActionListener for these menu items. */     
          JMenuItem rect = new JMenuItem("Rectangle");
          rect.setAccelerator( KeyStroke.getKeyStroke("ctrl R") );
          addShapeMenu.add(rect);
          rect.addActionListener(canvas);
          JMenuItem oval = new JMenuItem("Oval");
          oval.setAccelerator( KeyStroke.getKeyStroke("ctrl O") );
          addShapeMenu.add(oval);
          oval.addActionListener(canvas);
          JMenuItem roundrect = new JMenuItem("Round Rect");
          roundrect.setAccelerator( KeyStroke.getKeyStroke("ctrl D") );
          addShapeMenu.add(roundrect);
          roundrect.addActionListener(canvas);
          /* Create the JRadioButtonMenuItems that control the color
             of a newly added shape, and add them to the "Color"
             menu.  There is no ActionListener for these menu items.
             The canvas checks for the currently selected color when
             it adds a shape to the canvas.  A ButtonGroup is used
             to make sure that only one color is selected. */
          ButtonGroup colorGroup = new ButtonGroup();
          red = new JRadioButtonMenuItem("Red");
          shapeColorMenu.add(red);
          colorGroup.add(red);
          red.setSelected(true);
          green = new JRadioButtonMenuItem("Green");
          shapeColorMenu.add(green);
          colorGroup.add(green);
          blue = new JRadioButtonMenuItem("Blue");
          shapeColorMenu.add(blue);
          colorGroup.add(blue);
          cyan = new JRadioButtonMenuItem("Cyan");
          shapeColorMenu.add(cyan);
          colorGroup.add(cyan);
          magenta = new JRadioButtonMenuItem("Magenta");
          shapeColorMenu.add(magenta);
          colorGroup.add(magenta);
          yellow = new JRadioButtonMenuItem("Yellow");
          shapeColorMenu.add(yellow);
          colorGroup.add(yellow);
          black = new JRadioButtonMenuItem("Black");
          shapeColorMenu.add(black);
          colorGroup.add(black);
          gray = new JRadioButtonMenuItem("Gray");
          shapeColorMenu.add(gray);
          colorGroup.add(gray);
          white = new JRadioButtonMenuItem("White");
          shapeColorMenu.add(white);
          colorGroup.add(white);
          /* Create the "Clear" menu item, and add it to the
             "Options" menu.  The canvas will listen for events
             from this menu item. */
          JMenuItem clear = new JMenuItem("Clear");
          clear.setAccelerator( KeyStroke.getKeyStroke("ctrl C") );
          clear.addActionListener(canvas);
          optionsMenu.add(clear);
          optionsMenu.addSeparator();  // Add a separating line to the menu.
          /* Create the JCheckBoxMenuItems and add them to the Options
             menu.  There is no ActionListener for these items because
             the canvas class will check their state when it adds a
             new shape. */
          addLargeShapes = new JCheckBoxMenuItem("Add Large Shapes");
          addLargeShapes.setSelected(true);
          optionsMenu.add(addLargeShapes);
          addBorderedShapes = new JCheckBoxMenuItem("Add Shapes with Border");
          addBorderedShapes.setSelected(true);
          optionsMenu.add(addBorderedShapes);
          optionsMenu.addSeparator();
          /* Create a menu for background colors, and add it to the
             "Options" menu.  It will show up as a hierarchical sub-menu. */
          JMenu background = new JMenu("Background Color");
          optionsMenu.add(background);
          background.add("Red").addActionListener(canvas);
          background.add("Green").addActionListener(canvas);
          background.add("Blue").addActionListener(canvas);
          background.add("Cyan").addActionListener(canvas);
          background.add("Magenta").addActionListener(canvas);
          background.add("Yellow").addActionListener(canvas);
          background.add("Black").addActionListener(canvas);
          background.add("Gray").addActionListener(canvas);
          background.add("White").addActionListener(canvas);
          /* Create the pop-up menu and add commands for editing a
             shape.  This menu is not used until the user performs
             the pop-up trigger mouse gesture on a shape. */
          popup = new JPopupMenu();
          popup.add("Delete Shape").addActionListener(canvas);
          popup.add("Bring to Front").addActionListener(canvas);
          popup.addSeparator();
          popup.add("Make Large").addActionListener(canvas);
          popup.add("Make Small").addActionListener(canvas);
          popup.addSeparator();
          popup.add("Add Black Border").addActionListener(canvas);
          popup.add("Remove Black Border").addActionListener(canvas);
          popup.addSeparator();
          popup.add("Set Color to Red").addActionListener(canvas);
          popup.add("Set Color to Green").addActionListener(canvas);
          popup.add("Set Color to Blue").addActionListener(canvas);
          popup.add("Set Color to Cyan").addActionListener(canvas);
          popup.add("Set Color to Magenta").addActionListener(canvas);
          popup.add("Set Color to Yellow").addActionListener(canvas);
          popup.add("Set Color to Black").addActionListener(canvas);
          popup.add("Set Color to Gray").addActionListener(canvas);
          popup.add("Set Color to White").addActionListener(canvas);
          /* Set the "DefaultCloseOperation" for the frame.  This determines
             what happens when the user clicks the close box of the frame.
             It is set here so that System.exit() will be called to end
             the program when the user closes the window. */
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          /* Set the size and location of the frame, and make it visible. */
          setLocation(20,50);
          setSize(550,420);
          show();       
       class ShapeCanvas extends JPanel
                         implements ActionListener, MouseListener, MouseMotionListener {
             // This class represents a "canvas" that can display colored shapes and
             // let the user drag them around.  It uses an off-screen images to
             // make the dragging look as smooth as possible.
          ArrayList shapes = new ArrayList();
               // holds a list of the shapes that are displayed on the canvas
          ShapeCanvas() {
               // Constructor: set background color to white
               // set up listeners to respond to mouse actions
             setBackground(Color.white);
             addMouseListener(this);
             addMouseMotionListener(this);
          public void paintComponent(Graphics g) {
               // In the paint method, all the shapes in ArrayList are
               // copied onto the canvas.
             super.paintComponent(g);  // First, fill with background color.
             int top = shapes.size();
             for (int i = 0; i < top; i++) {
                Shape s = (Shape)shapes.get(i);
                s.draw(g);
          public void actionPerformed(ActionEvent evt) {
                 // Called to respond to action events from the
                 // menus or pop-up menu.
             String command = evt.getActionCommand();
             if (command.equals("Clear")) {
                shapes.clear(); // Remove all items from the ArrayList
                repaint();
             else if (command.equals("Rectangle"))
                addShape(new RectShape());
             else if (command.equals("Oval"))
                addShape(new OvalShape());
             else if (command.equals("Round Rect"))
                addShape(new RoundRectShape());
             else if (command.equals("Red"))
                setBackground(Color.red);
             else if (command.equals("Green"))
                setBackground(Color.green);
             else if (command.equals("Blue"))
                setBackground(Color.blue);
             else if (command.equals("Cyan"))
                setBackground(Color.cyan);
             else if (command.equals("Magenta"))
                setBackground(Color.magenta);
             else if (command.equals("Yellow"))
                setBackground(Color.yellow);
             else if (command.equals("Black"))
                setBackground(Color.black);
             else if (command.equals("Gray"))
                setBackground(Color.gray);
             else if (command.equals("White"))
                setBackground(Color.white);
             else if (clickedShape != null) {
                    // Process a command from the pop-up menu.
                if (command.equals("Delete Shape"))
                   shapes.remove(clickedShape);
                else if (command.equals("Bring to Front")) {
                   shapes.remove(clickedShape);
                   shapes.add(clickedShape); 
                else if (command.equals("Make Large"))
                   clickedShape.setSize(100,60);
                else if (command.equals("Make Small"))
                   clickedShape.setSize(50,30);
                else if (command.equals("Add Black Border"))
                   clickedShape.setDrawOutline(true);
                else if (command.equals("Remove Black Border"))
                   clickedShape.setDrawOutline(false);
                else if (command.equals("Set Color to Red"))
                   clickedShape.setColor(Color.red);
                else if (command.equals("Set Color to Green"))
                   clickedShape.setColor(Color.green);
                else if (command.equals("Set Color to Blue"))
                   clickedShape.setColor(Color.blue);
                else if (command.equals("Set Color to Cyan"))
                   clickedShape.setColor(Color.cyan);
                else if (command.equals("Set Color to Magenta"))
                   clickedShape.setColor(Color.magenta);
                else if (command.equals("Set Color to Yellow"))
                   clickedShape.setColor(Color.yellow);
                else if (command.equals("Set Color to Black"))
                   clickedShape.setColor(Color.black);
                else if (command.equals("Set Color to Gray"))
                   clickedShape.setColor(Color.gray);
                else if (command.equals("Set Color to White"))
                   clickedShape.setColor(Color.white);
                repaint();
          } // end actionPerformed()
          void addShape(Shape shape) {
                 // Add the shape to the canvas, and set its size, color
                 // and whether or not it should have a black border.  These
                 // properties are determined by looking at the states of
                 // various menu items.  The shape is added at the top-left
                 // corner of the canvas.
             if (red.isSelected())
                shape.setColor(Color.red);
             else if (blue.isSelected())
                shape.setColor(Color.blue);
             else if (green.isSelected())
                shape.setColor(Color.green);
             else if (cyan.isSelected())
                shape.setColor(Color.cyan);
             else if (magenta.isSelected())
                shape.setColor(Color.magenta);
             else if (yellow.isSelected())
                shape.setColor(Color.yellow);
             else if (black.isSelected())
                shape.setColor(Color.black);
             else if (white.isSelected())
                shape.setColor(Color.white);
             else
                shape.setColor(Color.gray);
             shape.setDrawOutline( addBorderedShapes.isSelected() );
             if (addLargeShapes.isSelected())
                shape.reshape(3,3,100,60);
             else
                shape.reshape(3,3,50,30);
             shapes.add(shape);
             repaint();
          } // end addShape()
          // -------------------- This rest of this class implements dragging ----------------------
          Shape clickedShape = null;  // This is the shape that the user clicks on.
                                      // It becomes the draggedShape is the user is
                                      // dragging, unless the user is invoking a
                                      // pop-up menu.  This variable is used in
                                      // actionPerformed() when a command from the
                                      // pop-up menu is processed.
          Shape draggedShape = null;  // This is null unless a shape is being dragged.
                                      // A non-null value is used as a signal that dragging
                                      // is in progress, as well as indicating which shape
                                      // is being dragged.
          int prevDragX;  // During dragging, these record the x and y coordinates of the
          int prevDragY;  //    previous position of the mouse.
          public void mousePressed(MouseEvent evt) {
                // User has pressed the mouse.  Find the shape that the user has clicked on, if
                // any.  If there is no shape at the position when the mouse was clicked, then
                // ignore this event.  If there is then one of three things will happen:
                // If the event is a pop-up trigger, then the pop-up menu is displayed, and
                // the user can select from the pop-up menu to edit the shape.  If the user was
                // holding down the shift key, then bring the clicked shape to the front, in
                // front of all the other shapes.  Otherwise, start dragging the shape.
             if (draggedShape != null) {
                  // A drag operation is already in progress, so ignore this click.
                  // This might happen if the user clicks a second mouse button before
                  // releasing the first one(?).
                return;
             int x = evt.getX();  // x-coordinate of point where mouse was clicked
             int y = evt.getY();  // y-coordinate of point
             clickedShape = null;  // This will be set to the clicked shape, if any.
             for ( int i = shapes.size() - 1; i >= 0; i-- ) { 
                    // Check shapes from front to back.
                Shape s = (Shape)shapes.get(i);
                if (s.containsPoint(x,y)) {
                   clickedShape = s;
                   break;
             if (clickedShape == null) {
                   // The user did not click on a shape.
                return;
             else if (evt.isPopupTrigger()) {
                  // The user wants to see the pop-up menu
                popup.show(this,x-10,y-2);
             else if (evt.isShiftDown()) {
                  // Bring the clicked shape to the front
                shapes.remove(clickedShape);
                shapes.add(clickedShape);
                repaint();
             else {
                  // Start dragging the shape.
                draggedShape = clickedShape;
                prevDragX = x;
                prevDragY = y;
          public void mouseDragged(MouseEvent evt) {
                 // User has moved the mouse.  Move the dragged shape by the same amount.
             if (draggedShape == null) {
                    // User did not click a shape.  There is nothing to do.
                return;
             int x = evt.getX();
             int y = evt.getY();
             draggedShape.moveBy(x - prevDragX, y - prevDragY);
             prevDragX = x;
             prevDragY = y;
             repaint();      // redraw canvas to show shape in new position
          public void mouseReleased(MouseEvent evt) {
                 // User has released the mouse.  Move the dragged shape, and set
                 // draggedShape to null to indicate that dragging is over.
                 // If the shape lies completely outside the canvas, remove it
                 // from the list of shapes (since there is no way to ever move
                 // it back on screen).  However, if the event is a popup trigger
                 // event, then show the popup menu instead.
             if (draggedShape == null) {
                   // User did not click on a shape. There is nothing to do.
                return;
             int x = evt.getX();
             int y = evt.getY();
             if (evt.isPopupTrigger()) {
                   // Check whether the user is trying to pop up a menu.
                   // (This should be checked in both the mousePressed() and
                   // mouseReleased() methods.)
                popup.show(this,x-10,y-2);
             else {
                draggedShape.moveBy(x - prevDragX, y - prevDragY);
                if ( draggedShape.left >= getSize().width || draggedShape.top >= getSize().height ||
                        draggedShape.left + draggedShape.width < 0 ||
                        draggedShape.top + draggedShape.height < 0 ) {  // shape is off-screen
                   shapes.remove(draggedShape);  // remove shape from list of shapes
                repaint();
             draggedShape = null;  // Dragging is finished.
          public void mouseEntered(MouseEvent evt) { }   // Other methods required for MouseListener and
          public void mouseExited(MouseEvent evt) { }    //              MouseMotionListener interfaces.
          public void mouseMoved(MouseEvent evt) { }
          public void mouseClicked(MouseEvent evt) { }
       }  // end class ShapeCanvas
       // ------- Nested class definitions for the abstract Shape class and three -----
       // -------------------- concrete subclasses of Shape. --------------------------
       static abstract class Shape {
             // A class representing shapes that can be displayed on a ShapeCanvas.
             // The subclasses of this class represent particular types of shapes.
             // When a shape is first constructed, it has height and width zero
             // and a default color of white.
          int left, top;      // Position of top left corner of rectangle that bounds this shape.
          int width, height;  // Size of the bounding rectangle.
          Color color = Color.white;  // Color of this shape.
          boolean drawOutline;  // If true, a black border is drawn on the shape
          void reshape(int left, int top, int width, int height) {
                // Set the position and size of this shape.
             this.left = left;
             this.top = top;
             this.width = width;
             this.height = height;
          void setSize(int width, int height) {
                // Set the size of this shape
             this.width = width;
             this.height = height;
          void moveBy(int dx, int dy) {
                 // Move the shape by dx pixels horizontally and dy pixels vertically
                 // (by changing the position of the top-left corner of the shape).
             left += dx;
             top += dy;
          void setColor(Color color) {
                 // Set the color of this shape
             this.color = color;
          void setDrawOutline(boolean draw) {
                 // If true, a black outline is drawn around this shape.
             drawOutline = draw;
          boolean containsPoint(int x, int y) {
                // Check whether the shape contains the point (x,y).
                // By default, this just checks whether (x,y) is inside the
                // rectangle that bounds the shape.  This method should be
                // overridden by a subclass if the default behavior is not
                // appropriate for the subclass.
             if (x >= left && x < left+width && y >= top && y < top+height)
                return true;
             else
                return false;
          abstract void draw(Graphics g); 
                // Draw the shape in the graphics context g.
                // This must be overridden in any concrete subclass.
       }  // end of class Shape
       static class RectShape extends Shape {
             // This class represents rectangle shapes.
          void draw(Graphics g) {
             g.setColor(color);
             g.fillRect(left,top,width,height);
             if (drawOutline) {
                g.setColor(Color.black);
                g.drawRect(left,top,width,height);
       static class OvalShape extends Shape {
              // This class represents oval shapes.
          void draw(Graphics g) {
             g.setColor(color);
             g.fillOval(left,top,width,height);
             if (drawOutline) {
                g.setColor(Color.black);
                g.drawOval(left,top,width,height);
          boolean containsPoint(int x, int y) {
                // Check whether (x,y) is inside this oval, using the
                // mathematical equation of an ellipse.
             double rx = width/2.0;   // horizontal radius of ellipse
             double ry = height/2.0;  // vertical radius of ellipse
             double cx = left + rx;   // x-coord of center of ellipse
             double cy = top + ry;    // y-coord of center of ellipse
             if ( (ry*(x-cx))*(ry*(x-cx)) + (rx*(y-cy))*(rx*(y-cy)) <= rx*rx*ry*ry )
                return true;
             else
               return false;
       static class RoundRectShape extends Shape {
              // This class represents rectangle shapes with rounded corners.
              // (Note that it uses the inherited version of the
              // containsPoint(x,y) method, even though that is not perfectly
              // accurate when (x,y) is near one of the corners.)
          void draw(Graphics g) {
             g.setColor(color);
             g.fillRoundRect(left,top,width,height,width/3,height/3);
             if (drawOutline) {
                g.setColor(Color.black);
                g.drawRoundRect(left,top,width,height,width/3,height/3);
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                         
        private void initComponents() {
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 400, Short.MAX_VALUE)
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 300, Short.MAX_VALUE)
            pack();
        }// </editor-fold>                       
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new ShapeDrawFrame().setVisible(true);
        // Variables declaration - do not modify                    
        // End of variables declaration                  
    }

    Kartik_Nibjiya wrote:
    I Want To Keep Track Of Each Shape Throughout as long as i dont exit my program and Each Of Its Individual Properties... How Do I DO That ??Well, in your programm you have the structure "shapes" where you keep track of each shape object containing each of its induvidual properties. So I don't understand what else you might want.

  • E61 and CR-47 in-car handsfree issues

    Compatability issues:
    I've just installed the CR-47 handsfree holder for the E61 in my Mini and connected the antenna, replacing a previous holder for smaller 6100 pop port Nokia. However, now when the E61 is firmly in the holder it charges but when making a call does not automatically turn the radio off and go through the car speaker system etc, so you can't talk to the other caller. But if I put my old Nokia into the CR-47 it works beautifully.
    Could there be a problem with the setup of my E61 which is preventing connection? It seems that the E61 cannot trigger the correct Pop-Port connector for routing through the car kit - very silly.
    I'm afraid I don't know which car kit it is, but I do know that it was professionally fitted with cable runs through the structure of the car and all wired up to the in-car entertainment system etc.
    There is also an indicator in the top righthand corner of the screen - a tray with an arrow pointing upwards. What does this mean, I can't find it in the manual?
    I don't see how Nokia can sell this cradle for the E61 with a Pop-Port interface when it won't interact with the handsfree functions except for charging.
    Thanks guys!

    It sounds like you have a cark-126 car kit which has old software and limited compatabillity, you will need to upgrade this to a ck-7w. you can identify a cark-126 if the pop port plug going into the bottom of the cradle is rubber, has no nokia makings & has small slits to the bottom.
    Danny b
    Nokia Accredited Installer
    If my answers help you, give me a Kudos. Its like a pat on the back.

  • E61 and CR-47 in-car handsfree problems

    I've just installed the CR-47 handsfree holder for the E61 in my Mini and connected the antenna, replacing a previous holder for smaller 6100 pop port Nokia. However, now when the E61 is firmly in the holder it charges but when making a call does not automatically turn the radio off and go through the car speaker system etc, so you can't talk to the other caller. But if I put my old Nokia into the CR-47 it works beautifully.
    Could there be a problem with the setup of my E61 which is preventing connection? It seems that the E61 cannot trigger the correct Pop-Port connector for routing through the car kit - very silly.
    I'm afraid I don't know which car kit it is, but I do know that it was professionally fitted with cable runs through the structure of the car and all wired up to the in-car entertainment system etc.
    There is also an indicator in the top righthand corner of the screen - a tray with an arrow pointing upwards. What does this mean, I can't find it in the manual?
    I don't see how Nokia can sell this cradle for the E61 with a Pop-Port interface when it won't interact with the handsfree functions except for charging.
    Thanks guys!

    OK, it might not be the CARK-126. The Mini is 2002 registered so it could be a different kit. All I know is that the kit is all plugged in behind the CD player with the microphone coming out next to the drivers mirror.
    Could it be another car kit?
    Is there anything I can do to make it work at all?
    Can I change the wiring?
    Just seems like the E61 is unable to mute the system, but is able to charge and goes into car mode. Also, the other car kits that are compatable are bluetooth ones, so there is no need for the Pop-Port, so why have it except for charging!
    I basically want to be able to use the Pop-Port system and have the E61 work the same way the 6100 does.Message Edited by peab1 on 10-Aug-2006
    01:28 PM

  • View pages in Pages NOT side by side

    I received a large document in Pages. Unfortunately, I do not want the pages to be side by side, but rather one on top of another. Although I zoom in (like I would with Word), I cannot get them to go one on top of another.
    Unfortunately, I have to scroll side to side to get to the next page. It is currently showing two pages at a time.
    Any help on how to make this go away is greatly appreciated.
    Thanks,
    Phil

    If I understand well, the doc's author choose to display two pages side by side.
    To change that, trigger the View pop-up at the left bottom corner of the document's window.
    I guess that '*Two up*' is checked. Check '*One up*'.
    Yvan KOENIG (VALLAURIS, France) mercredi 21 avril 2010 19:17:38

  • Trying to create an input dialog box, that will halt execution

    I am trying to get a pop up dialog box to appear where the user will enter their name, after clicking OK or Cancel, i would like the code to continue executing.  For example when i use the Alert.show("1");Alert.show("2");Alert.show("3");  it appears as 3,2,1. Is it possible to fire one alter at a time AFTER the user has clicked Ok.
    Back to the originial question.
    I am setting up a Pop up menu
    var ret:String;
    var Dialog:SimpleTitleWindowExample =SimpleTitleWindowExample(PopUpManager.createPopUp( this, SimpleTitleWindowExample , true));
    ret = Dialog.Input      //where input is just a public text for example
    return ret;
    ^returns null.
    I was hoping it would wait until  it was closed to continue. I thought it would by setting the modal = true
    Essentially I'm asking is there a way to halt execution until the user inputs some text? Doesn't have to utilize the PopUpManager.
    Please help. I've spent 4 hours trying to tackle this.  I even tried to do a DoEvent (Visual Studio) type loop until the button was clicked or variable was no longer blank.

    I think you may alternately be able to listen for the removedFromStage event and react to that. In any case, you need some way of reacting to SampleTitleWindow closing (via an event listener), and only then trigger the next pop-up.

Maybe you are looking for

  • Editing a video in Photoshop cs6

    Hello All I'm using Photoshop cs6 version 13.0.1 x64. I saw that Is it possible to edit videos. My question, Is there a possibility that we can change the background of a video in order to create a green screen video? Regards Panos

  • Embeded Oc4j server not starting up in Jdeveloper 10g 10.1.3.0.3

    hi, I have created simle hello.jsp , but i try to run it with the embedded OC4j server i get the following error . C:\jdk1.4\bin\javaw.exe -client -classpath C:\jdev\j2ee\home\oc4j.jar;C:\jdev\jdev\lib\jdev-oc4j-embedded.jar -Dhttp.proxyHost=172.16.2

  • What's the best way to start over?

    Hi everyone, I bought a new internal HDD to replace my main drive that is failing. Other post of mine detail where I have been with issues but anyway... Here is my current HDD set up: Bay #1: The failing WD 1 TB Green (10.5.5) which is going back for

  • Browsers Crashing, both safari and chrome

    This is my error report: Process:         Google Chrome [285] Path:            /Applications/Google Chrome.app/Contents/MacOS/Google Chrome Identifier:      com.google.Chrome Version:         28.0.1500.95 (1500.95) Code Type:       X86 (Native) Paren

  • I bought an iPod touch 5th gen and it was recently stolen. Can I track it by its Serial Number?

    I haven't even had it for that long and it was stolen right out of my bag, It was really expensive and I have a lot of important info on it. Please help me find out if it is trackable so to speak.