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:
SpreadSheetSupporter,SearchableTable,SortableTable,TableWithColumnFilters,SendToActionSupporter,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,CellEditorListener,ListSelectionListener,RowSorterListener,TableColumnModelListener,TableModelListener,Scrollable,weka.core.Undoable
public class InstancesTable extends SortableAndSearchableTable implements weka.core.Undoable, SendToActionSupporter
Table for displaying Instances objects. Supports simple undo by default, but can make use of aUndoHandlerWithQuickAccessas 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
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 PopupMenuCustomizerm_CellPopupMenuCustomizerthe customizer for the table cells popup menu.protected HashSet<ChangeListener>m_ChangeListenersthe listeners for changes.protected WekaFileChooserm_FileChooserthe filechooser for exporting data.protected PopupMenuCustomizerm_HeaderPopupMenuCustomizerthe customizer for the table header popup menu.protected HashMap<String,Object>m_LastSetupfor keeping track of the setups being used (classname-{plot|process}-{column|row} - setup).protected AttributeValueCellRendererm_Rendererthe 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 voidaddChangeListener(ChangeListener l)Adds the listener to the pool of listeners that get notified when the data changes.voidaddLastSetup(Class cls, boolean plot, boolean row, Object setup)Stores this last setup.voidaddUndoPoint()adds an undo point to the undo history, if the undo support is enabledprotected voidafterTableLayoutChanged()Can be called after the layout changed.booleancanUndo()returns whether an undo is possible, i.e. whether there are any undo points saved so farvoidclearUndo()removes the undo historyprotected BasePopupMenucreateCellPopup(MouseEvent e)Creates a popup menu for the cells.protected BasePopupMenucreateHeaderPopup(MouseEvent e)Shows a popup menu for the header.protected StringcreateLastSetupKey(Class cls, boolean plot, boolean row)Generates a key for the HashMap used for the last setups.PopupMenuCustomizergetCellPopupMenuCustomizer()Returns the current popup menu customizer (for the cells).TableCellRenderergetCellRenderer(int row, int column)Returns the renderer for this cell.PopupMenuCustomizergetHeaderPopupMenuCustomizer()Returns the current popup menu customizer (for the header).weka.core.InstancesgetInstances()returns the dataObjectgetLastSetup(Class cls, boolean plot, boolean row)Returns any last setup if available.Class[]getSendToClasses()Returns the classes that the supporter generates.ObjectgetSendToItem(Class[] cls)Returns the object to send.booleangetShowAttributeWeights()Returns whether to display attribute weights.booleangetShowWeightsColumn()Returns whether to display a weights column.UndoHandlerWithQuickAccessgetUndoHandler()Returns the undo handler in use.booleanhasSendToItem(Class[] cls)Checks whether something to send is available.protected voidinitGUI()Initializes the widget.booleanisReadOnly()returns whether the model is read-onlybooleanisUndoEnabled()returns whether undo support is enabledprotected SpreadSheetmodelToSpreadSheet()Returns the underlying sheet.protected voidnotifyChangeListeners()Notifies all the change listeners.voidremoveChangeListener(ChangeListener l)Removes the listener from the pool of listeners that get notified when the data changes.protected voidsaveAs(TableRowRange range)Exports the data.protected intselectionRowToModelRow(int index)Determines the actual row index.voidsetCellPopupMenuCustomizer(PopupMenuCustomizer value)Sets the popup menu customizer to use (for the cells).voidsetHeaderPopupMenuCustomizer(PopupMenuCustomizer value)Sets the popup menu customizer to use (for the header).voidsetInstances(weka.core.Instances data)sets the datavoidsetModel(TableModel model)Sets the model to use.voidsetReadOnly(boolean value)sets whether the model is read-onlyvoidsetShowAttributeWeights(boolean value)Sets whether to display attribute weights.voidsetShowWeightsColumn(boolean value)Sets whether to display a weights column.voidsetUndoEnabled(boolean enabled)sets whether undo support is enabledvoidsetUndoHandler(UndoHandlerWithQuickAccess value)Sets the undo handler to use.protected voidshowCellPopup(MouseEvent e)Shows a popup menu for the cells.protected voidshowHeaderPopup(MouseEvent e)Shows a popup menu for the header.voidsort(InstanceComparator comparator)Sorts the data with the given comparator.weka.core.InstancestoInstances(TableRowRange range)Returns the data.weka.core.InstancestoInstances(TableRowRange range, boolean view)Returns the data.voidundo()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 PopupMenuCustomizer m_HeaderPopupMenuCustomizer
the customizer for the table header popup menu.
-
m_CellPopupMenuCustomizer
protected 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:
initGUIin classSortableAndSearchableTable
-
setModel
public void setModel(TableModel model)
Sets the model to use.- Overrides:
setModelin classSortableAndSearchableTable- Parameters:
model- the model to display
-
afterTableLayoutChanged
protected void afterTableLayoutChanged()
Can be called after the layout changed.
-
setUndoHandler
public void setUndoHandler(UndoHandlerWithQuickAccess value)
Sets the undo handler to use.- Parameters:
value- the handler, null if to turn off
-
getUndoHandler
public 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:
isUndoEnabledin interfaceweka.core.Undoable- Returns:
- true if undo support is enabled
-
setUndoEnabled
public void setUndoEnabled(boolean enabled)
sets whether undo support is enabled- Specified by:
setUndoEnabledin interfaceweka.core.Undoable- Parameters:
enabled- whether to enable/disable undo support
-
clearUndo
public void clearUndo()
removes the undo history- Specified by:
clearUndoin 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:
canUndoin interfaceweka.core.Undoable- Returns:
- returns TRUE if there is an undo possible
-
undo
public void undo()
undoes the last action- Specified by:
undoin interfaceweka.core.Undoable
-
addUndoPoint
public void addUndoPoint()
adds an undo point to the undo history, if the undo support is enabled- Specified by:
addUndoPointin 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:
selectionRowToModelRowin classBaseTable- Parameters:
index- the selected row- Returns:
- the actual model row
-
toInstances
public weka.core.Instances toInstances(TableRowRange range)
Returns the data.- Parameters:
range- the range of rows to return- Returns:
- the data
-
toInstances
public weka.core.Instances toInstances(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:
getCellRendererin 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 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 BasePopupMenu createCellPopup(MouseEvent e)
Creates a popup menu for the cells.- Parameters:
e- the event- Returns:
- the menu
-
setHeaderPopupMenuCustomizer
public void setHeaderPopupMenuCustomizer(PopupMenuCustomizer value)
Sets the popup menu customizer to use (for the header).- Parameters:
value- the customizer, null to remove it
-
getHeaderPopupMenuCustomizer
public PopupMenuCustomizer getHeaderPopupMenuCustomizer()
Returns the current popup menu customizer (for the header).- Returns:
- the customizer, null if none set
-
setCellPopupMenuCustomizer
public void setCellPopupMenuCustomizer(PopupMenuCustomizer value)
Sets the popup menu customizer to use (for the cells).- Parameters:
value- the customizer, null to remove it
-
getCellPopupMenuCustomizer
public PopupMenuCustomizer getCellPopupMenuCustomizer()
Returns the current popup menu customizer (for the cells).- Returns:
- the customizer, null if none set
-
saveAs
protected void saveAs(TableRowRange range)
Exports the data.
-
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 SpreadSheet modelToSpreadSheet()
Returns the underlying sheet.- Overrides:
modelToSpreadSheetin classBaseTable- 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:
getSendToClassesin interfaceSendToActionSupporter- Returns:
- the classes
-
hasSendToItem
public boolean hasSendToItem(Class[] cls)
Checks whether something to send is available.- Specified by:
hasSendToItemin interfaceSendToActionSupporter- Parameters:
cls- the classes to retrieve the item for- Returns:
- true if an object is available for sending
-
getSendToItem
public Object getSendToItem(Class[] cls)
Returns the object to send.- Specified by:
getSendToItemin interfaceSendToActionSupporter- Parameters:
cls- the classes to retrieve the item for- Returns:
- the item to send
-
-