Class AbstractWelcomePart

java.lang.Object
com.amalgamasimulation.desktop.appelements.parts.AbstractWelcomePart

public abstract class AbstractWelcomePart extends Object
Base part for the welcome page of an application. The part draws its content in an SWT2DAnimationView that fills the part. A subclass defines the content in createContent with WelcomeContent: an image and sections with text, links and lists of recent files. The part builds the content again on the NEW_SCENARIO, NEW_STUDY_LOADED and NEW_STUDY_SAVED messages from PlatformTopics.
Author:
Ionov Ivan
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected com.amalgamasimulation.desktop.utils.MessageManager
     
    protected org.eclipse.swt.widgets.Shell
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    Adds the content of the welcome page to the given WelcomeContent.
    protected static List<String>
    Returns the paths of the files that exist, in the same order.
    void
    postConstruct(org.eclipse.swt.widgets.Composite parent)
    Creates the drawing area in the parent, subscribes to the messages and builds the content.
    void
    Builds the content again: removes the old content and calls createContent.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • messageManager

      @Inject protected com.amalgamasimulation.desktop.utils.MessageManager messageManager
    • shell

      @Inject protected org.eclipse.swt.widgets.Shell shell
  • Constructor Details

    • AbstractWelcomePart

      public AbstractWelcomePart()
  • Method Details

    • postConstruct

      @PostConstruct public void postConstruct(org.eclipse.swt.widgets.Composite parent)
      Creates the drawing area in the parent, subscribes to the messages and builds the content. If a subclass must prepare something before the first build, it overrides this method and calls super.postConstruct(parent) at the end.
    • createContent

      protected abstract void createContent(WelcomeContent content)
      Adds the content of the welcome page to the given WelcomeContent. The part calls this method on every build, and each time the WelcomeContent is new and empty.
    • refresh

      public void refresh()
      Builds the content again: removes the old content and calls createContent.
    • existingFiles

      protected static List<String> existingFiles(String[] paths)
      Returns the paths of the files that exist, in the same order. Leaves out blank paths and paths to missing files.