> FrAid
 

Settings, Symbols and Models

Introduction

The following section intends to clarify some important points in the FrAid terminology.

Settings

FrAid settings are the serialized part of each plugin (which is what lets you do graphics in FrAid). They usually live in a directory named "fraid_settings" and could be anywhere on the CLASSPATH. They could be in the fraid_settings directory in your installation, in the jar or not there at all, FrAid will use default values then. The settings are managed (created, changed, saved) using the Settings Editor. See also the FrAid Graphics section.

Symbols

Symbols in FrAid are all function and variable names which get loaded in the symbol table each time FrAid is started or during execution. A function can only be invoked if its name is loaded there. Each function is uniquely identified by its name and number of parameters i.e. two functions with the same name can coexist in the symbol table if they have different number of parameters. The variables are treated as functions with zero parameters. The functions with variable number of parameters have this number as -1. FrAid searches for symbols (function definitions) to load as follows:

  • The installation directory - the directory where the currently executed FrAid jar file resides is determined (in most cases different from the current user directory).
  • All jar files in the installation directory whose names contain "fraid" are searched for subdirectories named "functions" and everything in them is interpreted as FrAid library functions. It is important not to have unnecessary jar files in the FrAid installation directory or they will be searched as well.
  • All subdirectories of the installation directory are searched for subdirectories named "functions" and all .class files in them are interpreted as FrAid library functions. It is important not to have unnecessary directories and files in the FrAid installation directory or they will be searched as well.
    Note
    The last two points are important if you want to extend fraid with your own functions or plugins.

For all this to happen the class path is manipulated as follows

  • The installation directory is added to the class path - in a regular distribution the installation directory is the "bin" directory where all jar files stay.
  • The parent of the installation directory is added to the class path - in a regular distribution this is where the fraid_settings and fraid_models directories are.
  • All jar files in the installation directory are added to the class path
    Hint
    Use the printClassPath(); function to see what was added there.

Models

Some FrAid plugins (most notably those which use transformations or iterate transformations) need initial 2D or 3D objects to start with. These are kept in xml files which could be anywhere on the CLASSPATH in a directory named "fraid_models". In a regular FrAid installation this is the fraid_models directory.