Class FlkUser

java.lang.Object
  extended by FlkUser

public class FlkUser
extends java.lang.Object

FlkUser contains methods to maintain the internal FlkUserDB database created by analyzing the user's image directories they have placed in the Images/ folder. This database is used by Flicker to create entries in the (File | Open user images| ...) menus. This allows users to add many of their gel images without editing the FlkDemoDB.txt file. By placing your data in the Images/ directory, located in the installation directory, Flicker will discover it when it starts and add it to the demo menu. It works as follows:

  1. You copy or move one or more of your directories of with images you 
     want to use with Flicker in the Images/ folder.
  2. When Flicker starts, it creates additional submenu entries in the
    (File | Open user images | ...) menu that are the names of the user's
    directories.
  3. Within each submenu, it will generate all unique combinations of 
     the image files within the corresponding directory and denote them
     as for example, "image3 vs. image5", etc.
  4. Then just access them from the user menu as you would with the 
     built-in pairs of images in (File | Open demo images | ...). 

 Note that it does not generate comparisons between directories. You can 
 still do that by clicking on the left (and then later the right) and 
 using the (File | Open File Images)command to manually load the image.

 If you have this type of data, it will also add the 
 (File | Open user images | List user's images by directory) command.
 You can use this to get a report of all of the files in the popup report
 window.

 The structure contains the following 4 fields:
        SubMenuName, SubMenuEntry,  ImageURL1, ImageURL2
 The map is used to build menus of images to load
 a map entry contains the following fields:
 1. SubMenuName: is the menu image name: e.g.,
   "Human Plasma"
 2. SubMenuEntry: is the menu image name: e.g.,
   "(Swiss2DPAGE vs. plasmaL) gels - clickable"
 3. ImageURL1: is the Image URL for image 1: e.g.
   "Swiss2DPAGE.gif"
 4. ImageURL2: is the Image URL for image 2: e.g.
   "plasmaL.gif"

This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file. This notice must be included with the code. The Flicker Mozilla and Legal files are available on http://open2dprot.sourceforge.net/Flicker

Version:
$Date$ $Revision$
Author:
P. Lemkin (LECB/NCI), G. Thornwall (SAIC), Frederick, MD
See Also:
Flicker Home

Field Summary
static java.lang.String[][] allImgFileList
          [0:nDirs-1][0:nFiles(dir)-1] all image file names for all directories
static java.lang.String[] dirList
          [0:nDirs-1] user image directories names if any
static java.lang.String[] dirListPath
          [0:nDirs-1] user image directory paths if any
private static Flicker flk
          Instance of Flicker
static FlkUser[] flkUsers
          FlkUser database [0:nMaps]
(package private)  java.lang.String imageURL1
          ImageURL1: is the Image URL for image 1: e.g.
(package private)  java.lang.String imageURL2
          imageURL2: is the Image URL for image 2: e.g.
static int MAX_DATABASES
          MAX # of user databases
static int MAX_USER_IMAGES
          Max # of images since can have LOTS of combinations of user data
static int nDirs
          # of user image directories
static int nMaps
          # of flkUsers[] map entries
static int nPairs
          # of user data pairs added
(package private)  java.lang.String subMenuEntry
          is the menu image name: e.g., "(Swiss2DPAGE vs Merril) gels - clickable"
(package private)  java.lang.String subMenuName
          is the menu image name: e.g., "Human Plasma"
private static Util util
          Instance of Util
 
Constructor Summary
FlkUser(Flicker flkS)
          FlkUser() - constructor for Class FlkUser
FlkUser(java.lang.String subMenuName, java.lang.String subMenuEntry, java.lang.String imageURL1, java.lang.String imageURL2)
          FlkUser() - constructor to add a new FlkUser entry NOTE: to do add of an entry, use 'new FlkUser()' method
 
Method Summary
private  int addUserImagesPairs2UserDB()
          addUserImagesPairs2UserDB() - add "Images//..." data to (File | Open user images | ...subdirectories) menu entries.
static void clear()
          clear() - clear database flkUsers[0:nMaps-1].
 boolean delete()
          delete() - rmv entry from database flkUsers[0:nMaps-1].
static void listUserImageDirs()
          listUserImageDirs() - List user's images by directory
static int lookup(FlkUser fm)
          lookup() - lookup entry to database flkUsers[0:nMaps-1].
static int lookupByFileName(java.lang.String fileName1, java.lang.String fileName2)
          lookupByFileName() - lookup entry by file name to flkUsers[0:nMaps-1].
(package private) static int lookupBySubmenu(java.lang.String subMenuEntry)
          lookupBySubmenu() - lookup entry by submenu name to flkUsers[0:nMaps-1].
 boolean set(java.lang.String subMenuName, java.lang.String subMenuEntry, java.lang.String imageURL1, java.lang.String imageURL2)
          set() - set entry to database flkUsers[0:nMaps-1].
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flk

private static Flicker flk
Instance of Flicker


util

private static Util util
Instance of Util


MAX_USER_IMAGES

public static final int MAX_USER_IMAGES
Max # of images since can have LOTS of combinations of user data

See Also:
Constant Field Values

MAX_DATABASES

public static final int MAX_DATABASES
MAX # of user databases

See Also:
Constant Field Values

flkUsers

public static FlkUser[] flkUsers
FlkUser database [0:nMaps]


nMaps

public static int nMaps
# of flkUsers[] map entries


dirList

public static java.lang.String[] dirList
[0:nDirs-1] user image directories names if any


dirListPath

public static java.lang.String[] dirListPath
[0:nDirs-1] user image directory paths if any


nDirs

public static int nDirs
# of user image directories


allImgFileList

public static java.lang.String[][] allImgFileList
[0:nDirs-1][0:nFiles(dir)-1] all image file names for all directories


nPairs

public static int nPairs
# of user data pairs added


subMenuName

java.lang.String subMenuName
is the menu image name: e.g., "Human Plasma"


subMenuEntry

java.lang.String subMenuEntry
is the menu image name: e.g., "(Swiss2DPAGE vs Merril) gels - clickable"


imageURL1

java.lang.String imageURL1
ImageURL1: is the Image URL for image 1: e.g. "http://www.expasy.org/ch2dgifs/PLASMA_HUMAN/PLASMA_HUMAN_id.gif"


imageURL2

java.lang.String imageURL2
imageURL2: is the Image URL for image 2: e.g. "plasmaL.gif"

Constructor Detail

FlkUser

public FlkUser(Flicker flkS)
FlkUser() - constructor for Class FlkUser

Parameters:
flk - instance of Flicker

FlkUser

public FlkUser(java.lang.String subMenuName,
               java.lang.String subMenuEntry,
               java.lang.String imageURL1,
               java.lang.String imageURL2)
FlkUser() - constructor to add a new FlkUser entry NOTE: to do add of an entry, use 'new FlkUser()' method

Parameters:
subMenuName -
subMenuEntry -
imageURL1 -
imageURL2 -
Method Detail

addUserImagesPairs2UserDB

private int addUserImagesPairs2UserDB()
addUserImagesPairs2UserDB() - add "Images//..." data to (File | Open user images | ...subdirectories) menu entries. Look for directories in "Images/" and then compute all combinations of images (i,j) as im#i vs im#j, etc. The SubMenuEntry is "#i vs #j". So the data is organized by subdirectory. Use the subdirectory name as the SubMenuNames.

Returns:
# of additional user image pairs added if added user image subdirectories

lookup

public static int lookup(FlkUser fm)
lookup() - lookup entry to database flkUsers[0:nMaps-1].

Parameters:
fm - is the instance to lookup
Returns:
index of flkUsers[] if succeed, else -1

lookupBySubmenu

static int lookupBySubmenu(java.lang.String subMenuEntry)
lookupBySubmenu() - lookup entry by submenu name to flkUsers[0:nMaps-1].

Parameters:
subMenuEntry - is the menu name of the instance to lookup
Returns:
index of flkUsers[] if succeed, else -1

lookupByFileName

public static int lookupByFileName(java.lang.String fileName1,
                                   java.lang.String fileName2)
lookupByFileName() - lookup entry by file name to flkUsers[0:nMaps-1].

Parameters:
fileName1 - is the fileName name of the instance to lookup for imageURL1 (if not null)
fileName2 - is the fileName name of the instance to lookup for imageURL2 (if not null)
Returns:
index of flkUsers[] if succeed, else -1

set

public boolean set(java.lang.String subMenuName,
                   java.lang.String subMenuEntry,
                   java.lang.String imageURL1,
                   java.lang.String imageURL2)
set() - set entry to database flkUsers[0:nMaps-1]. NOTE: to do add of an entry, use 'new FlkUser()' method

Parameters:
subMenuName -
subMenuEntry -
imageURL1 -
imageURL2 -
Returns:
true if succeed

delete

public boolean delete()
delete() - rmv entry from database flkUsers[0:nMaps-1].

Returns:
true if succeed

clear

public static void clear()
clear() - clear database flkUsers[0:nMaps-1].


listUserImageDirs

public static void listUserImageDirs()
listUserImageDirs() - List user's images by directory