Composite design process - help!

Can anybody offer some guidance (any guidance). I have created several classes that I need to have communicate with each other. Therefore I created one called sessionData to kind of keep track of which class is doing what but it is not working. I get errors all over the place. Currently I have a JDesktopPane which has internal frames. Some of these internalframes call and make more internal frames. (as it is right now, they are created inside the new Internalframe) I need them to be created in the JDesktopPane instead. That is why I have the sessionData class. Any ideas? or point me to some code that already works. Or just answer, how do I instantiate ea. session in ea class?

I don't know if you want to use a session object. Session objects are an example of the Visitor pattern and have there advantages and disadvantages. Most of Swing uses an event notification process which is an example of the Observer pattern. You may want to read the sections in the design patterns book (Erich Gamma, et al) before deciding which will better serve your application. Most Swing apps I have worked on have used events.
You mentioned that you wanted your sessionData object to keep track of which class was doing what. That is kind of web programmers trick brought about because you have to keep track of what is happening on the client so you can respond appropriately. In Swing (or any other fat client), you can just wait for an event to happen and then deal with it appropriately. Much cleaner and elegant. Events are more object-oriented also because each class is more self contained. Your class doesn't care what someone else is doing, it only cares when someone sends an event to it.
As for your problem with JDesktopPane:
I don't understand what you are getting at. You have a JDesktopPane and you add a JInternalFrame to it, correct? Then something happens and you need to create a new JInternalFrame. You should add the second internal frame to the desktop pane not the first internal frame.
Here is a little example of what I am talking about. Say you have a little app that is opening files up and displaying them in a JInternalFrame. You might create an interface called FileListener that looks like this:
public interface FileListener {
  public void openFile(FileEvent fileEvent);
}The class which holds your JDesktopPane would then implement that interface and would create a new internal frame and add it to the desktop pane everytime the openFile method was called.
The FileEvent code would look like this:
public class FileEvent extends EventObject {
  private File file;
  public FileEvent(Object source, File file) {
    super(source);
    this.file = file;
  public File getFile() {
    return file;
}Then there are the classes that actually generate the FileEvent. For instance OpenAction might popup a JFileChooser and then fire an event so that a FileListener can open the File. Here are a couple of methods that might be in your OpenAction:
private List listeners = new LinkedList();
public void addFileListener(FileListener listener) {
  listeners.add(listener);
public void removeFileListener(FileListener listener) {
  listeners.remove(listener);
private void fireFileEvent(File file) {
  FileEvent event = new FileEvent(this, file);
  Iterator iterator = listeners.iterator();
  while (iterator.hasNext()) {
    ((FileListener)iterator.next()).openFile(event);
}When the JFileChooser returns with the selected file you can simply call fireFileEvent() and pass in the File as an argument. This will broadcast the event to everyone listening.
Lastly you register the class that is holding your JDesktopPane as a listener to OpenAction by calling the registerFileListener() method and you should see a new JInternal frame popup with the contents of the file that your JFileChooser selects.
Hope that helps,
-Phil

Similar Messages

  • Design process, help required

    Hi all,
    I am a sort of new be to the java programming world, and still finding my feet to a degree.
    I have a project which consists of me coding a java text editor, with some additional features, such as an online help feature, syntax colouring, bracket matching and a compiler aid i.e. translation of compiler error messages.
    While i feel slightly confident about the coding side of this project, i am not very cler as to how my overall design should look .
    This is realy a software design problen i have rather than a coding problem.
    If anyone can help put me in the right direction it shall be very much appreciated .
    If anybody wishes to ask questions please fell free.
    Thank you

    java_virgin:
    Bear with me while I respond to the others.
    Ceci...:
    Excellent advice, but let me address one pet peeve - MVC is a horrible misnomer. In some instances (enterprise software) the data is a "model" of the underlying reality but in other cases, such as a code editor, the data is not a model, it IS the underlying reality. So will you allow us to call this the Data, View, Controller pattern? Thanks in advance.
    Dr. Clap:
    draw picturesBravo. In 1970 a very experienced programmer told me this: "The first step in writing a program is to turn your computer off." Some truths are immutable.
    java_virgin:
    Thanks for your patience. Here's why.
    I'm writing a code editor. Version 1 was ad hoc based on another I'd written for a book about C++ programming. Version 2 was V1 but rebuilt using DVC (MVC, but it's not a Model, is the Data). Much improved - controller spits commands at the data. Data runs on a separate thread at its own pace. Intermediate command "stack" receives commands and supports multiple undo/redo operations. (Stack converts multiple commands to single ones: Ins "T"'; Ins "h"; Ins "e" becomes Ins "The", etc.)
    Then I realized that I'd want an application framework to surround the editor, so I wrote one. Multiple menu and icon bars, docking at any side or torn off and flying free. Then I hit the wall - didn't know how to interface the framework to the enclosed editor. I've been working on that design since about 2/1 and just today finished it. No nice pattern presented itself. But I'm pretty sure the design will nicely support lots of tools running together, as in NetBeans or Eclipse.
    I'd be glad to answer your original question, but would much prefer that we work together on separate parts of a single project. Is yours a school project? Mine's a personal project aiming for a commercial result.

  • Please can someone help, I have a question in my coursework that I don't know the answer to! Explain how PostScript fits into the design process?

    Please can someone help, I have a question in my coursework that I don't know the answer to! Explain how PostScript fits into the design process?

    The simple answer is that today PostScript really doesn't fit at all into the Graphic Design process, at least in terms of what the graphic designer needs to know.
    Historically, though, the PostScript imaging model, first introduced circa 1984 provided the basis for the initial publishing software including PageMaker, Illustrator, QuarkXPress, and even Ventura Publisher. This imaging model included support for continuously scalable text, vector, and raster imagery as well as the concepts of a current transformation matrix that allowed arbitrary scaling, rotation, etc. and multiple color spaces (grayscale, RGB, CMYK, spot, device independent, and color-managed).
    The PostScript imaging model was effectively replaced by the PDF imaging model, a significant superset of the PostScript imaging model, by the time Illustrator 9 and InDesign 2 were released in terms of support of ICC color management, transparency, etc.
    The fact is that a good graphic designed doesn't need to know anything about PostScript or PDF per sé, but rather about the basics of color (such as issues associated with color gamut and what how that affects display and printing), use of text versus vector versus raster images and why one should keep content at the highest level of abstraction all the way to the rendering (or screen) or RIP process for printing. Some knowledge of typography also helps.
              - Dov

  • Building a Composite Business Process from Scratch-Guided 1 (Cannot Build)

    Hi, I have tried to followed the document : Building a Composite Business Process from Scratch with SAP NetWeaver BPM u2013 Guide 1 to create my first BPM program, however, the program cannnot be built. I don't knoww how to fix the program, can you help?
    Error: Constraint violation: Active pool "Investment Approval Process" must have exactly one End or Termination but any End Error Event.
    Error: Constraint violation: Active pool "Investment Approval Process" must have exactly one Start Event.
    Warning: Constraint violation: No administrator defined for "Investment Approval Process".
    Warning: Constraint violation: Some of the data elements from input mapping of "Enter Purchase Request"is not initialized before used.
    Warning: Constraint violation: Some of the data elements from input mapping of "Approve Purchase Request"is not initialized before used.
    Error: Exception during constraint check of processes. Check Your model for problems.
    Error: Constraint validation found errors
    Ant build finished with ERRORS
    Constraint validation found errors
    Error: Build stopped due to an error: Constraint validation found errors
    Regards,
    Matt Yim

    Hi Matt,
    Check the following in your process:
    - If you have gateways in your process, ensure that all the paths have conditions and atleast 1 default path for gateway is set
    - Check for Process Administrator assignment and TaskLevel/Lane level potential owners are assigned
    - Check for the i/o mapping of tasks
    - Check the Problem View for th errors.
    Cheers,
    Arafat

  • Database design for Help Desk application.

    Hello does any one know
    Database design for Help Desk application.
    ERD
    Business rules and features
    ?

    The best way to approach a database design is to write a
    specification for the application. Document what processes the help
    desk technicians will do. In the process, identify what pieces of
    information they work with. When you have the complete
    specification written, you can then begin grouping the pieces of
    information they work with together. For example, a ticket may have
    a number, status, priority and a person to whom it is assigned. The
    person to whom the ticket is assigned will have a name, phone
    number, e-mail address and a list of technical skills.
    So in this overly-simplified example, we could have a table
    that contains ticket information, a table that has information
    about technicians and a table of skills. Then ask your self
    questions like "Can one ticket be handled by more than one
    technician?" "Can one technician handle more than one ticket?" Can
    a technician have more than one skill?" In this way, you can begin
    seeing the one-to-one, one-to-many and many-to-many relationships
    that exist.

  • Fireworks or Dreamweaver to start the design process?

    Please advise which is the best application to use to start the design process a site,  from a code-illiterate print-designer's point of view - I assumed it would be Dreamweaver but read somewhere recently that I should start in Fireworks (which I always thought was more for creating optimised graphic web content).
    As a print designer I use InDesign (with Photoshop and Illustrator) CS4 and would appreciate advice on the most logical and intuitive tool to use to start the job of designing a site with.
    Once the design is approved I will get someone who knows what they're doing with HTML, CSS and PHP etc. to check it all over and do the tricky bits.
    Any help in pointing me in the right direction would be appreciated.
    Thank you.
    PS - apologies if this is bad forum etiquette but I posted this question yesterday on the Web Design Forum but then thought this may be a more appropriate forum to post it.

    If you're a designer creating a new design, Fireworks is a great place to start. (I can't imagine trying to design in Dreamweaver, frankly.) If you're familiar with Photoshop and Illustrator, you could start with one of those applications, too, but Fireworks was built for the job.
    However, Fireworks is not a coding tool. Like Photoshop, it has the ability to export HTML, but that functionality is intended for creating mockups, not live sites. After you have your site designed in Fireworks, you or someone else will want to use Dreamweaver to (re-)produce the design in code.
    You can use Fireworks to set out your vertical grids, place header and navigations graphics, set place-holding text (remember that HTML text can be resized by users, so places for text blocks must be able to resize). And yes, Once you have your design, use Fireworks to slice that design and export the optimized graphics for your coder to use.

  • Hi I am trying to change the margins and layout of an existing in design document, help!

    Hi I am trying to change the margins and layout of an existing in design document, help!

    This is an open forum, not Adobe support... you need Adobe support to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"
    or
    Make sure that EVERY DETAIL is the same in every place you enter your information
    -right down to how you spell and punctuate the parts of your name and address
    Change/Verify Account https://forums.adobe.com/thread/1465499 may help
    -Credit card https://helpx.adobe.com/utilities/credit-card.html
    -email address https://forums.adobe.com/thread/1446019
    -http://helpx.adobe.com/x-productkb/global/didn-t-receive-expected-email.html

  • Best practices or design framework for designing processes in OSB(11g)

    Hi all,
    We have been working in oracle 10g, now in the new project we are going to use Soa suite 11g.For 10g we designed our services very similar to AIA framework. But in 11g since OSB is introduced we are not able to exactly fit the AIA framework here because OSB has a structure different than ESB.
    Can anybody suggest best practices or some design framework for designing processes in OSB or 11g SOA Suite ?

    http://download.oracle.com/docs/cd/E12839_01/integration.1111/e10223/04_osb.htm
    http://www.oracle.com/technology/products/integration/service-bus/index.html
    Regards,
    Anuj

  • When I try to apply update it tells me firefox is running and when I try to kill firefox it runs suddenly and mmediately after killig process help meeee

    When I try to apply update it tells me firefox is running and when I try to kill firefox it runs suddenly and immediately after killing process help meeee

    hello, in case firefox.exe is always running, this might be a sign of malware active on your pc.
    [[Troubleshoot Firefox issues caused by malware]]
    [[Firefox exe is always running]]

  • I purchased a file that advised it works with Illustrator intalled via extension manager and it only shows in my 'others products'? I cant even open the file in illustrator or in design? Help    =)

    I purchased a file that advised it works with Illustrator intalled via extension manager and it only shows in my 'others products'? I cant even open the file in illustrator or in design? Help    =)

    What's the product name please?

  • Design process for accessibility features?

    Hello all,
    I'm wondering if anyone might know where I can find some insight into how the iPad - specifically the accessibility features - was designed. I've found some speculation and one interview with a designer, but does Apple itself make its design process public? Or is it all proprietary?
    I hope this is the right forum - I scoured the website for a more appropriate one, but couldn't find it.

    Basically it's all proprietary. Apple tends to be very secretive about their design process. The available features are easily found:
    http://www.apple.com/ipad/features/accessibility.html
    and some general information:
    http://www.apple.com/accessibility/
    but how Apple decided what specifically to address in a given product and how they approached it generally won't get discussed in public. If you are a media representative working on a story, you might try Apple's PR department and see if they can provide insight or connect you with someone who can:
    http://www.apple.com/pr/
    but if you're enquiring as a private citizen, there's not much you're likely to be able to discover.
    As to the forum, there really isn't a particular forum for these sorts of questions, since the Discussions are for technical support issues. This forum is as good as any, and the Hosts probably will allow the thread to remain as long as it doesn't become a poll or a complaint thread.
    Regards.

  • Article about Composite Designer

    Hi all,
    a few days back I published one article about the new Composite Designer on SDN. It is a new feature of the Developer Studio shipped with Netweaver CE. You basically get a brief overview about the Composite Designer and its benefits for your work. Any feedback is welcome, so don´t hesitate to get in touch with me.
    You can find the article here:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f04a0a13-0ca1-2c10-0dbc-b5e131982f62
    Best regards,
    Stefan

    Glad you posted your findings. I've been using this class for a few years with no problems until I tried to use nested borders, so I just tracked the bug down last week. Then I found your post. :-)
    It's nice to have some corroboration. I submitted a patched CardPanel.java to TSC, hopefully they will update their article index to include the fixed version of the code.
    -jw

  • Batch Image Loading & Processing Help!

    I am a Retoucher and I have a new client that sends me 150 - 200 Real Estate photos per day. They shoot the photos so that I have 1 ambient exposure (Background Layer) and 1 flash exposure (Layer 1) which I then blend together with a recipe I designed for their look. I need to find a way to speed up the processing and although my action executes the look exactly how I need it in a very efficient manner the real time killer is the opening & layering steps.
    I know this a long shot but my ideal solution would be to drag the folder of images which are sorted and/or labelled in the correct order in to a droplet and from there it processes the images one at a time but layering the files (ambient as "Background" and flash as "Layer 1"), running the action, has a stop-action on lens correction, asks me where to save, closes the image and continues to the next image.
    Does anyone know of a way to accomplish this? Any help would be greatly appreciated, I've searched for countless hours and can't seem to find a solution.
    Thanks for any advice.
    Darren

    Only scripts can reliably handle file and layer operations based on names, so you should ask in that sub-forum.
    Mylenium

  • Importing Oracle Designer Processes into BPEL Designer

    Hello,
    We have several business processes defined and documented in Oracle Designer 10G , we were looking for a way to import these brocesses into Oracle BPEL. Is there any utility /tool to do this?
    Thank you.
    Syed Ahmad

    I think your problem is caused by the fact you do not have a TEMP directory on your C: drive.
    Windows NT has a temp directory under the drive C:\ but Windows 2000 doesn't.
    The import creates a parameter file for the import in the Temp directory.
    Hope this helps,
    Didier

  • Design / Formatting Help Needed

    Good Afternoon,
    I am in the process of developing a help system to support a
    proprietary green screen application that we use in our
    organization… the green screen application is very convoluted
    and all steps/processes etc to be completed in the system have many
    many steps to complete. In order to not overwhelm the end user, in
    any given help topic there are multiple subtopics that are
    “hidden” until the DHTML dropdown hot spot is
    activated.
    Within each hotspot, there are also “sub hot
    spots”. However, this is confusing to the user… there
    are so many hotspots etc (both hotspots from the main topic page
    and “sub” hotspots within a hotspot) that the user is
    losing track of where they are at.
    I was wondering if anyone had an general design
    recommendations or best practice recommendations that I should be
    adhering to in order to eliminate this confusion.
    Thanks!

    I've used hotspots within hotspots without issues. I suggest
    you break the information into smaller chunks if you can. If a
    particular task is very long, consider making it a book instead of
    a single topic. For example, if you assign one topic to each of
    five tasks, but the third task involves six steps, turn the third
    task into six steps/topics, and bind them as a book in your Help
    file. So you'll go from this:
    1. Task 1 (single topic)
    2. Task 2 (single topic)
    3. Task 3 (single topic)
    4. Task 4 (single topic)
    5. Task 5 (single topic)
    To this:
    1. Task 1 (single topic)
    2. Task 2 (single topic)
    3. Task 3 (one book with six topics)
    4. Task 4 (single topic)
    5. Task 5 (single topic)
    This kind of solution should cut down on some of the
    nesting.

Maybe you are looking for

  • ITunes deleted my iPad drivers while updating software

    If anyone can offer any insight into my problem, I would be so appreciative! I apologize for my lack of computer-savvy in advance. I plugged my iPad2 into my computer (Windows Vista OS) to sync it, since I hadn't done that in about a month. iTunes in

  • IPhone not syncing with iTunes

    I check all the correct boxes in itunes on my lap top when my iPhone is connected, the capacity bar shows the extent of the data to be synced including about 20G's of audio, but when the sync is completed the capacity bar in iTunes shows no memory us

  • Airport extreme 2009: how to downgrade security to WEP

    Hi, I have installed a new Airport Extreme (2009) and experiencing the following problem: The airport extreme software (7.4.1) does NOT allow me to encript my network with a simple WEP pasword( like before). (only WPA(2)).. Some pC devices with older

  • 24" LCD cinema display panel weight

    does the spec weight of 21 lbs. ( http://support.apple.com/kb/SP502 ) for the 24" apple cinema display include the stand? If so, what is the weight of the panel without the stand?  I'm looking at monitor arms and most say that the max weight is 20 lb

  • How to change Facetime ID number in iPhone 4 and also facing same issue with iMessage?

    I tried turing off Facetime, iMessage  and activating it again, No Luck. CHanged the Mobile number in Settings- Phone - My Number = No Luck Reset the Mobile = No Luck Did Restore by holding Power and home Button = No Luck It says Verifying and also w