public Component getGraphCellEditorComponent(JGraph graph, Object cell,
boolean isSelected) {
Component component = super.getGraphCellEditorComponent(graph,
cell, isSelected);
// set the size of an editor to that of the view
CellView view = graph.getGraphLayoutCache().getMapping(cell, false);
Rectangle2D tmp = view.getBounds();
editingComponent.setBounds((int) tmp.getX(), (int) tmp.getY(),
(int) tmp.getWidth(), (int) tmp.getHeight());
// I have to set a font here instead of in the
// RealCellEditor.getGraphCellEditorComponent() because
// I don't know what cell is being edited when in the
// RealCellEditor.getGraphCellEditorComponent().
Font font = GraphConstants.getFont(view.getAllAttributes());
editingComponent.setFont((font != null) ? font : graph.getFont());
return component;
}