Table shape

Hello! I am wondering if there is a way to change a cell, or
tables, shape. I am wanting to change the shape of a cell from a
rectangle to a rectangle with rounded corners. Or if there is
another way to help with this:
The text on my site will be written in a column, and will be
updated regularly so the cell which contains the text will need to
change in length quite often. I would like to place this text on a
background different from the webpages background, so I applied an
image as the background to the cell the text is written in.
The background is a rectangle of color with smooth rounded
edges on all four corners. But if I add more text so that the
column expands then the background will repeat itself and instead
of 4 corners I end up with 6 or more depending on how long the
column is.

You have to use images to do this. Everything on the web is
rectangles with
90 degree angles.
Think of it this way. You have images of each of the 4
corners. You also
have am image of a horizontal line that matches the corners,
and one of a
similar vertical line.
Make a 9-cell table. Put the corner images in each of the 4
corner cells.
Make the middle cells on each side have the corresponding
line image as a
background image. You are DONE! 8)
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"Shinster9" <[email protected]> wrote in
message
news:emmpp0$jr0$[email protected]..
> Hello! I am wondering if there is a way to change a
cell, or tables,
> shape. I
> am wanting to change the shape of a cell from a
rectangle to a rectangle
> with
> rounded corners. Or if there is another way to help with
this:
>
> The text on my site will be written in a column, and
will be updated
> regularly
> so the cell which contains the text will need to change
in length quite
> often.
> I would like to place this text on a background
different from the
> webpages
> background, so I applied an image as the background to
the cell the text
> is
> written in.
>
> The background is a rectangle of color with smooth
rounded edges on all
> four
> corners. But if I add more text so that the column
expands then the
> background
> will repeat itself and instead of 4 corners I end up
with 6 or more
> depending
> on how long the column is.
>

Similar Messages

  • Inserting text into table cells in Powerpoint

    Hi
    I have a named table ClientInfo on Slide 3 in Powerpoint. How can I programmatically insert text into the table's cells?
    Thanks
    Regards

    Hi Yahya,
    What did you mean named table? Did you mean the name of shape?
    If I understood correctly, we can use table object to manipulate a table shape on a slide. And here is a sample to insert text into the first cell for your reference:
    Application.ActivePresentation.Slides(3).Shapes("ClientInfo").Table.Cell(1, 1).Shape.TextFrame.TextRange.Text = "Hello"
    Also here are some helpful links for learning PowerPoint developing:
    How do I... (PowerPoint 2013 developer reference)
    Object model reference (PowerPoint 2013 developer reference)
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Rounded border in table but rectangle lines still visible

    How can I show only the rounded outline of a table? I've selected rounded border, and that shows up, but so does the rectangle of the table shape. Is there a way to get rid of that so that only the rounded border shows? The rounded border works perfectly for a text box.

    For each corner cell in the table set the border edges to 'None'.

  • Load table from xml

    Hi all
    Please see attach that I send ,, this is vi that write and read from xml file ,, my problem is when I press on load ??
    If you can see that I saved a table data  , I want if I press on load bottom  all the data loaded on the screen  in table shape as table control
    Who can I do that
    Note : press on set limit to save into xml file
    Thanks
    Attachments:
    loadTable.vi ‏28 KB

    Hi elyan
    As i can see you still have problems with xml files
    The for loop is not neened. Just delete it.
    At write buid an array, so at read you can select 1st element.
    At Unflatten from xml, wire a 2D array at "type" input.
    You  must have a look at basic Labview tutorials...

  • Determining the row id or primary key columns and values genericaly

    Hi There
    Does anyone perhaps know how to determine the rowid of the
    currently selected row in a form, or alternatively the primary
    key values/columns?
    Regards
    Herman

    Hi Tranen,
    you can view the constraints and respective columns by setting the
    Table Shape Properties in the Property Inspector.
    Select (all) the tables on the Diagram you want
    In the Property Inspector,under Constraints -Set the 'Show Constraint Columns' to 'True',
    Set 'Show Constraints' to 'True' .
    Constraints (PK,UK,FK,Check)
    Also Set the 'Show Columns' option to 'False' .This will be under display options in the Property inspector.
    This should modify the Table shape in the diagram as follows:
    <Table name>
    <PK> PKName:Column1,Column2
    <UK>UKName:Column3
    <FK>FKname:Column1
    are you looking for the same?
    Thanks.

  • How can I customize a Pages template to include a photo frame and text area?

    I am putting together a reference notebook for volunteers at our local zoo.
    I am attempting to format every info sheet the same. Each page will include a photo of the featured creature along with text including description, feeding habits, range etc.
    The only program I have to publish with is Pages. I've tried to put in a "photo box" so that each photo is the same size and in the same location on the page etc. I just can't seem to find all the tools I need to do this.
    I'd appreciate some guidance. Thanks so much.

    You need to create your own default template. Open the blank template & insert a photo, any photo. Now select the photo & resize it using the metrics inspector. Now, with photo selected, go to Format > Advanced & select Define as Media Placeholder. Then again go to Format > Advanced & select define as default image style. While you're at it set the amount of extra space in the wrap inspector, etc. You can do similar settings with text boxes, tables, shapes, etc.
    I suggest downloading the Pages User Guide from the Help menu & reading more about placeholders & about capturing pages (sorry, it's not something I can remember doing).

  • [SOLVED] Show only primary key columns in database diagrams

    Hi,
    I'd like to create a database diagram with some tables hiding all the columns that aren't primary key or foreign key.
    Currently the only way that I've found is right click on the column's name (in the table body visualized into the diagram) --> Hide selected shape
    I've found the option that permits to visualize the constraint name and (optionally) the relative fields on the same row but what I'd like is something like:
    <Table name>
    <column_name> PK
    <column_name> PK
    <column_name> FK1
    <column_name> FK2
    Do you know a way to do this?
    Many thanks
    Best regards
    Message was edited by:
    Tranen

    Hi Tranen,
    you can view the constraints and respective columns by setting the
    Table Shape Properties in the Property Inspector.
    Select (all) the tables on the Diagram you want
    In the Property Inspector,under Constraints -Set the 'Show Constraint Columns' to 'True',
    Set 'Show Constraints' to 'True' .
    Constraints (PK,UK,FK,Check)
    Also Set the 'Show Columns' option to 'False' .This will be under display options in the Property inspector.
    This should modify the Table shape in the diagram as follows:
    <Table name>
    <PK> PKName:Column1,Column2
    <UK>UKName:Column3
    <FK>FKname:Column1
    are you looking for the same?
    Thanks.

  • Grid view  border urgent help plz guys

    i am trying to have 5 rows and 6 colums in a grid view
    but the problem is i cannot set any border for the gird view.
    please tell me how to set a border for a GRID layout in javafx
    even in jfxtras i couldn't manage to set any border for a grid.
    there is a border property but i can't it' not working. please help me out on this issue.

    What I would do is to create a class that represents a day in the calendar (rectangle + day + task), and use a layout to arrange them (all the days) on a table shape.
    May this example help you to start (I'm using Tile layout instead of Grid layout):
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.paint.Color;
    import javafx.scene.CustomNode;
    import javafx.scene.Node;
    import javafx.scene.shape.Rectangle;
    import javafx.scene.layout.Tile;
    import javafx.scene.layout.Stack;
    import javafx.scene.control.Label;
    import javafx.scene.layout.LayoutInfo;
    import javafx.geometry.HPos;
    import javafx.scene.layout.VBox;
    import javafx.scene.text.Font;
    import javafx.scene.paint.LinearGradient;
    import javafx.scene.paint.Stop;
    class Day extends CustomNode{
        public-init var number: Integer;
        public-init var task: String;
        public override function create(): Node{
            Stack{
                content:[
                    Rectangle {
                        width: 75, height: 50
                        fill: LinearGradient {
                            startX: 0.0
                            startY: 0.0
                            endX: 0.0
                            endY: 1.0
                            stops: [
                                Stop {
                                    color: Color.WHITESMOKE
                                    offset: 0.0
                                Stop {
                                    color: Color.SILVER
                                    offset: 1.0
                        stroke: Color.BLACK
                    VBox{
                        content:[
                            Label {
                                text: number.toString()
                                textFill: Color.rgb(100,0,0)
                                font: Font{ size: 16 }
                            Label{
                                text: task
                                font: Font{ size: 10 }
                        spacing: 8
                        nodeHPos: HPos.CENTER
                        layoutInfo: LayoutInfo{ hfill: false, vfill: false }
    Stage {
        title: "MyCalendar"
        scene: Scene {
            width: 600
            height: 500
            content: [
              Tile {
                columns: 7
                content: [
                    Day{number: 1, task: ""},
                    Day{number: 2, task: ""},
                    Day{number: 3, task: "Anne's Birthday"},
                    Day{number: 4, task: ""},
                    Day{number: 5, task: ""},
                    Day{number: 6, task: ""},
                    Day{number: 7, task: "Buy a new TV"},
                    Day{number: 8, task: ""},
                    Day{number: 9, task: ""},
                    Day{number: 10, task: ""},
                    Day{number: 11, task: ""},
                    Day{number: 12, task: "Go theater"},
                    Day{number: 13, task: ""},
                    Day{number: 14, task: ""},
                    Day{number: 15, task: ""},
                    Day{number: 16, task: ""},
                    Day{number: 17, task: "Pay bills"},
                    Day{number: 18, task: ""},
                    Day{number: 19, task: "Pay more bills :("},
                    Day{number: 20, task: ""},
                    Day{number: 21, task: ""},
                    Day{number: 22, task: ""},
                    Day{number: 23, task: ""},
                    Day{number: 24, task: ""},
                    Day{number: 25, task: ""},
                    Day{number: 26, task: ""},
                    Day{number: 27, task: "Suzy's OrgyParty"},
                    Day{number: 28, task: ""},
                    Day{number: 29, task: ""},
                    Day{number: 30, task: ""},
                    Day{number: 31, task: ""},
                layoutX: 40, layoutY: 20
                layoutInfo: LayoutInfo{ hfill: false, vfill: false }
    }

  • R-Tree vs Quadtree

    Oracle database version : 11gR2
    While trying some experiments on R-Tree vs Quadtree performance, I encountered a situation where the query on Quadtree did not complete.
    Setup;
    CREATE TABLE SHAPES (ID NUMBER, SHAPE_RTREE SDO_GEOMETRY, SHAPE_QUAD SDO_GEOMETRY);
    Quadtree creation generates error on 11gR2, therefore while create the index I have mentioned the parameters 'SDO_LEVEL=4 GEODETIC=FALSE'
    Please note the data in SHAPE_RTREE column and SHAPE_QUAD column are the same.
    Query:
    SELECT ID FROM SHAPES WHERE SDO_ANYINTERACT(SHAPE_RTREE,<input point>) = 'TRUE';  --> Returns 13 rows in 8 secs (5800 gets)
    SELECT ID FROM SHAPES WHERE SDO_ANYINTERACT(SHAPE_QUAD,<input point>)  = 'TRUE';   --> Query did not complete even after 15 mins (Ctrl+c at one point showed 48,000 rows returned).
    SHAPE_RTREE and SHAPE_QUAD largely contain complex polygons with/without holes.
    I can paste the results after I am done with my tests. Just wanted to check if anyone has faced similar problems with Quadtree indexes.
    Rgds,
    Gokul

    Gokul Gopal wrote:
    Oracle database version : 11gR2
    Just wanted to check if anyone has faced similar problems with Quadtree indexes.
    On 11R2? I don't think so, because I don't think anybody uses Quadtree's still. And you shouldn't, R-Tree's are noticeably faster, they require less work, and since 11 Oracle maintains them for you so there is no noticeable degradation. Plus (but I'm not sure of this one) AFAIK you cannot partition your table and use partitioned spatial indexes with quad trees, but as said, I'm not sure about that one.
    Out of curiosity, where did you find out about Quadtrees? They're not mentioned anymore in 11R2 Docs. I know them because back in 7 and 8 you didn't have any other option, but since R-Tree's came along I've used them. As I remember they were a nightmare to maintain with all the tile size estimates and all that baloney...

  • New GUI components

    Hi,
    Is there any collection of fancy GUI components. Actually not really fancy, but kind of more advanced in new shapes. I'm trying to write an application. I need to create a table shape/spread sheet screen but the standard JTable is not exactly what I'm looking for.
    Thanks,
    S.

    by real time I only mean that I don't know how many results I will have until the search is complete, so I can't create the components beforehand, I have to do it when I get a result, while the program is running. I couldn't get anything but text to show up like that, but I think a JTable will suit my needs perfectly.

  • How to fix the PLS-00123 error?

    I construct about the oracle spatial sql as follow:
    declare
    ord sdo_ordinate_array := sdo_ordinate_array();
    begin
    begin for i IN 1 ..5624 LOOP
    ord extend;
    end LOOP;
    ord(1) := number1;
    ord(2) := number2;
    ord(3) := number3;
    ord(4) := number4;
    insert into table(shape,....) values(SDO_GEOMETRY(2002,NULL,NULL,SDO_ELEM_INFO_ARRAY(1,2,1),ord));
    END;
    Because the count of geometry node is very long. I got the PLS-00123 error when I execute the state? somebody help me fix the problem?????
    Message was edited by:
    user646459

    It seems more on PL/SQL error to me. Have you posted your question in PL/SQL forum?
    Ming Man

  • Pages template difficulty

    Hello. I'm using Pages '08 and I loathe the Helvetica font. It's difficult to read and ugly. I've tried the fix where one creates a new template with different defaults and sets Pages to open that when you open a new document, but it doesn't work. "Prevent widowed lines" and whatever is off (thankfully -- what possible reason would anybody ever use that?), but Helvetica is still the font. What's the problem? I've tried this over and over, and it isn't working.

    Welcome to Apple Discussions
    You need to change the font for all of the styles in the styles drawer (paragraph, character & list) then save this personalized document as a template then, in Pages > Preferences, select this template as the default for new documents. All of your new documents will have the styles you want.
    While you're at it set defaults for text boxes, tables, shapes, images, etc. Insert a text box, click in it & choose the font, size, color, etc. you want in the fonts panel or format bar. Resize the box if you want, set the amount of extra space in the wrap inspector, etc. You can do similar changes to inserted objects & tables. Delete each text box, object & table after you've set them. Now, save this document as a template & select that template as default in preferences. If you decide to make any changes to the template down the road, just Save As Template again with the same name & replace the previous version. Unfortunately, the settings won't apply to any other templates or "foreign" documents you open with Pages.

  • JDeveloper -  Error Fetching Data

    Hi All,
    I created a Database connection on JDeveloper successful, but when i try to view the data i get this error:
    Io exception: Software caused connection abort: socket write error*
    vendor code 17002*
    anyone who have idea what might be the problem please help me out.
    Many Thanx...

    Please follow Ivan's suggestion of posting the record from USER_SDO_GEOM_METADATA. Also, please run this and post the result as well:
    select distinct a.shape.sdo_srid from gis_local_road a;
    I've seen this error frequently, and it occurs for me when the SRID is undefined or inconsistent between one or more of the following:
    1. The SRID as set in the actual geometry column of the table (which appears to be SHAPE in GIS_LOCAL_ROAD based on your query)
    2. The SRID as set in the USER_SDO_GEOM_METADATA table row associated with that table
    3. The spatial index (if it was built while the above two SRIDs are inconsistent or undefined)
    Here's what I usually do to fix it:
    update <TABLE> a.<GEOM_COL>.sdo_srid = <SRID>;
    update user_sdo_geom_metadata set srid = <SRID> where table_name = '<TABLE>';
    commit;
    drop index <index>;
    create index <index> on <table> (<GEOM_COL>) indextype is mdsys.spatial_index;
    substitution key:
    <TABLE> = your table name (GIS_LOCAL_ROAD in this case)
    <GEOM_COL> = the SDO_GEOMETRY column in that table (SHAPE in this case)
    <SRID> = the oracle spatial reference identifier as referenced in the SDO_COORD_REF_SYS table according to the coordinate system of your data
    <INDEX> = the name of the spatial index that is tied to <GEOM_COL>
    If you don't know what SRID you're supposed to have, you can look it up by querying COORD_REF_SYS_NAME in the SDO_COORD_REF_SYS table.

  • How can I include, in the table of content, a title that I have put on a shape?

    Hello all,
    1. I have a table of content
    2. I have added shapes
    3. I wrote text (titles. subtitles) on the shapes
    4. They do not appear in the table of content.
    5. They only appear in the table of content if they are not on a shape.
    Pages 5.5.2
    Can you help?
    Law

    Hi Law,
    Text in a shape or a text box will not feature in the table of contents.
    To get a colour behind your titles, type them into your document (not a shape). Format as Heading or some other paragraph style the TOC will recognise.
    Select the title text and Format Panel > Text > Font > Gearwheel > Advanced Options.
    Choose Character Fill Color and choose a colour from the palette (left) or colour circle (right).
    Example Titles (all on the same page for a smaller screen shot).
    Chapter 3 (in a coloured Text Box or Shape) does not appear in the TOC:
    Hint for cheats :
    To give the titles a wider Character Fill Colour, add some Tab characters before and after.
    Regards,
    Ian.

  • 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

  • Object Link to Engineering Record from DIR

    Hello Gurus, With respect to the below post. I did the config setting and I see only the CASE GUID showing up and not the Engineering Record number. PLM7 Engineering Record not working as expected And also I am not able to navigate to my ER from the

  • Proc C - How to convert datetime variable in Proc C into C?

    Hi, Does anyone know how to convert a datetime variable in Pro C into C? For Example, Order_Table with OrderId and OrderDate fields. How do I compare the OrderDate with the system datetime in Pro C or C? Thank you.

  • Curve 8520 completely frozen!!

    Help please had my bb curve since xmas.  It has been freezing up the last couple of days.  I downloaded I took this on my phone app from bb apps and since then its completely frozen, cant switch on or off and just have a message that the phone cannot

  • Appraisal authorisation

    Hello there I've got a few questions here regarding MBO: 1) Can someone kindly advise which are the authorisation objects are to control the following fields in PHAP_ADMIN. I know P_HAP_DOC is used, but does this authoristion object restricts the fol

  • IWeb & os x Mountain Lion

    after installing os x Mountain Lion, iWeb lost my site details and I cannot edit it anymore. how can I recover my site