Main Page | Packages | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ikayaki.gui.ProjectExplorerTable Class Reference

Inheritance diagram for ikayaki.gui.ProjectExplorerTable:

Inheritance graph
[legend]
Collaboration diagram for ikayaki.gui.ProjectExplorerTable:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ProjectExplorerTable (ProjectComponent parent)
 ProjectExplorerTable (ProjectComponent parent, boolean isCalibration)
void setColumns (int[] columns)
void fitColumnWidths ()
void setDirectory (File directory)
void projectUpdated (ProjectEvent event)

Static Public Attributes

static final int COLUMN_FILENAME = 0
static final int COLUMN_TYPE = 1
static final int COLUMN_LASTMOD = 2
static final int COLUMN_LASTMEASURE = 3
static final int COLUMN_UNMEASURED = 4
static final String[] column_name = {"Name", "Type", "Modified", "Measured", "Elapsed"}
static final int[] default_columns = {COLUMN_FILENAME, COLUMN_TYPE, COLUMN_LASTMOD}
static final int[] calibration_columns = {COLUMN_FILENAME, COLUMN_LASTMEASURE, COLUMN_UNMEASURED}

Private Member Functions

void scrollToRow (int rowIndex)
File[] getProjectFiles (File directory)

Private Attributes

final ProjectComponent parent
boolean isCalibration
final ProjectExplorerTableModel explorerTableModel
final Comparator< File > explorerTableComparator = new ProjectExplorerTableComparator()
Thread projectTypeCacher = new Thread()
File directory
File[] files = new File[0]
int selectedFile = -1
int explorerTableSortColumn = 0
int[] columns = new int[0]

Static Private Attributes

static final int COLUMN_UNDEFINED = -1

Classes

class  ProjectExplorerPopupMenu
class  ProjectExplorerTableComparator
class  ProjectExplorerTableModel

Detailed Description

Creates a list of project files in directory. Handles loading selected projects and showing export popup menu.

Author:
Samuli Kaipiainen

Definition at line 51 of file ProjectExplorerTable.java.


Constructor & Destructor Documentation

ikayaki.gui.ProjectExplorerTable.ProjectExplorerTable ProjectComponent  parent  ) 
 

Builds ProjectExplorerTable for displaying all project files.

Parameters:
parent the component whose setProject() method will be called on opening a new project file.

Definition at line 117 of file ProjectExplorerTable.java.

ikayaki.gui.ProjectExplorerTable.ProjectExplorerTable ProjectComponent  parent,
boolean  isCalibration
 

Builds ProjectExplorerTable.

Parameters:
parent the component whose setProject() method will be called on opening a new project file.
isCalibration if true, this table will display only calibration projects and related columns.

Event A: On table click - call Project.loadProject(File) with clicked project file, call (MainViewPanel) parent.setProject(Project) with returned Project unless null, on which case show error message and revert explorerTable selection to old project, if any.

Event B: On table mouse right-click - create a ProjectExplorerPopupMenu for rightclicked project file.

ExplorerTable sorting.

Definition at line 127 of file ProjectExplorerTable.java.

References ikayaki.gui.ProjectExplorerTable.calibration_columns, ikayaki.gui.ProjectExplorerTable.default_columns, ikayaki.gui.ProjectExplorerTable.explorerTableModel, ikayaki.gui.ProjectExplorerTable.files, ikayaki.gui.null, ikayaki.gui.project, ikayaki.gui.ProjectExplorerTable.selectedFile, and ikayaki.gui.ProjectExplorerTable.setColumns().

Here is the call graph for this function:


Member Function Documentation

void ikayaki.gui.ProjectExplorerTable.fitColumnWidths  ) 
 

Makes sure that all data fits in their columns (excluding the COLUMN_FILENAME column). Renders every cell of the table to find out their preferred width, and makes the column wider if the contents does not fit the column. <p/> This method must be run in the event thread. It is recommendable to cache the project type column's data before calling this method, since this method needs to render every cell of the table.

Definition at line 287 of file ProjectExplorerTable.java.

File [] ikayaki.gui.ProjectExplorerTable.getProjectFiles File  directory  )  [private]
 

Reads project file listing from given directory.

Parameters:
directory directory whose project file listing to read.
Returns:
project files in that directory; new File[0] if directory is null or invalid.

Definition at line 357 of file ProjectExplorerTable.java.

References ikayaki.gui.null.

void ikayaki.gui.ProjectExplorerTable.projectUpdated ProjectEvent  event  ) 
 

Forwards ProjectEvents to the table model.

Parameters:
event ProjectEvent received.

Implements ikayaki.ProjectListener.

Definition at line 410 of file ProjectExplorerTable.java.

References ikayaki.gui.ProjectExplorerTable.ProjectExplorerTableModel.projectUpdated().

Here is the call graph for this function:

void ikayaki.gui.ProjectExplorerTable.scrollToRow int  rowIndex  )  [private]
 

Scrolls the table to show the specified row.

Parameters:
rowIndex row to scroll to.

Definition at line 347 of file ProjectExplorerTable.java.

References ikayaki.gui.rowIndex.

void ikayaki.gui.ProjectExplorerTable.setColumns int[]  columns  ) 
 

Sets the columns displayed in this table.

Parameters:
columns int-table with COLUMN_xxx values, or null to just update table.

Definition at line 247 of file ProjectExplorerTable.java.

References ikayaki.gui.null.

Referenced by ikayaki.gui.ProjectExplorerTable.ProjectExplorerTable().

void ikayaki.gui.ProjectExplorerTable.setDirectory File  directory  ) 
 

Updates table contents, sets selectedFile index and table selection to selected project file, or -1.

Parameters:
directory directory whose project files to display, or null to just update the table.

Definition at line 315 of file ProjectExplorerTable.java.

References ikayaki.gui.null.

Referenced by ikayaki.gui.CalibrationPanel.setProject().


Member Data Documentation

final int [] ikayaki.gui.ProjectExplorerTable.calibration_columns = {COLUMN_FILENAME, COLUMN_LASTMEASURE, COLUMN_UNMEASURED} [static]
 

Definition at line 104 of file ProjectExplorerTable.java.

Referenced by ikayaki.gui.ProjectExplorerTable.ProjectExplorerTable().

final int ikayaki.gui.ProjectExplorerTable.COLUMN_FILENAME = 0 [static]
 

Definition at line 95 of file ProjectExplorerTable.java.

final int ikayaki.gui.ProjectExplorerTable.COLUMN_LASTMEASURE = 3 [static]
 

Definition at line 98 of file ProjectExplorerTable.java.

final int ikayaki.gui.ProjectExplorerTable.COLUMN_LASTMOD = 2 [static]
 

Definition at line 97 of file ProjectExplorerTable.java.

final String [] ikayaki.gui.ProjectExplorerTable.column_name = {"Name", "Type", "Modified", "Measured", "Elapsed"} [static]
 

Definition at line 100 of file ProjectExplorerTable.java.

final int ikayaki.gui.ProjectExplorerTable.COLUMN_TYPE = 1 [static]
 

Definition at line 96 of file ProjectExplorerTable.java.

final int ikayaki.gui.ProjectExplorerTable.COLUMN_UNDEFINED = -1 [static, private]
 

Definition at line 94 of file ProjectExplorerTable.java.

final int ikayaki.gui.ProjectExplorerTable.COLUMN_UNMEASURED = 4 [static]
 

Definition at line 99 of file ProjectExplorerTable.java.

int [] ikayaki.gui.ProjectExplorerTable.columns = new int[0] [private]
 

Visible columns in this table (as in column translation table); can be set with setColumns(int[]). Initialized to new int[0] so that ProjectExplorerTableModel can be created.

Definition at line 110 of file ProjectExplorerTable.java.

final int [] ikayaki.gui.ProjectExplorerTable.default_columns = {COLUMN_FILENAME, COLUMN_TYPE, COLUMN_LASTMOD} [static]
 

Definition at line 103 of file ProjectExplorerTable.java.

Referenced by ikayaki.gui.ProjectExplorerTable.ProjectExplorerTable().

File ikayaki.gui.ProjectExplorerTable.directory [private]
 

Currently open directory.

Definition at line 76 of file ProjectExplorerTable.java.

final Comparator<File> ikayaki.gui.ProjectExplorerTable.explorerTableComparator = new ProjectExplorerTableComparator() [private]
 

Definition at line 65 of file ProjectExplorerTable.java.

final ProjectExplorerTableModel ikayaki.gui.ProjectExplorerTable.explorerTableModel [private]
 

Definition at line 63 of file ProjectExplorerTable.java.

Referenced by ikayaki.gui.ProjectExplorerTable.ProjectExplorerTable().

int ikayaki.gui.ProjectExplorerTable.explorerTableSortColumn = 0 [private]
 

Current sort column; must be set to an untranslated column index.

Definition at line 91 of file ProjectExplorerTable.java.

File [] ikayaki.gui.ProjectExplorerTable.files = new File[0] [private]
 

Project files to in current directory. Set to new File[0] so that ProjectExplorerTableModel can be created.

Definition at line 81 of file ProjectExplorerTable.java.

Referenced by ikayaki.gui.ProjectExplorerTable.ProjectExplorerTable().

boolean ikayaki.gui.ProjectExplorerTable.isCalibration [private]
 

Tells whether this table is calibration project table or all-project table.

Definition at line 61 of file ProjectExplorerTable.java.

final ProjectComponent ikayaki.gui.ProjectExplorerTable.parent [private]
 

The component (MainViewPanel) whose setProject() method will be called on opening a new project file.

Definition at line 56 of file ProjectExplorerTable.java.

Thread ikayaki.gui.ProjectExplorerTable.projectTypeCacher = new Thread() [private]
 

Builds the project type cache for each directory. If the thread is still working when a new request arrives, the old thread should be interrupted.

Definition at line 71 of file ProjectExplorerTable.java.

int ikayaki.gui.ProjectExplorerTable.selectedFile = -1 [private]
 

Selected project file index, or -1 if none selected in current directory.

Definition at line 86 of file ProjectExplorerTable.java.

Referenced by ikayaki.gui.ProjectExplorerTable.ProjectExplorerTable().


The documentation for this class was generated from the following file:
Generated on Fri May 6 16:01:09 2005 for Squid by  doxygen 1.4.1