Class DefaultDisplayService

    • Constructor Detail

      • DefaultDisplayService

        public DefaultDisplayService()
    • Method Detail

      • getActiveDisplay

        public <D extends Display<?>> D getActiveDisplay​(Class<D> displayClass)
        Description copied from interface: DisplayService
        Gets the most recently active display (of the specified Display type).
        Specified by:
        getActiveDisplay in interface DisplayService
      • isUniqueName

        public boolean isUniqueName​(String name)
        Description copied from interface: DisplayService
        Checks whether the given name is already taken by an existing display.
        Specified by:
        isUniqueName in interface DisplayService
        Parameters:
        name - The name to check.
        Returns:
        true if the name is available, false if already taken.
      • createDisplay

        public Display<?> createDisplay​(Object o)
        Description copied from interface: DisplayService
        Creates a display for the given object, publishing a DisplayCreatedEvent to notify interested parties. In particular:
        • Visible UIs will respond to this event by showing the display.
        • The ObjectService will add the new display to its index, until a corresponding DisplayDeletedEvent is later published.

        To create a Display without publishing an event, see DisplayService.createDisplayQuietly(java.lang.Object).

        Specified by:
        createDisplay in interface DisplayService
        Parameters:
        o - The object for which a display should be created. The object is then added to the display.
        Returns:
        Newly created Display<?> containing the given object. The Display is typed with ? rather than T matching the Object because it is possible for the Display to be a collection of some other sort of object than the one being added. For example, ImageDisplay is a Display<DataView> with the DataView wrapping a Dataset, yet the ImageDisplay supports adding Datasets directly, taking care of wrapping them in a DataView as needed.
      • createDisplay

        public Display<?> createDisplay​(String name,
                                        Object o)
        Description copied from interface: DisplayService
        Creates a display for the given object, publishing a DisplayCreatedEvent to notify interested parties. In particular:
        • Visible UIs will respond to this event by showing the display.
        • The ObjectService will add the new display to its index, until a corresponding DisplayDeletedEvent is later published.

        To create a Display without publishing an event, see DisplayService.createDisplayQuietly(java.lang.Object).

        Specified by:
        createDisplay in interface DisplayService
        Parameters:
        name - The name to be assigned to the display.
        o - The object for which a display should be created. The object is then added to the display.
        Returns:
        Newly created Display<?> containing the given object. The Display is typed with ? rather than T matching the Object because it is possible for the Display to be a collection of some other sort of object than the one being added. For example, ImageDisplay is a Display<DataView> with the DataView wrapping a Dataset, yet the ImageDisplay supports adding Datasets directly, taking care of wrapping them in a DataView as needed.
      • createDisplayQuietly

        public Display<?> createDisplayQuietly​(Object o)
        Description copied from interface: DisplayService
        Creates a display for the given object, without publishing a DisplayCreatedEvent. Hence, the display will not be automatically shown or tracked.
        Specified by:
        createDisplayQuietly in interface DisplayService
        Parameters:
        o - The object for which a display should be created. The object is then added to the display.
        Returns:
        Newly created Display<?> containing the given object. The Display is typed with ? rather than T matching the Object because it is possible for the Display to be a collection of some other sort of object than the one being added. For example, ImageDisplay is a Display<DataView> with the DataView wrapping a Dataset, yet the ImageDisplay supports adding Datasets directly, taking care of wrapping them in a DataView as needed.
      • onEvent

        protected void onEvent​(WinClosedEvent event)
        Deletes the display when display window is closed.
      • onEvent

        protected void onEvent​(WinActivatedEvent event)
        Sets the display to active when its window is activated.
      • onEvent

        protected void onEvent​(DisplayDeletedEvent evt)
        Removes a display from the display list when it is deleted