> FrAid

FrAid Settings Editor


FrAid Settings Editor


This is the tool used in FrAid to create or change files or object in the memory containing variuos ystem settings. All FrAid plugins are maintained this way. The SettingsEditor can read and write two kinds of files:

  • XML serialised classes ( all FrAid plugin settings can be serialized this way );
  • Java serialised classes ( this option works but is not used currently by any of the plugins);

Currently all the files on which FrAid operates are in the (installed) fraid_settings directory but there is no restriction upon that - files anywhere on the system can be accessed. The SettingsEditor can operate on the public fields of any Java class. Currently it does not suport editing of arrays.
There are two ways to use SettingsEditor:

  • within your Java code to change a live object;
  • as a stand alone aplication to create or change a serialized Java object (XML or regular);

Changing Options

Every time you click Settings on the popup menu of any GraphicsPanel the SettingsEditor opens this panel's plugin bean object for editing.

Editing of Settings

  • Editing of Strings and primitive data types (int, double, short, boolean, long, char, byte, float)

    prim example

    In the tree on the left select the item you want ot change. The value will appear in the edit pane on the right. Change it and click Set or Shift-Enter (the Enter key will work as usual for editing strings, Shift-Enter would set the value).
  • Editing of Arrays - currently does not support array editing;
  • Editing of File Names - FileNames (java.io.File) could not be XML serialized so all objects containing fields of this class should be serialized (saved) through the Java standard serialization (i.e. GeneralSettings);
  • Editing of Colors - the standard ColorChooser is used, click Set after you pick your color.
  • Editing of ColorMaps

    color map

    Using the eight buttons and the color list in the middle choose and order your seed colors. Choose one of the three radio buttons at the bottom:
    • Exact Colors will generate a color map with the exact same number as the seed colors (6 in the example above), Number of Levels will be automatically set and read only;
    • Blended Colors will generate a color map with gradually changing colors and the number of colors specified at the Number of Levels edit box (35 in the example).
    • Alternating Colors wil generate a color map alternating the seed colors and the number of colors specified at the Number of Levels edit box (35 in the example).
    Before clicking Set check what Number of Levels shows because this is the number of colors your ColorMap will contain (some algorithms i.e. JuliaThread use this number). You can safely disregard the Preview number of levels shown at the top right corner, it tells you only about the preview panel.

Creating and Changing Files

You can use it as a standalone application from the command line.

$ java -cp fraid.jar org.fraid.utils.SettingsEditor [objectSpecificator]

Where objectSpecificator is an optional string parameter containing a file or class name:

  • If it is a class name ( i.e. MyPackage.MySubpackage.MyClass) a new object of this class will be instantiated, changed with the SettingsEditor and saved to the disk.
  • If it is a file name the objct serialized in the file will be instantiated and could be changed and saved again for use by FrAid (or any other program). The extention of the file does not influence SettingsEditor on how the file will be interpreted (as XML or not). The program will automaticaly determine if the file is XML or regular Java serialized object.
  • If this parameter is ommited SettingsEditor will open without any class loaded and you can choose your class or file from the menus:

    stand alone

Using the Changed Object

After you are done with your changes depending on how you ran the SettingsEditor you can:

  • If it was called from the command line, save your work in the desired filed format (using the Format menu, the default is XML) and exit.
  • If it was called from the GraphicsPanel or your Java program, just close the window and the changed object will passed back to the application. If used this way there are no menus so the object can not be serialized (for use in Applets). (Java) If you want to serialize (save) your object after it was changed this way do it separately (i.e. the SaveSettings menu item from the GraphicsPanel's popup menu)