uk.co.silentsoftware.core.attributestrategy
Class GigaScreenAttributeStrategy

java.lang.Object
  extended by uk.co.silentsoftware.core.attributestrategy.GigaScreenAttributeStrategy
All Implemented Interfaces:
AttributeStrategy

public class GigaScreenAttributeStrategy
extends java.lang.Object
implements AttributeStrategy

GigaScreen attribute strategy that attempts to pick the attribute based on the most common set of colours from 2 screens


Constructor Summary
GigaScreenAttributeStrategy()
           
 
Method Summary
 int[] enforceAttributeRule(int[] mostPopularColour, int[] secondMostPopularColour)
          Enforce the rule by modifying the rgb component objects and changing the attribute colour set they are from *if necessary* (i.e.
private  boolean isBright(int mostPopularColour, int secondMostPopularColour)
          Tests whether an individual screen has bright attributes.
 boolean isBrightSet(int mostPopularColour, int secondMostPopularColour)
          Similar to ColorHelper.isBrightSet but uses the strategy implementation to determine whether *both* colours should be in the bright or half bright set.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GigaScreenAttributeStrategy

public GigaScreenAttributeStrategy()
Method Detail

enforceAttributeRule

public int[] enforceAttributeRule(int[] mostPopularColour,
                                  int[] secondMostPopularColour)
Description copied from interface: AttributeStrategy
Enforce the rule by modifying the rgb component objects and changing the attribute colour set they are from *if necessary* (i.e. bright or half bright).

Specified by:
enforceAttributeRule in interface AttributeStrategy

isBrightSet

public boolean isBrightSet(int mostPopularColour,
                           int secondMostPopularColour)
Description copied from interface: AttributeStrategy
Similar to ColorHelper.isBrightSet but uses the strategy implementation to determine whether *both* colours should be in the bright or half bright set.

Specified by:
isBrightSet in interface AttributeStrategy
Returns:
See Also:
ColourHelper.isBrightSet(int)

isBright

private boolean isBright(int mostPopularColour,
                         int secondMostPopularColour)
Tests whether an individual screen has bright attributes.

Parameters:
mostPopularColour -
secondMostPopularColour -
Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object