|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsnakeprogram.SnakeIO
public class SnakeIO
This class is used for reading and writing snakes. It uses file dialogs and dialogs for errors. There are two types of files. Elongation data, Snake data, and image condition data. Copyright (c) 2010, Lehigh University All rights reserved. see COPYING for license.
Constructor Summary | |
---|---|
SnakeIO()
|
Method Summary | |
---|---|
static double[] |
getEndpointChanges(Snake s,
int cur,
int prev)
Finds the 'overlapping' coordinates as determined by the shortest distance, without transforming the snake, by lining indicies. |
static java.lang.String |
getOpenFileName(java.awt.Frame parent)
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 parent,
java.util.HashMap<java.lang.String,java.lang.Double> values)
This loads the snakes from a snake store file. |
static MultipleSnakesStore |
loadSnakes(java.lang.String fname,
java.util.HashMap<java.lang.String,java.lang.Double> values)
This loads the snakes from a snake store file. |
static double |
measureDistance(java.util.ArrayList<double[]> pts,
int start,
int stop)
|
static void |
writeSnakeElongationData(java.awt.Frame parent,
java.util.HashMap<java.lang.String,java.lang.Double> values,
MultipleSnakesStore SnakeStore,
int total_frames)
Writes out the elongation data for each snake in px, as a function of time. |
static void |
writeSnakeElongationData(java.lang.String fname,
java.util.HashMap<java.lang.String,java.lang.Double> values,
MultipleSnakesStore SnakeStore,
int total_frames)
Writes out the elongation data for each snake in px, as a function of time. |
static void |
writeSnakes(java.awt.Frame parent,
java.util.HashMap<java.lang.String,java.lang.Double> values,
MultipleSnakesStore SnakeStore)
Writes out the Snake Data for saving and restoring the actual traced snakes. |
static void |
writeSnakes(java.lang.String fname,
java.util.HashMap<java.lang.String,java.lang.Double> values,
MultipleSnakesStore SnakeStore)
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 |
---|
public SnakeIO()
Method Detail |
---|
public static java.lang.String getSaveFileName(java.awt.Frame parent, java.lang.String title)
public static java.lang.String getOpenFileName(java.awt.Frame parent)
public static void writeSnakeElongationData(java.lang.String fname, java.util.HashMap<java.lang.String,java.lang.Double> values, MultipleSnakesStore SnakeStore, int total_frames)
fname
- this is the filename to save the data too.values
- This contians the constant values as key values pairsSnakeStore
- Contains the snake datatotal_frames
- for writing elongation data of every frame even when there isn't a snakepublic static void writeSnakeElongationData(java.awt.Frame parent, java.util.HashMap<java.lang.String,java.lang.Double> values, MultipleSnakesStore SnakeStore, int total_frames)
parent
- This just needs to be a frame so the dialog can appear. It could be a new frame or null.values
- This contians the constant values as key values pairsSnakeStore
- Contains the snake datatotal_frames
- for writing elongation data of every frame even when there isn't a snakepublic static double[] getEndpointChanges(Snake s, int cur, int prev)
public static double measureDistance(java.util.ArrayList<double[]> pts, int start, int stop)
public static void writeSnakes(java.lang.String fname, java.util.HashMap<java.lang.String,java.lang.Double> values, MultipleSnakesStore SnakeStore)
fname
- This is the file namevalues
- This hashmap stores all of the constants for the current simulation.SnakeStore
- Contains the snake datapublic static void writeSnakes(java.awt.Frame parent, java.util.HashMap<java.lang.String,java.lang.Double> values, MultipleSnakesStore SnakeStore)
parent
- This is a Frame for showing dialogs this could be null or a new Framevalues
- This hashmap stores all of the constants for the current simulation.SnakeStore
- Contains the snake datapublic static MultipleSnakesStore loadSnakes(java.lang.String fname, java.util.HashMap<java.lang.String,java.lang.Double> values)
fname
- The name of the file to be openedvalues
- A hashmap that the key,value pairs will be put into. If there are already values they will be replaced.public static MultipleSnakesStore loadSnakes(java.awt.Frame parent, java.util.HashMap<java.lang.String,java.lang.Double> values)
parent
- Just a frame for the dialogs. It could a new frame or null if you don't have one handyvalues
- A hashmap that the key,value pairs will be put into. If there are already values they will be replaced.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |