Class GContractList

  • All Implemented Interfaces:
    java.lang.Iterable<sag.elements.GElement>, sag.elements.Drawable

    public class GContractList
    extends sag.elements.GGroup
    Displays a list of contracts
    Author:
    Luna Otte
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static float WIDTH  
      • Fields inherited from class sag.elements.GElement

        handleMouseEvents, mouseListener, mouseListenerSync, positionX, positionY, rawSVGElement, rotation, scaleX, scaleY, skewX, skewY
    • Constructor Summary

      Constructors 
      Constructor Description
      GContractList​(java.util.Collection<Contract> contracts)
      Creates a new ContractList
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addContract​(Contract contract)
      Adds a contract
      float getHeight()
      Getter for the height of the list
      GContractList onEnter​(java.util.function.Consumer<Contract> action)
      This event is triggered when a user's cursor enters a contract
      GContractList onExit​(java.util.function.Consumer<Contract> action)
      This event is triggered when a user's cursor leaves a contract
      void setContracts​(java.util.Collection<Contract> contracts)
      Sets the contracts of the list
      • Methods inherited from class sag.elements.GGroup

        addChild, addChild, getChildByRenderingIndex, getNumChildren, getRawSVGGroup, indexOfChild, iterator, processMouseButtonEvent, processMouseMotionEvent, processMouseWheelEvent, removeChild, renderChildAfter, renderChildBefore, renderChildEarlier, renderChildFirst, renderChildLast, renderChildLater, setChildRenderingIndex, setRootSAGPanel, swapChildren
      • Methods inherited from class sag.elements.GElement

        amIPicked, executeUpdate, flipHorizontal, flipVertical, getGElement, getParent, getPositionX, getPositionY, getRGBStringFromColor, getRootSAGPanel, getRotation, getScaleX, getScaleY, getSkewX, getSkewY, move, removeCSSAttribute, removeXMLAttribute, rotate, scale, scale, setAttribute, setCSSAttribute, setCSSAttribute, setDisplay, setFill, setFill, setFillOpacity, setMouseEventListener, setOpacity, setParent, setPosition, setRotation, setScale, setScale, setSkew, setStroke, setStroke, setStroke, setStrokeLinecap, setStrokeLinejoin, setStrokeOpacity, setStrokePattern, setStrokePatternOffset, setStrokeWidth, setXMLAttribute, setXMLAttribute, skew, unsetFill, unsetFillOpacity, unsetOpacity, unsetStroke, unsetStrokeLinecap, unsetStrokeLinejoin, unsetStrokeOpacity, unsetStrokePattern, unsetStrokePatternOffset, unsetStrokeWidth, update, updateTransform
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • GContractList

        public GContractList​(java.util.Collection<Contract> contracts)
        Creates a new ContractList
        Parameters:
        contracts - The initial contracts
    • Method Detail

      • addContract

        public void addContract​(Contract contract)
        Adds a contract
        Parameters:
        contract - The contract to add
      • setContracts

        public void setContracts​(java.util.Collection<Contract> contracts)
        Sets the contracts of the list
        Parameters:
        contracts - The new contracts
      • getHeight

        public float getHeight()
        Getter for the height of the list
        Returns:
        The height
      • onEnter

        public GContractList onEnter​(java.util.function.Consumer<Contract> action)
        This event is triggered when a user's cursor enters a contract
        Parameters:
        action - The action that will be taken when the mouse enters
        Returns:
        The GContractList (for chaining methods)
      • onExit

        public GContractList onExit​(java.util.function.Consumer<Contract> action)
        This event is triggered when a user's cursor leaves a contract
        Parameters:
        action - The action that will be taken when the mouse leaves
        Returns:
        The GContractList (for chaining methods)