snakeprogram3d
Class SnakeIO

java.lang.Object
  extended by snakeprogram3d.SnakeIO

public class SnakeIO
extends java.lang.Object

Mostly static class for reading and writing snakes. Also used for opening dialogs


Constructor Summary
SnakeIO()
           
 
Method Summary
static java.lang.String getOpenFileName(java.awt.Frame parent)
          Open file dialog
static java.lang.String getOpenFileName(java.awt.Frame parent, java.lang.String s)
          Open file dialog
static java.lang.String getSaveFileName(java.awt.Frame parent, java.lang.String title)
          Save file dialog
static MultipleSnakesStore loadSnakes(java.awt.Frame frame, java.util.HashMap<java.lang.String,java.lang.Double> constants)
          For loading snakes from api/plugin context.
static MultipleSnakesStore loadSnakes(SnakeFrame parent)
          This loads the snakes from a snake store file.
static void writeSnakeElongationData(SnakeFrame parent, MultipleSnakesStore SnakeStore, int total_frames)
          Writes out the elongation data for each snake in px, as a function of time.
static void writeSnakes(SnakeFrame parent, MultipleSnakesStore SnakeStore)
          Writes out the Snake Data for saving and restoring the actual traced snakes.
static void writeSnakes(SnakeFrame parent, MultipleSnakesStore SnakeStore, java.io.File f)
          Writes out the Snake Data for saving and restoring the actual traced snakes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SnakeIO

public SnakeIO()
Method Detail

getSaveFileName

public static java.lang.String getSaveFileName(java.awt.Frame parent,
                                               java.lang.String title)
Save file dialog


getOpenFileName

public static java.lang.String getOpenFileName(java.awt.Frame parent)
Open file dialog


getOpenFileName

public static java.lang.String getOpenFileName(java.awt.Frame parent,
                                               java.lang.String s)
Open file dialog


writeSnakeElongationData

public static void writeSnakeElongationData(SnakeFrame parent,
                                            MultipleSnakesStore SnakeStore,
                                            int total_frames)
Writes out the elongation data for each snake in px, as a function of time. included in the output file are the constants from the snake panel.

Parameters:
parent - This is a snake frame, it is nescessary to get the constants
SnakeStore - Contains the snake data
total_frames - for writing elongation data of every frame even when there isn't a snake

writeSnakes

public static void writeSnakes(SnakeFrame parent,
                               MultipleSnakesStore SnakeStore)
Writes out the Snake Data for saving and restoring the actual traced snakes. Includes the constants and all of the snake points.

Parameters:
parent - This is a snake frame, it is nescessary to get the constants
SnakeStore - Contains the snake data

writeSnakes

public static void writeSnakes(SnakeFrame parent,
                               MultipleSnakesStore SnakeStore,
                               java.io.File f)
Writes out the Snake Data for saving and restoring the actual traced snakes. Includes the constants and all of the snake points. Doesn't pop up a window but uses the parent for constants.

Parameters:
parent - This is a snake frame, it is nescessary to get the constants
SnakeStore - Contains the snake data
f - uses this file.

loadSnakes

public static MultipleSnakesStore loadSnakes(java.awt.Frame frame,
                                             java.util.HashMap<java.lang.String,java.lang.Double> constants)
For loading snakes from api/plugin context.

Parameters:
frame - for showing dialogs, could be null if nescessary
constants - will be filled/updated with constants from the snake file.
Returns:
the snakes, lots and lots of snakes.

loadSnakes

public static MultipleSnakesStore loadSnakes(SnakeFrame parent)
This loads the snakes from a snake store file. SnakeFrame is nescessary to set the constants. This reads the file for constants first, then when it finds the first snake it begins to load snake data.