|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.kev.mapping.animations.MapAnimations
public final class MapAnimations
This class connects the mapping-file with the corresponding SVG-file.
Method Summary | |
---|---|
ArrayList<String> |
attributeParser(String input,
boolean isInputAttribute)
This function is intensively used by the mapInputToOutput() method. |
JSONObject |
compareDifference(JSONObject oldJSONObject,
JSONObject newJSONObject)
|
String |
computeRangeValue(String inputValue,
String inputRange,
String outputRange)
Maps the current JSON value from an input range to an output range |
void |
createHashMap()
This Method creates a HashMap of SVGElements of the actual Mapping file. |
static boolean |
createSingleInstance()
|
void |
doAnimations(JSONObject jsonObject)
Applies the Animations for all JSON-Keys which exists in the mapping file. |
HashMap<String,ArrayList<Pair<String,Animation>>> |
getDefaultKeyToAnimationsMap()
|
static MapAnimations |
getInstance()
Returns the single instance of the EclipseJSVGCanvas. |
HashMap<String,HashMap<String,ArrayList<Pair<String,Animation>>>> |
getJsonKeyToInputValuesToAnimationsMap()
|
EclipseJSVGCanvas |
getJSVGCanvas()
Returns the actual JSVGCanvas. |
HashMap<String,ArrayList<Pair<String,Animation>>> |
getKeyToAnimationsMap()
|
SVGFile |
getMappingFile()
Return the current mapping file of this MapAnimations. |
String |
getMappingFilePath()
|
HashMap<String,HashSet<String>> |
getModifiedKeyMap()
|
org.w3c.dom.svg.SVGDocument |
getSVGDocument()
Returns the actual SVGDocument. |
void |
initializeMappingFile(String filename,
boolean isResource)
|
boolean |
jsonValueMatchesInputValue(String jsonValue,
String inputValue)
Tests if a value matches the input string of an animation. |
SVGFile |
loadFromFile(String filename)
Loads an mapping file from disk. |
SVGFile |
loadFromResource(String filename)
Loads an .mapping file from the resource example folder. |
JSONObject |
makeItFlat(JSONObject inputObject)
Make the input JSONObject flat if there exists a hierarchy. |
HashMap<String,String> |
mapInputToOutput(ArrayList<String> inputArray,
ArrayList<String> outputArray)
THIS Method is really important and should be used for all animations! This method maps the input values to the corespondig output values. |
ArrayList<String> |
parser(String input)
Scans a string of comma separated values and simple puts them into an array. |
void |
setDefaultKeyToAnimationsMap(HashMap<String,ArrayList<Pair<String,Animation>>> defaultKeyToAnimationsMap)
|
void |
setJsonKeyToInputValuesToAnimationsMap(HashMap<String,HashMap<String,ArrayList<Pair<String,Animation>>>> jsonKeyToInputValuesToAnimationsMap)
|
void |
setKeyToAnimationsMap(HashMap<String,ArrayList<Pair<String,Animation>>> keyToAnimationsMap)
|
boolean |
valueMatchesRange(String value,
String range)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void initializeMappingFile(String filename, boolean isResource)
public String getMappingFilePath()
public static boolean createSingleInstance()
public static MapAnimations getInstance()
public EclipseJSVGCanvas getJSVGCanvas()
public org.w3c.dom.svg.SVGDocument getSVGDocument()
public final SVGFile getMappingFile()
public final SVGFile loadFromResource(String filename)
filename
- name of the file to load from resource
public final SVGFile loadFromFile(String filename)
filename
- name of the file to load from disk
public void createHashMap()
mappingFile
- current mapping file for which the hashmap should be createdpublic void doAnimations(JSONObject jsonObject)
jsonObject
- the actual JSON-objectpublic boolean valueMatchesRange(String value, String range)
public ArrayList<String> parser(String input)
public ArrayList<String> attributeParser(String input, boolean isInputAttribute)
input
- String to parseisInputAttribute
- true means save all input values of a range. Example: true = 1..5 => 1,2,3,4,5 |
false = 1..5 => 1,5
public HashMap<String,String> mapInputToOutput(ArrayList<String> inputArray, ArrayList<String> outputArray)
inputArray
- the array with all valid input valuesoutputArray
- the array with the animation specific values to which the input values should be
mapped
public JSONObject compareDifference(JSONObject oldJSONObject, JSONObject newJSONObject)
public final JSONObject makeItFlat(JSONObject inputObject) throws JSONException
inputObject
- the input JSONObject, which may not be flat
JSONException
- , is thrown if a conversion failspublic void setJsonKeyToInputValuesToAnimationsMap(HashMap<String,HashMap<String,ArrayList<Pair<String,Animation>>>> jsonKeyToInputValuesToAnimationsMap)
jsonKeyToInputValuesToAnimationsMap
- the jsonKeyToInputValuesToAnimationsMap to setpublic HashMap<String,HashMap<String,ArrayList<Pair<String,Animation>>>> getJsonKeyToInputValuesToAnimationsMap()
public void setDefaultKeyToAnimationsMap(HashMap<String,ArrayList<Pair<String,Animation>>> defaultKeyToAnimationsMap)
defaultKeyToAnimationsMap
- the defaultKeyToAnimationsMap to setpublic HashMap<String,ArrayList<Pair<String,Animation>>> getDefaultKeyToAnimationsMap()
public void setKeyToAnimationsMap(HashMap<String,ArrayList<Pair<String,Animation>>> keyToAnimationsMap)
public HashMap<String,ArrayList<Pair<String,Animation>>> getKeyToAnimationsMap()
public HashMap<String,HashSet<String>> getModifiedKeyMap()
public final String computeRangeValue(String inputValue, String inputRange, String outputRange)
jsonValue
- input
- output
-
public boolean jsonValueMatchesInputValue(String jsonValue, String inputValue)
jsonValue
- inputValue
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |