Class ShapeBuilder

All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IMetadataContext<Serializable,Component>, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable

public class ShapeBuilder extends WebMarkupContainer
Creates a shape. The initial with / height is set to 100%, margin is set to 0
Author:
Tobias Soloschenko
See Also:
  • Constructor Details

    • ShapeBuilder

      public ShapeBuilder(String id)
      Creates a shape at the position of the given id
      Parameters:
      id - the it to position the shape
    • ShapeBuilder

      public ShapeBuilder(String id, IModel<?> model)
      Creates a shape at the position of the given id
      Parameters:
      id - the it to position the shape
      model - the model this shape contains
  • Method Details

    • onComponentTag

      protected void onComponentTag(ComponentTag tag)
      Overrides:
      onComponentTag in class Component
    • renderHead

      public void renderHead(IHeaderResponse response)
      Specified by:
      renderHead in interface IHeaderContributor
      Overrides:
      renderHead in class Component
    • getDimension

      protected String getDimension()
      Gets the dimension of the shape as string - height and width
      Returns:
      the dimension settings as string
    • getWidth

      public String getWidth()
      Gets the with of the shape
      Returns:
      the with of the shape
    • useWidth

      public ShapeBuilder useWidth(String width)
      Uses the given width for the shape
      Parameters:
      width - the width to use
      Returns:
      the shape
    • getHeight

      public String getHeight()
      Gets the height of the shape
      Returns:
      the height of the shape
    • useHeight

      public ShapeBuilder useHeight(String height)
      Uses the given height for the shape
      Parameters:
      height - the height to use
      Returns:
      the shape
    • getMargin

      public String getMargin()
      Gets the maring of the shape
      Returns:
      the margin of the shape
    • withMargin

      public ShapeBuilder withMargin(String margin)
      Uses the given margin for the shape
      Parameters:
      margin - the margin to use
      Returns:
      the shape
    • getShape

      public Shape getShape()
      Gets the shape type the shape is using
      Returns:
      the shape type
    • shape

      public ShapeBuilder shape(Shape shape)
      Uses the given shape
      Parameters:
      shape - the shape
      Returns:
      the shape
    • getTransition

      public Shape getTransition()
      Gets the transition shape
      Returns:
      the transition shape
    • transition

      public ShapeBuilder transition(Shape transition)
      Uses the given transition shape
      Parameters:
      transition - the transition shape
      Returns:
      the shape
    • getOrientation

      public ShapeBuilder.Orientation getOrientation()
      The orientation the shape is positioned
      Returns:
      the orientation
    • orientation

      public ShapeBuilder orientation(ShapeBuilder.Orientation orientation)
      Uses the given orientation
      Parameters:
      orientation - the orientation to use
      Returns:
      the shape