Easy ways to implement Zoom functionality

Hello,
I have written a small object orientated graph editor that is made of a custom JPanel and custom JComponents. At the moment, device coordinates and user coordinates are the same, - they correspond. Drawing is done via Graphics2D objects.
Is there an easy way to implement a zoom functionality so that device coordinates and user coordinates remain idetically, by just configuring the device (for example via class GraphicsConfiguration ) - so that MouseEvents and all other coordinates are being calculated and converted automatically (Maybe by changing the devices virtual resolution of 72 dpi to another resolution?)
Any help appreciated!
Thanks in advance!
alex

You have to do much work to implement this. Here is the main method that I coded to implement zoom. The whole package is just too large to post here.
* Implements the zoom in, zoom out or zoom functionality according to
* the string <code>command</code> passed in.
* @param command     the command string, one of the three: zoomin,
*     zoomout, zoom
public void zoom(String command) {        
     if(command.equalsIgnoreCase("zoomin")) {
     if(zoomMultiplier+deltZoom > maxZoomMultiplier) return;
          zoomMultiplier = zoomMultiplier+deltZoom;
     } else if(command.equalsIgnoreCase("zoomout")) {
          zoomMultiplier = zoomMultiplier-deltZoom;
          if(zoomMultiplier < minZoomMultiplier)
          zoomMultiplier = minZoomMultiplier;
     } else if(command.equalsIgnoreCase("zoom")) {
          zoomMultiplier = 1.0;
     //Gets the currently visible rectangle's width & height, calculates the new
     //bounds's width & height
     Rectangle rect = getVisibleRect();
     //System.out.println("Contour.zoom getVisibleRect() = "+rect.x+", "+rect.y);
     int newW = (int)((double)rect.width* zoomMultiplier);
     int newH = (int)((double)rect.height* zoomMultiplier);
     //System.out.println("Contour.zoom setBounds = "+newW+", "+newH);
     * Enlarges the component's bounds here & Graph2D.paint() will
     * use this bounds to redraw the contour.
     setBounds(new Rectangle(0, 0, newW, newH));
     //Focuses the currently contents as much as possible
     this.scrollRectToVisible(rect);
     * Changing the size of a scroll pane's client is a two-step process.
     * First, set the client's preferred size. Then, call revalidate on the
     * client to let the scroll pane know that it should update itself and
     * its scroll bars.
     //Update client's preferred size because the area taken up
     //by the graphics has gotten larger or smaller.
     //this.setPreferredSize(new Dimension(rect.width, rect.height));
     this.setPreferredSize(new Dimension(newW, newH));
     //Let the scroll pane know to update itself and its scrollbars.
this.revalidate();                     
Here is some fields used in the method above and the class the method belongs to:
* The multiplier when the zoom in functionality should be carried out.
public double zoomMultiplier = 1.0;
* The increment for each zoom in or out action.
public double deltZoom = 0.2;
* The maximum multiplier in zoom in functionality.
public double maxZoomMultiplier = 20.0;
* The minimum multiplier in zoom in functionality, and
* the currently used value is 1.0.
public double minZoomMultiplier = 1.0;
* The threshold to pan the contour after the PanTo(move)
* button or menu item is activated.
private double deltDistanceToPan = 10.0;
You have to code your method paint() or other methods carrying out the actual painting carefully to make it work with this method harmoniously. It's a too long story to let you know the details here. If you need more discussion, please email me([email protected] or [email protected]. The former address cannot work recently though I pay for it yearly. The latter address is more stable thought it's a free one. You'd better use it.)
Hope this can help.

Similar Messages

  • Is there an easy way to implement a confirm dialog?

    Hi All,
        I'm wondering is there an easy way to show an confirm dialog to user with out create a new view manually?
        Thanks,
    YiNing

    Hi ,
    use the below code for confirmation box , with 2 options "OK "
    and "Cancel"
    IWDControllerInfo controllerInfo =     wdControllerAPI.getViewInfo().getViewController();
    IWDConfirmationDialog dialog =     wdComponentAPI.getWindowManager().createConfirmationWindow
                                    ( String dialogText,controllerInfo.findInEventHandlers                                ("ok"),"Ok");
                        dialog.addChoice(controllerInfo.findInEventHandlers                                          ("cancel"), "Cancel");
                        dialog.open();     
    Thanks,
    Sunitha Hari

  • In Labview, is there an easy way to implement a string input from the operator with a dialog box?

    I have a production test system that I want the operator to enter the serial number through a dialog box. As I've currently done it, there's a string control on the front panel to enter the serial number, but the program will run without it. Any helpful hints would be greatly appreciated.

    make a special vi with only the string as a control and a second string as an indicator connected to it. This string might be hidden after you connect this indicator to the connector. In the vi-properties select dialog and off you go.
    greetings from the Netherlands

  • Is there a way to implement a breadcrumb turnaround for RoboHelp7 HTML?

    Hello everyone,
    I have a unique situation on my hands.  I would like to implement breadcrumb functionality for RoboHelp7 HTML Help.  I am aware of the following items (feel free to correct me if I'm wrong about any of this):
    Breadcrumbs can be automatically populated using RoboHelp7 WebHelp;
    Breadcrumb functionality is available for RoboHelp 8, for both WebHelp and HTML Help
    Despite my pleas, our company is not yet able to upgrade to RoboHelp8, so I've been hard at work developing a JavaScript file that creates a breadcrumb trail (certainly open to error as this is not an automatic process).  It's gotten to be an exhaustive process, as I'm trying to extract the Help system name (not topic name) for the script.
    So my question is this: is there an easier way to implement breadcrumb functionality for RoboHelp7's HTML Help, or is this the best I can do?
    Any help or referral is much appreciated.
    Thanks in advance,
    Sick of Scripting

    Hi there
    I have RoboHelp 7 and Breadcrumbs aren't offered there as a feature for CHM ouptut. Sorry.
    Anything you do will most certainly involve some custom coding or manual input.
    I suppose one possibility would involve creating a few templates. You would need one for each book path in your project. Then build a breadcrumb trail leading to the book. Apply the template to the appropriate topics.
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Any easy way to execute function when a [bindable] property changes?

    Say i have a [Bindable] property
    [Bindable] public var myText:String;
    Is there some easy way to trigger a function when myText changes?
    I understand that Bindable metadata tag adds setter and getter functions and some propertyChanged-event or something, so can i like just use ".addEventListener(Event, myFunction)" somewhere or something similar to execute myFunction?

    I tested this code:
    import mx.binding.utils.ChangeWatcher;
    public var myText:String;
    private var watcherInstance:ChangeWatcher = ChangeWatcher.watch(this, ["myText"], changeHandler);
    public function changeHandler(event:Event) :void {
         trace("win");
            private function handleClick() : void {
                myText = "testing" + new Date().getTime();
                trace("myText is now " + myText)
    <mx:Button label="click" click="handleClick()"/>
    only traces I get are:
    myText is now testing1283532597884
    myText is now testing1283532604501
    myText is now testing1283532609616

  • Best way to implement m to n relation?

    Could you please give me some advice on the best way to implement m-n relations in apex?
    Example: I want to store server and database info. A server can have multiple database of course. But in case of a RAC database, the database can be running on multiple servers. So I have tables:
    create table SERVERS (id number primary key, name varchar2(30));
    create table DATABASES(id number primary key, name varchar2(30))
    and an m-to-n table
    create table SERV_DB(serv_id number references SERVERS(id), db_id number references DATABASES(id), instance_name varchar2(30))
    So the table SERV_DB can tell me e.g. that database PROD is running on server 'prdsrv1' with instance PROD1 and on server 'prdsrv2' with instance name PROD2
    How would you design an apex page to maintain this information (adding relations, updating instance names, etc)? I have a solution using checkboxes and 2 for-loops over htmldb_application.g_f40 (to process checkboxes) and g_f41 (to process text fields with instance names) and some delete statements but the logic behind it looks too complex for me. I am convinced that this can be done more simpler. Seems like a common problem to me, so I wonder if there is no out-of-the-box solution in apex for this?
    Could you please show me or create a small demo application with the solution that looks most elegant to you?
    Thanks,
    Geert

    Thanks for your reply. You modified the question slightly, but conceptually it is still the same. What you call the instances table corresponds with my serv_db table. I understand the solution you propose using the tabular report. If I see it correctly, you would have an insert button above the tabular report for each new relation (instance - server) you would want to add. This is ok for the case i used (databases, servers, instances) because there are relatively few relations. However I would not like this solution for other cases. E.g.:
    case: you have a list of persons and a list of tasks. You want to assign tasks to persons in a way that each person has multiple tasks to do and each task can be assigned to multiple persons.
    Suppose you add a new person, and you want to assign 15 tasks to him. The solution above (with the tabular report) would be quite some work because you would have to click 15 times on the insert button and on each click select a task from the select list. In this case it would be more appropriate to, after selecting the new person, see a list of all tasks (e.g. 30 tasks) with a checkbox in front, so you can mark 15 out of the 30 checkboxes and press submit. It gets more complex when you want to assign also an attribute to the relation, i.e. showing the list with all tasks, a checkbox in front and a select list next to each task where you can choose from e.g. "priority high" or "priority low" to indicate that this task is high or low priority for that person. Is there an easy way to implement that?

  • How to implement zooming in UITableView

    How I can implement zooming functionality in uitableView in ios7 or ios6. Need quick response. Thanks in advance.

    Change font size and row height in response to a pinch gesture?

  • Is there an easy way to pan and zoom still slides in PE4?

    Either i'm totally stupid, or why is it so hard to pan and zoom still slides in PE4?
    I'm trying to create a slide show in PE4, and i want to pan and zoom on each slide -- nothing overly fancy, but i want to control where the beginning and end point is for each zoom. It's really easy to do this in PSE 6 -- it shows you green and red boxes for where the pans/zooms begin and end and you can just grab the boundaries and change them. in PE 4, it seems you have to use presets (which are only pans OR zooms) or resort to Keyframes which are very complicated and VERY POORLY explained in the Adobe PE4/PSE6 classroom in a book.
    Is there an easy way to do pans and zooms without being a rocket scientist?

    Eric,
    The ability to use Keyframing in infinitely powerful. However, with that power comes some hand-work.
    However, once one has their head around the concept of Keyframing, the mechanics of it, plus the options, it becomes easy and second nature. It's getting to that point, that requires a bit of work and practice. I second Steve's tip link, as a great place to start. Once you become comfortable with the power, you'll likely never go back to any form of "Random Pan & Zoom."
    Now, the work that I do is usually very tightly scripted. Each "move" depends on the exact subject and what I, or the director, want at that moment, with that image. I often have this part figured out, before I re-size the images for Import. If I need more Pan, then I'll go a bit larger. Less Pan and I'll get it right at the DVD frame size (720x480 PAR 0.9, in my case).
    Learning which Panels to have open, and when, will go a long way to making the experience easier and more enjoyable, so setting up one's Workspace is very important. Big, honking monitors also make the editing experience more pleasant.
    Good luck,
    Hunt

  • Can we implement the functionality similar to ROW_NUMBER() in generic/common way for all databases using SQL ?

    In my project,i am allowing user to select database of his choice from given options & i need to write queries considering
    all these optional databases. So as per my one of requirement,is there any way to achieve generic functionality similar to ROW_NUMBER() in MSSQL ?

    First run this and check the db version
    SELECT @@VERSION
    EXEC sp_dbcmptlevel 'db name'
    If version is above 2012 and compatibility level is above 80 ROW_NUMBER will work.
    Otherwise you need to use this
    http://sqlserverplanet.com/sql-2000/simulate-row_number-in-sql-2000
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Intelligent way to implement string command parser?

    Hi,
    since a while I am thinking about a possibility to improve a LV program that controls Hardware on a RT target.
    The current situation: The user interface is a LV program running on a laptop, the instrument is a CRIO target with
    its own software controlling the hardware and aquiring data.
    Both programs communbicat via TCP/IP, user actions are sent to the RT target as strings (tab delimited with arguments).
    Now, since the programs are continuously being improved it is a bit cumbersome to get the set of commands synchronized
    with the "parser" which evaluates these commands.
    Is there a way to get a command set and the corresponding parser in "sync"?
    Maybe I need to explain this a bit more:
    Currently, all possible commands are stored in a Type-Def of a combo-field (I am not sure this is the correct term, in german its "Kominationsfeld").
    Each command has one entry, the possible arguments separated by tabs and are defined with a placeholder, in my case the string @@@.
    I do this to avoid typos and to have an overview of all commands.
    Now it would be nice to have a "parser" in the RT software which checks the incomming commands againts this Type-Def combo field and populates
    a case structure with all possible commands. So I only have to write the code in the case structure to "do something" with the command and its arguments.
    I know the latter is not possible but maybe there is a solution something in between that I did not see so far.
    What I would appreciate is at least a mechanism which "synchronizes" the cases in a case structure with my string command "array". But I need srings to be sent
    as strings not numbers like with a ring.
    Another point is the number of arguments which varies between commands.
    Any suggestions?
    Olaf

    Hi Olaf,
    First of all, you should have created this post in the LabVIEW Real-Time forum, since your question is about RT communication.
    Then to summarize, you have a LabVIEW project where you target a cRIO. You use the TCP/IP Protocol for communicating between your Host PC and RT, if I'm correct.
    When setting a the Server/Client mechanism, you have a certain synchronization already. TCP functions are only working with strings, however you can define any datatype and convert it into a string, and then read the data back. This way, you could send an enum for the command name and connect it to a case structure, in the same you use it in a state machine (see attachment).
    Could you clarify some aspects:
    - Which LV Version do you use?
    - Which mechanism did you implement for the TCP Communication?
    - Do you need to control your cRIO from the host or/and read data from your cRIO?
    - Are you aware about shared variables? easier way to communicate between Host and RT Target
     I would suggest you have a look at these Tutorials:
    Real-Time VI to Host VI Communication Methods
    Command-based Communication Using Simple TCP/IP Messaging
    Regards,
    Laurent P.
    Application Engineer - NI Switzerland
    Attachments:
    string conversion.vi ‏9 KB

  • The best way to make zoom over a Graphic2D object

    Hi to all!
    I'm reading severals webs that describe the way to make zoom using Java2D. I'm working with an object Graphic2D and I want let the user to zomming in over the image, clicking the left mouse button and make zoom out clicking the right mouse button. I'm trying to make this using the method "scale()" of Graphic2D class, but I don't understand how it really works and I don't know if I have choised the best way to implement the zoom function. I let you a piece of code that I think sould do that I have said, why doesn't it works?
    public class zoom extends JPanel implements MouseListener, MouseMotionListener{
        public static JFrame window = new JFrame();
        Graphics2D g2;
        public static void main(String[] args) {
            zoom internalPanel = new zoom();
            internalPanel.setBorder(BorderFactory.createTitledBorder("Zoom test"));
            window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            window.setPreferredSize(new Dimension(500, 500));
            window.setLayout(new FlowLayout(FlowLayout.CENTER));
            window.add(internalPanel);
            window.pack();
            window.setVisible(true);
        public zoom(){  
            setPreferredSize(new Dimension(500, 500));
            addMouseListener(this);
            addMouseMotionListener(this);
        public void paintComponent(Graphics g) {
            super.paintComponent(g);
            g2 = (Graphics2D) g;
            Dimension d = getSize();
            Image mImagen = createImage(500, 500);
            Graphics2D offG = (Graphics2D) mImagen.getGraphics();
            offG.setColor(Color.white);
            offG.fill(new Rectangle2D.Double(0, 0, d.width, d.height));
            g2.drawImage(mImagen, 0, 20, null);
            g2.setColor(Color.blue);
            Ellipse2D ellipse = new Ellipse2D.Double(100.0d, 100.0d, 100.0d, 100.0d);
            g2.fill(ellipse);
        public void mouseClicked(MouseEvent e) {
            if (e.getButton()==1){
                g2.scale(10.0, 10.0);
            if (e.getButton()==3){
                g2.scale(-10.0, -10.0);
        public void mousePressed(MouseEvent e){}
        public void mouseReleased(MouseEvent e){}
        public void mouseEntered(MouseEvent e){}
        public void mouseExited(MouseEvent e){}
        public void mouseDragged(MouseEvent e){}
        public void mouseMoved(MouseEvent e){}
    }Thanks for read.
    Edited by: Daniel.GB on May 1, 2008 5:02 PM

    zoom makes centering the zoomed image over the mouse pointer
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class ZoomTest2 extends JPanel implements MouseListener,
                                                     MouseMotionListener {
        Image mImagen;
        Point loc;
        double scale = 1.0;
        double scaleInc = 0.1;
        double MIN_SCALE = 0.25;
        final int WIDTH  = 500;
        final int HEIGHT = 500;
        public ZoomTest2(){  
            addMouseListener(this);
            addMouseMotionListener(this);
        public Dimension getPreferredSize() {
            Dimension d = new Dimension();
            d.width  = (int)(scale*WIDTH);
            d.height = (int)(scale*HEIGHT);
            return d;
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D) g;
            Dimension d = getSize();
            if(mImagen == null) {
                mImagen = createImage(WIDTH, HEIGHT);
                Graphics2D offG = (Graphics2D) mImagen.getGraphics();
                offG.setColor(Color.white);
                offG.fill(new Rectangle2D.Double(0, 0, d.width, d.height));
                offG.dispose();
                loc = new Point(WIDTH/2, HEIGHT/2);
            AffineTransform orig = g2.getTransform();
            // Center the scaled image under the mouse pointer.
            double x = loc.x - scale*WIDTH/2;
            double y = loc.y - scale*HEIGHT/2;
            g2.translate(x, y);
            g2.scale(scale, scale);
            g2.drawImage(mImagen, 0, 0, null);
            g2.setColor(Color.blue);
            Ellipse2D ellipse = new Ellipse2D.Double(100.0d, 100.0d, 100.0d, 100.0d);
            g2.fill(ellipse);
            g2.setTransform(orig);
        public void mousePressed(MouseEvent e) {
            if (SwingUtilities.isLeftMouseButton(e)){
                scale = scale + scaleInc;
            } else if (SwingUtilities.isRightMouseButton(e)){
                scale = scale - scaleInc;
                if(scale < MIN_SCALE)
                    scale = MIN_SCALE;
            loc = e.getPoint();
            repaint();
        public void mouseClicked(MouseEvent e){}
        public void mouseReleased(MouseEvent e){}
        public void mouseEntered(MouseEvent e){}
        public void mouseExited(MouseEvent e){}
        public void mouseDragged(MouseEvent e){}
        public void mouseMoved(MouseEvent e){}
        public static void main(String[] args) {
            ZoomTest2 internalPanel = new ZoomTest2();
            internalPanel.setBorder(BorderFactory.createTitledBorder("Zoom test"));
            JFrame window = new JFrame();
            window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            window.setLayout(new FlowLayout(FlowLayout.CENTER));
            window.add(internalPanel);
            window.pack();
            window.setVisible(true);
    }

  • Is there an easy way to filter a 2-d array based on the values of two of the fields?

    Is there an easy way to filter a 2-d array based on the values of one of the fields. In my attached VI the output array has the following format:
    TimeStamp        Ident                Frame Type          Bytes    Data
    10:57:07.621   3AD00016   CAN Data Frame   8          0000000000000000
    10:57:07.622   3AD00017   CAN Data Frame   8          000005E000000000
    10:57:07.624   3AD00018   CAN Data Frame   8          0000000003300000
    10:57:07.625   2DC00000   CAN Data Frame   8          0000000000000000
    10:57:07.626   3AD00019   CAN Data Frame    4         0000030000000000
    I would like to delete any rows that do not have an "Ident" between the values of 3AD00000 and 3AD0001E. So for the above data the fourth row would be deleted. The only way I can see to do it is to form a 1-d array. Is there a better approach?
    Thank you.
    Solved!
    Go to Solution.
    Attachments:
    CMM_SN_MULTI.vi ‏20 KB

    Hi chuck72352,
    after you have sorted your data, you can use the InRange Function. Combined with a "search 1D Array" you'll get the range you really want.
    Mike
    Attachments:
    ArraySubset.PNG ‏25 KB

  • How do I add a zoom function to a digital magazine (.swf file) in InDesign CS6?

    Hi,
    Im creating an interactive digital magazine for our company which will go on the iPad, but also online for computers.
    The iPad (.folio) has zoom functions, but on screen (.swf) the magazine is very static and peaple can't zoom and scroll (the zooming buttons function in InDesign doesn't work here).
    So, how do I add a zoom function to a digital magazine (.swf file) in InDesign CS6?
    (I read older posts regarding this problem in CS5... It's not possible for me to purchase an additional product for that. I have Flash, if there is a tutorial on how to do it, that'd be helpful too)
    Thanks for your help!
    Best regards!

    Although the help implies this should work, and I've seen it written in a book to do things this way, it's not how I do things:
    var content_req1:URLRequest = new URLRequest("text/hales.txt");
    var content_ldr:URLLoader = new URLLoader(content_req1);
    content_ldr.addEventListener(Event.COMPLETE, onComplete1);
    Instead, try:
    var content_req1:URLRequest = new URLRequest("text/hales.txt");
    var content_ldr:URLLoader = new URLLoader();
    content_ldr.addEventListener(Event.COMPLETE, onComplete1);
    content_ldr1.load(content_req1);

  • Is There an Easier Way to Save a PDF for Perfect Binding?

    I've always had this problem whenever I do a booklet or magazine that will end up perfect bound: I have my document setup in CS6 with "facing pages" so I can easily design spreads with images and backgrounds that span both pages. Usually, when it prints, it's saddle stitched, so I don't mind if the inside edge has contents from the other page since they will print next to each other anyway. When I've done perfect bound booklets in the past, I've always unchecked "facing pages" and manually duplicated and moved the image that span the entire spread to cover both pages. However, I'm currently working on a 48-page magazine and I really don't feel like doing this... specifically for fear of missing something and overlooking it so that it prints wrong.
    Here are some examples:
    This first one obviously has one background image that spans both pages of the spread
    However, when I try to separate the pages. My same right-hand page now has no background. A good majority of the magazine is laid out this way.
    Similarly, this spread with 2 full-page ads have no bleed on the inside margin for proofing purposes. If it were saddle stitched, I wouldn't give a second thought I'd just let the auto bleed pull image from the other ad. Who cares? They're going to be right next to each other anyway. But, since we're going the perfect-bound route, I need for each ad to have full bleed on all 4 sides. Is it just my neuroticism? The inside edge will be glued amongst 47 other pages. Will anyone ever notice that sliver of white, black, and red from the Sarge ad nestled in the spine when they're viewing the Sunrise Detox ad is the cutting is off?
    I know you can do the "shuffle pages" thing to help with the ads, but I'm just hoping there's an easier way; a checkbox... something! C'mon, Adobe! You're #1 in the design industry and it's so difficult to work around the facing-pages-full-bleed issue. I know I'm not very advanced with my InDesign experience. But if after several years, many booklets, a few magazines, and a couple version upgrades, I'd like to think I would've found an easier way to do this. You know, kinda like how your new liquid pages features. That would be tremendous if something similar could be implemented for people in printing to quickly change between design spreads, proof spreads, and printing single pages!
    Thanks in advance for any help!!
    ~Coral

    If you have facing pages, you have to set up the document with facing pages that is what is it for. If you have a spreadwide design as above, keep the spreads together. There is not even one reason not to do so.
    Only for wire-O-bindings might a different workflow useful, but also with facing pages documents and only when the left page and the right page have not a spread wide design:
    //// I did one mistake, I created a doument with a right binding, but it would work the same way with left binding.)
    1. Create a document with Facing Pages.
    2. Select the Spread in the Page Panel (Window > Page Panel) and in the panel’s flyout menu deselect "Allow Selected Spread to Shuffle". The spread’s page number will appear in brackets.
    3. Select a single page of the spread and drag it to the side until a vertical bar appears.
    4. Now you have the result.
    Left and right pages have their own spread and will have a bleed around each page without taking information from the other page.

  • Displaying Multiple Values on GUI components - best way to implement

    Hi,
    my program needs to implement a basic function that most commercial programs use very widely: If the program requires that a GUI component (say a JTextField) needs to display multiple values it either goes <blank> or say something more meaningfull like "multiple values". What is the best way of implementing it?
    In particular:
    My data is a class called "Student" that among other things has a field for the student name, like: protected String name; and the usual accessor methods (getName, setName) for it.
    Assuming that the above data (i.e. Student objects) is stored in a ListModel and the user can select multiple "Students", if a JTextField is required to display the user selection (blank for multiple selections, or the student "name" for a single selection), what is the best (OO) way of implementing it? Is there any design pattern (best practice) for this basic piece of functionality? A crude way is to have the JTextField check and compare all the time the user selections one by one, but I'm sure there must be a more OO/better approach.
    Any ideas much appreciated.
    Kyri.

    Ok, I will focus on building a solution on 12c.
    right now I have used a USER_DATASTORE with a procedure to glue all the field together in one document.
    This works fine for the search.
    I have created a dummy table on which the index is created and also has an extra field which contains the key related to all the tables.
    So, I have the following tables:
    dummy_search
    contracts
    contract_ref
    person_data
    nac_data
    and some other tables...
    the current design is:
    the index is on dummy_search.
    When we update contracts table a trigger will update dummy_search.
    same configuration for the other tables.
    Now we see locking issues when having a lot of updates on these tables as the same time.
    What is you advice for this situation?
    Thanks,
    Edward

Maybe you are looking for