Help with creating a layout.

I need help creating a layout for my program, but am having tons of problems. I just an't that good at creating this, and it's been driving me insane.
Here's the link to how I want it to look like. http://s94182144.onlinehome.us/randomstuff/layout.JPG
In panel 1... that will be a cartesian plain, so it will pretty much be empty until lines and stuff are drawn in there.
In panel 2, there will be two drop down menus and a couple of buttons
In panel 3, there will be a bunch of things, with two buttons on the bottom.... and this section has to be scrollable.
Any help with the basic layout will be helpful... I can put in the buttons myself. For reference, the whole programs size is 400x800.
Thanks,
sachit

Read this section from the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html]How to Use Layout Managers. You can combine multiple Layout Managers to get the effect your want. By default the content pane uses the BorderLayout, so one approach might be:
JPanel center = new JPanel(new BorderLayout());
center.add(panel1, BorderLayout.CENTER);
center.add(panel2, BorderLayout.SOUTH);
getContentPane().add(center, BorderLayout.CENTER);
getContentPane().add(panel3, BorderLayout.EAST);
It turn you would layout panel1, panel2 and panel3 with the appropriate layout manager. Panel2 could be something like:
JPanel panel2 = new JPanel( new BorderLayout() );
panel2.add(comboBox1, BorderLayout.WEST);
panel2.add(comboBox2, BorderLayout.EAST);
JPanel bottom = new JPanel();
bottom.add(button1);
buttom.add(button2);
panel.add(bottom, BorderLayout.SOUTH);

Similar Messages

  • I need help with Creating Key Pairs

    Hello,
    I need help with Creating Key Pairs, I generate key pais with aba provider, but the keys generated are not base 64.
    the class is :
    import java.io.*;
    import java.math.BigInteger;
    import java.security.*;
    import java.security.spec.*;
    import java.security.interfaces.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import au.net.aba.crypto.provider.ABAProvider;
    class CreateKeyPairs {
    private static KeyPair keyPair;
    private static KeyPairGenerator pairGenerator;
    private static PrivateKey privateKey;
    private static PublicKey publicKey;
    public static void main(String[] args) throws Exception {
    if (args.length != 2) {
    System.out.println("Usage: java CreateKeyParis public_key_file_name privete_key_file_name");
    return;
    createKeys();
    saveKey(args[0],publicKey);
    saveKey(args[1],privateKey);
    private static void createKeys() throws Exception {
    Security.addProvider(new ABAProvider());
    pairGenerator = KeyPairGenerator.getInstance("RSA","ABA");
    pairGenerator.initialize(1024, new SecureRandom());
    keyPair = pairGenerator.generateKeyPair();
    privateKey = keyPair.getPrivate();
    publicKey = keyPair.getPublic();
    private synchronized static void saveKey(String filename,PrivateKey key) throws Exception {
    ObjectOutputStream out= new ObjectOutputStream(new FileOutputStream(filename));
    out.writeObject(key);
    out.close();
    private synchronized static void saveKey(String filename,PublicKey key) throws Exception {
    ObjectOutputStream out= new ObjectOutputStream( new FileOutputStream(filename));
    out.writeObject(key);
    out.close();
    the public key is:
    �� sr com.sun.rsajca.JSA_RSAPublicKeyrC��� xr com.sun.rsajca.JS_PublicKey~5< ~��% L thePublicKeyt Lcom/sun/rsasign/p;xpsr com.sun.rsasign.anm����9�[ [ at [B[ bq ~ xr com.sun.rsasign.p��(!g�� L at Ljava/lang/String;[ bt [Ljava/lang/String;xr com.sun.rsasign.c�"dyU�|  xpt Javaur [Ljava.lang.String;��V��{G  xp   q ~ ur [B���T�  xp   ��ccR}o���[!#I����lo������
    ����^"`8�|���Z>������&
    d ����"B��
    ^5���a����jw9�����D���D�)�*3/h��7�|��I�d�$�4f�8_�|���yuq ~
    How i can generated the key pairs in base 64 or binary????
    Thanxs for help me
    Luis Navarro Nu�ez
    Santiago.
    Chile.
    South America.

    I don't use ABA but BouncyCastle
    this could help you :
    try
    java.security.Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
    java.security.KeyPairGenerator kg = java.security.KeyPairGenerator.getInstance("RSA","BC");
    java.security.KeyPair kp = kg.generateKeyPair();
    java.security.Key pub = kp.getPublic();
    java.security.Key pri = kp.getPrivate();
    System.out.println("pub: " + pub);
    System.out.println("pri: " + pri);
    byte[] pub_e = pub.getEncoded();
    byte[] pri_e = pri.getEncoded();
    java.io.PrintWriter o;
    java.io.DataInputStream i;
    java.io.File f;
    o = new java.io.PrintWriter(new java.io.FileOutputStream("d:/pub64"));
    o.println(new sun.misc.BASE64Encoder().encode(pub_e));
    o.close();
    o = new java.io.PrintWriter(new java.io.FileOutputStream("d:/pri64"));
    o.println(new sun.misc.BASE64Encoder().encode(pri_e));
    o.close();
    java.io.BufferedReader br = new java.io.BufferedReader(new java.io.FileReader("d:/pub64"));
    StringBuffer keyBase64 = new StringBuffer();
    String line = br.readLine ();
    while(line != null)
    keyBase64.append (line);
    line = br.readLine ();
    byte [] pubBytes = new sun.misc.BASE64Decoder().decodeBuffer(keyBase64.toString ());
    br = new java.io.BufferedReader(new java.io.FileReader("d:/pri64"));
    keyBase64 = new StringBuffer();
    line = br.readLine ();
    while(line != null)
    keyBase64.append (line);
    line = br.readLine ();
    byte [] priBytes = new sun.misc.BASE64Decoder().decodeBuffer(keyBase64.toString ());
    java.security.KeyFactory kf = java.security.KeyFactory.getInstance("RSA","BC");
    java.security.Key pubKey = kf.generatePublic(new java.security.spec.X509EncodedKeySpec(pubBytes));
    System.out.println("pub: " + pubKey);
    java.security.Key priKey = kf.generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(priBytes));
    System.out.println("pri: " + priKey);
    catch(Exception e)
    e.printStackTrace ();
    }

  • Help with creating a form, I want to add a check box to enable me to unlock certain fields and deselect the block again

    Help with creating a form, I want to add a check box to enable me to unlock certain fields and deselect the block again

    Look to the right under "More Like This". Your issue has been discussed many many times. The error you are seeing is because you do not have enough free "contiguous" space on your hard drive. Read the other threads that address this issue to find how to solve the issue.
    Or, put "The disk cannot be partitioned because some files cannot be moved" into the search box at the upper right of this page.

  • Help with creating a Quiz

    Hey i need help with creating a quiz with scoring and all.
    I need a helping hand so if you can get me started that
    would help a lot.
    Use the Question class to define a Quiz class. A
    quiz can be composed of up to 25 questions. Define the add method
    of the Quiz class to add a question to a quiz. Define the giveQuiz
    method of the Quiz class to present each question in turn to the user,
    accept an answer for each one, and keep track of the results. Define
    a class called QuizTime with a main method that populates a quiz,
    presents it, and prints the final results.
    // Question.java Author: Lewis/Loftus/Cocking
    // Represents a question (and its answer).
    public class Question implements Complexity
    private String question, answer;
    private int complexityLevel;
    // Sets up the question with a default complexity.
    public Question (String query, String result)
    question = query;
    answer = result;
    complexityLevel = 1;
    // Sets the complexity level for this question.
    public void setComplexity (int level)
    complexityLevel = level;
    // Returns the complexity level for this question.
    public int getComplexity()
    return complexityLevel;
    // Returns the question.
    public String getQuestion()
    return question;
    // Returns the answer to this question.
    public String getAnswer()
    return answer;
    // Returns true if the candidate answer matches the answer.
    public boolean answerCorrect (String candidateAnswer)
    return answer.equals(candidateAnswer);
    // Returns this question (and its answer) as a string.
    public String toString()
    return question + "\n" + answer;
    }

    Do you know why this lazy f&#97;rt-&#97;ss is back? Because when he posted his homework last week, some sorry-assed idiot went and did it for him.
    http://forum.java.sun.com/thread.jspa?threadID=5244564&messageID=10008358#10008358
    He didn't even thank the poster.
    It's the same problem over and over again. You feed the bears and it only teaches them to come back for handouts.
    My polite suggestion to the original poster: please do your own f&#117;cking homework.

  • Need help with creating a brush

    Hi guys,
    I wanted to ask for help with creating a brush (even a link to a tutorial will be goon enough ).
    I got this sample:
    I've created a brush from it, and i'm trying to get this kind of result:
    but it's only duplicates it and gives me this result:
    Can someone help me please understand what i need to define in order to make the brush behave like a continues brush instead of duplicate it?
    Thank you very much
    shlomit

    what you need to do is make a brush that looks like the tip of a brush. photoshop has several already but you can make your own that will be better.
    get a paintbrush and paint a spot kind of like what you did but dont paint a stroke. make it look kindof grungy. then make your brush from that, making sure to desaturate it and everything.
    EDIT:
    oh, and if you bring the fill down to like 10-20% your stroke will look better

  • I need help with creating PDF with Preview...

    Hello
    I need help with creating PDF documetns with Preview. Just a few days ago, I was able to create PDF files composed of scanned images (notes) and everything worked perfectly fine. However, today I was having trouble with it. I scanned my notebook and saved 8 images/pages in jpeg format. I did the usual routine with Preview (select all files>print>PDF>save as PDF>then save). Well this worked a few days ago, but when I tried it today, I was able to save it, but the after opening the PDF file that I have saved, only the first page was there. The other pages weren't included. I really don't see anything wrong with what I'm doing. I really need help. Any help would be greatly appreciated.

    I can't find it.  I went into advanced and then document processing but no batch sequence is there and everything is grayed out.
    EDIT: I realized that you cant do batch sequences in standard.  Any other ideas?

  • I need help with creating some formulas

    I'm not sure if anyone around here can help me, but I'm trying to create a Numbers document and need some help with creating a formula/function.
    I have a column of amounts and I would like to create a formula which deducts a percentage (11.9%) and puts the result in another column.
    If anyone can help me, it would be greatly appreciated.

    Here is an example that shows one way to do this:
    The original data is in column A.  In column B we will store formulas to adjust the amounts:
    1) select the cell where you want to formula (in this case cell B2)
    2) Type the "=" (equal sign):
    3) click cell A2:
    4) now type the rest of the formula which is: "*(100-11.9)/100"  that is asterisk, then open parenthesis, 100 minus eleven point nine close parenthesis forward slash  one hundred
    The Asterisk is the multiply operator  (times) and the forward slash is the division operator (divide)
    now hit return.  select cell B2 and hover the cursor over the bottom edge of the cell:
    drag the little yellow dot down to "fill" the formula down as needed.

  • Need help with creating template. Changes are not going through to index.html page

    Hi all,
    I have an issue with my template that I am creating and also a question about creating template Regions (Repeating and Editable).
    Somehow my changes to my index.dwt are not changing my index.html page.
    Also my other question is: For my top navigation bar and left navigation bar links, do I need to select and define each individual button or link as Repeating/Editable Region? or can I just select the whole navigation bar (the one on the top) etc...
    Below are my steps for creating my template...I am kinda fairly new to using DW and this is my first attempt to making a template following the DW tutorial CD that came with DW CS3.
    I appreciate any help with this...regards, Dano
    -Open my index.html file
    -File/save as template
    -Save
    -update links - yes
    -Select Repeating and Editable Regions (I selected the whole top navigation bar and selected Repeating Region and Editable Region, same with the left side navigation links)
    -File close all
    -Open the index.dwt
    -Save as and selected the index.html and chose to overide it..
    When I make changes to my index.dwt it is not changing the index.html
    I feel that I am missing some important steps here.....
    Website address
    www.defenseproshop.com

    Figured out

  • Help with creating a flash banner

    Hi,
    I need some help with a creating/replicating a flash banner I
    saw online. I cant find it anymore but I will do my best to
    describe it.
    The banner had multiple images layered on top of each other
    horizontally. Each image covered the image to the left of it. When
    you moused over an image the image expanded to full size while the
    other remained contracted.
    How can I create something with the above description? Are
    there any good tutorials for something like this or maybe someone
    can provide me with a few tips/tricks for doing this?
    I am proficient in PShop and a beginner with Flash so the
    design portion is not the hard part, just the programming/setup in
    flash is what has me stumped.
    Thanks in advance for any assitance.
    Regards,
    Mike
    Hookah Life

    Update:
    The banner on this template has an exact example of what I am
    shooting for.
    http://www.algozone.com/zencart-templates-zc03c00287-p-1191.html

  • Help with create a trigger

    hello all
    i have a 4 tables and i would like to create a trigger in a tables
    CREATE TABLE CLIENT_INFO
    ( CLIENT_NO     VARCHAR2(10) CONSTRAINT CLIENT_INFO_CNO_PK PRIMARY KEY,
      CLIENT_NAME   VARCHAR2(50) NOT NULL,
      ORDERS_AMOUNT NUMBER(7)
    CREATE TABLE STOCK_INFO
    ( ITEM_NO              VARCHAR2(10) ,
      ITEM_DESCRIPTION     VARCHAR2(100),
      SELLING_PRICE        NUMBER(6),
      QTY_IN_HAND          NUMBER(6)    NOT NULL,
      CONSTRAINT ITEM_NUM_SPRICE_PK PRIMARY KEY (ITEM_NO , SELLING_PRICE)
    CREATE TABLE ORDER_INFO
    ( ORDER_NO     VARCHAR2(10) CONSTRAINT ORDER_INFO_ONO_PK PRIMARY KEY,
      CLIENT_NO    VARCHAR2(10),
      ORDER_DATE   DATE,
      ORDER_AMOUNT NUMBER(6),
      CONSTRAINT ORDER_INFO_CNO_FK  FOREIGN KEY (CLIENT_NO) REFERENCES CLIENT_INFO (CLIENT_NO)
    CREATE TABLE ORDER_LINES
    ( ORDER_NO       VARCHAR2(10),
      ITEM_NO        VARCHAR2(10),
      LINE_QTY       NUMBER(6),
      SELLING_PRICE  NUMBER(6),
      TOTAL_PRICE    NUMBER(6)
    ALTER TABLE ORDER_LINES
    ADD  CONSTRAINT ORDER_LINES_ONO_FK FOREIGN KEY (ORDER_NO) REFERENCES ORDER_INFO (ORDER_NO);
    ALTER TABLE ORDER_LINES
    ADD  CONSTRAINT ORDER_LINES_INO_FK FOREIGN KEY (ITEM_NO) REFERENCES STOCK_INFO (ITEM_NO);i would like to create this trigger
    1-order_amount in table 3 due to any (insert,update or delete ) in total_price in table 4
    2-orders_amount in table 1 due to any (insert,update or delete ) in order_amount in table 3
    i would like to ask another quotations r this relations in good for tables
    thank's all

    >
    plz i need a help to create a trigger
    >
    Using a trigger won't solve your problem. You are trying to use child table triggers to maintain parent table information.
    There is no transaction control to ensure that the parent table will be updated with the correct information.
    One process could update child record 1 while another process is updating child record two. Each process will see a different total if they try to compute the sum of all child records since the first process will see the 'old' value for the child record that the second process is updating and the second process will the 'old' value for the child record that the first process is updating.
    So the last process to commit could store the wrong total in the parent record withoug an exception ever being raised.
    See Conflicting Writes in Read Committed Transactions in the Database Concepts doc
    http://docs.oracle.com/cd/E14072_01/server.112/e10713/consist.htm
    >
    some one ask me this quotation in interview
    and im told him i can't understand this structure for database he said just do it
    >
    And I would tell them that using a trigger is not the right way to accomplish that since it could invalidate the data concurrency and data consistency of the tables.
    Sometimes you just have to tell people NO.

  • Help with dynamic page layouts

    Hello JSP Gurus,
    I'm attempting to dynamically generate the page layout for my site based on the organization a user belongs to. Basically, I'd have certain resources like navigation links, graphics, etc, that are modular. Then I'd like to construct the layout using these "moduls" in a dynamic fashion. Does anyone have any suggestions on techniques or technologies that would be useful? I'm not really looking at the portal/portlet model. Is this something that Cocoon could do by storing the layout for each customer as an XML file or something? Any ideas, suggestions, experiences would be helpful.
    Thanks!

    How does Tiles differ from the JetSpeed apache
    project? They both appear to be portal-like
    frameworks, or am I incorrect about that? Which is
    preferred?Frankly, I can't give you an in-depth answer to that. Maybe someone else can help with more details.
    What I can tell you is that JetSpeed seems to be more of a real portal architecture. Emphasis is placed on the framework portion, interfacing with exisiting applications. Visual layout takes second seat to this.
    Tiles on the other hand puts more emphasis on visual layout and reuse.
    Just looking at JetSpeed's visual interfacing a little bit makes me really dislike it. You build tables and such inside of a servlet, so there's a tight coupling (or at least, much tighter than with Struts/Tiles) between the presentation and logic. (I'm basing this on a JavaWorld article at
    http://www.javaworld.com/javaworld/jw-07-2001/jw-0727-jetspeed.html )
    Based on your initial question, it would seem to me that tiles is much closer to what you're looking for (and likely easier to just pick up and use).
    Anyway, take all this with a grain of salt; I'm not exactly an expert on JetSpeed. =)

  • Need help with Fluid Grid Layout and variable column balance.

    I'm using the fluid grid layout.  I have multiple columns that are actually fluid grid layout columns done by Dreamweaver.  I'd like them to extend as high as each other (all to the maximum height of each other) within the same section.  An added catch is that in the desktop layout, I have three side by side under one that takes the whole width of the page.  On tablet size, it's 2x2 in a square grid.  On mobile, they're vertically stacked.  I'm trying to get it so that background colour and/or borders looks decent and is fully balanced, no matter which layout is hit with the fluid layout.  The columns reflow, no problem.  But the height of any background and/or border is variable. 
    Any help on fixing this? 
    Example at:  https://music2help.thoughtburst.net/ 
    The example doesn't have borders or colours, as it looked silly unbalanced.  The music2help.css is the only one I'm modifying manually.
    Love the fluid grid layout, but I need a way to make it behave decently with backgrounds/borders.  Any help would be hugely appreciated!
    Thanks!
    mark->

    I tried the solution Nancy posted.  It altered things, but doesn't seem to do the trick.
    Just some quick background.  I did HTML from 1994 through about five years ago by hand in vi on *nix systems.  I learned HTML through 4.01, and never bothered with XHTML at all.  I learned CSS through most of CSS2.  The CSS3 and HTML5 stuff is all new to me, but it can't be that hard.  I'm not exactly a novice in JS (I've done a fair bit of AJAX programming), but it's not even close to my primary language (I'm a Perl guy).
    I'm "stuck on" wanting to use Fluid Grid Layouts.  It's billed as one of the selling points of DW CS6, and I really like the concept and results.  I just want the results embellished a little, namely with sensible identical heights on grid containers set in the same row, so that you can apply background colours, dropshadows, and borders.  That's really all I want to do that it doesn't already do.
    I have a test page at:  http://music2help.thoughtburst.net/ that you can try with your Quick Columns.  I'd be interested to know if you can get it to work.
    Here's the catch, though...  Resize the browser, shrinking it inwards.  (I suggest Firefox, as Chrome only shrinks so far, and you won't get to Mobile width.)  As you can see, on a Tablet, one of the columns that should be equal height actually moves up a row and should be equal height with the row that, on a desktop, would take the entire width of the page area.  So that's like a 4-up output in printing terms.  At Mobile size, the entire thing is vertical, so none of the columns should be resized.
    If your product works and can accomodate these conditions, I think I would be interested in spending the $35 it costs. 
    Let me know?  Thanks!
    EDIT:  Changed URL to be non-SSL.  The server has multiple vhosts on it, and I keep forgetting that I don't have a cert on this new one.  Sorry about that.  You can just add anything to one of the the three middle columns, if you're pulling it down to test.

  • Help with creating Box2D bodies dynamically, according to shape.

    Hello everyone,
    I am having some issues on how to dynamically create Box2D bodies dynamically, according to the shape.
    So far this is how I've layed out my project in attempt to do this...
    Main class:
    package
    //imports
              public class Architecture extends Sprite
                        public var world:b2World;
                        public var stepTimer:Timer;
                        public var mToPx:Number = 20;
                        public var pxToM:Number = 1 / mToPx;
                        protected var shapeObjectDirector:ShapeObjectDirector = new ShapeObjectDirector();
                        public function Architecture()
      //gravity
                                  var gravity:b2Vec2 = new b2Vec2(0, 10);
                                  world = new b2World(gravity, true);
      //debug draw
                                  var debugDraw:b2DebugDraw = new b2DebugDraw();
                                  var debugSprite:Sprite = new Sprite();
                                  addChild(debugSprite);
                                  debugDraw.SetSprite(debugSprite);
                                  debugDraw.SetDrawScale(mToPx);
                                  debugDraw.SetFlags(b2DebugDraw.e_shapeBit);
                                  debugDraw.SetAlpha(0.5);
                                  world.SetDebugDraw(debugDraw);
      //declarations
                                  var wheelBuilder:WheelBuilder = new WheelBuilder(world, pxToM);
                                  createShape(wheelBuilder, 0, 0, 0, 0);
      //timer
                                  stepTimer = new Timer(0.025 * 1000);
                                  stepTimer.addEventListener(TimerEvent.TIMER, onTick);
                                  stepTimer.start();
                        private function createShape(shapeObjectBuilder:ShapeObjectBuilder, pxStartX:Number, pxStartY:Number, mVelocityX:Number, mVelocityY:Number):void
                                  shapeObjectDirector.setShapeObjectBuilder(shapeObjectBuilder);
                                  var body:b2Body = shapeObjectDirector.createShapeObject(pxStartX * pxToM, pxStartY * pxToM, mVelocityX, mVelocityY);
                                  var sprite:B2Sprite = body.GetUserData() as B2Sprite;
                                  sprite.x = pxStartX;
                                  sprite.y = pxStartY;
                                  this.addChild(sprite);
                        public function onTick(event:TimerEvent):void
                                  world.Step(0.025, 10, 10);
                                  world.DrawDebugData();
    ShapeObjectBuilder class:
    package
    //imports
              public class ShapeObjectBuilder
                        public var body:b2Body;
                        protected var circle:b2CircleShape;
                        protected var polygon:b2PolygonShape;
                        protected var world:b2World, pxToM:Number;
                        protected var fixtureDef:b2FixtureDef;
                        protected var bodyDef:b2BodyDef;
                        protected var fixture:b2Fixture;
                        protected var startingVelocity:b2Vec2;
                        protected var sprite:B2Sprite;
                        protected var restitution:Number, friction:Number, density:Number;
                        protected var mStartX:Number, mStartY:Number;
                        protected var mVelocityX:Number, mVelocityY:Number;
                        protected var Image:Class;
                        public function ShapeObjectBuilder(world:b2World, pxToM:Number)
                                  this.world = world;
                                  this.pxToM = pxToM;
                        public function createCircleShape():void
                                  circle = new b2CircleShape();
                                  createFixtureDef(circle);
                        public function createPolygonShape():void
                                  polygon = new b2PolygonShape();
                                  createFixtureDef(polygon);
                        public function createFixtureDef(shape:b2Shape):void
                                  fixtureDef = new b2FixtureDef();
                                  fixtureDef.shape = shape;
                                  fixtureDef.restitution = restitution;
                                  fixtureDef.friction = friction;
                                  fixtureDef.density = density;
                        public function createBodyDef(mStartX:Number, mStartY:Number):void
                                  bodyDef = new b2BodyDef();
                                  bodyDef.type = b2Body.b2_dynamicBody;
                                  bodyDef.position.Set(mStartX, mStartY);
                        public function createBody():void
                                  body = world.CreateBody(bodyDef);
                        public function createFixture():void
                                  fixture = body.CreateFixture(fixtureDef);
                        public function setStartingVelocity(mVelocityX:Number, mVelocityY:Number):void
                                  startingVelocity = new b2Vec2(mVelocityX, mVelocityY);
                                  body.SetLinearVelocity(startingVelocity);
                        public function setImage():void
                                  sprite = new B2Sprite();
                                  var bitmap:Bitmap = new Image();
                                  sprite.addChild(bitmap);
                                  bitmap.x -= bitmap.width / 2;
                                  bitmap.y -= bitmap.height / 2;
                        public function linkImageAndBody():void
                                  body.SetUserData(sprite);
                                  sprite.body = body;
    ShapeObjectDirector class:
    package builders
    //imports
              public class ShapeObjectDirector
                        protected var shapeObjectBuilder:ShapeObjectBuilder;
                        public function ShapeObjectDirector()
      //constructor code
                        public function setShapeObjectBuilder(builder:ShapeObjectBuilder):void
                                  this.shapeObjectBuilder = builder;
                        public function createCircleObject():void
                                  shapeObjectBuilder.createCircleShape();
                        public function createPolygonObject():void
                                  shapeObjectBuilder.createPolygonShape();
                        public function createShapeObject(mStartX:Number, mStartY:Number, mVelocityX:Number, mVelocityY:Number):b2Body
                                  shapeObjectBuilder.createBodyDef(mStartX, mStartY);
                                  shapeObjectBuilder.createBody();
                                  shapeObjectBuilder.createFixture();
                                  shapeObjectBuilder.setStartingVelocity(mVelocityX, mVelocityY);
                                  shapeObjectBuilder.setImage();
                                  shapeObjectBuilder.linkImageAndBody();
                                  return shapeObjectBuilder.body;
    WheelBuilder class:
    package builders
      //imports
              public class WheelBuilder extends ShapeObjectBuilder
                        [Embed(source='../../lib/Basketball.png')]
                        public var Basketball:Class;
                        public function WheelBuilder(world:b2World, pxToM:Number)
                                  super(world, pxToM);
                                  restitution = 1.0;
                                  friction = 0.0;
                                  density = 5.0;
                                  Image = Basketball;
                                  circle.SetRadius(15 * 0.5 * pxToM);
    The above code did have some errors, but even if it worked I wouldn't have been happy. It was just my attempt at what I'm trying to achieve.
    What I want to is be able to call a function in my "Main" class to create a shape (Circle body or Polygon body), like so... createShape(wheelBuilder, 0, 0, 0, 0);
    I would like to make the class ShapeObjectDirector and ShapeObjectBuilder to be able to handle b2CircleShape() and b2PolygonShape(), but my problem is creating constants to handle both datatypes all in the one class.
    Basically, I need help with building a class to create shapes on the fly, with minimal code in the Main class. What do you guys suggest? I would be grateful for one of you's who have enough experience with this kind of thing to write me a post on how I can tackle this problem, all responses appreciated.
    Thankyou,
    Brendon.

    UIImageView initWithImage takes a UIImage* as a parameter, not NSString*. So load your image into a UIImage first
    UIImage *ballImage = [UIImage imageNamed:@"Ball.png"];
    UIImageView *tempStart = [[UIImageView alloc] initWithImage:ballImage];

  • Help with creating extension

    I am very new to extension creating but i gave it a go and cs5 said it install
    ed the extension but when i went to use it it threw an error on line 22..
    i don't know what i did wrong.. the ext html is below along with the mxi text .. hope someone can help. thanks in advance. hopefully your help will assist me with creating others that work and share.
    http://www.pegaan.com/extension/convey.html
    http://www.pegaan.com/extension/conveyer.mxi
    this is the extension cs5 made
    http://www.pegaan.com/extension/conveyer.mxp

    Hi
    You have posted this question in the wrong section of the forum, this is the html5 section, you would be better advised reposting in the extension developers section.
    As for your problem, you have used microsoft word or similar to develop the code, and the javascript should be in a separate file. Can I suggest that you read the following, which will explain extension development in dreamweaver -
    http://help.adobe.com/en_US/dreamweaver/cs/extend/dreamweaver_cs5_extending.pdf
    PZ

  • Help with creating reports - Report Builder 6.0.8.11.3

    Helllo!
    I’m using report builder 6.0.8.11.3 and the operating system is Unix, and the result is a character text file.
    Now imagine the following situation, I need to send to a letter to several companies. That letter has some lines of introduction, in the first page, as well as the company address. Below this introduction I pretend to put a list of employees and each one info. Each employee info has four lines of size. And the list can grow from one person to hundreds, which makes the letter grow from one page to more.
    This is simple to do it. The problem is that I need to know and to use in the letter, the number of current page and the total number of pages for each company.
    This letter has two kinds of pages (one with the introduction text and some employees and other with employees only), and I need to know the number of employees for each page, to calculate the total number of pages. I have the propriety “max register number per page” but is useful for a page. Assuming that I get the total number pages using some PL/SQL.
    Can you have any other solution? Or give me some help with this one?
    Thanks.

    Hi
    I have problem in RTF output.How can I get this patch3 file.I am
    not able to log on to "ftp.oracle".
    Please help.
    Vijay

Maybe you are looking for

  • No video working in any browser

    The videos were working fine two days before but now, I can't watch any video. I have tried everything - uninstalling and reinstalling flash, disabling hardware accelerator, deleting flash cache, restoring my laptop to previous points, installing var

  • To_number with period and comma

    As a part of a validation function I have to validate strings against a valid number format. The following weird behaviour I have spot during the implementation. SQL> select TO_NUMBER('1.1.1.1,11','9G999D99') from dual; TO_NUMBER('1.1.1.1,11','9G999D

  • Automator in Snow Leopard - Newbie MacBook Pro Owner Needs Help

    All, I'm new to Macs and am having a devil of a time figuring out Automator. I am trying to use an Automator script to open my library of photos and save them as JPEGs. I am using a "Save for Web" automator script I downloaded from Apple.com; it's su

  • Can't open projects with Imovie 5 that were created with earlier version

    I can't open my Imovie projects that I created when using Mac OS 9.2 now that I'm using Tiger and Imovie 5. I'm not sure what version of Imovie I created them with. Do I need to find an earlier version and open them in the classic environment, or is

  • Can i take this product put it in my truck and hook it to my sprint wireless internet conection

    hp officejet 4500 wireless 7 64 bit windows 7 Can i take this product put it in my truk and fax paper work to my company with my sprint wireless internet connection which has a phone number.If it can be done could some one explain it to me.