Interface StreamItem

All Superinterfaces:
StreamKeyListener
All Known Implementing Classes:
AbstractStreamItem, ExecutableItem, FolderItem, PagedFolderItem, PagedFolderItem.PageItem, ProxyItem, RunnableItem, ToggleItem, URIItem

public interface StreamItem extends StreamKeyListener
Interface to bind actions to a key of a stream deck. Can also be used with the StreamDeckController.

MIT License Copyright (c) 2017 Roland von Werden Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Version:
1.0.0
Author:
Roland von Werden
  • Field Details

    • TEXT_POS_TOP

      static final int TEXT_POS_TOP
      Value to indicate that the text for this item should be displayed at the top.
      See Also:
    • TEXT_POS_CENTER

      static final int TEXT_POS_CENTER
      Value to indicate that the text for this item should be displayed at the center.
      See Also:
    • TEXT_POS_BOTTOM

      static final int TEXT_POS_BOTTOM
      Value to indicate that the text for this item should be displayed at the bottom.
      See Also:
  • Method Details

    • getChildren

      default StreamItem[] getChildren()
      Returns an array with the children of this item. If the item has a parent, the parent must be the 5th item (getChildren()[4] ) in the array.
      Returns:
      Children of this item, or null, if not a folder
    • getChildCount

      int getChildCount()
    • getChild

      default StreamItem getChild(int i)
    • getChildId

      default int getChildId(StreamItem item)
      Returns the Index of the child
      Parameters:
      item - Child to be identified
      Returns:
      Index of the child or -1 if its not a child.
    • isLeaf

      default boolean isLeaf()
      Returns whether this item has children --> is a folder, or if it is a simple key.
      Returns:
      true if the Streamitem has children, false if not
    • getParent

      StreamItem getParent()
      Returns the parent of the item.
      Returns:
      StreamItem that is the parent of this item, null if the StreamItem has nor parent.
    • setParent

      void setParent(StreamItem parent)
    • getIcon

      SDImage getIcon()
      Returns the icon to be displayed on the stream deck.
      Returns:
      Returns the icon object of the Item
    • getButtonCount

      int getButtonCount()
    • setButtonCount

      void setButtonCount(int count)
    • getRowCount

      int getRowCount()
    • setRowCount

      void setRowCount(int count)
    • getColumnCount

      int getColumnCount()
    • hasAnimation

      boolean hasAnimation()
      Returns if the item has an animation that can be displayed
      Returns:
      true if an animation exists, false if the item has no animation.
    • getAnimation

      AnimationStack getAnimation()
      Returns the animation of the item.
      Returns:
      Animation in form of the AnimationStack, null if the item has no no animation
    • getText

      String getText()
      Retrns the text on the item.
      Returns:
      Text or null, if there is no text
    • setText

      void setText(String text)
      Sets the text to be displayed of the item.
      Parameters:
      text - Text to be displayed
    • setTextPosition

      void setTextPosition(int textPos)
      Position of the displayed text.
      Parameters:
      textPos - Position of the text (Top - TEXT_POS_TOP, center- TEXT_POS_CENTER, bottom, TEXT_POS_BOTTOM)
    • setIconPackage

      void setIconPackage(IconPackage iconPackage)
      Apply the icon and animation of the IconPackage to the item
      Parameters:
      iconPackage - IconPackage to be applied
    • setIcon

      void setIcon(SDImage icon)
      Sets the icon for the item.
      Parameters:
      icon - New icon for the item.
    • setAnimation

      void setAnimation(AnimationStack animation)
      Sets the animation of the item
      Parameters:
      animation - AnimationStack with the animation
    • addIconUpdateListener

      void addIconUpdateListener(IconUpdateListener listener)
      Adds an IconUpdateListener to the item.
      Parameters:
      listener - Listener that listens for changes on the icon
    • removeIconUpdateListener

      void removeIconUpdateListener(IconUpdateListener listener)
      Removes the given listener. If the listener has not been added before it will do nothing.
      Parameters:
      listener - Listener to be removed.
    • hasDialListeners

      boolean hasDialListeners()
      Returns if the Item has dedicated StreamKeyListeners for dials on the stream deck
      Returns:
      True if there is at least one Listener for changes in dials
    • getDialListeners

      StreamKeyListener[] getDialListeners()
      Returns the StreamKeyListeners for dials
      Returns:
      an Array of StreamKeyListeners, or an empty arrary or null
    • hasTouchScreenListeners

      boolean hasTouchScreenListeners()
      Returns if the Item has dedicated StreamKeyListeners for the touch screen on the stream deck
      Returns:
      True if there is at least one Listener for changes in dials
    • getTouchScreenListeners

      StreamKeyListener[] getTouchScreenListeners()
      Returns the StreamKeyListeners for the touch screen
      Returns:
      an Array of StreamKeyListeners, or an empty arrary or null
    • hasTouchScreenImage

      boolean hasTouchScreenImage()
      Returns if the Item has dedicated SDImage for the touch screen on the stream deck
      Returns:
      True if there is an image, false if not
    • getTouchScreenImage

      SDImage getTouchScreenImage()
      Returns the SDImage for the touch screen
      Returns:
      an SDImage or null