Interface FieldBackgroundColorManager
-
- All Known Implementing Classes:
EmptyFieldBackgroundColorManager
,FullySelectedFieldBackgroundColorManager
,MixedFieldBackgroundColorManager
public interface FieldBackgroundColorManager
Interface for classes that manage the background color of fields. The background color is affected by the current selection and highlight. Implementers of this class manage the interaction of the selection and highlight to provide a single object from which to get background color information.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.awt.Color
getBackgroundColor()
Returns the overall background color for the entire field.java.awt.Color
getPaddingColor(int padIndex)
Returns the color for the right or left padding within the field.java.util.List<Highlight>
getSelectionHighlights(int row)
Return a list of highlights (background colors ranges) for a given row of text in the field.
-
-
-
Method Detail
-
getBackgroundColor
java.awt.Color getBackgroundColor()
Returns the overall background color for the entire field. If the field is totally, selected, then this color will be the selection color. If the field is highlighted,then the color will be the highlight color. If both, then the color will be the combined color. If the color is the same the overall background color of the layout containing this field, then null will be returned to indicate that the background color for this field does not need to be painted- Returns:
- the background color for this field or null if it is the same as the background for the entire layout.
-
getSelectionHighlights
java.util.List<Highlight> getSelectionHighlights(int row)
Return a list of highlights (background colors ranges) for a given row of text in the field.- Parameters:
row
- the row for which to get a list of highlights.- Returns:
- a list of highlights for the row.
-
getPaddingColor
java.awt.Color getPaddingColor(int padIndex)
Returns the color for the right or left padding within the field. The padding is difference of the width of the field and the width of the text being displayed. Most fields pad to the right, but a few pad to the left.- Parameters:
padIndex
- either 0 or 1 to get left padding or right padding respectively.- Returns:
- the color for either the right or left padding.
-
-