Vector Question

Hi,
I am using sql server to retrieve the data. Wondering if it's possible to use vector to do multiple batch update/prepared statement? or some other suggestions?
Environment is jsp/beans. For instance..
In a database table, the display in jsp for the year is going across/x-axis (1997, 1998, 1999, 2000)
the competitors is going down/y-axis (s, m, l, xl) and within the layout, there's sales number. 1997, s is $2000, 1998, s is $5000, etc.
I have the part to display working fine.
Thanks again for your help!

Hi,
As ur using beans/jsp, you can safely move on to either slim String array or ArrayList. try batch execution which increases performance.
I hope, i striked at the point.
Regards

Similar Messages

  • Simple Vector Question

    Hello all, apparently my ability to construct useful search terms has failed and so I haven't been able to figure this out. I imagine it is too basic a question.
    Every year I have to design a team jersey and while I am fine at drawing out my design, I always run into a problem when converting to digital vector format.
    My problem is this: if I have a closed path (say a square) and I want to break up this square so that I can fill it with 2 colours, how do I go about this?
    I have the anchor points that I want to connect to create a separate closed path, but I can't figure out how to connect them together to get the job done. I have done this in the past, but I can't figure this out today at all.
    Thanks

    Well, in order to connect, you need to cut up first. Use the knife tool to do so. When separating anchor points, a simple click while hovering over them will do. Then use the Join command to close the paths gain with the proper end points selected.
    Mylenium

  • Marker defininition using Vector question

    Hi all,
    I would like to know in what unit are polygon points coordinates of marker definition and if they are relative to scale.
    Here is an example:
    <?xml version="1.0" standalone="yes"?>
    <svg width="1in" height="1in">
    <desc/>
    <g class="marker" style="stroke:#0000FF;fill:#6666FF;font-family:Dialog;font-size:12;font-fill:#6666FF">
    <polyline points="201.0,200.0,0.0,200.0,101.0,0.0"/>
    </g>
    </svg>
    thanks,
    Branislav

    Hi Joao,
    thanks for explanation,
    I have one more question - is it possible to define style relative to scale so if zooming in a marker becomes bigger? or I have to define more static themes with static styles, include them to basemap and set the individual visibility scale for them to get this effect?
    thanks,
    Branislav
    Message was edited by:
    bjanko

  • Converting a Vector of objects to an arbitrary array type

    I am trying to use published java code (from a java magazine) of the form:
    Vector temp = new Vector();
    Question[] questions = (Question[])temp.toArray(Question[temp.size()]);
    When I try to "run" this code, it fails. However, it compiles OK? What's going on? What special
    properties, structure, etc. is required of the Question class (if any)? When I try a String[], or an Int[],
    in place of Question[], the conversion works like a charm! Can anyone shed some light on this?
    [email protected]

    What error are you getting?
    P.S. Don't you know it's not really a good idea to post your email adress on a forum? I hope you like spam.

  • Vector in a Vector

    Hi, i have a basic Vector question:
    When i have following:
    Vector ouside = new Vector();
    Vector inside = new Vector();
    outside.addElement(inside);
    inside.addElement("Test");
    is the Vector ouside changed too and contains the inside Vector with "Test"?

    is the Vector ouside changed too and contains the
    inside Vector with "Test"?In Java an object is always represented by a reference pointing at it.
    Before "Test" is added, the inside object is referenced from two places.
    1. The pointer held in the inside reference variable.
    2. The pointer held in the first element of the outside object.
    Now when you add "Test" to the inside object the two pointers above will still point to it. Just because you change the content of an object doesn't mean that pointers to it are changed.

  • Help(urgent) Tuesday

    Hi.
    This is a specie of technical doubt (i really appreciate a code, but that?s not the idea). In Java, I am going to make a specie of questionnaire, we say that it wonders if you smoke,how many; if you drink alcohol, how many liters, if you are a sedentary pig, etc. , but the main trouble, is that if I develope it in only-text mode (DOS), it'll be very simple; so, I'd like to do it with javax.swing, but it's very difficul to know how to use te AWT or to activate an ActionListener, or get it inside of my program. I?ve done a few things but i really need help. Every question will be with three options( JRadioButtons) then, I'll change every question ( pressing a "next" button, that?s could be a huge problem) and at the end, I'll tell you "if you go-on that way, you'll die very soon" and some recommendations, etc. I want that, if it?s possible "help me", because I face the Abstrac Window Toolkit (AWT) and the package of javax.swing (or I make it only text-based?)
    WARNING: Here comes my "very complete" code.
    If you aren?t patient, will be better for you skipping
    he following.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class Look {
    static void Metal(){
    try {
    UIManager.setLookAndFeel(
    UIManager.getSystemLookAndFeelClassName());
    } catch (Exception e) { }
    public void Display_frame (){
    JFrame frame = new JFrame("Factores de riesgo");
    frame.setSize(80,80);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);
    class Select extends Jpanel implemets ActionListener {
    JTextField nombre;
    JLabel nombre1;
    JTextField estatura;
    JLabel estatura1;
    JTextField peso;
    JLabel peso1;
    JLabel top1;
    JPanel datos;
    public final String MENSAJE= "?Esta Seguro?";
    public JButton siguiente= new JButton("Siguiente");
    void Datos() {       
    top1=new JLabel=("Introduzca sus datos: ",)
    nombre=new JtextField(5);
    nombre1=new JLabel("Nombre:", SwingConstant.LEFT);
    estatura=new JtextField(3);
    estatura1=new Jlabel("Estatura:", SwingConstant.LEFT);
    peso=new JtextField(3);
    peso1=new Jlabel("Peso:", SwingConstant.LEFT);
    siguiente.addActionListener(this);
    datos.add(nombre);
    datos.add(nombre1);
    datos.add(estatura);
    datos.add(estatura1);
    datos.add(peso);
    datos.add(peso1);
    class Opciones extends JPanel implements ActionListener {
    String aviso1=" ?Fuma usted?";
    String aviso2=" ?Cuantas cajatillas?";
    String aviso3=" ?Bebe usted alcohol?";
    JLabel top2;
    Jlabel top3;
    JPanel smoke;
    JPanel drink;
    smoke=createSimpleDialogBox();
    JRadioButton[] botones= new JRadioButton[3];
    ButtonGroup grupo= new ButtonGroup();
    botones[0]= new JRadioButton("1 -> 14 cigarros")
    botones[1]= new JRadioButton("15 -> 24 cigarros")
    botones[2]= new JRadioButton("+24 cancerigenos
    public class Proyect{
    public static void main(String[] args) {
    Look show =new Look();
    show.Metal();
    show.Display_frame();
    Thanks
    I really apreaciate if somebody tell me how can I do that, if you can, before tuesday
    (I�m not asking for much) (Sure boy..............)
    By the way, I�m mexican. I hope you can understand the question

    Try this code, create a question file like in the provided example below
    code:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class SwingTest extends JFrame implements ActionListener
         private JButton fNextButton;
         private JPanel fMainPanel;
         private Vector questions;
         private Vector answers;
         private int fCurrentVisiblePanel;
         private int nrOfQuestions;
         private int timesAnswer1Answered;
         private int timesAnswer2Answered;
         private int timesAnswer3Answered;
         private int currentAnswer = 0;
         public SwingTest( String title)
              super(title);
              init();
              this.setDefaultCloseOperation(3);
         private boolean loadQuestions()
              String resourceName = "questions.properties";
              URL url = ClassLoader.getSystemClassLoader().getSystemResource(resourceName);
              if (url == null)
                   this.getContentPane().add(new JLabel("no questions were found"), BorderLayout.NORTH);
                   return false;
              File mPr = new File(URLDecoder.decode(url.getFile()));
              Properties properties = new Properties();
              if (null != mPr)
                   try
                        properties.load(new FileInputStream(mPr));
                   catch (IOException e)
                        System.out.println("error with file");
                   nrOfQuestions = new Integer(properties.getProperty("NR_OF_QUESTIONS")).intValue();
                   questions = new Vector(nrOfQuestions);
                   answers = new Vector(nrOfQuestions);
                   for( int i=1; i <=nrOfQuestions ; i++)
                        String question = properties.getProperty("QUESTION"+i);
                        String answer1 = properties.getProperty("ANSWER1_"+i);
                        String answer2 = properties.getProperty("ANSWER2_"+i);
                        String answer3 = properties.getProperty("ANSWER3_"+i);
                        questions.add(question);
                        Vector answerlist = new Vector(3);
                        answerlist.add(answer1);
                        answerlist.add(answer2);
                        answerlist.add(answer3);
                        answers.add(answerlist);
              return true;
         public void init()
              if( !loadQuestions())
              return;
              fMainPanel = new JPanel( new GridLayout(1,4) );
              JPanel buttonPanel = new JPanel( new FlowLayout() );
              fNextButton = new JButton("Next");
              fNextButton.addActionListener( this);
              buttonPanel.add(fNextButton);
              getContentPane().add( fMainPanel, BorderLayout.CENTER);
              getContentPane().add( buttonPanel, BorderLayout.SOUTH);
              //start with first panel...
              createQuestionairePanel(fCurrentVisiblePanel++);
         private void createQuestionairePanel(int panelNumber)
              fMainPanel.removeAll(); //rebuild the questionaire
              ButtonGroup group = new ButtonGroup();
              String q = (String)questions.get(panelNumber);
              JLabel question = new JLabel("Question : "+q);
              Vector answerlist = (Vector)answers.get(panelNumber);
              //build the 3 radiobuttons
              JRadioButton radioButton1 = new JRadioButton((String)answerlist.get(0));
              group.add(radioButton1);
              radioButton1.addItemListener(new ItemListener()
                   public void itemStateChanged(ItemEvent e)
                        currentAnswer=1;
              JRadioButton radioButton2 = new JRadioButton((String)answerlist.get(1));
              group.add(radioButton2);
              radioButton2.addItemListener(new ItemListener()
                   public void itemStateChanged(ItemEvent e)
                        currentAnswer=2;
              JRadioButton radioButton3 = new JRadioButton((String)answerlist.get(2));
              group.add(radioButton3);
              radioButton3.addItemListener(new ItemListener()
                   public void itemStateChanged(ItemEvent e)
                        currentAnswer=3;
              //and add all to the screen
              fMainPanel.add(question);
              fMainPanel.add(radioButton1);
              fMainPanel.add(radioButton2);
              fMainPanel.add(radioButton3);
              fMainPanel.updateUI();
         public static void main( String[] args)
              SwingTest test = new SwingTest("Test");
              test.pack();
              test.setSize(500,500);
              test.setVisible(true);
              test.show();
         public void actionPerformed(ActionEvent e)
              if ( e.getSource().equals(fNextButton))
                   switch( currentAnswer )
                        case 1: timesAnswer1Answered++; break;
                        case 2: timesAnswer2Answered++; break;
                        case 3: timesAnswer3Answered++; break;
                   if ( fCurrentVisiblePanel < nrOfQuestions )
                        createQuestionairePanel(fCurrentVisiblePanel++);
                   else
                        currentAnswer = 0;
                        fMainPanel.removeAll();
                        String result = "timesAnswer1Answered= "+timesAnswer1Answered+", timesAnswer2Answered= "+timesAnswer2Answered+", timesAnswer3Answered= "+timesAnswer3Answered;
                        fMainPanel.add(new JLabel(result));
                        ((JComponent)this.getContentPane()).updateUI();
    examle questions file: (place this in the same directory as your classfile with the name questions.properties)
    NR_OF_QUESTIONS = 2
    QUESTION1 = are you lame?
    ANSWER1_1 = yes
    ANSWER2_1 = n0
    ANSWER3_1 = maybe
    QUESTION2 = are you tired?
    ANSWER1_2 = yes
    ANSWER2_2 = no
    ANSWER3_2 = only after programming this

  • Question on Vector Mask Functionality

    Hello everyone, I'm fairly new to Photoshop CS 5 so I apologize if I am asking the wrong type of questions, here goes:
    When working with Vector Masks can you:
    1) "Link" or "share" one image's vector mask with other images? (ex. If I made "Building A" then duplicated it, but then wanted to change what Building A looked like, I would only have to change the source mask and the copies would be updated.
    2) Move the image independent of the vector mask (it seems like I can only move the vector mask, not the image itself). Or in other words: can I move the image and have the mask follow it, instead of only being able to move the vector mask inside of the image boundaries?
    My application of the question:
    I'm making a 2D top down layout of a "city block" type area. To fill in the buildings, I've made Building A,B,C etc, and use multiple copies of each building. Ideally, I would like to be able to "link" or share say Building A's vector mask with all the other instances of Building A (so that when I change the master, they all change to the new mask shape). The second behavior I'm trying to find is the ability to move the layer without moving where the Vector Mask is on that layer (since it seems that you can only move where the mask is, meaning that even if I could share masks, they would all end up in the same place meaning I would have to re-position each one by hand again.
    Any ideas are appreciated, thank you for reading.

    When working with Vector Masks can you:
    1) "Link" or "share" one image's vector mask with other images? (ex. If I made "Building A" then duplicated it, but then wanted to change what Building A looked like, I would only have to change the source mask and the copies would be updated.
    Yes, this is possible, but not with the classic layer vector mask system in Photoshop. Layer masks are part of a layer, and not individual layers themselves, so they cannot be converted into a reusable object.
    The solution is to avoid vector layer masks, and use a clipping mask/layer instead. A clipping mask/layer CAN be converted to a reusable smart object, and when you change one, all the other instances change as well.
    The second part of the solution is to convert both the content layer(s) and the clipping mask/layer to a smart object. Then group the lot. Incidentally, if your buildings are made up of several elements you merely have to include those additional elements in the clipping group. Another advantage is that each elements can still have its own regular layer mask. Win win situation. And layer effects can be applied to clipping layers/masks, which is again impossible for layer masks. It also opens up the gates to a far less destructive workflow.
    2) Move the image independent of the vector mask (it seems like I can only move the vector mask, not the image itself). Or in other words: can I move the image and have the mask follow it, instead of only being able to move the vector mask inside of the image boundaries?
    This is also solved when using clipping masks/layers - both the content and the mask can be moved independently as regular layers. Another advantage is that both can also be transformed individually.
    My application of the question:
    I'm making a 2D top down layout of a "city block" type area. To fill in the buildings, I've made Building A,B,C etc, and use multiple copies of each building. Ideally, I would like to be able to "link" or share say Building A's vector mask with all the other instances of Building A (so that when I change the master, they all change to the new mask shape). The second behavior I'm trying to find is the ability to move the layer without moving where the Vector Mask is on that layer (since it seems that you can only move where the mask is, meaning that even if I could share masks, they would all end up in the same place meaning I would have to re-position each one by hand again.
    Any ideas are appreciated, thank you for reading.
    So here is my solution. I made a sample with two top view buildings that should be reused the way you want:
    1) FIrst create groups for each building, and put the content in those. Then trace vector layer shapes over the content. Set the transparency for the mask layers to a sensible opacity setting for easier masking.
    2) Put the vector shape below the content layer for each building. Then for (1) and (2), <ALT> click on the border between the content and the shape layer. (<OPTION> for Mac) This will mask the building content. (3) Do not forget to reset the layer opacity for the shape layers back to 100%!
    3) Next, let's convert these building into recyclable objects. Convert each content and clipping mask layer to a smart object. Then rename those smart object layers to something sensible (honestly, I forgot to label the layers properly earlier, but you catch my meaning here ;-)
    Done! To clone each building, duplicate the layer groups. For each instance you can move the content (handy if you are sharing multiple building graphics in the same bitmap or illustrator file), or you can decide to move the mask instead. Or both. Same holds true for transforming. Your choice. To move or transform a building, select the layer group.
    To change or amend the masks or content, double-click on the smart object of your choice, and make some changes.
    Also, don't forget that you can insert additional elements in a clipping group by placing it above the first clipped layer, and then <ALT> clicking again on the border between them. So in theory you could start constructing different looking buildings by adding in other smart objects in the clipping groups. The sky is the limit! This way you can create several building blocks to construct various buildings with different looks. And still limit the number of blocks - and all update-able.
    Unfortunately, this is where the workflow breaks down a tad: due to the smart object's implementation in Photoshop you CANNOT edit the mask or building's content in context - instead it opens up in its own file window. This can be somewhat mitigated by placing both windows side by side (window->Arrange-->Two-up Vertical).
    This brings us to the second caveat: when you do make a change, the edits are not updated in realtime in the master document. You must first save. Again a bit of a workflow breaker, but still... At least you now have a non-destructive instanced workflow.
    The smart object content can be replaced easily with a right-mouse click on the smart object layer itself. Or use a externally referenced smart object instead if you prefer to generate your buildings in an external application.
    Btw, Photoline's layer system is far more logical and easier to use for this type of work. Layer masks behave like regular layers. Layers, groups, masks, external file layers, and so on can be virtually cloned and instanced like smart objects, but the master object is editable in context, and all the other instances update in realtime. So it is more convenient. At least, that is my experience.
    Hope this was helpful! Now go build your cities. :-)
    PS: I was thinking: isn't Illustrator or InDesign is far more logical choice for this type of work where you need access to reusable blocks of content? It would also be a more efficient and speedier workflow - Photoshop isn't really meant for this type of work. And Illustrator and InDesign potentially provide better output quality. You can also divide your work in pages, and so on. Then again, you would probably lose the flexibility of smart objects.

  • Okay, so please disregard my last question.  I had the page set up in vector view.  Hmmmm, ridiculous.

    okay, so please disregard my last question.  I had the page set up in vector view.  Hmmmm, ridiculous.  THanks, though, if you took the time to research my idiocy, I appreciate it.

    So this is not the computer that the device normally syncs with, iTunes is working exactly as designed.

  • Questions about Vectors

    I began using Vectors in my programs because Arrays didn't fit my needs (didn't want to have to fix a size for the array), but I wondered if it was possible with Vectors to make tables with multiples dimensions.. Example:
    An array could be defined with [] [] []
    and each time we add [], it created a new dimension. Is that possible with Vectors?!
    Another question:
    I'm trying to create a calculator where we can create an equation, let's say: 2+5-7*2
    Where it respects the priority of equations, and I thought the best way to do so was to store each number and equation in a vector, separatly.. Although, I am having a lot of trouble to succeed, and I wondered if I was on the right way..
    Thanks for your attention!

    As mentioned in one of the other responses, a tree is probably the way to go for your expression parser.
    For using Vector to store multidimensional data you would store vectors within vectors, so the object stored in each element of the first vector (the 'rows') would itself be a vector, and then the elements of these contained vectors is the data for each 'column' of that row.

  • Vector file - newb question

    After reading the user manual, I still don't understand how this works. Let's say I use Adobe Illustrator to draw a picture of sayyyyyyyy.......a kitty. Is there any possible way to take my kitty picture, export it out of illustrator as a vector file and import it into Motion so that motion can scale that image more or less indefinitely and maintain the crystal clear image no matter what the size. Like, can I zoom in on kitty's eyeball in Motion and still have the image look good?
    Sorry for the newbie question but I just have not worked with vector images much. Thanks for any help.

    The answer is yes. All you do is save the file as .ai or .pdf, bring it into Motion, and turn off fixed resolution for the underlying media (import the file to the Canvas, select it in the Media tab of the Project Pane, select the Media tab of the Inspector, and uncheck Fixed Resolution). You can now scale it as large as you wish with no loss of resolution.

  • Question: is it possible to recover an InDesign file that will not open. the problem came by copying a pictogram vector illustrator to indesign. My file indesign does not want to open it now. Thank you

    Question: is it possible to recover an InDesign file that will not open. the problem came by copying a pictogram vector illustrator to indesign. My file indesign does not want to open it now. Thank you

    You can try the script mentioned in #1 here: Re: InDesign 6 is crashing when attempting to open a particular document. All others are opening OK.
    Here's how to install a script: http://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-o r-blog-post.php

  • Question about selecting vector paths in Photoshop

    Hi, I have a question about selecting path points in photoshop.
    This is the setup. I have a vector shape layer (the redi circle). but that's placed inside a group with a vector mask (the black pentagon). What I want to do is select parts of the red circle using click and drag) so I can modify portions of the circle).
    This is Photoshop's behavior as I've noticed it. Photoshop likes to select the shapes for you, and will target layers on its own when you use the Path Selection Tool. It tends to want to select the top most shape. If I target the shape layer first, I can use the Direct Selection tool to select individual points. I can add selected points bu shift+clicking.This is all well and good.
    If I try to select multiple points using click+drag though, it gets a bit weird.
    If I try to click+drag to select multiple points from within the vector mask (from the black), it will fail and select the vector mask. If i try to click+drag to select multiple points from outside the vector mask (from the white), then it will allow me to select points from my vector shape like i intended.
    I could also shift click to hide the vector mask, and it will work the way i want.
    Is there an easy way to tell photoshop not to auto target vector shapes? or a better way to select paths inside vector masks?
    Thanx for any input

    canvai wrote:
    Is there an easy way to tell photoshop not to auto target vector shapes? or a better way to select paths inside vector masks?
    Sure.
    Simply click once on the vector mask for the shape layer (red circle) to highlight that vector mask in the Layers Panel. Then when you click-drag the anchors of that path will be selected, not the group's path.
    If you have no mask highlighted, Photoshop assumes it should select the first path it comes in contact with.

  • Vector collection - enumeration question

    Hi all
    Question: This is how I currently loop through a Vectors elements:
    for (int i = 0; i < clinicVector.size(); i++)
    cmbClinic.addItem(((ClinicRecord)clinicVector.elementAt(i)).GetString());
    This code simply adds some data from the ClinicRecord class to a Choice component. Now my question is this...is this the fastest way to do this? Or would using the Enumeration class be faster?
    Also, I am using JDK1.1.8. Is Vector my only choice for a dynamic collection? I have heard of ArrayList but can't find it in the javadocs (I assume it came in with JDK1.2).
    Thanks for any pointers.

    Let me detail how my system works. You are correct about the ClinicRecord class...it is a wrapper for a table in my back-end DB.
    Each field in the tblClinic table has the name of the clinic + an ID (and some other stuff thats not worth mentioning).
    As I need to do some matching I have encapuslated my Vector in another object called clinics to take care of this matching (matching from id's to clinic names and vice versa).
    My clients (psion netBooks) need to be able to work off-line, so the user has a transfer screen where they can download patients AND what I call lookup objects (Clinic class is one of these). As clinics may have been added by the DBA since the last download, lookup objects are downloaded each time (actually they're not...there is a tick-box on the transfer screen called "Download Lookups...if ticked, downloads them). Lookup objects are persistant objects that get saved to the local client and therefore can be accessed off-line by simply opening from disk.
    Sound good? I haven't really given it that much thought. How do you deal with such lookup objects?

  • Questions about Using Vector To File And JTable

    hi all
    I want to write all data from Vector To File and read from file To Vector
    And I want To show all data from vector to JTable
    Note: I'm using the JBuilder Compiler
    This is Class A that my datamember  And Methods in it
    import java.io.*;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2008</p>
    * <p>Company: </p>
    * @author unascribed
    * @version 1.0
    public  class A implements Serializable {
      int no;
      String name;
      int age;
      public void setA (int n,String na,int a)
        no=n;
        name=na;
        age=a;
      public void set_no(int n)
        no = n;
      public void set_age(int a)
        age = a;
        public int getage ()
        return age;
      public void setName(String a)
        name  = a;
      public String getname ()
        return name;
      public int getno ()
        return no;
    This is The Frame That the JTextFeild And JButtons & JTable in it
    import java.awt.*;
    import java.io.*;
    import java.util.*;
    import com.borland.jbcl.layout.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.table.*;
    import javax.swing.border.*;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2008</p>
    * <p>Company: </p>
    * @author unascribed
    * @version 1.0
    public class Frame1 extends JFrame {
    /* Vector v = new Vector ();
      public int i=0;*/
      A a = new A();
      XYLayout xYLayout1 = new XYLayout();
      JTextField txtno = new JTextField();
      JTextField txtname = new JTextField();
      JTextField txtage = new JTextField();
      JButton add = new JButton();
      JButton search = new JButton();
      /*JTable jTable1 = new JTable();
      TableModel tableModel1 = new MyTableModel(*/
                TableModel dataModel = new AbstractTableModel() {
              public int getColumnCount() { return 2; }
              public int getRowCount() { return 2;}
              public Object getValueAt(int row, int col) { return new A(); }
          JTable table = new JTable(dataModel);
          JScrollPane scrollpane = new JScrollPane(table);
      TitledBorder titledBorder1;
      TitledBorder titledBorder2;
      ObjectInputStream in;
      ObjectOutputStream out;
      JButton read = new JButton();
      public Frame1() {
        try {
          jbInit();
        catch(Exception e) {
          e.printStackTrace();
      private void jbInit() throws Exception {
        titledBorder1 = new TitledBorder(BorderFactory.createEmptyBorder(),"");
        titledBorder2 = new TitledBorder("");
        this.getContentPane().setLayout(xYLayout1);
        add.setBorder(BorderFactory.createRaisedBevelBorder());
        add.setNextFocusableComponent(txtno);
        add.setMnemonic('0');
        add.setText("Add");
        add.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            add_actionPerformed(e);
        add.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            add_actionPerformed(e);
        search.setFocusPainted(false);
        search.setText("Search");
        search.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            search_actionPerformed(e);
        xYLayout1.setWidth(411);
        xYLayout1.setHeight(350);
        read.setText("Read");
        read.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            read_actionPerformed(e);
        this.getContentPane().add(txtno, new XYConstraints(43, 35, 115, 23));
        this.getContentPane().add(txtname,  new XYConstraints(44, 67, 114, 22));
        this.getContentPane().add(txtage,      new XYConstraints(44, 97, 115, 23));
        this.getContentPane().add(add,      new XYConstraints(60, 184, 97, 26));
        this.getContentPane().add(search,  new XYConstraints(167, 185, 88, 24));
        this.getContentPane().add(table,   new XYConstraints(187, 24, 205, 119));
        this.getContentPane().add(read,   new XYConstraints(265, 185, 75, 24));
        this.setSize(450,250);
        table.setGridColor(new Color(0,0,255));
      void add_actionPerformed(ActionEvent e)
        a.set_no(Integer.parseInt(txtno.getText()));
        a.setName(txtname.getText());
        a.set_age(Integer.parseInt(txtage.getText()));
        fileOutput();
        txtno.setText(null);
        txtname.setText(null);
        txtage.setText(null);
        try
          out.writeObject(a);
          out.close();
        }catch (Exception excep){};
    /*  try
           add.setDefaultCapable(true);
          v.addElement(new A());
         ((A)v.elementAt(i)).setA(Integer.parseInt(txtno.getText()),txtname.getText(),Integer.parseInt(txtage.getText()));
        JOptionPane.showMessageDialog(null,"The Record is Added");
        txtno.setText(null);
        txtname.setText(null);
        txtage.setText(null);
        i++;
      }catch (Exception excep){};*/
      void search_actionPerformed(ActionEvent e) {
        int n = Integer.parseInt(JOptionPane.showInputDialog("Enter No:"));
        for (int i=0;i<v.size();i++)
          if (((A)v.elementAt(i)).getno()==n)
            txtno.setText(Integer.toString(((A)v.elementAt(i)).getno()));
            txtname.setText(((A)v.elementAt(i)).getname() );
            txtage.setText(Integer.toString(((A)v.elementAt(i)).getage()));
      public void fileOutput()
        try
          out = new ObjectOutputStream(new FileOutputStream("c:\\UserData.txt",true));
        }catch(Exception excep){};
      public void fileInput()
        try
          in = new ObjectInputStream(new FileInputStream("c:\\UserData.txt"));
        }catch(Exception excep){};
      void read_actionPerformed(ActionEvent e) {
      fileInput();
        try
          a = (A)in.readObject();
          txtno.setText(Integer.toString(a.getno()));
          txtname.setText(a.getname());
          txtage.setText(Integer.toString(a.getage()));
        }catch (Exception excep){};
    }

    //program which copies string data between vector and file
    import java.util.*;
    import java.io.*;
    class Util
    private Vector v;
    private FileReader filereader;
    private FileWriter filewriter;
    Util(String data[])throws Exception
      v=new Vector();
      for(String o:data)
        v.add(o);
    public void listData()throws Exception
      int size=v.size();
      for(int i=0;i<size;i++)
       System.out.println(v.get(i));
    public void copyToFile(String data,String fname)throws Exception
      filewriter =new FileWriter(fname);
      filewriter.write(data);
      filewriter.flush();
      System.out.println("Vector content copied into file..."+fname);
    public void copyFromFile(String fname)throws Exception
      filereader=new FileReader(fname);
      char fcont[]=new char[(int)new File(fname).length()];
      filereader.read(fcont,0,fcont.length);
      String temp=new String(fcont); 
      String fdata[]=temp.substring(1,temp.length()-1).split(",");
      for(String s:fdata)
        v.add(s.trim()); 
      System.out.println("File content copied into Vector...");
    public String getData()throws Exception
       return(v.toString());
    class TestUtil
    public static void main(String a[])throws Exception
      String arr[]={"siva","rama","krishna"};
      Util util=new Util(arr);
      System.out.println("before copy from file...");
      util.listData();
      String fname=System.getProperty("user.home")+"\\"+"vecdata";
      util.copyToFile(util.getData(),fname);
      util.copyFromFile(fname);
      System.out.println("after copy from file...");
      util.listData();
    }

  • Some questions about creating web animations with lighter data and exporting to vector Flash format.

    Hi, I will be creating animations in After Effects mostly using Illustrator vector files and will be exporting to SWF or XFL for using the animations on the web.
    One of the priorities is light data as possible to provide viewers with slower connections with better experience. However the animation should also impress and I need to find a balance between performance and possible imagery.  The animations may have sound and voice narrative.
    I need help with understanding which type of non-vector data is heavier than others. Non-vector image data or sound and voice? And from non-vector image data is some of it lighter or heavier than other - for example motion blur vs smooth gradient vs many colors?
    I would greatly appreciate any suggestions, tips, pointers, etc.,

    Hi, I will be creating animations in After Effects mostly using Illustrator vector files and will be exporting to SWF or XFL for using the animations on the web.
    One of the priorities is light data as possible to provide viewers with slower connections with better experience. However the animation should also impress and I need to find a balance between performance and possible imagery.  The animations may have sound and voice narrative.
    I need help with understanding which type of non-vector data is heavier than others. Non-vector image data or sound and voice? And from non-vector image data is some of it lighter or heavier than other - for example motion blur vs smooth gradient vs many colors?
    Let's do a little "Myth Busters" on that one, shall we?
    Vector data is per se not "lighter" than pixel data. You could have complex paths for which storing the information of the individual nodes takes up more space than a pixel image of the object.
    Dynamic rasterization of vector data costs CPU performance and may in effect make things more slow than just playing a series of pixel images. That would apply to anything from path strokes to gradients.
    All your pretty AI vectors don't mean anything if they are constructed in such a way that either AE or Flash need to rasterize them on import. Anything from converting Bezier paths to paths consisting of dense linear segments to converting fills, patterns, gradient meshes and so on to pixel data
    Pixels are pixels. It does not matter whether they are gradients, mothionblur or just non-antialiased shapes. Flash doesn't care and neither image format that may be used in Flash stores any more or less info. They only differ in their methods, but in the end it's for you to decide whether you use JPEG, PNG8 or PNG24. They all have their pros and cons.
    It makes a difference, if data is embedded in an SWF or if it is externally linked just as it makes a difference whether you enforce audio sync or not, playing every frame or not.
    So for all intends and purposes, it's still up to you to make up your own mind and find the best solution. And Rick has a point - if you're really that concerned about efficiency, then do it in Flash or Flash Catalyst and consider the options there that may help like GPU accelerated layer styles for drop shadows etc., dynamic text or your vector data remaining vector in teh first place.
    Mylenium

Maybe you are looking for

  • Problem with my iphone

    Hi, I just got a used iphone 4s from a friend , he was with a different carrier than me. I am trying my sim card with it but it says that i need a sim card from hes carrier, what am i supposed to do ? Restoring won't help. Iphone 4S IOS 5.0.1

  • The logics for ALL calc key figures (CKF) - Table available?

    Hello experts, I am going through a project here to convert a lot of CKF / RKF in BI Queries. There are 100's of them and what I want to do is to be able to see all the formula's used in one list as opposed to go through each on in query designer whi

  • Reading ORABLOB

    Hi all, In a table (X), I have a Column whose datatype is "BLOB" It insert/updates well...no issues.Displays fine on the ASP page tooo. My Requirement: When I select this column through sql query in TOAD or sql prompt, the result is (ORABLOB) but I w

  • Mailbox migration failed: MapiExceptionJetErrorPageNotInitialized: Unable to find table row

    Hi Everyone, I'm trying to migrate mailboxes from 2010 -> 2013 and I've com across an odd error. I've put my skip limit to 5(for bad files), however this error seems to appear regardless. I'm not a Jets DB expert, but not being able to find a row see

  • Link Checking Issue

    I have been having problems with the link checking on my site background: I had in the past used a lot of relative links for my php includes, I have had to switch them to be root based. This is due to problems I have had with people who use contribut