com.threerings.editor.util
Class PropertyUtil

java.lang.Object
  extended by com.threerings.editor.util.PropertyUtil

public class PropertyUtil
extends Object

Some general utility methods relating to editable properties.


Constructor Summary
PropertyUtil()
           
 
Method Summary
static double getMaximum(Property[] lineage)
          Finds the maximum value by walking up the lineage.
static int getMaxSize(Property[] lineage)
          Finds the maximum size by walking up the lineage.
static double getMinimum(Property[] lineage)
          Finds the minimum value by walking up the lineage.
static int getMinSize(Property[] lineage)
          Finds the minimum size by walking up the lineage.
static String getMode(Property[] lineage)
          Finds the mode string by walking up the lineage.
static void getReferences(ConfigManager cfgmgr, Object object, Set<Tuple<Class<?>,String>> configs, Set<String> resources)
          Finds all configs and resources referenced in the supplied editable object and places them in the supplied sets.
static void getResources(ConfigManager cfgmgr, Object object, Set<String> paths)
          Finds all resources referenced by the specified editable object (and any configs referenced by that object, etc.) and places them in the supplied set.
static double getScale(Property[] lineage)
          Finds the scale value by walking up the lineage.
static double getStep(Property[] lineage)
          Finds the step value by walking up the lineage.
static String getUnits(Property[] lineage)
          Finds the units string by walking up the lineage.
static Object strip(ConfigManager cfgmgr, Object object)
          Strips and returns a single object.
static boolean validateReferences(String where, ConfigManager cfgmgr, Set<Tuple<Class<?>,String>> configs, Set<String> resources, PrintStream out)
          Valides the supplied sets of configs and resources.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyUtil

public PropertyUtil()
Method Detail

getMode

public static String getMode(Property[] lineage)
Finds the mode string by walking up the lineage.

Parameters:
lineage - the property lineage, with the actual property at the end.

getUnits

public static String getUnits(Property[] lineage)
Finds the units string by walking up the lineage.

Parameters:
lineage - the property lineage, with the actual property at the end.

getMinimum

public static double getMinimum(Property[] lineage)
Finds the minimum value by walking up the lineage.

Parameters:
lineage - the property lineage, with the actual property at the end.

getMaximum

public static double getMaximum(Property[] lineage)
Finds the maximum value by walking up the lineage.

Parameters:
lineage - the property lineage, with the actual property at the end.

getStep

public static double getStep(Property[] lineage)
Finds the step value by walking up the lineage.

Parameters:
lineage - the property lineage, with the actual property at the end.

getScale

public static double getScale(Property[] lineage)
Finds the scale value by walking up the lineage.

Parameters:
lineage - the property lineage, with the actual property at the end.

getMinSize

public static int getMinSize(Property[] lineage)
Finds the minimum size by walking up the lineage.

Parameters:
lineage - the property lineage, with the actual property at the end.

getMaxSize

public static int getMaxSize(Property[] lineage)
Finds the maximum size by walking up the lineage.

Parameters:
lineage - the property lineage, with the actual property at the end.

getReferences

public static void getReferences(ConfigManager cfgmgr,
                                 Object object,
                                 Set<Tuple<Class<?>,String>> configs,
                                 Set<String> resources)
Finds all configs and resources referenced in the supplied editable object and places them in the supplied sets.


validateReferences

public static boolean validateReferences(String where,
                                         ConfigManager cfgmgr,
                                         Set<Tuple<Class<?>,String>> configs,
                                         Set<String> resources,
                                         PrintStream out)
Valides the supplied sets of configs and resources.

Returns:
true if the references are valid

getResources

public static void getResources(ConfigManager cfgmgr,
                                Object object,
                                Set<String> paths)
Finds all resources referenced by the specified editable object (and any configs referenced by that object, etc.) and places them in the supplied set.


strip

public static Object strip(ConfigManager cfgmgr,
                           Object object)
Strips and returns a single object.



Copyright © 2011. All Rights Reserved.