Package generic.theme
Class GThemeValueMap
java.lang.Object
generic.theme.GThemeValueMap
- Direct Known Subclasses:
- GTheme
Class for storing colors, fonts, and icons by id
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a new empty map.GThemeValueMap(GThemeValueMap initial) Constructs a new value map, populated by all the values in the given map.
- 
Method SummaryModifier and TypeMethodDescriptionaddColor(ColorValue value) Adds theColorValueto the map.Adds theFontValueto the map.Adds theIconValueto the map.addProperty(JavaPropertyValue value) Adds the given property value to this map.voidvoidclear()Clears all color, font, and icon values from this mapbooleancontainsColor(String id) Returns true if aColorValueexists in this map for the given id.booleancontainsFont(String id) Returns true if aFontValueexists in this map for the given id.booleancontainsIcon(String id) Returns true if anIconValueexists in this map for the given id.booleanReturns true if anJavaPropertyValueexists in this map for the given id.booleanReturns a newGThemeValueMapthat is only populated by values that don't exist in the give map.Returns the currentColorValuefor the given id or null if none exists.Returns the set of all color ids in this mapReturns a list of all theColorValues stored in this map.Gets the set of icon (.png, .gif) files that are used by IconValues that came from files versus resources in the classpath.Returns the currentFontValuefor the given id or null if none exists.Returns the set of all font ids in this mapgetFonts()Returns a list of all theFontValues stored in this map.Returns the currentIconValuefor the given id or null if none exists.Returns the set of all icon ids in this mapgetIcons()Returns a list of all theIconValues stored in this map.Returns a list of all theJavaPropertyValues stored in this map.getProperty(String id) Returns the currentJavaPropertyValuefor the given id or null if none exists.Returns the set of all Java property ids in this mapReturns the resolved color, following indirections as needed to get the color ultimately assigned to the given id.Returns the resolved font, following indirections as needed to get the font ultimately assigned to the given id.Returns the resolved icon, following indirections as needed to get the icon ultimately assigned to the given id.Returns the resolved property, following indirections as needed to get the property ultimately assigned to the given id.inthashCode()booleanisEmpty()Returns true if there are not color, font, icon or property values in this mapvoidload(GThemeValueMap valueMap) Loads all the values from the given map into this map, replacing values with the same ids.voidremoveColor(String id) removes anyColorValuewith the given id from this map.voidremoveFont(String id) removes anyFontValuewith the given id from this map.voidremoveIcon(String id) removes anyIconValuewith the given id from this map.voidremoveProperty(String id) removes anyJavaPropertyValuewith the given id from this map.size()Returns the total number of color, font, icon and property values stored in this map
- 
Field Details- 
colorMap
- 
fontMap
- 
iconMap
- 
propertyMap
 
- 
- 
Constructor Details- 
GThemeValueMappublic GThemeValueMap()Constructs a new empty map.
- 
GThemeValueMapConstructs a new value map, populated by all the values in the given map. Essentially clones the given map.- Parameters:
- initial- the set of values to initialize to
 
 
- 
- 
Method Details- 
addColorAdds theColorValueto the map. If a ColorValue already exists in the map with the same id, it will be replaced- Parameters:
- value- the- ColorValueto store in the map.
- Returns:
- the previous value for the color key or null if no previous value existed
 
- 
addFontAdds theFontValueto the map. If a FontValue already exists in the map with the same id, it will be replaced- Parameters:
- value- the- FontValueto store in the map.
- Returns:
- the previous value for the font key or null if no previous value existed
 
- 
addIconAdds theIconValueto the map. If a IconValue already exists in the map with the same id, it will be replaced- Parameters:
- value- the- IconValueto store in the map.
- Returns:
- the previous value for the icon key or null if no previous value existed
 
- 
addPropertyAdds the given property value to this map. If a property value already exists in the map with the same id, it will be replaced.- Parameters:
- value- the- JavaPropertyValueto store in the map.
- Returns:
- the previous value for the icon key or null if no previous value existed.
 
- 
getColorReturns the currentColorValuefor the given id or null if none exists.- Parameters:
- id- the id to look up a color for
- Returns:
- the current ColorValuefor the given id or null if none exists.
 
- 
getFontReturns the currentFontValuefor the given id or null if none exists.- Parameters:
- id- the id to look up a font for
- Returns:
- the current FontValuefor the given id or null if none exists.
 
- 
getIconReturns the currentIconValuefor the given id or null if none exists.- Parameters:
- id- the id to look up a icon for
- Returns:
- the current IconValuefor the given id or null if none exists.
 
- 
getPropertyReturns the currentJavaPropertyValuefor the given id or null if none exists.- Parameters:
- id- the id to look up a icon for
- Returns:
- the current JavaPropertyValuefor the given id or null if none exists.
 
- 
loadLoads all the values from the given map into this map, replacing values with the same ids.- Parameters:
- valueMap- the map whose values are to be loaded into this map
 
- 
getColorsReturns a list of all theColorValues stored in this map.- Returns:
- a list of all the ColorValues stored in this map.
 
- 
getFontsReturns a list of all theFontValues stored in this map.- Returns:
- a list of all the FontValues stored in this map.
 
- 
getIconsReturns a list of all theIconValues stored in this map.- Returns:
- a list of all the IconValues stored in this map.
 
- 
getPropertiesReturns a list of all theJavaPropertyValues stored in this map.- Returns:
- a list of all the JavaPropertyValues stored in this map.
 
- 
containsColorReturns true if aColorValueexists in this map for the given id.- Parameters:
- id- the id to check
- Returns:
- true if a ColorValueexists in this map for the given id
 
- 
containsFontReturns true if aFontValueexists in this map for the given id.- Parameters:
- id- the id to check
- Returns:
- true if a FontValueexists in this map for the given id
 
- 
containsIconReturns true if anIconValueexists in this map for the given id.- Parameters:
- id- the id to check
- Returns:
- true if an IconValueexists in this map for the given id
 
- 
containsPropertyReturns true if anJavaPropertyValueexists in this map for the given id.- Parameters:
- id- the id to check
- Returns:
- true if an JavaPropertyValueexists in this map for the given id
 
- 
sizeReturns the total number of color, font, icon and property values stored in this map- Returns:
- the total number of color, font, icon and property values stored in this map
 
- 
clearpublic void clear()Clears all color, font, and icon values from this map
- 
isEmptypublic boolean isEmpty()Returns true if there are not color, font, icon or property values in this map- Returns:
- true if there are not color, font, icon or property values in this map
 
- 
removeColorremoves anyColorValuewith the given id from this map.- Parameters:
- id- the id to remove
 
- 
removeFontremoves anyFontValuewith the given id from this map.- Parameters:
- id- the id to remove
 
- 
removeIconremoves anyIconValuewith the given id from this map.- Parameters:
- id- the id to remove
 
- 
removePropertyremoves anyJavaPropertyValuewith the given id from this map.- Parameters:
- id- the id to remove
 
- 
getChangedValuesReturns a newGThemeValueMapthat is only populated by values that don't exist in the give map.- Parameters:
- base- the set of values (usually the default set) to compare against to determine what values are changed.
- Returns:
- a new GThemeValueMapthat is only populated by values that don't exist in the give map
 
- 
getExternalIconFilesGets the set of icon (.png, .gif) files that are used by IconValues that came from files versus resources in the classpath. These are the icon files that need to be included when exporting this set of values to a zip file.- Returns:
- the set of icon (.png, .gif) files that are used by IconValues that came from files versus resources in the classpath
 
- 
hashCodepublic int hashCode()
- 
equals
- 
checkForUnresolvedReferencespublic void checkForUnresolvedReferences()
- 
getColorIdsReturns the set of all color ids in this map- Returns:
- the set of all color ids in this map
 
- 
getFontIdsReturns the set of all font ids in this map- Returns:
- the set of all font ids in this map
 
- 
getIconIdsReturns the set of all icon ids in this map- Returns:
- the set of all icon ids in this map
 
- 
getPropertyIdsReturns the set of all Java property ids in this map- Returns:
- the set of all Java property ids in this map
 
- 
getResolvedColorReturns the resolved color, following indirections as needed to get the color ultimately assigned to the given id.- Parameters:
- id- the id for which to get a color
- Returns:
- the resolved color, following indirections as needed to get the color ultimately assigned to the given id.
 
- 
getResolvedFontReturns the resolved font, following indirections as needed to get the font ultimately assigned to the given id.- Parameters:
- id- the id for which to get a font
- Returns:
- the resolved font, following indirections as needed to get the font ultimately assigned to the given id
 
- 
getResolvedIconReturns the resolved icon, following indirections as needed to get the icon ultimately assigned to the given id.- Parameters:
- id- the id for which to get an icon
- Returns:
- the resolved icon, following indirections as needed to get the icon ultimately assigned to the given id
 
- 
getResolvedPropertyReturns the resolved property, following indirections as needed to get the property ultimately assigned to the given id.- Parameters:
- id- the id for which to get an property
- Returns:
- the resolved property, following indirections as needed to get the property ultimately assigned to the given id
 
 
-