|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfacets.util.shade.ShadeSet
public class ShadeSet
Extensible, sortable set of Shades.
| Field Summary | |
|---|---|
static int |
SORT_BLUE
Sort index. |
static int |
SORT_BRIGHTNESS
Sort index. |
static int |
SORT_GREEN
Sort index. |
static int |
SORT_HUE
Sort index. |
static int |
SORT_RED
Sort index. |
static int |
SORT_SATURATION
Sort index. |
static int |
SORT_SNAP
Sort index. |
static int |
SORT_TITLE
Sort index. |
static int |
SORTS
Sort index. |
| Constructor Summary | |
|---|---|
protected |
ShadeSet(Shade[] shades,
ShadeSet master)
Core constructor, not public API. |
|
ShadeSet(ShadeSet master)
Constructor for public API. |
| Method Summary | |
|---|---|
Shade |
addShade(Shade shade)
Adds shade to the working set,
providing no equivalent shade is already stored. |
boolean |
isAddedShade(Shade shade)
True if shade is not a member of the internal reference set. |
void |
setSort(int sort)
Sets the sort used by shades. |
Shade[] |
shades()
The sorted contents of the working set of Shades. |
protected int |
snapBits()
The bit length to be used when 'snapping' new to existing shades. |
Shade |
snapShade(Shade shade)
Checks whether shade can be 'snapped' to an existing shade. |
int |
sort()
The sort used by shades. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SORT_TITLE
public static final int SORT_SNAP
public static final int SORT_HUE
public static final int SORT_SATURATION
public static final int SORT_BRIGHTNESS
public static final int SORT_RED
public static final int SORT_GREEN
public static final int SORT_BLUE
public static final int SORTS
| Constructor Detail |
|---|
public ShadeSet(ShadeSet master)
master - has its reference set shared by the instance, which creates
its own working set.
A suitable master is Shades.HTML_SET which can be shared between
instances.
protected ShadeSet(Shade[] shades,
ShadeSet master)
One of shades or master may be null.
shades - if non-null and master is null
are stored as an internal reference set,
with duplicates (by either colour or title) removedmaster - if non-null shares its reference set
with the new instance; in which case shades are ignored.
In either case an extensible working set is initialised from the reference set;
it is this working set that is accessible via shades.
This constructor is not public API and should be regarded as package-private except for documentation purposes.
| Method Detail |
|---|
public final Shade addShade(Shade shade)
shade to the working set,
providing no equivalent shade is already stored.
Any shade of the same title is replaced by shade.
shade - must be non-null.
shade if successful, otherwise the existing equivalent shade.public final boolean isAddedShade(Shade shade)
shade is not a member of the internal reference set.
shade - must be non-nullpublic final void setSort(int sort)
shades.
sort - should be one of the SORT_XXX constants.public final Shade[] shades()
Shades.
public final Shade snapShade(Shade shade)
shade can be 'snapped' to an existing shade.
Returns the existing shade if found, otherwise shade.
shade - must be non-nullpublic final int sort()
shades.
Sort will be one of the SORT_XXX constants.
protected int snapBits()
Default is 9.
Shade.snapRGB(int)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||