AudioExplorerPresentation.java

  1. /*
  2.  * *********************************************************************************************************************
  3.  *
  4.  * blueMarine II: Semantic Media Centre
  5.  * http://tidalwave.it/projects/bluemarine2
  6.  *
  7.  * Copyright (C) 2015 - 2021 by Tidalwave s.a.s. (http://tidalwave.it)
  8.  *
  9.  * *********************************************************************************************************************
  10.  *
  11.  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
  12.  * the License. You may obtain a copy of the License at
  13.  *
  14.  *     http://www.apache.org/licenses/LICENSE-2.0
  15.  *
  16.  * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
  17.  * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the
  18.  * specific language governing permissions and limitations under the License.
  19.  *
  20.  * *********************************************************************************************************************
  21.  *
  22.  * git clone https://bitbucket.org/tidalwave/bluemarine2-src
  23.  * git clone https://github.com/tidalwave-it/bluemarine2-src
  24.  *
  25.  * *********************************************************************************************************************
  26.  */
  27. package it.tidalwave.bluemarine2.ui.audio.explorer;

  28. import javax.annotation.Nonnull;
  29. import java.util.Optional;
  30. import java.net.URI;
  31. import javafx.beans.property.StringProperty;
  32. import javafx.beans.property.SimpleStringProperty;
  33. import it.tidalwave.role.ui.PresentationModel;
  34. import it.tidalwave.role.ui.UserAction;
  35. import it.tidalwave.bluemarine2.model.spi.Entity;
  36. import lombok.Getter;
  37. import lombok.experimental.Accessors;

  38. /***********************************************************************************************************************
  39.  *
  40.  * The Presentation of the explorer of audio media files.
  41.  *
  42.  * @stereotype  Presentation
  43.  *
  44.  * @author  Fabrizio Giudici
  45.  *
  46.  **********************************************************************************************************************/
  47. public interface AudioExplorerPresentation
  48.   {
  49.     @Getter @Accessors(fluent = true)
  50.     public static class Properties
  51.       {
  52.         private final StringProperty folderNameProperty = new SimpleStringProperty("");
  53.       }

  54.     /*******************************************************************************************************************
  55.      *
  56.      * Binds the UI with the callbacks.
  57.      *
  58.      * @param   upAction    the action to go to the upper folder
  59.      *
  60.      ******************************************************************************************************************/
  61.     public void bind (@Nonnull Properties properties, @Nonnull UserAction upAction);

  62.     /*******************************************************************************************************************
  63.      *
  64.      * Shows this presentation on the screen.
  65.      *
  66.      ******************************************************************************************************************/
  67.     public void showUp (@Nonnull Object control);

  68.     /*******************************************************************************************************************
  69.      *
  70.      * Populates the presentation with the available media browsers.
  71.      *
  72.      * @param   pm                  the {@link PresentationModel}
  73.      *
  74.      ******************************************************************************************************************/
  75.     public void populateBrowsers (@Nonnull PresentationModel pm);

  76.     /*******************************************************************************************************************
  77.      *
  78.      * Populates the presentation with a set of items and optionally restores some visual properties.
  79.      *
  80.      * @param   pm                  the {@link PresentationModel}
  81.      * @param   optionalMemento     the container of properties
  82.      *
  83.      ******************************************************************************************************************/
  84.     public void populateItems (@Nonnull PresentationModel pm, @Nonnull Optional<Object> optionalMemento);

  85.     /*******************************************************************************************************************
  86.      *
  87.      * Renders some details about an {@link Entity}.
  88.      *
  89.      * @param   entityDetails       the details
  90.      *
  91.      ******************************************************************************************************************/
  92.     public void renderDetails (@Nonnull String entityDetails);

  93.     /*******************************************************************************************************************
  94.      *
  95.      * Puts the focus on the list to select media items.
  96.      *
  97.      ******************************************************************************************************************/
  98.     public void focusOnMediaItems();

  99.     /*******************************************************************************************************************
  100.      *
  101.      * Returns an object containing the snapshot of some relevant visual properties.
  102.      *
  103.      * @return      the memento object
  104.      *
  105.      ******************************************************************************************************************/
  106.     @Nonnull
  107.     public Object getMemento();

  108.     /*******************************************************************************************************************
  109.      *
  110.      *
  111.      ******************************************************************************************************************/
  112.     public void setCoverArt (@Nonnull Optional<URI> optionalCoverArtUri);
  113.   }