|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.view.AbstractMouseInputEditor
y.view.tabular.TableLabelEditor
public class TableLabelEditor
This MultiplexingNodeEditor.NodeEditor can be used to edit the labels of rows and columns
of a TableGroupNodeRealizer. An text editor for the label is opened when double clicking on the header of the
row or column.
| Constructor Summary | |
|---|---|
TableLabelEditor()
The default constructor of this class. |
|
| Method Summary | |
|---|---|
protected boolean |
columnLabelHit(TableGroupNodeRealizer.Column column,
double x,
double y)
Determines whether a double mouse click at the specified hit location should start label editing for the specified column. |
protected NodeLabel |
createLabel(TableGroupNodeRealizer.Column column)
Creates and returns a new NodeLabel for the given TableGroupNodeRealizer.Column. |
protected NodeLabel |
createLabel(TableGroupNodeRealizer.Row row)
Creates and returns a new NodeLabel for the given TableGroupNodeRealizer.Row. |
Cursor |
getCursor(Mouse2DEvent event)
Returns a mouse cursor to indicate what action this event could trigger or
null if the editor does not want to initiate a cursor change. |
protected NodeLabel |
getLabel(TableGroupNodeRealizer.Column column)
Returns a NodeLabel for the column. |
protected NodeLabel |
getLabel(TableGroupNodeRealizer.Row row)
Returns a NodeLabel for the row. |
boolean |
isExtendedLabelHitEnabled()
Returns true if the editor should start label editing for
columns and rows that have no children upon hits outside of the column's
top inset area or the row's left inset area and false
otherwise. |
boolean |
isLabelCreationEnabled()
Determines whether or not the editor may create new labels for columns or rows that do not have any associated labels. |
boolean |
isValidStartPosition(double x,
double y)
The given position is considered a valid start position if the header of a TableGroupNodeRealizer.Row
or TableGroupNodeRealizer.Column can be found there. |
void |
mouse2DEventHappened(Mouse2DEvent event)
Listener-like interface that will be notified of Mouse2DEvents. |
protected boolean |
rowLabelHit(TableGroupNodeRealizer.Row row,
double x,
double y)
Determines whether a double mouse click at the specified hit location should start label editing for the specified row. |
void |
setContext(Graph2DView view,
MultiplexingNodeEditor parent,
NodeRealizer realizer)
Provides context information for the editor. |
void |
setExtendedLabelHitEnabled(boolean enabled)
Specifies whether the editor may start label editing for columns and rows that have no children upon hits outside of the column's top inset area or the row's left inset area. |
void |
setLabelCreationEnabled(boolean enabled)
Specifies whether or not the editor may create new labels for columns or rows that do not have any associated labels. |
boolean |
startsEditing(Mouse2DEvent event)
This method is used by clients to query whether the given event is deemed as a starting gesture. |
void |
stopEditing()
Called by clients to stop the editing process cleanly. |
| Methods inherited from class y.view.AbstractMouseInputEditor |
|---|
addChangeListener, fireStateChanged, isEditing, isEnabled, isInterestedInEvents, removeChangeListener, setEnabled, startEditing |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface y.view.MouseInputEditor |
|---|
addChangeListener, isEditing, isInterestedInEvents, removeChangeListener, startEditing |
| Constructor Detail |
|---|
public TableLabelEditor()
| Method Detail |
|---|
public boolean isValidStartPosition(double x,
double y)
TableGroupNodeRealizer.Row
or TableGroupNodeRealizer.Column can be found there.
x - The horizontal position.y - The vertical position.
true, if the header of a TableGroupNodeRealizer.Row
or TableGroupNodeRealizer.Column can be found at the given coordinates;
false otherwise.
protected boolean columnLabelHit(TableGroupNodeRealizer.Column column,
double x,
double y)
column - the Column to check.x - the x-coordinate of the hit location.y - the y-coordinate of the hit location.
true if label editing should be started;
false otherwise.
protected boolean rowLabelHit(TableGroupNodeRealizer.Row row,
double x,
double y)
row - the Row to check.x - the x-coordinate of the hit location.y - the y-coordinate of the hit location.
true if label editing should be started;
false otherwise.protected NodeLabel getLabel(TableGroupNodeRealizer.Row row)
Returns a NodeLabel for the row. If there is already a node label for row
added to the TableGroupNodeRealizer to which row belongs, it is returned.
Otherwise createLabel(y.view.tabular.TableGroupNodeRealizer.Row) is called so that a new label can
be returned.
row - The row to get the node label for.
protected NodeLabel getLabel(TableGroupNodeRealizer.Column column)
Returns a NodeLabel for the column. If there is already a node label for
column added to the TableGroupNodeRealizer to which column belongs, it is returned.
Otherwise createLabel(y.view.tabular.TableGroupNodeRealizer.Column) is called so that a new label can
be returned.
column - The column to get the node label for.
protected NodeLabel createLabel(TableGroupNodeRealizer.Row row)
NodeLabel for the given TableGroupNodeRealizer.Row.
row - The row to create a label for.
NodeLabel.protected NodeLabel createLabel(TableGroupNodeRealizer.Column column)
NodeLabel for the given TableGroupNodeRealizer.Column.
column - The column to create a label for.
NodeLabel.public boolean isLabelCreationEnabled()
true if the editor may create new labels for columns
or rows that do not have any associated labels; false
otherwise.setLabelCreationEnabled(boolean)public void setLabelCreationEnabled(boolean enabled)
enabled - true if the editor may create new labels for columns
or rows that do not have any associated labels; false
otherwise.isLabelCreationEnabled()public boolean isExtendedLabelHitEnabled()
true if the editor should start label editing for
columns and rows that have no children upon hits outside of the column's
top inset area or the row's left inset area and false
otherwise. Note, that even if this property is true column
label editing is only triggered outside of any rows and row label editing
is only triggered outside of any columns.
By default, this property is true.
true if the editor should start label editing
of columns and rows that have no children upon hits outside of the column's
top inset area or the row's left inset area and false
otherwise.setExtendedLabelHitEnabled(boolean),
columnLabelHit(y.view.tabular.TableGroupNodeRealizer.Column, double, double),
rowLabelHit(y.view.tabular.TableGroupNodeRealizer.Row, double, double)public void setExtendedLabelHitEnabled(boolean enabled)
By default, this property is true.
enabled - if true the editor may start label editing
upon hits outside of the column's top inset area or the row's left
inset area; if false only hits inside a column's top inset
area or a row's left inset area will trigger label editing.isExtendedLabelHitEnabled(),
columnLabelHit(y.view.tabular.TableGroupNodeRealizer.Column, double, double),
rowLabelHit(y.view.tabular.TableGroupNodeRealizer.Row, double, double)public boolean startsEditing(Mouse2DEvent event)
MouseInputEditor
event - the event that happened
MouseInputEditor.isInterestedInEvents()public void mouse2DEventHappened(Mouse2DEvent event)
MouseInputEditor
event - the event that happenedMouseInputEditor.isInterestedInEvents()
public void setContext(Graph2DView view,
MultiplexingNodeEditor parent,
NodeRealizer realizer)
MultiplexingNodeEditor.NodeEditor
setContext in interface MultiplexingNodeEditor.NodeEditorview - the current view in which the editing is done.parent - the multiplexing editor that delegates to the node editor.realizer - the realizer representing the node to edit.public Cursor getCursor(Mouse2DEvent event)
MultiplexingNodeEditor.NodeEditorevent could trigger or
null if the editor does not want to initiate a cursor change.
getCursor in interface MultiplexingNodeEditor.NodeEditorevent - The mouse event a cursor can be returned for.
Cursor if a possible action for this mouse event
shall be indicated or null.public void stopEditing()
MouseInputEditor
stopEditing in interface MouseInputEditorstopEditing in class AbstractMouseInputEditor
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||