Package jcckit.graphic
Class Anchor
- java.lang.Object
-
- jcckit.graphic.Anchor
-
public class Anchor extends Object
Anchor of a graphical element. There exist only the three instancesLEFT_BOTTOM
,CENTER
, andRIGHT_TOP
.The anchor factor can be used in a position formular. Its value for the three instances reads:
Instance Factor LEFT_BOTTOM 0 CENTER 1 RIGHT_TOP 2 - Author:
- Franz-Josef Elmer
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getFactor()
Returns the factor.static Anchor
getHorizontalAnchor(ConfigParameters config, String key, Anchor defaultValue)
Returns form the specified configuration parameters the horizontal anchor defined by the specified key or the specified default value.static Anchor
getVerticalAnchor(ConfigParameters config, String key, Anchor defaultValue)
Returns form the specified configuration parameters the vertical anchor defined by the specified key or the specified default value.
-
-
-
Method Detail
-
getHorizontalAnchor
public static Anchor getHorizontalAnchor(ConfigParameters config, String key, Anchor defaultValue)
Returns form the specified configuration parameters the horizontal anchor defined by the specified key or the specified default value.- Parameters:
config
- Configuration parameters.key
- The key of the anchor. null is not allowed.defaultValue
- The default value.- Returns:
- one of the three instances of Anchor.
- Throws:
FactoryException
- if the value of key is neither left, center, nor right. Note, thatFactoryException.getClassName()
returns the invalid value.
-
getVerticalAnchor
public static Anchor getVerticalAnchor(ConfigParameters config, String key, Anchor defaultValue)
Returns form the specified configuration parameters the vertical anchor defined by the specified key or the specified default value.- Parameters:
config
- Configuration parameters.key
- The key of the anchor. null is not allowed.defaultValue
- The default value.- Returns:
- one of the three instances of Anchor.
- Throws:
FactoryException
- if the value of key is neither top, center, nor bottom. Note, thatFactoryException.getClassName()
returns the invalid value.
-
getFactor
public int getFactor()
Returns the factor.
-
-