# Class ScaleConfigKey

java.lang.Object
uk.ac.starlink.ttools.plot2.config.ConfigKey<Scale>
uk.ac.starlink.ttools.plot2.config.ScaleConfigKey

public class ScaleConfigKey extends ConfigKey<Scale>
Config key for axis scales.

Serialization to string uses `ParsedFunctionCall`, so it's a scale name with optionally comma-separated parameters enclosed in parentheses, e.g. "`linear`" or "`symlog(2,.5)`". Missing parameters are permitted and set to the relevant parameter default.

Since:
  20 Mar 2025
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`ScaleConfigKey(ConfigMeta meta)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Specifier<Scale>`
`createSpecifier()`
Constructs a graphical control with which the user can specify a suitable value for association with this key.
`Scale`
`stringToValue(String txt)`
Decodes a string value to the value type of this key.
`String`
`valueToString(Scale scale)`
Reports a value as a string.

### Methods inherited from class ConfigKey

`cast, getDefaultValue, getMeta, getValueClass, toString`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### ScaleConfigKey

public ScaleConfigKey(ConfigMeta meta)
Constructor.

Parameters:
  `meta` - metadata

## Method Details

### valueToString

public String valueToString(Scale scale)
Description copied from class: `ConfigKey`
Reports a value as a string. If at all possible the roundtripping should be possible, so `stringToValue(valueToString(v)).equals(v)`. A null value, if permitted, should be represented as an empty string.

Specified by:
  `valueToString` in class `ConfigKey<Scale>`
Parameters:
  `scale` - possible value associated with this key
Returns:
  string representation

### stringToValue

public Scale stringToValue(String txt) throws ConfigException
Description copied from class: `ConfigKey`
Decodes a string value to the value type of this key. An empty string should be interpreted as a null value, but this may cause an exception if null is not a permissible value for this key.

Specified by:
  `stringToValue` in class `ConfigKey<Scale>`
Parameters:
  `txt` - string representation of value
Returns:
  value
Throws:
  `ConfigException`

### createSpecifier

public Specifier<Scale> createSpecifier()
Description copied from class: `ConfigKey`
Constructs a graphical control with which the user can specify a suitable value for association with this key.

Specified by:
  `createSpecifier` in class `ConfigKey<Scale>`
Returns:
  new specifier