org.jgraph.graph
Class DefaultGraphCellEditor
- java.lang.Object
-
- org.jgraph.graph.DefaultGraphCellEditor
-
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.io.Serializable, java.util.EventListener, javax.swing.CellEditor, GraphSelectionListener, GraphCellEditor
public class DefaultGraphCellEditor extends java.lang.Object implements java.awt.event.ActionListener, GraphCellEditor, GraphSelectionListener, java.io.Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description classDefaultGraphCellEditor.DefaultTextFieldTextField used when no editor is supplied.classDefaultGraphCellEditor.EditorContainerContainer responsible for placing the editingComponent.
-
Constructor Summary
Constructors Constructor and Description DefaultGraphCellEditor()Constructs a DefaultTreeCellEditor object for a JGraph using the specified renderer and a default editor.DefaultGraphCellEditor(GraphCellEditor editor)Constructs a DefaultTreeCellEditor object for a JTree using the specified renderer and the specified editor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidactionPerformed(java.awt.event.ActionEvent e)Messaged when the timer fires, this will start the editing session.voidaddCellEditorListener(javax.swing.event.CellEditorListener l)Adds the CellEditorListener.voidcancelCellEditing()Messages cancelCellEditing to the realEditor and removes it from this instance.java.awt.ColorgetBorderSelectionColor()Returns the color the border is drawn.java.lang.ObjectgetCellEditorValue()Returns the value currently being edited.java.awt.FontgetFont()Gets the font used for editing.java.awt.ComponentgetGraphCellEditorComponent(JGraph graph, java.lang.Object cell, boolean isSelected)Configures the editor.booleanisCellEditable(java.util.EventObject event)If the realEditor returns true to this message, prepareForEditing is messaged and true is returned.voidremoveCellEditorListener(javax.swing.event.CellEditorListener l)Removes the previously added CellEditorListener l.voidsetBorderSelectionColor(java.awt.Color newColor)Sets the color to use for the border.voidsetFont(java.awt.Font font)Sets the font to edit with.booleanshouldSelectCell(java.util.EventObject event)Messages the realEditor for the return value.booleanstopCellEditing()If the realEditor will allow editing to stop, the realEditor is removed and true is returned, otherwise false is returned.voidvalueChanged(GraphSelectionEvent e)Resets lastPath.
-
-
-
Constructor Detail
-
DefaultGraphCellEditor
public DefaultGraphCellEditor()
Constructs a DefaultTreeCellEditor object for a JGraph using the specified renderer and a default editor. (Use this constructor for normal editing.)
-
DefaultGraphCellEditor
public DefaultGraphCellEditor(GraphCellEditor editor)
Constructs a DefaultTreeCellEditor object for a JTree using the specified renderer and the specified editor. (Use this constructor for specialized editing.)- Parameters:
editor- a TreeCellEditor object
-
-
Method Detail
-
setBorderSelectionColor
public void setBorderSelectionColor(java.awt.Color newColor)
Sets the color to use for the border.
-
getBorderSelectionColor
public java.awt.Color getBorderSelectionColor()
Returns the color the border is drawn.
-
setFont
public void setFont(java.awt.Font font)
Sets the font to edit with.nullindicates the renderers font should be used. This will NOT override any font you have set in the editor the receiver was instantied with. If null for an editor was passed in a default editor will be created that will pick up this font.- Parameters:
font- the editing Font- See Also:
getFont()
-
getFont
public java.awt.Font getFont()
Gets the font used for editing.- Returns:
- the editing Font
- See Also:
setFont(java.awt.Font)
-
getGraphCellEditorComponent
public java.awt.Component getGraphCellEditorComponent(JGraph graph, java.lang.Object cell, boolean isSelected)
Configures the editor. Passed onto the realEditor.- Specified by:
getGraphCellEditorComponentin interfaceGraphCellEditor- Parameters:
graph- the JGraph that is asking the editor to edit This parameter can be null.cell- the value of the cell to be edited.isSelected- true if the cell is to be rendered with selection highlighting- Returns:
- the component for editing
-
getCellEditorValue
public java.lang.Object getCellEditorValue()
Returns the value currently being edited.- Specified by:
getCellEditorValuein interfacejavax.swing.CellEditor
-
isCellEditable
public boolean isCellEditable(java.util.EventObject event)
If the realEditor returns true to this message, prepareForEditing is messaged and true is returned.- Specified by:
isCellEditablein interfacejavax.swing.CellEditor
-
shouldSelectCell
public boolean shouldSelectCell(java.util.EventObject event)
Messages the realEditor for the return value.- Specified by:
shouldSelectCellin interfacejavax.swing.CellEditor
-
stopCellEditing
public boolean stopCellEditing()
If the realEditor will allow editing to stop, the realEditor is removed and true is returned, otherwise false is returned.- Specified by:
stopCellEditingin interfacejavax.swing.CellEditor
-
cancelCellEditing
public void cancelCellEditing()
Messages cancelCellEditing to the realEditor and removes it from this instance.- Specified by:
cancelCellEditingin interfacejavax.swing.CellEditor
-
addCellEditorListener
public void addCellEditorListener(javax.swing.event.CellEditorListener l)
Adds the CellEditorListener.- Specified by:
addCellEditorListenerin interfacejavax.swing.CellEditor
-
removeCellEditorListener
public void removeCellEditorListener(javax.swing.event.CellEditorListener l)
Removes the previously added CellEditorListener l.- Specified by:
removeCellEditorListenerin interfacejavax.swing.CellEditor
-
valueChanged
public void valueChanged(GraphSelectionEvent e)
Resets lastPath.- Specified by:
valueChangedin interfaceGraphSelectionListener- Parameters:
e- the event that characterizes the change.
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
Messaged when the timer fires, this will start the editing session.- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener
-
-
DataMelt 3.0 © DataMelt by jWork.ORG