|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectzinger.bsheet.AbstractPersistence
zinger.bsheet.StandardMapPersistence
public abstract class StandardMapPersistence
Field Summary | |
---|---|
static java.lang.String |
APPEARANCE_MAP_KEY
|
static java.lang.String |
COLUMN_IDENTIFIERS_KEY
|
static java.lang.String |
COLUMNS_KEY
|
static java.lang.String |
DATA_VECTOR_KEY
|
static java.lang.String |
DATA_VECTOR_LENGTH_KEY
|
static java.lang.String |
FORMATS_KEY
|
static java.lang.String |
ROW_HEIGHTS_KEY
|
static java.lang.String |
VERSION_KEY
|
Fields inherited from class zinger.bsheet.AbstractPersistence |
---|
extensions, fileFilter |
Constructor Summary | |
---|---|
StandardMapPersistence()
|
|
StandardMapPersistence(javax.swing.filechooser.FileFilter fileFilter,
java.lang.String[] extensions)
|
Method Summary | |
---|---|
protected void |
decompressDataVector(java.util.Vector dataVector,
int originalLength)
Decompresses given two-dimensional data vector. |
boolean |
evalValues(javax.swing.JTable table,
java.util.Map map)
|
protected java.util.List |
getColumns(javax.swing.table.TableColumnModel columnModel)
Creates a List of Column objects from a table model's column enumerator. |
protected java.util.Vector |
getCompressedDataVector(java.util.Vector dataVector)
Creates a compressed version of the given two-dimensional data vector. |
boolean |
isLoadCapable()
|
protected abstract java.util.Map |
load(java.io.File file)
|
boolean |
load(javax.swing.JTable table,
java.io.File file)
Loads a document into the model behind the table. |
protected void |
load(java.util.Map map,
javax.swing.JTable table)
Loads table model data from the specified object map. |
protected java.util.Map |
save(javax.swing.JTable table)
|
boolean |
save(javax.swing.JTable table,
java.io.File file)
Persists the document from the model behind the table. |
protected abstract void |
save(java.util.Map map,
java.io.File file)
|
protected void |
setColumns(java.util.List columns,
javax.swing.table.TableColumnModel columnModel)
Sets the columns in the table model based on the List containing Column objects. |
Methods inherited from class zinger.bsheet.AbstractPersistence |
---|
autocorrectFile, getFileFilter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String VERSION_KEY
public static final java.lang.String COLUMN_IDENTIFIERS_KEY
public static final java.lang.String DATA_VECTOR_KEY
public static final java.lang.String DATA_VECTOR_LENGTH_KEY
public static final java.lang.String COLUMNS_KEY
public static final java.lang.String FORMATS_KEY
public static final java.lang.String ROW_HEIGHTS_KEY
public static final java.lang.String APPEARANCE_MAP_KEY
Constructor Detail |
---|
public StandardMapPersistence(javax.swing.filechooser.FileFilter fileFilter, java.lang.String[] extensions)
public StandardMapPersistence()
Method Detail |
---|
public boolean isLoadCapable()
true
if the implementation can load a document as well as persist itpublic boolean save(javax.swing.JTable table, java.io.File file) throws java.io.IOException
Persistence
true
if the document was persisted successfully
java.io.IOException
- if an IO problem occurred during persisting the documentpublic boolean load(javax.swing.JTable table, java.io.File file) throws java.io.IOException, java.lang.UnsupportedOperationException
Persistence
true
if the document was loaded successfully
java.io.IOException
- if an IO problem occurred during loading the document
java.lang.UnsupportedOperationException
- if the implementation is not capable of loading
documents as per isLoadCapable()
methodPersistence.isLoadCapable()
protected java.util.Map save(javax.swing.JTable table)
protected void load(java.util.Map map, javax.swing.JTable table)
Constant Variable | Constant Value (* = required) | Description |
---|---|---|
COLUMN_IDENTIFIERS_KEY |
column_ids * |
A Vector containing column identifiers. |
DATA_VECTOR_KEY |
data_vector * |
A compressed two-dimensional data vector.
A data vector is compressed by removing all trailing empty row elements
and trailing null from each ramaining row vector. |
DATA_VECTOR_LENGTH_KEY |
data_vector_length |
An Integer containing the row count (the length of the data vector). |
COLUMNS_KEY |
columns |
A List of Column objects. |
FORMATS_KEY |
formats |
A formats Map used in BSHTableModel for column and cell formatting. |
ROW_HEIGHTS_KEY |
row_heights |
A Map mapping row indices to row heights for non-default row height values. |
APPEARANCE_MAP_KEY |
appearance_map |
A cell appearance Map used for column and cell presentation setting. |
COLUMN_IDENTIFIERS_KEY
,
DATA_VECTOR_KEY
,
DATA_VECTOR_LENGTH_KEY
,
COLUMNS_KEY
,
FORMATS_KEY
,
ROW_HEIGHTS_KEY
,
APPEARANCE_MAP_KEY
,
DefaultTableModel.setDataVector(java.util.Vector, java.util.Vector)
,
setColumns(java.util.List, javax.swing.table.TableColumnModel)
,
BSHTableModel.setFormats(java.util.Map)
,
BSHTableModel.setAppearanceMap(java.util.Map)
,
decompressDataVector(java.util.Vector, int)
protected void decompressDataVector(java.util.Vector dataVector, int originalLength)
originalLength
). Note: This method is not a true inverse
function of getCompressedDataVector(Vector)
because trailing empty rows
are represented by null
elements rather than empty Vector
objects
and trailing null
elements of the rows are not restored. Also note that this method
operates directly on the passed in vector and mutates it.
load(java.util.Map, javax.swing.JTable)
,
getCompressedDataVector(java.util.Vector)
protected java.util.Vector getCompressedDataVector(java.util.Vector dataVector)
null
elements in remaining rows. This method does not
mutate passed in Vector
.
save(javax.swing.JTable)
,
decompressDataVector(java.util.Vector, int)
protected java.util.List getColumns(javax.swing.table.TableColumnModel columnModel)
List
of Column
objects from a table model's column enumerator.
save(javax.swing.JTable)
,
setColumns(java.util.List, javax.swing.table.TableColumnModel)
protected void setColumns(java.util.List columns, javax.swing.table.TableColumnModel columnModel)
List
containing Column
objects.
load(java.util.Map, javax.swing.JTable)
,
getColumns(javax.swing.table.TableColumnModel)
protected abstract java.util.Map load(java.io.File file) throws java.io.IOException
java.io.IOException
protected abstract void save(java.util.Map map, java.io.File file) throws java.io.IOException
java.io.IOException
public boolean evalValues(javax.swing.JTable table, java.util.Map map)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |