Class GAsset

  • All Implemented Interfaces:
    sag.elements.Drawable

    public class GAsset
    extends sag.elements.GSVG
    A GSVG that displays an asset from the /assets/ directory
    Author:
    Luna Otte
    See Also:
    Asset
    • Field Summary

      • Fields inherited from class sag.elements.GElement

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

      Constructors 
      Constructor Description
      GAsset()  
      GAsset​(Asset asset)
      Creates a new GAsset using the provided Asset
      GAsset​(Asset asset, java.awt.Color currentColor)
      Creates a new GAsset using the provided Asset.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      GAsset setAsset​(Asset asset)
      Swaps the asset with some other one
      GAsset setAsset​(Asset asset, java.awt.Color currentColor)
      Swaps the asset with some other one.
      • Methods inherited from class sag.elements.GSVG

        getCacheKey, setSVG, setSVG, setSVG
      • Methods inherited from class sag.elements.GElement

        amIPicked, executeUpdate, flipHorizontal, flipVertical, getGElement, getParent, getPositionX, getPositionY, getRGBStringFromColor, getRootSAGPanel, getRotation, getScaleX, getScaleY, getSkewX, getSkewY, move, processMouseButtonEvent, processMouseMotionEvent, processMouseWheelEvent, removeCSSAttribute, removeXMLAttribute, rotate, scale, scale, setAttribute, setCSSAttribute, setCSSAttribute, setDisplay, setFill, setFill, setFillOpacity, setMouseEventListener, setOpacity, setParent, setPosition, setRootSAGPanel, 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
    • Constructor Detail

      • GAsset

        public GAsset​(Asset asset)
        Creates a new GAsset using the provided Asset
        Parameters:
        asset - The asset that should be displayed
      • GAsset

        public GAsset​(Asset asset,
                      java.awt.Color currentColor)
        Creates a new GAsset using the provided Asset. Also sets its color if currentColor is used in place of a color anywhere inside the asset.
        Parameters:
        asset - The asset that should be displayed
        currentColor - The color that should be used
      • GAsset

        public GAsset()
    • Method Detail

      • setAsset

        public GAsset setAsset​(Asset asset)
        Swaps the asset with some other one
        Parameters:
        asset - The new asset
        Returns:
        This GAsset
      • setAsset

        public GAsset setAsset​(Asset asset,
                               java.awt.Color currentColor)
        Swaps the asset with some other one. Also sets its color if currentColor is used in place of a color anywhere inside the asset.
        Parameters:
        asset - The path to the new asset
        currentColor - The color that should be used
        Returns:
        This GAsset