Class AACMappings
java.lang.Object
AACMappings
public class AACMappings
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description AACMappings(java.lang.String filename)
-
Method Summary
Modifier and Type Method Description void
add(java.lang.String imageLoc, java.lang.String text)
Adds the mapping to the current category (or the default category if that is the current category)java.lang.String
getCurrentCategory()
Gets the current categoryjava.lang.String[]
getImageLocs()
Provides an array of all the images in the current categoryjava.lang.String
getText(java.lang.String imageLoc)
Given the image location selected, it determines the associated text with the image.boolean
isCategory(java.lang.String imageLoc)
Determines if the image represents a category or text to speakvoid
reset()
Resets the current category of the AAC back to the default categoryvoid
writeToFile(java.lang.String filename)
Writes the ACC mappings stored to a file.
-
Constructor Details
-
AACMappings
public AACMappings(java.lang.String filename)
-
-
Method Details
-
getText
public java.lang.String getText(java.lang.String imageLoc)Given the image location selected, it determines the associated text with the image. If the image provided is a category, it also updates the AAC's current category to be the category associated with that image- Parameters:
imageLoc
- the location where the image is stored- Returns:
- returns the text associated with the current image
-
getImageLocs
public java.lang.String[] getImageLocs()Provides an array of all the images in the current category- Returns:
- the array of images in the current category
-
reset
public void reset()Resets the current category of the AAC back to the default category -
getCurrentCategory
public java.lang.String getCurrentCategory()Gets the current category- Returns:
- returns the current category or the empty string if on the default category
-
isCategory
public boolean isCategory(java.lang.String imageLoc)Determines if the image represents a category or text to speak- Parameters:
imageLoc
- the location where the image is stored- Returns:
- true if the image represents a category, false if the image represents text to speak
-
writeToFile
public void writeToFile(java.lang.String filename)Writes the ACC mappings stored to a file. The file is formatted as the text location of the category followed by the text name of the category and then one line per item in the category that starts with > and then has the file name and text of that image for instance: img/food/plate.png food >img/food/icons8-french-fries-96.png french fries >img/food/icons8-watermelon-96.png watermelon img/clothing/hanger.png clothing >img/clothing/collaredshirt.png collared shirt represents the file with two categories, food and clothing and food has french fries and watermelon and clothing has a collared shirt- Parameters:
filename
- the name of the file to write the AAC mapping to
-
add
public void add(java.lang.String imageLoc, java.lang.String text)Adds the mapping to the current category (or the default category if that is the current category)- Parameters:
imageLoc
- the location of the imagetext
- the text associated with the image
-