public class DataFrameTable extends JPanel
This is open source software released under the Apache 2.0 License
| Modifier and Type | Class and Description |
|---|---|
private static class |
DataFrameTable.CustomAction
Convenience class to ofInts actions
|
JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategylistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
DataFrameTable()
Constructor
|
DataFrameTable(com.zavtech.morpheus.frame.DataFrame frame)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
private Action |
createAlignmentAction(int alignment)
Returns a new action to change the alignment for selected cells
|
private Action |
createBestFitAction()
Creates a new action to best fit columns
|
private Action |
createClearFormatAction()
Creates a new action to clear the formatting on selected cells
|
protected void |
createColumns(JTable table)
Called to ofInts columns for the target table
|
private Action |
createConditionalFontColorAction()
Creates a new action to change font color of selected cells
|
private Action |
createCsvExportAction()
Creates a new action to export data to excel
|
private Action |
createDateFormatAction(String pattern)
Returns a new action to accept a specific date format to selected cells
|
private Action |
createDecreasePrecisionAction()
Creates a new action to decrease decimal precision
|
private Action |
createFillColorAction()
Creates a new action to change fill color of selected cells
|
private Action |
createFontAction()
Returns a new action to change the font type
|
private Action |
createFontColorAction()
Creates a new action to change font color of selected cells
|
private Action |
createFontStyleAction(int style)
Returns a new action to change the font style for selected cells
|
private Action |
createIncreasePrecisionAction()
Creates a new action to increase decimal precision
|
private Action |
createNumberTypeAction(Integer numberType,
String description)
Creates a new action to accept a specific type of formatting to selected cells
|
DataFrameCellFormat |
getCellFormat(int rowIndex,
int colIndex,
boolean create)
Returns the cell format for the row and column index
|
DataFrameCellFormat |
getCellFormat(Object row,
Object column,
boolean create)
Returns the cell format for row and column key
|
(package private) int |
getColumnIndex(JTable table,
int colIndex)
Returns the column index of the combined table
|
<R,C> com.zavtech.morpheus.frame.DataFrame<R,C> |
getDataFrame()
Returns a reference to the data frame bound to this viewer
|
DataFrameCellFormat |
getDefaultCellFormat()
Returns the default format for cells
|
private static ImageIcon |
getIcon(int size,
String name)
Returns a new icon for of the size and name specified
|
DataFrameCellFormat |
getRowHeaderFormat(Object row,
boolean create)
Returns the cell format for the row header cell (ie fixed column)
|
int[] |
getSelectedColumns()
Returns the selected column indices in view space
|
int[] |
getSelectedRows()
Returns the selected row indices in view space
|
private void |
initPopupMenu()
Initializes the popup menu for this component
|
private void |
initTable(JTable table)
Initializes a table component for this component
|
private void |
resizeLeftTable()
Called to resize the row header viewport based on the size of the left table
|
void |
setDataFrame(com.zavtech.morpheus.frame.DataFrame frame)
Sets the data frame instance to display in this viewer
|
void |
setDecimalCount(int decimalCount)
Called to set the decimal count for this editor
|
void |
setDefaultCellFormat(DataFrameCellFormat defaultCellFormat)
Sets the default cell format for this table
|
private void |
validateActions()
Called to validate this components actions
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, 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, 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, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, 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, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, 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, validateTreeaction, 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, getPeer, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprivate static final Logger LOG
private int decimalCount
private JScrollPane scrollPane
private JTable leftTable
private JTable rightTable
private DataFrameCellEditor editor
private DataFrameTableModel model
private DataFrameCellRenderer renderer
private DataFrameCellFormat defaultCellFormat
private ListSelectionModel selectionModel
private TableRowSorter<TableModel> sorter
private Map<Object,DataFrameCellFormat> formatMap
private com.zavtech.morpheus.index.Index<Object> rowIndex
private com.zavtech.morpheus.index.Index<Object> colIndex
private JPopupMenu popupMenu
private JMenu fontMenu
private JMenu styleMenu
private JMenu dateFormatMenu
private JMenu decimalFormatMenu
private JMenu alignmentMenu
private Action bestFitAction
private Action exportCsvAction
private Action backgroundAction
private Action foregroundAction
private Action increasePrecisionAction
private Action decreasePrecisionAction
private TableColumnModelListener columnModelListener
private MouseListener mouseListener
public DataFrameTable()
public DataFrameTable(com.zavtech.morpheus.frame.DataFrame frame)
frame - the DataFrame for this tableprivate void initTable(JTable table)
table - the tableprotected void createColumns(JTable table)
table - the table referenceprivate void initPopupMenu()
public <R,C> com.zavtech.morpheus.frame.DataFrame<R,C> getDataFrame()
public void setDataFrame(com.zavtech.morpheus.frame.DataFrame frame)
frame - the data frame to display, can be nullpublic DataFrameCellFormat getDefaultCellFormat()
public void setDefaultCellFormat(DataFrameCellFormat defaultCellFormat)
defaultCellFormat - the default cell formatpublic DataFrameCellFormat getRowHeaderFormat(Object row, boolean create)
row - the row keycreate - if true, ofInts a new cell format if none existspublic DataFrameCellFormat getCellFormat(Object row, Object column, boolean create)
row - the row keycolumn - the column keycreate - if true, ofInts a new cell format if none existspublic final DataFrameCellFormat getCellFormat(int rowIndex, int colIndex, boolean create)
rowIndex - the row index in view spacecolIndex - the column index in view spacecreate - if true, ofInts a new cell format if none existsint getColumnIndex(JTable table, int colIndex)
table - the JTable referencecolIndex - the column index on the JTablepublic void setDecimalCount(int decimalCount)
decimalCount - the decimal count for editorprivate Action createAlignmentAction(int alignment)
alignment - the alignment as per SwingConstantsprivate Action createFontAction()
private Action createFontStyleAction(int style)
style - the font styleprivate Action createDateFormatAction(String pattern)
pattern - the date format patternprivate Action createNumberTypeAction(Integer numberType, String description)
numberType - the number typedescription - the action descriptionprivate Action createIncreasePrecisionAction()
private Action createDecreasePrecisionAction()
private Action createCsvExportAction()
private Action createBestFitAction()
private Action createFillColorAction()
private Action createFontColorAction()
private Action createConditionalFontColorAction()
private Action createClearFormatAction()
private void validateActions()
public int[] getSelectedRows()
public int[] getSelectedColumns()
private static ImageIcon getIcon(int size, String name)
size - the icon size (16 | 32)name - the icon nameprivate void resizeLeftTable()
Copyright 2014-2017, Xavier Witdouck