Storing Vector information

Dear all,
Can any one suggest what is the best (I mean data type) way to store vector information (line, Pline) information into a oracle database. I am having average of 45 to 75 pair of X,Y coordinate for a pline.
Thanks In advance
Jesu.

1) Reference to Variable size as if it was a method.
Are you sure you get this? Where?
2) Method elementAt(int) not found in vector class.
your own Vector class hides java.util.Vector so you need to use java.util.Vector whenever you mean java.util.Vector and use Vector whenever you mean your own Vector class
3) Method addElement(Movie) not found in vector class.
same as above

Similar Messages

  • Use stored login information from Safari/Firefox etc in Flash Player standalone? (Mac)

    I play a flash game called FFR (Flash Flash Revolution). It uses a login system to keep track of scores and ranks from the songs I play. On my late model eMac It's very laggy in-browser, even on low quality. I downloaded the Flash Player 9 stand alone and it runs smooth, however it doesn't use my stored login information from Safari/Firefox (or IE5 for that matter) Like Windows does. Is there any way to fix this?

    Anyone?

  • I've stored login information for many sites but on some sites I've to login manually. What to do?

    I'd stored login information for Facebook. Earlier firefox used to fill in the login information but now it doesn't . What to do?

    You could try going into settings, Safari, auto fill then turn on names and passwords.

  • Where are stored the informations of the ADF structures?

    I'm working with ADF tecnology and JSP.
    I'm in a browse page in update phase on the View Object A and I need open (with an html anchor <a href... ) another browser page in which are displayed data of another View Object B.
    coming back on the first browse page, when I try to submit the modify data in the View Object A, I've observed that I lose the DataControls that I had previously for this context, in particular the result of ctx.getBindingContext().findDataControl("AppModuleDataControl") is null.
    How can I reobtain the value of the DataControls of the first browse page on update phase?
    How can I reobtain all the context? where are stored the informations of the ADF structures(session, request...)?
    thanks
    Francesca Brucciani

    I believe it is stored in the registry setting:
    HKey_Current_User\Software\Microsoft\Office\15.0\MS Project\Options
    Julie

  • Print postscript files from flash cs3 to get vector information

    I've been playing around with some dynamic flash paintings
    and would like to export the vector information. I've tried
    choosing "print--save pdf--save pdf as postscript" I installed
    Adobe's PS drivers. I set up a virtual printer on localhost using
    AdobeDistiller. This is not working for me.
    I witnessed flash exporting vector information this way on a
    pc, but can't seem to get this working on a mac. The pc user
    downloaded and installed postscript drivers from Adobe and used a
    similar method.
    I'm on Mac OS 10.4.11
    Any ideas? This has been frustrating me for some time.
    Thanks ahead of time for the help!

    There are several ways to do this.
    The easiest one, I think, is exporting a FLV file from the Render Queue, picking in the Outpit Module one of the "Same as source (Flash 8 and Higher)" FLV presets, modified manually just to enable the "Encode Alpha Channel" checkbox.
    Because of a known limitation in the Flash authoring app, which can only handle embedded transparency information correctly when done in a certain way, it's strongly recommended after settting the FLV encoding options that you set the "Color" menu in the Output Module to "Straight (Unmatted)". Otherwise you may get ugly halos around certain elements.

  • Error storing authorisation information

    I recently installed iTunes on my new computer, but when I want to purchase a song or even play a preview I get to following error message:
    "An error occured storing authorisation information on your computer."
    I tried reinstalling iTunes to no avail.
    This is getting quite annoying because I also can't play previously purchased songs anymore.
    Thanks in advance for any insights.

    Ok, finally I solved it (for me that is);
    1.First go to the folder:
    C:\Documents and Settings\All Users\Application Data\Apple Computer\iTunes\SC Info
    2.Then:
    In Windows Explorer, go to Tools/Folder Options/View, then
    scroll down and remove the checkmark on the "Use Simple File Sharing..." option. Windows XP (pro) use simple file sharing by default. You have more control without it.
    Now go to the folder you want to share, right-click and select the "sharing and security" option, select the "share this folder" radio button, click "maximum allowed", click "Permissions" and make sure to select the permissions to the user or group you want. I would select Full Control to Everyone first just to make sure it works.
    On the "security" tab, allow everything!
    Now iTunes is allowed to save authorisation information on your system!

  • Error Storing Authorization Information?

    Recently, I decided to make my usual log in account a non-administrative account. Now when I try and purchase music from the iTunes music store, I receive the below message about the "required file" not being found or having a permission error. I ran repair permission without effect. When I change my account back to administrator status, the error does not appear, so I assume that I need to change the read/write permissions for the file that stores the authorization information. Anyone know where this file is (hidden?) and how I can correct this error?
    Thanks
    "There was an error storing your authorization information on this computer.
    The required file was not found or has permissions error. Correct this permissions problem and try again, or deauthorize this computer if the permissions cannot be changed."

    Authorization information is stored in the 'SC Info.sidb' file in the 'SC Info' folder (hidden) inside ./Users/Shared.
    Your Shared folder might not have the correct permission.
    This article mentions which permissions it should have:
    iTunes: Missing Shared Folder May Prevent Authorization
    Hope this helps.
    M
    17' iMac fp 800 MHz 768 MB RAM   Mac OS X (10.3.9)   Several ext. HD (backup and data)

  • Issue with storing authorization information, trying to start Home Sharing

    I am currently attempting to set 'Home Sharing' up on my iTunes so that I will be able to share music and videos between two computers in my household. Both computers are on the same network, my home network. When I attempt to start Home Sharing, the following phrase pops up after putting in my iTunes username and password:
    "There was an error storing your authorization information on this computer." (followed by other writing)
    If anyone can help me to correct this issue and to start my Home Sharing it would be greatly appreciated.

    Hello \'CUSE FAN,
    I would recommend taking a look through the following article.
    Troubleshooting Home Sharing
    http://support.apple.com/kb/TS2972
    Cheers,
    Allen

  • Storing user information into session best practice.

    I am developing an web application where user first have to login to be able to enter.
    When user correctly logged in an UserAccount object with all user data (except loginName and Password) is being stored into session. An Filter is checking session for UserAccount object and if user correctly logged in forwards the request to the next filter in the application.
    When user logged out, the session object is being destroyed. �Session invalidate()�
    I would like to know if there are better solutions for this.
    Thank you in advance.
    --Nermin B.

    You may want to also re-evaluate your "application" as a whole.
    In most cases - yours may be the exception - session objects are used to well, associate a particular web browser with a particular user. There usually is little need to retain additional information about that person, unless that information is frequently accessed. I think Shok used a poor example; a person's address, phone number, credit card number and so on is usually accessed once per visit, whereas the contents of that person's shopping cart is generally accessed every time the user changes web pages.
    The key concept here is you want to balance memory consumption verses database hits (or file i/o). Authorization info should be in the object, whereas general background info can be in the data source and accessed when needed.
    If on the other hand, you don't have a data source, you don't really have much of a choice and a session object (or similarly, a JavaBean) should just go ahead and contain all of the information about the user.
    To change the subject, session objects and JavaBeans are server side. As long as you keep a careful eye on the interfaces to those objects, you should be fine security wise. For example, if a person passes a parameter to your web page, make sure the parameter is anticipated and correct before you save it in the object. In other words, don't write a generic function that blindly accepts parameter names and values and sets them accordingly within the session object. The only place you should be able to set the password attribute is from the change-your-password JSP page.
    Cookies on the other hand are definitely stored on the client's machine, and yes, you want to be really paranoid and make sure that the cookie you are retrieving is the cookie you are expecting. I think the source of confusion is that session ids corresponding to session objects can be stored within a cookie - so you if can change the id, the server thinks you are someone else and uses that person's session object.

  • Best practise for storing lead information

    Hi all
    I'm running a qualification process by using a lead assessment script. Via this script our reps ask the potential customer 8 questions and a score is calculated.
    Now the reps will begin the process of converting the leads into opportunities - in a prioritized order based on the assessment script score.
    Then information which is entered in the assessment script is stored in 8 fields in the lead record and is relevant to a single department in a hospital (fx anesthesia). This information is very valuable to us in the future - because it tells us a lot about the leads potential for buying other products.
    Now I want to make sure that this information is passed on in the most appropriate way when leads are converted to opportunities, contacts and accounts. My first thought was to create the 8 new fields in the opportunity record type and contact record type and map the lead conversion to these fields. By second thought this would provide me with a lot of redundant data. Also the data will be updated regularly - which will cause problems with that solution.
    Another option is to display the 8 lead fields as related information on the opportunity and contact record detail page. Or I could pass over the data to the contact record and tell the reps that this is where it should be updated in the future.
    I'm pretty new to OnDemand so I might not be on the right track here!? Any help will be very much appreciated :-)
    Regards,
    Allan

    Allan, once the lead is converted the lead record (with your 8 fields) is available as a related record under the opportunity and contact records. This allows you to make any updates to these fields without having to do it multiple times if you were to map them during lead conversion.

  • In 2007, I stored some information on a disk, as it was too sensitive to remain on my computer. Now the disk shows it was a .cwk file and I cannot open it. I've tried several things, but I've gotten messages that it isn't a pages, numbers or presentation

    In 2007, I stored some sensitive information on a disk rather than leave it on my computer. Now, in the latest version of Pages, I cannot read the disk, although accessing the information could save me days of work duplicating it. Is there a way of reading/converting the disk?

    By 'cannot read the disk' I assume you mean that you can access the file but cannot open it (if you couldn't read the disk you wouldn't be able to see the file in the first place).
    As you have found, the latest Pages does not open Appleworks documents. If you had the earlier version of Pages and upgraded, the older version is still in the iwork '09 folder in your Applications folder and that version pf Pages will open AW Word Processing documents (which presumably that is).
    Failing that, Panergy Software's docXConverter v3.2 ($19.95) can convert Appleworks 5 and 6 Word Processing documents to RTF (though it has been reported that it can only handle documents which contain only text, not those which include images or frames). The latest version of the free LibreOffice can open AppleWorks 6 Word Processing documents and an ability to open ClarisWorks documents has been reported: it does appear to be able to handle at least some embedded images.

  • Storing Vector Application Scope - Pressed for time

    I'm reading in a file through my application and right now every time a user goes to the page, the file is being read in and parsed etc etc to be formatted for display. Now, I know this can hamper performance dramatically as the users increase, and I want to be able to make this task work optimally.
    The file is also being updated through FTP every 15 minutes, and I want to be able to have the correct version read in when a user accesses the page. My first question is whether this is a good way of going about getting and presenting the information?
    Secondly, I want to somehow store the Vector of lines from the file globally so that all the users can use it. I want to store the Vector, and a timestamp consisting of the file's last modification date in order to do a check of whether to access the current Vector, or read in the file again and refresh the timestamp all across the application (so the one user to be reading the file during the time that a new file comes in will update it for all other users). What's the best way to go about doing this?
    *** Also - If you are familiar with tags, I'd like to know how I can add this functionality to my current tags (one which reads the file, and the other which displays the Vector of lines). I'm not sure how to have the tag just read in session attributes, or just variables that reside on the page.
    I really really appreciate your time and help in this matter,
    Thank you,
    Lior

    Caches for all the users. Unfortunately since the code is proprietary, I cannot send you the actual code. But here are the steps to do it:
    in web.xml do this:
    1.
    <servlet>
    <servlet-name>ReadfileServlet</servlet-name>
    <servlet-class>somepackage.BootstrapServlet</servlet-class>
    <init-param>
    <param-name>FilePath</param-name>
    <param-value>c:\filetoread</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    2.
    Create a Global class (say GlobalVariables) which has a member variable (say m_FileContent) and static synchronized set/get methods for the member variable.
    3.
    In ReadFileServlet's init method,
    Read the file specified in FilePath. Then assign it to a servlet member variable (why do you neeed a vector? why not a String?)
    Then assign this member variable to the Global class's member variable using the set method (GlobalVariables.setVariable(variable)).
    4.
    From any jsp use variable = GlobalVariables.getVariable().
    Hope this helps.
    -Srini

  • Storing TimeZone information in SQLServer

    Hi Folks,
    I have a requirement to store/retrive the date, time and timezone
    information of a realtime captured data that has an associated
    timezone into the sqlserver database.
    Another catch is, i want to achieve this using JDBC. So here are my
    questions :
    1. What datatypes in sqlserver database table, can store the
    specified timezone information as well.
    2. What JDBC calls i need to make to store/retrieve the date tiwjt
    the timezone data as well
    I am sure some one came across this problem and there must be a
    solution
    All the responses are greatly appreciated.
    Thanks
    Sri

    The first thing is to determined if the requrement says you are supposed to store the timezone or use the timezone when storing.
    The two are not the same.
    And if the former then if it was me I would question the requirement itself. That is because humans will not be able to use the mixed timezone info and computers certainly will not. For example consider what happens when someone wants to look a results between 11:00 am and 12:00 am. So you return all of the results, but then display each with the correct timezone. And it looks like the results are spread all over the place. (Not to mention that when you order the returned results it will not look correct to the human.)
    At any rate the correct way is to store the date/time as a timestamp - which is the only way databases store date/time anyway. Then store the timezone in a varchar field. The timezone in java will be based on UMT although in the database it might be something different (although will not matter to you.)
    You must NOT store different timezones into the date/time fields. Doing so will make it impossible to sort or to retrieve based on time ranges.

  • Security of storing sensitive information in an encrypted sparse image.

    Is it a good idea to put sensitive information, passwords and bank account details etc, in a sparse image?
    I know there will always be a risk with keeping information in a digital form, but I'm beginning to wonder if I'm being more careless than I first thought.
    My password is pretty good, using 256 AES encryption.
    Inside the sparse image I have several text documents (*.rtf), in which my information is stored. Maybe information in these files is somehow cached to a non-encrypted part of the hard drive. Maybe sparse-images and the implementation of AES encryption that Apple use is not suitable for such sensitive information...
    I would appreciate your thoughts on the matter, and of course any advice as to how better to store passwords digitally
    Phil.

    Hi Phil;
    I suggest you get 1Password. It will allow you to keep all of your sensitive data in an encrypted database. If also has some very nice features to sync which other devices.
    Allan

  • 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.

Maybe you are looking for