Class ColorCellEditor
- java.lang.Object
-
- javax.swing.AbstractCellEditor
-
- org.nuiton.jaxx.runtime.swing.editor.ColorCellEditor
-
- All Implemented Interfaces:
ActionListener,Serializable,EventListener,CellEditor,TableCellEditor
public class ColorCellEditor extends AbstractCellEditor implements TableCellEditor, ActionListener
AColorcell editor.- Since:
- 2.5.4
- Author:
- Matthieu Allon, Tony Chemit - dev@tchemit.fr
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected JButtonbuttonprotected JColorChoosercolorChooserprotected ColorcurrentColorprotected JDialogdialogprotected static StringEDIT-
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
-
-
Constructor Summary
Constructors Constructor Description ColorCellEditor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(ActionEvent e)Handles events from the editor button and from the dialog's OK button.ColorgetCellEditorValue()ComponentgetTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)protected static StringtoBrowserHexValue(int number)protected static StringtoHex(int r, int g, int b)-
Methods inherited from class javax.swing.AbstractCellEditor
addCellEditorListener, cancelCellEditing, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.swing.CellEditor
addCellEditorListener, cancelCellEditing, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing
-
-
-
-
Field Detail
-
currentColor
protected Color currentColor
-
button
protected final JButton button
-
colorChooser
protected final JColorChooser colorChooser
-
dialog
protected final JDialog dialog
-
EDIT
protected static final String EDIT
- See Also:
- Constant Field Values
-
-
Method Detail
-
actionPerformed
public void actionPerformed(ActionEvent e)
Handles events from the editor button and from the dialog's OK button.- Specified by:
actionPerformedin interfaceActionListener
-
getCellEditorValue
public Color getCellEditorValue()
- Specified by:
getCellEditorValuein interfaceCellEditor
-
toHex
protected static String toHex(int r, int g, int b)
-
toBrowserHexValue
protected static String toBrowserHexValue(int number)
-
getTableCellEditorComponent
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
- Specified by:
getTableCellEditorComponentin interfaceTableCellEditor
-
-