Class AbstractStreamItem
java.lang.Object
de.rcblum.stream.deck.items.AbstractStreamItem
- All Implemented Interfaces:
StreamKeyListener, StreamItem
- Direct Known Subclasses:
ExecutableItem, FolderItem, RunnableItem, ToggleItem, URIItem
Abstract version of StreamItem, implements al relevant functions for icons
and animations.
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.
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 Summary
FieldsModifier and TypeFieldDescriptionprotected AnimationStackAnimation for the key, if presentprotected intButton count of the connected StreamDeckprotected SDImageImage with text if present.protected StreamItemParent of the itemprotected SDImageRaw image of the folderprotected intRow count of the connected StreamDeckprotected Stringprotected intFields inherited from interface StreamItem
TEXT_POS_BOTTOM, TEXT_POS_CENTER, TEXT_POS_TOP -
Constructor Summary
ConstructorsConstructorDescriptionAbstractStreamItem(IconPackage pkg, int buttonCount, int rowCount) AbstractStreamItem(SDImage img, int buttonCount, int rowCount) AbstractStreamItem(SDImage img, AnimationStack animation) AbstractStreamItem(SDImage img, AnimationStack animation, int buttonCount, int rowCount) AbstractStreamItem(SDImage img, AnimationStack animation, String text) AbstractStreamItem(SDImage rawImg, AnimationStack animation, String text, int textPos, int buttonCount, int rowCount) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIconUpdateListener(IconUpdateListener listener) Adds anIconUpdateListenerto the item.protected voidfireIconUpdate(boolean animationChanged) Returns the animation of the item.intintintReturns theStreamKeyListeners for dialsgetIcon()Returns the icon to be displayed on the stream deck.Returns the parent of the item.intgetText()Retrns the text on the item.Returns theSDImagefor the touch screenReturns theStreamKeyListeners for the touch screenbooleanReturns if the item has an animation that can be displayedbooleanReturns if the Item has dedicatedStreamKeyListeners for dials on the stream deckbooleanReturns if the Item has dedicatedSDImagefor the touch screen on the stream deckbooleanReturns if the Item has dedicatedStreamKeyListeners for the touch screen on the stream deckvoidremoveIconUpdateListener(IconUpdateListener listener) Removes the given listener.voidsetAnimation(AnimationStack animation) Sets the animation of the itemvoidsetButtonCount(int buttonCount) voidSets the icon for the item.voidsetIconPackage(IconPackage iconPackage) Apply the icon and animation of theIconPackageto the itemvoidsetParent(StreamItem parent) voidsetRowCount(int rowCount) voidSets the text to be displayed of the item.voidvoidsetTextPosition(int textPos) Position of the displayed text.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface StreamItem
getChild, getChildId, getChildren, isLeafMethods inherited from interface StreamKeyListener
onKeyEvent
-
Field Details
-
text
-
textPos
protected int textPos -
parent
Parent of the item -
rawImg
Raw image of the folder -
img
Image with text if present. -
animation
Animation for the key, if present -
buttonCount
protected int buttonCountButton count of the connected StreamDeck -
rowCount
protected int rowCountRow count of the connected StreamDeck
-
-
Constructor Details
-
AbstractStreamItem
-
AbstractStreamItem
-
AbstractStreamItem
-
AbstractStreamItem
-
AbstractStreamItem
-
AbstractStreamItem
-
AbstractStreamItem
-
AbstractStreamItem
public AbstractStreamItem(SDImage rawImg, AnimationStack animation, String text, int textPos, int buttonCount, int rowCount)
-
-
Method Details
-
getIcon
Description copied from interface:StreamItemReturns the icon to be displayed on the stream deck.- Specified by:
getIconin interfaceStreamItem- Returns:
- Returns the icon object of the Item
-
setIconPackage
Description copied from interface:StreamItemApply the icon and animation of theIconPackageto the item- Specified by:
setIconPackagein interfaceStreamItem- Parameters:
iconPackage- IconPackage to be applied
-
getChildCount
public int getChildCount()- Specified by:
getChildCountin interfaceStreamItem
-
setAnimation
Description copied from interface:StreamItemSets the animation of the item- Specified by:
setAnimationin interfaceStreamItem- Parameters:
animation-AnimationStackwith the animation
-
setIcon
Description copied from interface:StreamItemSets the icon for the item.- Specified by:
setIconin interfaceStreamItem- Parameters:
icon- New icon for the item.
-
getButtonCount
public int getButtonCount()- Specified by:
getButtonCountin interfaceStreamItem
-
setButtonCount
public void setButtonCount(int buttonCount) - Specified by:
setButtonCountin interfaceStreamItem
-
getRowCount
public int getRowCount()- Specified by:
getRowCountin interfaceStreamItem
-
setRowCount
public void setRowCount(int rowCount) - Specified by:
setRowCountin interfaceStreamItem
-
getColumnCount
public int getColumnCount()- Specified by:
getColumnCountin interfaceStreamItem
-
getParent
Description copied from interface:StreamItemReturns the parent of the item.- Specified by:
getParentin interfaceStreamItem- Returns:
- StreamItem that is the parent of this item,
nullif the StreamItem has nor parent.
-
setParent
- Specified by:
setParentin interfaceStreamItem
-
getText
Description copied from interface:StreamItemRetrns the text on the item.- Specified by:
getTextin interfaceStreamItem- Returns:
- Text or
null, if there is no text
-
setText
Description copied from interface:StreamItemSets the text to be displayed of the item.- Specified by:
setTextin interfaceStreamItem- Parameters:
text- Text to be displayed
-
setText
-
setTextPosition
public void setTextPosition(int textPos) Description copied from interface:StreamItemPosition of the displayed text.- Specified by:
setTextPositionin interfaceStreamItem- Parameters:
textPos- Position of the text (Top -StreamItem.TEXT_POS_TOP, center-StreamItem.TEXT_POS_CENTER, bottom,StreamItem.TEXT_POS_BOTTOM)
-
hasAnimation
public boolean hasAnimation()Description copied from interface:StreamItemReturns if the item has an animation that can be displayed- Specified by:
hasAnimationin interfaceStreamItem- Returns:
trueif an animation exists,falseif the item has no animation.
-
getAnimation
Description copied from interface:StreamItemReturns the animation of the item.- Specified by:
getAnimationin interfaceStreamItem- Returns:
- Animation in form of the
AnimationStack,nullif the item has no no animation
-
addIconUpdateListener
Description copied from interface:StreamItemAdds anIconUpdateListenerto the item.- Specified by:
addIconUpdateListenerin interfaceStreamItem- Parameters:
listener- Listener that listens for changes on the icon
-
removeIconUpdateListener
Description copied from interface:StreamItemRemoves the given listener. If the listener has not been added before it will do nothing.- Specified by:
removeIconUpdateListenerin interfaceStreamItem- Parameters:
listener- Listener to be removed.
-
fireIconUpdate
protected void fireIconUpdate(boolean animationChanged) -
hasDialListeners
public boolean hasDialListeners()Description copied from interface:StreamItemReturns if the Item has dedicatedStreamKeyListeners for dials on the stream deck- Specified by:
hasDialListenersin interfaceStreamItem- Returns:
- True if there is at least one Listener for changes in dials
-
getDialListeners
Description copied from interface:StreamItemReturns theStreamKeyListeners for dials- Specified by:
getDialListenersin interfaceStreamItem- Returns:
- an Array of
StreamKeyListeners, or an empty arrary or null
-
hasTouchScreenListeners
public boolean hasTouchScreenListeners()Description copied from interface:StreamItemReturns if the Item has dedicatedStreamKeyListeners for the touch screen on the stream deck- Specified by:
hasTouchScreenListenersin interfaceStreamItem- Returns:
- True if there is at least one Listener for changes in dials
-
getTouchScreenListeners
Description copied from interface:StreamItemReturns theStreamKeyListeners for the touch screen- Specified by:
getTouchScreenListenersin interfaceStreamItem- Returns:
- an Array of
StreamKeyListeners, or an empty arrary or null
-
getTouchScreenImage
Description copied from interface:StreamItemReturns theSDImagefor the touch screen- Specified by:
getTouchScreenImagein interfaceStreamItem- Returns:
- an
SDImageor null
-
hasTouchScreenImage
public boolean hasTouchScreenImage()Description copied from interface:StreamItemReturns if the Item has dedicatedSDImagefor the touch screen on the stream deck- Specified by:
hasTouchScreenImagein interfaceStreamItem- Returns:
- True if there is an image, false if not
-