# Class MarkStyleSelectors

java.lang.Object
uk.ac.starlink.ttools.gui.MarkStyleSelectors

public class MarkStyleSelectors extends Object
Contains some utility methods for generating selectors for plot style elements.

Since:
  6 Mar 2013
Author:
  Mark Taylor

## Method Summary

Modifier and Type
Method
Description
`static JComboBox<ErrorRenderer>`
`createErrorSelector(ErrorRenderer[] errorRenderers, ErrorRenderer defaultRenderer, ErrorModeSelection[] errorModeSelections)`
Returns a new JComboBox which will contain ErrorRenderer objects.
`static JComboBox<MarkerShape>`
`createMarkerShapeSelector(MarkerShape[] shapes)`
Returns a new JComboBox for marker shape selection with specified list of shapes.
`static ComboBoxModel<Integer>`
`createNumberedModel(int count)`
Convenience method to construct a new ComboBoxModel which contains Integers numbered from 0 to `count-1`.
`static JComboBox<MarkShape>`
`createShapeSelector()`
Returns a new JComboBox for marker shape selection with a default list of shapes.
`static JComboBox<MarkShape>`
`createShapeSelector(MarkShape[] shapes)`
Returns a new JComboBox for marker shape selection with specified list of shapes.
`static JComboBox<Integer>`
`createSizeSelector()`
Returns a new JComboBox for selecting symbol sizes, using the default maximum size (`MAX_SIZE`).
`static JComboBox<Integer>`
`createSizeSelector(int maxSize)`
Returns a new JComboBox for selecting symbol sizes, using a specified maximum size.
`static MarkStyle`
`getStyle(MarkShape shape, int size, Color color, int opaqueLimit, boolean hidePoints, ErrorRenderer errorRenderer, MarkStyle.Line line, int thick, float[] dash, ErrorModeSelection[] errModels)`
Returns a MarkStyle described by its attributes.

### Methods inherited from class Object

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

## Method Details

### createShapeSelector

public static JComboBox<MarkShape> createShapeSelector()
Returns a new JComboBox for marker shape selection with a default list of shapes.

Returns:
  new shape selection combo box

### createShapeSelector

public static JComboBox<MarkShape> createShapeSelector(MarkShape[] shapes)
Returns a new JComboBox for marker shape selection with specified list of shapes.

Parameters:
  `shapes` - shape options
Returns:
  new shape selection combo box

### createMarkerShapeSelector

public static JComboBox<MarkerShape> createMarkerShapeSelector(MarkerShape[] shapes)
Returns a new JComboBox for marker shape selection with specified list of shapes.

Parameters:
  `shapes` - shape options
Returns:
  new shape selection combo box

### createSizeSelector

public static JComboBox<Integer> createSizeSelector()
Returns a new JComboBox for selecting symbol sizes, using the default maximum size (`MAX_SIZE`).

Returns:
  new size selection combo box

### createSizeSelector

public static JComboBox<Integer> createSizeSelector(int maxSize)
Returns a new JComboBox for selecting symbol sizes, using a specified maximum size.

Parameters:
  `maxSize` - maximum size
Returns:
  new size selection combo box

### createErrorSelector

public static JComboBox<ErrorRenderer> createErrorSelector(ErrorRenderer[] errorRenderers, ErrorRenderer defaultRenderer, ErrorModeSelection[] errorModeSelections)
Returns a new JComboBox which will contain ErrorRenderer objects.

Parameters:
  `errorRenderers` - full list of renderers to select from (may be subsetted according to current ErrorMode selections)
  `defaultRenderer` - default error renderer to use if no other is known
  `errorModeSelections` - error mode selection models, one per axis
Returns:
  new error renderer combo box

### createNumberedModel

public static ComboBoxModel<Integer> createNumberedModel(int count)
Convenience method to construct a new ComboBoxModel which contains Integers numbered from 0 to `count-1`.

Parameters:
  `count` - number of entries in the model
Returns:
  new ComboBoxModel filled with Integers

### getStyle

public static MarkStyle getStyle(MarkShape shape, int size, Color color, int opaqueLimit, boolean hidePoints, ErrorRenderer errorRenderer, MarkStyle.Line line, int thick, float[] dash, ErrorModeSelection[] errModels)
Returns a MarkStyle described by its attributes.

Parameters:
  `shape` - marker shape
  `size` - marker size
  `color` - marker colour
  `hidePoints` - whether markers are invisible
  `errorRenderer` - error bar rendering style
  `line` - line type
  `thick` - line thickness
  `dash` - line dash pattern
Returns:
  marker