Documentation of 'de.erichseifert.gral.graphics.DrawableContainer' Java class
DrawableContainer
de.erichseifert.gral.graphics

Class DrawableContainer

    • Constructor Summary

      Constructors 
      Constructor and Description
      DrawableContainer()
      Creates a new container for Drawables without layout manager.
      DrawableContainer(Layout layout)
      Creates a new container for Drawables with the specified layout manager.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(Drawable drawable)
      Adds a new component to this container.
      void add(Drawable drawable, java.lang.Object constraints)
      Adds a new component to this container.
      boolean contains(Drawable drawable)
      Returns whether the specified Drawable is stored.
      void draw(DrawingContext context)
      Draws the Drawable with the specified drawing context.
      java.lang.Object getConstraints(Drawable drawable)
      Return additional information on component
      java.util.List<Drawable> getDrawables()
      Returns a list of stored components.
      java.util.List<Drawable> getDrawablesAt(java.awt.geom.Point2D point)
      Returns the components at the specified point.
      Insets2D getInsets()
      Returns the space that this container must preserve at each of its edges.
      Layout getLayout()
      Returns the layout associated with this container.
      java.awt.geom.Dimension2D getPreferredSize()
      Returns the preferred size of the Drawable.
      java.util.Iterator<Drawable> iterator()
      Returns an iterator over the container's elements.
      void layout()
      Recalculates this container's layout.
      void remove(Drawable drawable)
      Removes a component from this container.
      void setBounds(double x, double y, double width, double height)
      Sets the bounds to the specified coordinates, width and height.
      void setBounds(java.awt.geom.Rectangle2D bounds)
      Sets the bounds to the specified bounding rectangle.
      void setInsets(Insets2D insets)
      Sets the space that this container must preserve at each of its edges.
      void setLayout(Layout layout)
      Sets the layout associated with this container.
      int size()
      Returns the number of components that are stored in this container.
      • Methods inherited from class java.lang.Object

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

        forEach, spliterator
    • Constructor Detail

      • DrawableContainer

        public DrawableContainer()
        Creates a new container for Drawables without layout manager.
      • DrawableContainer

        public DrawableContainer(Layout layout)
        Creates a new container for Drawables with the specified layout manager.
        Parameters:
        layout - Layout manager to be set.
    • Method Detail

      • draw

        public void draw(DrawingContext context)
        Draws the Drawable with the specified drawing context.
        Specified by:
        draw in interface Drawable
        Parameters:
        context - Environment used for drawing.
      • add

        public void add(Drawable drawable)
        Adds a new component to this container.
        Specified by:
        add in interface Container
        Parameters:
        drawable - Component
      • add

        public void add(Drawable drawable,
                        java.lang.Object constraints)
        Adds a new component to this container.
        Specified by:
        add in interface Container
        Parameters:
        drawable - Component
        constraints - Additional information (e.g. for layout)
      • contains

        public boolean contains(Drawable drawable)
        Description copied from interface: Container
        Returns whether the specified Drawable is stored.
        Specified by:
        contains in interface Container
        Parameters:
        drawable - Element to be checked.
        Returns:
        true if the element is stored in the Container, false otherwise.
      • getDrawablesAt

        public java.util.List<Drawable> getDrawablesAt(java.awt.geom.Point2D point)
        Description copied from interface: Container
        Returns the components at the specified point. The first component in the result List is the most specific component, i.e. the component with the deepest nesting level. If no component could be found an empty List will be returned.
        Specified by:
        getDrawablesAt in interface Container
        Parameters:
        point - Two-dimensional point.
        Returns:
        Components at the specified point, with the deepest nested component first.
      • getDrawables

        public java.util.List<Drawable> getDrawables()
        Description copied from interface: Container
        Returns a list of stored components.
        Specified by:
        getDrawables in interface Container
        Returns:
        Contained drawables.
      • getConstraints

        public java.lang.Object getConstraints(Drawable drawable)
        Return additional information on component
        Specified by:
        getConstraints in interface Container
        Parameters:
        drawable - Component
        Returns:
        Information object or null
      • remove

        public void remove(Drawable drawable)
        Removes a component from this container.
        Specified by:
        remove in interface Container
        Parameters:
        drawable - Component
      • getInsets

        public Insets2D getInsets()
        Returns the space that this container must preserve at each of its edges.
        Specified by:
        getInsets in interface Container
        Returns:
        The insets of this DrawableContainer
      • setInsets

        public void setInsets(Insets2D insets)
        Sets the space that this container must preserve at each of its edges.
        Specified by:
        setInsets in interface Container
        Parameters:
        insets - Insets to be set.
      • getLayout

        public Layout getLayout()
        Returns the layout associated with this container.
        Specified by:
        getLayout in interface Container
        Returns:
        Layout manager
      • setLayout

        public void setLayout(Layout layout)
        Sets the layout associated with this container.
        Specified by:
        setLayout in interface Container
        Parameters:
        layout - Layout to be set.
      • layout

        public void layout()
        Recalculates this container's layout.
        Specified by:
        layout in interface Container
      • iterator

        public java.util.Iterator<Drawable> iterator()
        Returns an iterator over the container's elements.
        Specified by:
        iterator in interface java.lang.Iterable<Drawable>
        Returns:
        an Iterator.
      • size

        public int size()
        Returns the number of components that are stored in this container.
        Specified by:
        size in interface Container
        Returns:
        total number of components
      • setBounds

        public void setBounds(double x,
                              double y,
                              double width,
                              double height)
        Description copied from class: AbstractDrawable
        Sets the bounds to the specified coordinates, width and height. This method should be used when overriding functionality.
        Specified by:
        setBounds in interface Drawable
        Overrides:
        setBounds in class AbstractDrawable
        Parameters:
        x - horizontal position of the upper-left corner
        y - vertical position of the upper-left corner
        width - horizontal extent
        height - vertical extent

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.