public class mxCellEditor extends java.lang.Object implements mxICellEditor
Modifier and Type | Field and Description |
---|---|
protected javax.swing.AbstractAction |
cancelEditingAction |
static int |
DEFAULT_MIN_HEIGHT |
static int |
DEFAULT_MIN_WIDTH |
static double |
DEFAULT_MINIMUM_EDITOR_SCALE |
protected java.lang.Object |
editingCell |
protected javax.swing.JEditorPane |
editorPane
Holds the editor for HTML editing.
|
protected boolean |
extractHtmlBody
Specifies if the text content of the HTML body should be extracted
before and after editing for HTML markup.
|
protected mxGraphComponent |
graphComponent |
protected double |
minimumEditorScale
Defines the minimum scale to be used for the editor.
|
protected int |
minimumHeight |
protected int |
minimumWidth |
protected boolean |
replaceLinefeeds
Specifies if linefeeds should be replaced with BREAKS before editing,
and BREAKS should be replaced with linefeeds after editing.
|
protected javax.swing.JScrollPane |
scrollPane |
protected boolean |
shiftEnterSubmitsText
Specifies if shift ENTER should submit text if enterStopsCellEditing
is true.
|
protected javax.swing.JTextArea |
textArea
Holds the editor for plain text editing.
|
protected javax.swing.AbstractAction |
textSubmitAction |
protected java.util.EventObject |
trigger |
Constructor and Description |
---|
mxCellEditor(mxGraphComponent graphComponent) |
Modifier and Type | Method and Description |
---|---|
protected void |
configureActionMaps()
Installs the keyListener in the textArea and editorPane
for handling the enter keystroke and updating the modified state.
|
java.lang.String |
getCurrentValue()
Returns the current editing value.
|
java.lang.Object |
getEditingCell()
Returns the cell that is currently being edited.
|
java.awt.Component |
getEditor()
Returns the current editor or null if no editing is in progress.
|
java.awt.Rectangle |
getEditorBounds(mxCellState state,
double scale)
Returns the bounds to be used for the editor.
|
protected java.lang.String |
getInitialValue(mxCellState state,
java.util.EventObject trigger)
Gets the initial editing value for the given cell.
|
double |
getMinimumEditorScale() |
int |
getMinimumHeight() |
int |
getMinimumWidth() |
boolean |
isExtractHtmlBody()
Returns replaceHtmlLinefeeds
|
protected boolean |
isHideLabel(mxCellState state) |
boolean |
isReplaceHtmlLinefeeds()
Returns replaceHtmlLinefeeds
|
boolean |
isShiftEnterSubmitsText()
Returns shiftEnterSubmitsText
|
void |
setExtractHtmlBody(boolean value)
Sets extractHtmlBody
|
void |
setMinimumEditorScale(double minimumEditorScale) |
void |
setMinimumHeight(int minimumHeight) |
void |
setMinimumWidth(int minimumWidth) |
void |
setReplaceHtmlLinefeeds(boolean value)
Sets replaceHtmlLinefeeds
|
void |
setShiftEnterSubmitsText(boolean value)
Sets shiftEnterSubmitsText
|
void |
startEditing(java.lang.Object cell,
java.util.EventObject evt)
Starts editing the given cell.
|
void |
stopEditing(boolean cancel)
Stops the current editing.
|
protected boolean |
useLabelBounds(mxCellState state)
Returns true if the label bounds of the state should be used for the
editor.
|
public static int DEFAULT_MIN_WIDTH
public static int DEFAULT_MIN_HEIGHT
public static double DEFAULT_MINIMUM_EDITOR_SCALE
protected mxGraphComponent graphComponent
protected double minimumEditorScale
protected int minimumWidth
protected int minimumHeight
protected transient java.lang.Object editingCell
protected transient java.util.EventObject trigger
protected transient javax.swing.JScrollPane scrollPane
protected transient javax.swing.JTextArea textArea
protected transient javax.swing.JEditorPane editorPane
protected boolean extractHtmlBody
protected boolean replaceLinefeeds
protected boolean shiftEnterSubmitsText
protected javax.swing.AbstractAction cancelEditingAction
protected javax.swing.AbstractAction textSubmitAction
public mxCellEditor(mxGraphComponent graphComponent)
public boolean isExtractHtmlBody()
public void setExtractHtmlBody(boolean value)
public boolean isReplaceHtmlLinefeeds()
public void setReplaceHtmlLinefeeds(boolean value)
public boolean isShiftEnterSubmitsText()
public void setShiftEnterSubmitsText(boolean value)
protected void configureActionMaps()
public java.awt.Component getEditor()
protected boolean useLabelBounds(mxCellState state)
public java.awt.Rectangle getEditorBounds(mxCellState state, double scale)
public void startEditing(java.lang.Object cell, java.util.EventObject evt)
mxICellEditor
startEditing
in interface mxICellEditor
protected boolean isHideLabel(mxCellState state)
public void stopEditing(boolean cancel)
mxICellEditor
stopEditing
in interface mxICellEditor
protected java.lang.String getInitialValue(mxCellState state, java.util.EventObject trigger)
public java.lang.String getCurrentValue()
public java.lang.Object getEditingCell()
mxICellEditor
getEditingCell
in interface mxICellEditor
public double getMinimumEditorScale()
public void setMinimumEditorScale(double minimumEditorScale)
minimumEditorScale
- the minimumEditorScale to setpublic int getMinimumWidth()
public void setMinimumWidth(int minimumWidth)
minimumWidth
- the minimumWidth to setpublic int getMinimumHeight()
public void setMinimumHeight(int minimumHeight)
minimumHeight
- the minimumHeight to setCopyright (c) 2010-2017 Gaudenz Alder, JGraph Ltd. All rights reserved.