com.michaelbaranov.microba.gradienteditor

Class GradientEditor


public class GradientEditor
extends GradientBar

IMPORTANT: alpha featre not implemented. Stubs only. No alpha marker bar yet.

This is a component for displaying/modifying a gradient (palette).

Implementation details:
This implementation combines a GradientBar with two MarkerBar components. The marker bars are used to provide editing capabilities to the gradient bar. Note, that this component doesn't provide direct color-selecting capabilitied but relies on other external components such as JColorChooser.

Author:
Michael Baranov

Field Summary

static String
PROPERTY_ALPHA_MUTATION_MODEL
The name of a "alphaMutationModel" property.
static String
PROPERTY_ALPHA_SELECTION_MODEL
The name of a "alphaSelectionModel" property.
static String
PROPERTY_COLOR_MUTATION_MODEL
The name of a "colorMutationModel" property.
static String
PROPERTY_COLOR_SELECTION_MODEL
The name of a "colorSelectionModel" property.

Constructor Summary

GradientEditor()
Constructor.

Method Summary

MarkerMutationModel
getAlphaMutationModel()
Regturns the current alpha mutation model.
ListSelectionModel
getAlphaSelectionModel()
Returns current alpha selection model.
MarkerMutationModel
getColorMutationModel()
Regturns the current color mutation model.
ListSelectionModel
getColorSelectionModel()
Returns current color selection model.
String
getUIClassID()
void
setAlphaMutationModel(MarkerMutationModel mutationModel)
Replaces current alpha mutation model with given one.
void
setAlphaSelectionModel(ListSelectionModel selectionModel)
Replaces current alpha selection model with given one.
void
setColorMutationModel(MarkerMutationModel mutationModel)
Replaces current color mutation model with given one.
void
setColorSelectionModel(ListSelectionModel selectionModel)
Replaces current color selection model with given one.

Field Details

PROPERTY_ALPHA_MUTATION_MODEL

public static final String PROPERTY_ALPHA_MUTATION_MODEL
The name of a "alphaMutationModel" property.

PROPERTY_ALPHA_SELECTION_MODEL

public static final String PROPERTY_ALPHA_SELECTION_MODEL
The name of a "alphaSelectionModel" property.

PROPERTY_COLOR_MUTATION_MODEL

public static final String PROPERTY_COLOR_MUTATION_MODEL
The name of a "colorMutationModel" property.

PROPERTY_COLOR_SELECTION_MODEL

public static final String PROPERTY_COLOR_SELECTION_MODEL
The name of a "colorSelectionModel" property.

Constructor Details

GradientEditor

public GradientEditor()
Constructor.

Method Details

getAlphaMutationModel

public MarkerMutationModel getAlphaMutationModel()
Regturns the current alpha mutation model.
Returns:
current alpha mutation model

getAlphaSelectionModel

public ListSelectionModel getAlphaSelectionModel()
Returns current alpha selection model.
Returns:
current alpha selection model.

getColorMutationModel

public MarkerMutationModel getColorMutationModel()
Regturns the current color mutation model.
Returns:
current color mutation model

getColorSelectionModel

public ListSelectionModel getColorSelectionModel()
Returns current color selection model.
Returns:
current color selection model.

getUIClassID

public String getUIClassID()

setAlphaMutationModel

public void setAlphaMutationModel(MarkerMutationModel mutationModel)
Replaces current alpha mutation model with given one.
Parameters:
mutationModel - new mutation model. May be null.

setAlphaSelectionModel

public void setAlphaSelectionModel(ListSelectionModel selectionModel)
Replaces current alpha selection model with given one. This implementation uses ListSelectionModel.getLeadSelectionIndex() to determine selected marker.
Parameters:
selectionModel - new selection model. May be null.

setColorMutationModel

public void setColorMutationModel(MarkerMutationModel mutationModel)
Replaces current color mutation model with given one.
Parameters:
mutationModel - new mutation model. May be null.

setColorSelectionModel

public void setColorSelectionModel(ListSelectionModel selectionModel)
Replaces current color selection model with given one. This implementation uses ListSelectionModel.getLeadSelectionIndex() to determine selected marker.
Parameters:
selectionModel - new selection model. May be null.