Class MarginDesc

java.lang.Object
org.proto4j.swing.core.desc.GenericDesc<Margin>
org.proto4j.swing.core.desc.MarginDesc
Direct Known Subclasses:
BevelBorderDesc, CompoundBorderDesc, EmptyBorderDesc, EtchedBorderDesc, LineBorderDesc, TitledBorderDesc

public abstract class MarginDesc
extends GenericDesc<Margin>
The base class for all MarginDesc inheritors. This abstract layer is used to provide the general requirements on this class.

There will be only one MarginDesc at a time on a ComponentDesc instance.

Since:
1.0
See Also:
ComponentDesc
  • Field Summary

    Fields inherited from class org.proto4j.swing.core.desc.GenericDesc

    INVALID_INT, UNDEFINED
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected MarginDesc()
    Creates a new MarginDesc
  • Method Summary

    Modifier and Type Method Description
    void applyTo​(java.awt.Component component)
    Applies the stored options on the given component.
    abstract javax.swing.border.Border create()
    Tries to create the Border.
    abstract boolean shouldPlaceBorder()  

    Methods inherited from class org.proto4j.swing.core.desc.GenericDesc

    annotationType, get, getDefinedOptions, getOption, hasOption, keys, put, read, read

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MarginDesc

      protected MarginDesc()
      Creates a new MarginDesc
  • Method Details

    • shouldPlaceBorder

      public abstract boolean shouldPlaceBorder()
      Returns:
      true if a Border should be created, false otherwise
    • create

      public abstract javax.swing.border.Border create()
      Tries to create the Border. This method should return null on failure.
      Returns:
      the new Border instance
    • applyTo

      public void applyTo​(java.awt.Component component)
      Applies the stored options on the given component.
      Specified by:
      applyTo in class GenericDesc<Margin>
      Parameters:
      component - the Component reference