Class ColorGradient
java.lang.Object
ch.nolix.system.element.base.AbstractElement
ch.nolix.system.gui.colorgradient.ColorGradient
- All Implemented Interfaces:
IElement, IColorGradient
A
ColorGradient is not mutable.- Author:
- Silvan Wyss
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ColorGradientfromSpecification(INode<?> specification) IContainer<INode<?>> static ColorGradientwithColors(Color color1, Color color2) static ColorGradientwithDirectionAndColors(Direction direction, Color color1, Color color2) Methods inherited from class AbstractElement
equals, getSpecification, hashCode, toStringMethods inherited from interface IElement
getSpecification, toFormatedString, toXml
-
Field Details
-
DEFAULT_DIRECTION
-
DEFAULT_COLOR1
-
DEFAULT_COLOR2
-
-
Method Details
-
fromSpecification
- Parameters:
specification-- Returns:
- a new
ColorGradientfrom the given specification. - Throws:
RuntimeException- if the given specification is not valid.
-
withColors
- Parameters:
color1-color2-- Returns:
- a new
ColorGradientwith the given color1 and color2. - Throws:
RuntimeException- if the given color1 is null.RuntimeException- if the given color2 is null.
-
withDirectionAndColors
- Parameters:
direction-color1-color2-- Returns:
- a new
ColorGradientwith the given direction, color1 and color2. - Throws:
RuntimeException- if the given direction is null.RuntimeException- if the given color 1 is null.RuntimeException- if the given color 2 is null.
-
getAttributes
- Specified by:
getAttributesin interfaceIElement- Returns:
- the attributes of the current
IElement.
-
getColor1
- Specified by:
getColor1in interfaceIColorGradient- Returns:
- the color1 of the current
IColorGradient.
-
getColor2
- Specified by:
getColor2in interfaceIColorGradient- Returns:
- the color2 of the current
IColorGradient.
-
getDirection
- Specified by:
getDirectionin interfaceIColorGradient- Returns:
- the direction of the current
IColorGradient.
-