|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectex1.WepsDBFile
This class holds basic information about a weps crop or operation xml file. Each xml data file loaded is bound to a new instance of this class.
Constructor Summary | |
WepsDBFile(java.lang.String f,
boolean isCrop,
DefnFileParser p)
Creates a new instance of WepsDBFile |
Method Summary | |
boolean |
addParm(java.lang.String name,
java.lang.String val)
Adds a parameter and its value to the list for crops or if this is an operation to the currrent action node being built. |
void |
changeName(java.lang.String mcrewCfgDir,
java.lang.String newName)
Change the name of an existing file. |
boolean |
changeProcess(int procNum,
int newProc,
ActionValue av)
This function changes a process to a different type. |
boolean |
checkProcesses(boolean displayMessage)
This function determines if the WEPS operations process and group ordering is valid. |
void |
createClone(java.lang.String mcrewCfgDir,
WepsDBFile wf,
boolean stripActions)
Create a copy of this file. |
boolean |
deleteFile()
Get rid of this file |
boolean |
deleteProcess(int index)
This function deletes a process from an operation. |
ActionValue |
endActionNode(ex1.OpAction act)
This closes building an action node by setting its type and then adding it to the list. |
ActionValue |
find(ex1.OpAction a)
Finds the first action of a specific type in the operation. |
ActionValue |
getAction(int inx)
Return the ith action in the list or null if we don't have it. |
int |
getActionCount()
For operations return the number of processes/actions that make up this operation |
java.lang.String |
getActionName(int index)
For an operation file return the name of the ith action. |
java.util.Collection |
getAllParms()
Returns a list of all the parameters. |
java.lang.String |
getBaseName()
The basename of the file without the .CROP or .OPRN extension |
java.lang.String |
getFileName()
Return the basename and extension of this file. |
java.lang.String |
getPathName()
Return the full pathname for this file. |
java.lang.String |
getPathOnly(java.lang.String dbDir)
Get the path part of this file rooted at the main weps database directory. |
int |
getRowsSpanned(int code,
char ty)
This determines how many rows in a detail operations table this file occupies for the indicated code and type, like P24, P32, etc. |
int |
getSub(ActionValue a)
This returns the subIndex of this action within the operation. |
java.lang.String |
getValue(ParamDef p,
boolean altUnits)
Get the value of a specific crop parameter. |
java.lang.String |
getValueAt(int tab,
int col,
int sub,
boolean altUnits)
This reads a particular value from an operations record. |
boolean |
insertProcess(int procNum,
int newProc,
boolean before,
ActionValue av)
This function inserts a new process before (or after) a given process. |
boolean |
isModified()
Return true if any parameter has changed. |
boolean |
isOutOfOrder()
Return true if the process sequence is incorrect, set proviously as a result of checking processes. |
boolean |
isReadOnly()
Basic test to see if the file can be written. |
void |
moveLeft(int col)
Shifts the process one to the left in the process list. |
void |
moveRight(int col)
Shifts the process one to the right in the process list. |
boolean |
saveFile(java.lang.String mcrewCfgDir)
Save the database file as an XML file specified by the DTD's in mcrewCfgDir |
boolean |
setValue(ParamDef p,
java.lang.String val,
boolean altUnits)
Sets the value of a specific crop parameter. |
boolean |
setValueAt(int tab,
int col,
int sub,
java.lang.String val,
boolean altUnits)
The matching function to setValueAt() for operations data. |
ActionValue |
startActionNode()
This starts off the first action node of an operation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WepsDBFile(java.lang.String f, boolean isCrop, DefnFileParser p)
f
- name of file to loadisCrop
- true if crop filep
- structure holding all parameter infoMethod Detail |
public boolean isReadOnly()
public ActionValue startActionNode()
public int getSub(ActionValue a)
a
- the structure to search for
public ActionValue endActionNode(ex1.OpAction act)
act
- type of process this node is to representpublic ActionValue find(ex1.OpAction a)
a
- type of process to search for
public boolean addParm(java.lang.String name, java.lang.String val)
name
- parameter nameval
- value of the parameterpublic int getRowsSpanned(int code, char ty)
code
- numeric part of process to search forty
- charcter (P,G,O) type of process to search for
public java.lang.String getValueAt(int tab, int col, int sub, boolean altUnits)
tab
- what process type, corresponds to table index of detail tablescol
- what column(parameter) to getsub
- if there are more than 1 process of this type selects which onaltUnits
- true if the value should be returned in the alternate unitspublic boolean setValueAt(int tab, int col, int sub, java.lang.String val, boolean altUnits)
tab
- what process type, corresponds to table index of detail tablescol
- what column(parameter) to getsub
- if there are more than 1 process of this type selects which onval
- string to savealtUnits
- true if the value is in alternate units and needs to be converted before storing
public java.util.Collection getAllParms()
public java.lang.String getValue(ParamDef p, boolean altUnits)
p
- Info about parameteraltUnits
- true if alternate(english) conversion should be donepublic boolean setValue(ParamDef p, java.lang.String val, boolean altUnits)
p
- the parameter info about what to setval
- the value that is to be savedaltUnits
- true if the value is in English unitspublic int getActionCount()
public ActionValue getAction(int inx)
inx
- the index of the process to get
public java.lang.String getActionName(int index)
index
- what process to return name for
public java.lang.String getFileName()
public java.lang.String getPathName()
public java.lang.String getPathOnly(java.lang.String dbDir)
dbDir
- directory where crop or operation files are located
public java.lang.String getBaseName()
public boolean isModified()
public boolean saveFile(java.lang.String mcrewCfgDir)
mcrewCfgDir
- directory of mcrew config files
public void createClone(java.lang.String mcrewCfgDir, WepsDBFile wf, boolean stripActions)
mcrewCfgDir
- directory where the mcrew config xml and dtd files arewf
- base file structure where data comes fromstripActions
- true to remove all actionspublic void changeName(java.lang.String mcrewCfgDir, java.lang.String newName)
mcrewCfgDir
- directory where mcrew config files are locatednewName
- new name for filepublic boolean deleteFile()
public boolean changeProcess(int procNum, int newProc, ActionValue av)
procNum
- process index in operation to changenewProc
- index of new processav
- template to use to fill in parm values or nullpublic boolean insertProcess(int procNum, int newProc, boolean before, ActionValue av)
procNum
- index of current process in this operationnewProc
- type of new operation to insertbefore
- true if this should be inserted before, false for afterav
- set of parameters to use as template or nullpublic boolean deleteProcess(int index)
index
- index in list of processes that is to be deleted
public boolean checkProcesses(boolean displayMessage)
displayMessage
- true if a dialog is to be displayed
public void moveRight(int col)
col
- column that is to be logically shifted rightpublic void moveLeft(int col)
col
- column that is to be shifted logically leftpublic boolean isOutOfOrder()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |