| Methods from java.awt.Component: |
|---|
|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, dispatchEventImpl, doLayout, enable, enable, enableEvents, enableInputMethods, eventTypeEnabled, findNextFocusComponent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, generateName, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getGraphicsConfigurationImpl, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFocusable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFocusable, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setPeer, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, translateEvent, update, validate |
| Method from net.sourceforge.jbird.ListSpecies Detail: |
protected final Choice buildChecklistChoice(JbirdDB db) throws SQLException {
IntStringArrays checklists = db.getChecklists();
Choice checklist_choice = new Choice();
checklist_choice.add(progres.getString("-NONE-"));
checklist_numbers = checklists.inta;
int max = checklists.inta.length;
for (int idx = 0; idx < max; idx ++) {
checklist_choice.add(checklists.stringa[idx]);
}
return checklist_choice;
}
|
protected final Panel buildChoices(JbirdDB db,
ResourceBundle rb) {
Panel cp = new Panel();
// set up columns
int[] colchoiceorder = (int[])
rb.getObject("species_list_choice_order");
String[] colchoices = (String[])
rb.getObject("species_list_choices");
col_choice = new OrderedChoice(colchoices, colchoiceorder);
col_label = new Label(rb.getString("Table_columns:_species_+"));
// set up cells
int[] cellchoiceorder = (int[])
rb.getObject("species_list_cell_order");
String[] cellchoices = (String[])
rb.getObject("species_list_cell_choices");
cell_choice = new OrderedChoice(cellchoices, cellchoiceorder);
cell_label = new Label(rb.getString("Table_cell_values:"));
checklist_label = new Label(rb.getString("Include_from_checklist:"));
try {
checklist_choice = buildChecklistChoice(db);
}
catch (SQLException e) {
log.popupError(progres.getString
("Error_reading_checklists"), true);
log.error(e.getMessage());
}
cp.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.anchor = GridBagConstraints.WEST;
c.gridx = 0;
c.gridy = 0;
cp.add(col_label, c);
c.gridx = 1;
cp.add(col_choice, c);
c.gridx = 0;
c.gridy = 1;
cp.add(cell_label, c);
c.gridx = 1;
cp.add(cell_choice, c);
if (checklist_choice != null) {
c.gridx = 0;
c.gridy = 2;
cp.add(checklist_label, c);
c.gridx = 1;
cp.add(checklist_choice, c);
}
col_choice.selectLogical(SpeciesListQuery.COLUMNS_OBSERVER + 1);
cell_choice.selectLogical(SpeciesListQuery.CELL_TYPE_BOOLEAN);
if (checklist_choice != null) {
checklist_choice.select(0);
}
col_choice.addItemListener(new ColumnChoiceListener());
return cp;
}
|
protected final void buildGoButton(ResourceBundle rb) {
go_button = new Button(rb.getString("GO!"));
go_button.addActionListener(new GButtonListener());
}
|
protected final SpeciesTableDialog buildMonoTable(SpeciesTableModel tablemodel,
int datespan) {
SpeciesTable table = new SpeciesTable(tablemodel);
// These are a waste, but you never know when I'll
// want to use this method for a multi-column table.
//table.setDefaultRenderer(Date.class,
//new DateRenderer(new SimpleDateFormat(
//date_formats[datespan])));
//table.setDefaultRenderer(Boolean.class,
//new BooleanRenderer());
return new SpeciesTableDialog(owner, table);
}
Build a simple table and dialog that does not contain a
reference column of species. Used when only a list of
species has been requested although it could be used
for tables with multiple columns. |
protected final SpeciesTableDialog buildSplitTable(SpeciesTableModel tablemodel,
int datespan) {
SpeciesDataTable jrctable = new SpeciesDataTable(tablemodel);
jrctable.setRefcolWidth(250);
jrctable.setBodycolWidths(100);
return new SpeciesTableDialog(owner,
jrctable,
(SpeciesTable)jrctable.getRefcolTable());
}
Build a table and dialog that has a reference column
of species names. Used when the table contains more
columns than just species names. |
public final void checkNameType() {
}
|
public void checkOptions() {
}
|
public void close() {
if (wait_window != null) {
wait_window.dispose();
wait_window = null;
}
}
|
protected final void columnChoiceChanged() {
if (col_choice.getSelectedIndex() == 0) {
cell_choice.setEnabled(false);
cell_label.setEnabled(false);
} else if (! cell_choice.isEnabled()) {
cell_choice.setEnabled(true);
cell_label.setEnabled(true);
}
}
|
public int getComponentID() {
return MainFrame.LISTQUERY;
}
|
public final int getSelectedChecklist() {
int answer = -1;
int choice = checklist_choice.getSelectedIndex() - 1;
if (choice >= 0) {
answer = checklist_numbers[choice];
}
return answer;
}
|
public final MainFrameState getState() {
MainFrameState answer = new MainFrameState();
return getState(answer);
}
|
public final MainFrameState getState(MainFrameState template) {
template.setComponentType(MainFrame.LISTQUERY);
int[] state = new int[3];
state[COLUMN_CHOICE] = col_choice.getSelectedLogicalIndex();
state[CELL_CHOICE] = cell_choice.getSelectedLogicalIndex();
state[CHECKLIST_CHOICE] = getSelectedChecklist();
template.setComponentState(MainFrame.LISTQUERY, state);
template.setComponentState(MainFrame.QUERY_RESTRICTIONS,
restrictions.getState());
return template;
}
|
protected final void popupWaitWindow() {
if (wait_window == null) {
wait_window = new JWait(owner,
progres.getString("Working"));
}
wait_window.activate(2000);
}
|
protected final void pushedGo() {
try {
restrictions.configure(list_query);
}
catch(ParseException pe) {
log.error("ListSpecies.pushedGo: ParseException - "
+ pe.getMessage());
log.popupError(progres.getString("Date_format"), false);
wait_window.setVisible(false);
return;
}
int[] checklists;
int checklist = getSelectedChecklist();
if (checklist > -1) {
checklists = new int[1];
checklists[0] = checklist;
} else {
checklists = null;
}
int coltype = col_choice.getSelectedLogicalIndex() - 1;
int celltype = cell_choice.getSelectedLogicalIndex();
SpeciesComparatorSortOrder comp = new SpeciesComparatorSortOrder();
SpeciesTableModel tablemodel;
try {
tablemodel = list_query.query(coltype,
celltype,
checklists,
1, // WORK HERE - common names
comp);
}
catch (SQLException e) {
log.error("ListSpecies.pushedGo: SQLException - "
+ e.getMessage());
Object[] oba = new Object[1];
oba[0] = e.getMessage();
log.popupError(MessageFormat.format(
progres.getString("Unanticipated_error"), oba),
false);
wait_window.setVisible(false);
return;
}
if (tablemodel == null) {
log.popupWarning(progres.getString("Empty_query"),
false);
wait_window.setVisible(false);
return;
}
boolean scientific;
if (jbird_options.scientificnames) {
scientific = true;
} else {
scientific = false;
}
tablemodel.setShowScientific(scientific);
tablemodel.setShowFamilies(true);
tablemodel.setAllFamiliesVisible(true);
tablemodel.setCollapsable(true);
int datespan = DateRange.MULTI_YEAR;
try {
datespan = restrictions.getDateSpan();
} catch (ParseException pe) {
// fail silently and with default date format
}
if (datespan < = DateRange.NA) {
datespan = DateRange.MULTI_YEAR;
}
SpeciesTableDialog jtd;
if (coltype >= 0) {
jtd = buildSplitTable(tablemodel, datespan);
} else {
jtd = buildMonoTable(tablemodel, datespan);
}
jtd.localize(progres);
jtd.center(jtd.getPreferredSize());
jtd.setMenuText(progres.getString("File"));
jtd.setCloseText(progres.getString("Close"));
jtd.setCSVText(progres.getString("Save_as_CSV"));
jtd.setHTMLText(progres.getString("Save_as_HTML"));
jtd.setFileButton(progres.getString("Accept"));
// prepare to handle IOExceptions
jtd.setExceptionListener(exception_listener);
wait_window.setVisible(false);
jtd.setVisible(true);
jtd.setNullifyOnClose(true);
System.gc();
}
|
protected final void selectChecklist(int listno) {
int max = checklist_numbers.length;
for (int idx = 0; idx < max; idx ++) {
if (listno == checklist_numbers[idx]) {
checklist_choice.select((idx + 1));
return;
}
}
}
Select checklist using its number in the database. |
public final void setState(MainFrameState to) {
to.setComponentType(MainFrame.LISTQUERY);
int[] state = (int[])to.getComponentState(MainFrame.LISTQUERY);
if (state != null) {
col_choice.selectLogical(state[COLUMN_CHOICE]);
cell_choice.selectLogical(state[CELL_CHOICE]);
selectChecklist(state[CHECKLIST_CHOICE]);
}
restrictions.setState(
to.getComponentState(MainFrame.QUERY_RESTRICTIONS));
}
|
protected final void tableSaveError(IOException e) {
log.popupError(
progres.getString("Error_saving_table"), true);
log.error(e.getMessage());
}
This method is called when the SpeciesTableDialog
experiences an IOException while trying to save
a table as either a CSV file or as an HTML
document. |