Class InstancesTable
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JTable
-
- adams.gui.core.BaseTable
-
- adams.gui.core.SortableAndSearchableTable
-
- adams.gui.visualization.instances.InstancesTable
-
- All Implemented Interfaces:
adams.data.spreadsheet.SpreadSheetSupporter
,adams.gui.core.SearchableTable
,adams.gui.core.SortableTable
,adams.gui.core.TableWithColumnFilters
,adams.gui.sendto.SendToActionSupporter
,ImageObserver
,MenuContainer
,Serializable
,EventListener
,Accessible
,CellEditorListener
,ListSelectionListener
,RowSorterListener
,TableColumnModelListener
,TableModelListener
,Scrollable
,weka.core.Undoable
public class InstancesTable extends adams.gui.core.SortableAndSearchableTable implements weka.core.Undoable, adams.gui.sendto.SendToActionSupporter
Table for displaying Instances objects. Supports simple undo by default, but can make use of aUndoHandlerWithQuickAccess
as well.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class adams.gui.core.BaseTable
adams.gui.core.BaseTable.ColumnWidthApproach
-
Nested classes/interfaces inherited from class javax.swing.JTable
JTable.AccessibleJTable, JTable.DropLocation, JTable.PrintMode
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.gui.visualization.core.PopupMenuCustomizer
m_CellPopupMenuCustomizer
the customizer for the table cells popup menu.protected HashSet<ChangeListener>
m_ChangeListeners
the listeners for changes.protected WekaFileChooser
m_FileChooser
the filechooser for exporting data.protected adams.gui.visualization.core.PopupMenuCustomizer
m_HeaderPopupMenuCustomizer
the customizer for the table header popup menu.protected HashMap<String,Object>
m_LastSetup
for keeping track of the setups being used (classname-{plot|process}-{column|row} - setup).protected AttributeValueCellRenderer
m_Renderer
the renderer to use.-
Fields inherited from class adams.gui.core.SortableAndSearchableTable
KEY_COLWIDTH, KEY_SEARCHREGEXP, KEY_SEARCHSTRING, KEY_SORTCASESENSITIVE, KEY_SORTCOL, KEY_SORTORDER, m_Model, m_SortNewTableModel
-
Fields inherited from class adams.gui.core.BaseTable
m_CellPopupMenuListeners, m_ColumnWidthApproach, m_HeaderPopupMenuListeners, m_MaxColumnOptimalColumnWidthCalc, m_MaxColumnOptimalHeaderWidthCalc, m_RemoveItemsListeners, m_ShowSimpleCellPopupMenu, m_ShowSimpleHeaderPopupMenu, m_SimpleCellPopupMenuListener, m_SimpleHeaderPopupMenuListener, m_TableHelper, m_TooManyColumnsDefaultWidth
-
Fields inherited from class javax.swing.JTable
AUTO_RESIZE_ALL_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_OFF, AUTO_RESIZE_SUBSEQUENT_COLUMNS, autoCreateColumnsFromModel, autoResizeMode, cellEditor, cellSelectionEnabled, columnModel, dataModel, defaultEditorsByColumnClass, defaultRenderersByColumnClass, editingColumn, editingRow, editorComp, gridColor, preferredViewportSize, rowHeight, rowMargin, rowSelectionAllowed, selectionBackground, selectionForeground, selectionModel, showHorizontalLines, showVerticalLines, tableHeader
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
Constructor Summary
Constructors Constructor Description InstancesTable(InstancesTableModel model)
Initializes the table with the model.InstancesTable(weka.core.Instances data)
Initializes the table with the data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChangeListener(ChangeListener l)
Adds the listener to the pool of listeners that get notified when the data changes.void
addLastSetup(Class cls, boolean plot, boolean row, Object setup)
Stores this last setup.void
addUndoPoint()
adds an undo point to the undo history, if the undo support is enabledprotected void
afterTableLayoutChanged()
Can be called after the layout changed.boolean
canUndo()
returns whether an undo is possible, i.e.void
clearUndo()
removes the undo historyprotected adams.gui.core.BasePopupMenu
createCellPopup(MouseEvent e)
Creates a popup menu for the cells.protected adams.gui.core.BasePopupMenu
createHeaderPopup(MouseEvent e)
Shows a popup menu for the header.protected String
createLastSetupKey(Class cls, boolean plot, boolean row)
Generates a key for the HashMap used for the last setups.adams.gui.visualization.core.PopupMenuCustomizer
getCellPopupMenuCustomizer()
Returns the current popup menu customizer (for the cells).TableCellRenderer
getCellRenderer(int row, int column)
Returns the renderer for this cell.adams.gui.visualization.core.PopupMenuCustomizer
getHeaderPopupMenuCustomizer()
Returns the current popup menu customizer (for the header).weka.core.Instances
getInstances()
returns the dataObject
getLastSetup(Class cls, boolean plot, boolean row)
Returns any last setup if available.Class[]
getSendToClasses()
Returns the classes that the supporter generates.Object
getSendToItem(Class[] cls)
Returns the object to send.boolean
getShowAttributeWeights()
Returns whether to display attribute weights.boolean
getShowWeightsColumn()
Returns whether to display a weights column.adams.gui.core.UndoHandlerWithQuickAccess
getUndoHandler()
Returns the undo handler in use.boolean
hasSendToItem(Class[] cls)
Checks whether something to send is available.protected void
initGUI()
Initializes the widget.boolean
isReadOnly()
returns whether the model is read-onlyboolean
isUndoEnabled()
returns whether undo support is enabledprotected adams.data.spreadsheet.SpreadSheet
modelToSpreadSheet()
Returns the underlying sheet.protected void
notifyChangeListeners()
Notifies all the change listeners.void
removeChangeListener(ChangeListener l)
Removes the listener from the pool of listeners that get notified when the data changes.protected void
saveAs(adams.gui.core.TableRowRange range)
Exports the data.protected int
selectionRowToModelRow(int index)
Determines the actual row index.void
setCellPopupMenuCustomizer(adams.gui.visualization.core.PopupMenuCustomizer value)
Sets the popup menu customizer to use (for the cells).void
setHeaderPopupMenuCustomizer(adams.gui.visualization.core.PopupMenuCustomizer value)
Sets the popup menu customizer to use (for the header).void
setInstances(weka.core.Instances data)
sets the datavoid
setModel(TableModel model)
Sets the model to use.void
setReadOnly(boolean value)
sets whether the model is read-onlyvoid
setShowAttributeWeights(boolean value)
Sets whether to display attribute weights.void
setShowWeightsColumn(boolean value)
Sets whether to display a weights column.void
setUndoEnabled(boolean enabled)
sets whether undo support is enabledvoid
setUndoHandler(adams.gui.core.UndoHandlerWithQuickAccess value)
Sets the undo handler to use.protected void
showCellPopup(MouseEvent e)
Shows a popup menu for the cells.protected void
showHeaderPopup(MouseEvent e)
Shows a popup menu for the header.void
sort(InstanceComparator comparator)
Sorts the data with the given comparator.weka.core.Instances
toInstances(adams.gui.core.TableRowRange range)
Returns the data.weka.core.Instances
toInstances(adams.gui.core.TableRowRange range, boolean view)
Returns the data.void
undo()
undoes the last action-
Methods inherited from class adams.gui.core.SortableAndSearchableTable
backupModelSettings, finishInit, getActualRow, getActualRowCount, getColumnFilter, getDisplayRow, getSeachString, getSortColumn, getSortNewTableModel, getTableModelClass, getUnsortedModel, initialSortCaseSensitive, initialSortNewTableModel, isAnyColumnFiltered, isAscending, isCaseSensitive, isColumnFiltered, isColumnFilterRegExp, isRegExpSearch, isSorted, removeAllColumnFilters, removeColumnFilter, restoreModelSettings, search, setCaseSensitive, setColumnFilter, setSortNewTableModel, setUnsortedModel, setUnsortedModel, sort, sort
-
Methods inherited from class adams.gui.core.BaseTable
adaptiveOptimalColumnWidth, addCellPopupMenuListener, addHeaderPopupMenuListener, addRemoveItemsListener, copyToClipboard, createSimpleCellPopupMenu, createSimpleHeaderPopupMenu, enterColumnWidth, getColumnWidthApproach, getColumnWidths, getFileChooser, getMaxColumnOptimalColumnWidthCalc, getMaxColumnOptimalHeaderWidthCalc, getSelectedRow, getSelectedRows, getShowSimpleCellPopupMenu, getShowSimpleHeaderPopupMenu, getTableHelper, getTooManyColumnsDefaultWidth, initialUseOptimalColumnWidths, invertRowSelection, invertSelection, notifyCellPopupMenuListener, notifyHeaderPopupMenuListener, notifyRemoveItemsListeners, removeCellPopupMenuListener, removeHeaderPopupMenuListener, removeRemoveItemsListener, scrollColumnToVisible, scrollRowToVisible, selectAll, selectNone, setColumnWidth, setColumnWidth, setColumnWidthApproach, setColumnWidths, setColumnWidths, setColumnWidths, setMaxColumnOptimalColumnWidthCalc, setMaxColumnOptimalHeaderWidthCalc, setOptimalColumnWidth, setOptimalColumnWidth, setOptimalColumnWidthBounded, setOptimalColumnWidthBounded, setOptimalColumnWidths, setOptimalColumnWidthsBounded, setOptimalHeaderWidth, setOptimalHeaderWidth, setSelectedRow, setSelectedRows, setShowSimpleCellPopupMenu, setShowSimpleHeaderPopupMenu, setShowSimplePopupMenus, setTooManyColumnsDefaultWidth, showCell, showSimpleCellPopupMenu, showSimpleHeaderPopupMenu, toSpreadSheet, toSpreadSheet, toSpreadSheet
-
Methods inherited from class javax.swing.JTable
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createDefaultTableHeader, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getAutoResizeMode, getCellEditor, getCellEditor, getCellRect, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditingRow, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRowCount, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUIClassID, getUpdateSelectionOnSort, getValueAt, initializeLocalVars, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, print, print, print, print, print, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setIntercellSpacing, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setUpdateSelectionOnSort, setValueAt, sizeColumnsToFit, sizeColumnsToFit, sorterChanged, tableChanged, unconfigureEnclosingScrollPane, updateUI, valueChanged
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
m_Renderer
protected AttributeValueCellRenderer m_Renderer
the renderer to use.
-
m_FileChooser
protected WekaFileChooser m_FileChooser
the filechooser for exporting data.
-
m_LastSetup
protected HashMap<String,Object> m_LastSetup
for keeping track of the setups being used (classname-{plot|process}-{column|row} - setup).
-
m_ChangeListeners
protected HashSet<ChangeListener> m_ChangeListeners
the listeners for changes.
-
m_HeaderPopupMenuCustomizer
protected adams.gui.visualization.core.PopupMenuCustomizer m_HeaderPopupMenuCustomizer
the customizer for the table header popup menu.
-
m_CellPopupMenuCustomizer
protected adams.gui.visualization.core.PopupMenuCustomizer m_CellPopupMenuCustomizer
the customizer for the table cells popup menu.
-
-
Constructor Detail
-
InstancesTable
public InstancesTable(weka.core.Instances data)
Initializes the table with the data.- Parameters:
data
- the data to display
-
InstancesTable
public InstancesTable(InstancesTableModel model)
Initializes the table with the model.- Parameters:
model
- the model to use
-
-
Method Detail
-
initGUI
protected void initGUI()
Initializes the widget.- Overrides:
initGUI
in classadams.gui.core.SortableAndSearchableTable
-
setModel
public void setModel(TableModel model)
Sets the model to use.- Overrides:
setModel
in classadams.gui.core.SortableAndSearchableTable
- Parameters:
model
- the model to display
-
afterTableLayoutChanged
protected void afterTableLayoutChanged()
Can be called after the layout changed.
-
setUndoHandler
public void setUndoHandler(adams.gui.core.UndoHandlerWithQuickAccess value)
Sets the undo handler to use.- Parameters:
value
- the handler, null if to turn off
-
getUndoHandler
public adams.gui.core.UndoHandlerWithQuickAccess getUndoHandler()
Returns the undo handler in use.- Returns:
- the handler, null if none set
-
isUndoEnabled
public boolean isUndoEnabled()
returns whether undo support is enabled- Specified by:
isUndoEnabled
in interfaceweka.core.Undoable
- Returns:
- true if undo support is enabled
-
setUndoEnabled
public void setUndoEnabled(boolean enabled)
sets whether undo support is enabled- Specified by:
setUndoEnabled
in interfaceweka.core.Undoable
- Parameters:
enabled
- whether to enable/disable undo support
-
clearUndo
public void clearUndo()
removes the undo history- Specified by:
clearUndo
in interfaceweka.core.Undoable
-
canUndo
public boolean canUndo()
returns whether an undo is possible, i.e. whether there are any undo points saved so far- Specified by:
canUndo
in interfaceweka.core.Undoable
- Returns:
- returns TRUE if there is an undo possible
-
undo
public void undo()
undoes the last action- Specified by:
undo
in interfaceweka.core.Undoable
-
addUndoPoint
public void addUndoPoint()
adds an undo point to the undo history, if the undo support is enabled- Specified by:
addUndoPoint
in interfaceweka.core.Undoable
- See Also:
isUndoEnabled()
,setUndoEnabled(boolean)
-
isReadOnly
public boolean isReadOnly()
returns whether the model is read-only- Returns:
- true if model is read-only
-
setReadOnly
public void setReadOnly(boolean value)
sets whether the model is read-only- Parameters:
value
- if true the model is set to read-only
-
setInstances
public void setInstances(weka.core.Instances data)
sets the data- Parameters:
data
- the data to use
-
getInstances
public weka.core.Instances getInstances()
returns the data- Returns:
- the current data
-
selectionRowToModelRow
protected int selectionRowToModelRow(int index)
Determines the actual row index.- Overrides:
selectionRowToModelRow
in classadams.gui.core.BaseTable
- Parameters:
index
- the selected row- Returns:
- the actual model row
-
toInstances
public weka.core.Instances toInstances(adams.gui.core.TableRowRange range)
Returns the data.- Parameters:
range
- the range of rows to return- Returns:
- the data
-
toInstances
public weka.core.Instances toInstances(adams.gui.core.TableRowRange range, boolean view)
Returns the data.- Parameters:
range
- the range of rows to returnview
- whether to return a view- Returns:
- the data
-
getCellRenderer
public TableCellRenderer getCellRenderer(int row, int column)
Returns the renderer for this cell.- Overrides:
getCellRenderer
in classJTable
- Parameters:
row
- the rowcolumn
- the column- Returns:
- the renderer
-
showHeaderPopup
protected void showHeaderPopup(MouseEvent e)
Shows a popup menu for the header.- Parameters:
e
- the event
-
createHeaderPopup
protected adams.gui.core.BasePopupMenu createHeaderPopup(MouseEvent e)
Shows a popup menu for the header.- Parameters:
e
- the event- Returns:
- the menu
-
showCellPopup
protected void showCellPopup(MouseEvent e)
Shows a popup menu for the cells.- Parameters:
e
- the event
-
createCellPopup
protected adams.gui.core.BasePopupMenu createCellPopup(MouseEvent e)
Creates a popup menu for the cells.- Parameters:
e
- the event- Returns:
- the menu
-
setHeaderPopupMenuCustomizer
public void setHeaderPopupMenuCustomizer(adams.gui.visualization.core.PopupMenuCustomizer value)
Sets the popup menu customizer to use (for the header).- Parameters:
value
- the customizer, null to remove it
-
getHeaderPopupMenuCustomizer
public adams.gui.visualization.core.PopupMenuCustomizer getHeaderPopupMenuCustomizer()
Returns the current popup menu customizer (for the header).- Returns:
- the customizer, null if none set
-
setCellPopupMenuCustomizer
public void setCellPopupMenuCustomizer(adams.gui.visualization.core.PopupMenuCustomizer value)
Sets the popup menu customizer to use (for the cells).- Parameters:
value
- the customizer, null to remove it
-
getCellPopupMenuCustomizer
public adams.gui.visualization.core.PopupMenuCustomizer getCellPopupMenuCustomizer()
Returns the current popup menu customizer (for the cells).- Returns:
- the customizer, null if none set
-
saveAs
protected void saveAs(adams.gui.core.TableRowRange range)
Exports the data.- Overrides:
saveAs
in classadams.gui.core.BaseTable
- Parameters:
range
- what data to export
-
createLastSetupKey
protected String createLastSetupKey(Class cls, boolean plot, boolean row)
Generates a key for the HashMap used for the last setups.- Parameters:
cls
- the schemeplot
- plot or processrow
- row or column- Returns:
- the generated key
-
addLastSetup
public void addLastSetup(Class cls, boolean plot, boolean row, Object setup)
Stores this last setup.- Parameters:
cls
- the schemeplot
- plot or processrow
- row or columnsetup
- the setup to add
-
getLastSetup
public Object getLastSetup(Class cls, boolean plot, boolean row)
Returns any last setup if available.- Parameters:
cls
- the schemeplot
- plot or processrow
- row or column- Returns:
- the last setup or null if none stored
-
addChangeListener
public void addChangeListener(ChangeListener l)
Adds the listener to the pool of listeners that get notified when the data changes.- Parameters:
l
- the listener to add
-
removeChangeListener
public void removeChangeListener(ChangeListener l)
Removes the listener from the pool of listeners that get notified when the data changes.- Parameters:
l
- the listener to remove
-
notifyChangeListeners
protected void notifyChangeListeners()
Notifies all the change listeners.
-
modelToSpreadSheet
protected adams.data.spreadsheet.SpreadSheet modelToSpreadSheet()
Returns the underlying sheet.- Overrides:
modelToSpreadSheet
in classadams.gui.core.BaseTable
- Returns:
- the spread sheet
-
setShowWeightsColumn
public void setShowWeightsColumn(boolean value)
Sets whether to display a weights column.- Parameters:
value
- if true then the weights get shown in a separate column
-
getShowWeightsColumn
public boolean getShowWeightsColumn()
Returns whether to display a weights column.- Returns:
- true if the weights get shown in a separate column
-
setShowAttributeWeights
public void setShowAttributeWeights(boolean value)
Sets whether to display attribute weights.- Parameters:
value
- if true then the attributes weights get shown in the header
-
getShowAttributeWeights
public boolean getShowAttributeWeights()
Returns whether to display attribute weights.- Returns:
- true if the attributes weights get shown in the header
-
sort
public void sort(InstanceComparator comparator)
Sorts the data with the given comparator.- Parameters:
comparator
- the comparator to use
-
getSendToClasses
public Class[] getSendToClasses()
Returns the classes that the supporter generates.- Specified by:
getSendToClasses
in interfaceadams.gui.sendto.SendToActionSupporter
- Returns:
- the classes
-
hasSendToItem
public boolean hasSendToItem(Class[] cls)
Checks whether something to send is available.- Specified by:
hasSendToItem
in interfaceadams.gui.sendto.SendToActionSupporter
- Parameters:
cls
- the classes to retrieve the item for- Returns:
- true if an object is available for sending
-
-