Package br.com.jteam.jfcm.controller

Examples of br.com.jteam.jfcm.controller.EventDispatchService


  public void createContentContainer()
  {
    TreePanel treePanel = new TreePanel();
    ContentPanel contentPanel = new ContentPanel();
    EventDispatchService service = EventDispatchService.getInstance();
    service.subscribe(OpenFileEvent.class, treePanel);
    service.subscribe(OpenHistoryFileEvent.class, treePanel);
    service.subscribe(OpenHistoryFileEvent.class, contentPanel);
    service.subscribe(OpenFileEvent.class, contentPanel);
    service.subscribe(ShowImageEvent.class, contentPanel);
    service.subscribe(ShowTextEvent.class, contentPanel);
    JScrollPane treeScrollPane = new JScrollPane(treePanel);
    JScrollPane contentScrollPane = new JScrollPane(contentPanel);
    Dimension minimumSize = new Dimension(0, 0);
    treeScrollPane.setMinimumSize(minimumSize);
    contentScrollPane.setMinimumSize(minimumSize);
View Full Code Here


    ShowFileContentService showFileService = new ShowFileContentServiceImpl();
    ShowFileContentAdapter showFileAdaper = new ShowFileContentAdapterImpl(showFileService);
    PresentationFile<?> preparedFile = null;
    try {
      preparedFile = showFileAdaper.prepareFileToView(presentationFile);
      EventDispatchService dispatchService = EventDispatchService.getInstance();
      if (preparedFile.isImageFile()) {
        Image image = (Image) preparedFile.getContent();
        dispatchService.fireEvent(new ShowImageEvent(image));
      } else if (preparedFile.isTextFile()) {
        String text = (String) preparedFile.getContent();
        dispatchService.fireEvent(new ShowTextEvent(text));
      }
    } catch (ShowFileContentAdapterException e) {
      JOptionPane.showMessageDialog(null, BaseBundle.getValue("error.unknow.file.type"));
    }
  }
View Full Code Here

   */
  private void openFile(File file)
  {
    try {
      PresentationFile<?> presentationFile = adapter.openZipContent(file.getAbsolutePath());
      EventDispatchService eventService = EventDispatchService.getInstance();
      eventService.fireEvent(new OpenFileEvent(presentationFile));
      eventService.fireEvent(new UpdateFileHistoryEvent());
    } catch (FileListContentAdapterException e) {
      JOptionPane.showMessageDialog(null, BaseBundle.getValue("error.openning.file"));
    }
  }
View Full Code Here

TOP

Related Classes of br.com.jteam.jfcm.controller.EventDispatchService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.