| java.lang.Object org.netbeans.modules.visualweb.designer.InteractionManager
InteractionManager | public class InteractionManager (Code) | | This class manages the interactions in the designer surface:
mouse gestures, keyboard gestures, and sequence operations like
drags, moves, resizes, etc.
author: Tor Norbye |
Inner Class :static class DefaultDesignerPopupEvent implements DesignerPopupEvent | |
Method Summary | |
void | drawInlineEditorBox(Graphics2D g2d, Rectangle rect) | public DomPosition | findTextPosition(int x, int y) Return the text position at the given location - or Position.NONE if
we're not over a text flow area. | public void | finishInlineEditing(boolean cancel) If there is an inline editor, finish editing in it. | public InlineEditor | getInlineEditor() | Cursor | getInsertCursor() | public CssBox | getInsertModeBox() Return the box whose contents are being edited. | Cursor | getLinkedCursor() | public MouseHandler | getMouseHandler() | public Point | getPastePoint() This method returns the position at which a component should be
pasted.
This implementation returns the current position of the mouse cursor.
If the cursor is outside the visual editor or hasn't moved
since the last time this method was invoked, this method will
return a position one grid box below and to the right of the
currently selected component. | public void | highlight(Element componentRootElement, Element regionElement) We have a separate "current"/"highlighted" item, unrelated to selection,
which is used to for example indicate which box is being dropped upon. | void | inlineEdit(Element[] componentRootElements) | public static boolean | isDomEvent(MouseEvent e) Return true iff this event corresponds to a "dom inspector"
event, e.g. | public boolean | isHighlighted() | public boolean | isInlineEditing() | public static boolean | isLinkingEvent(MouseEvent e) | public static boolean | isMenuEvent(MouseEvent e) Return true iff this event corresponds to a "menu" event,
e.g. | static boolean | isReadOnlyRegion(DomPosition pos) Report whether the given node is in a read-only region of
the document or not. | public static boolean | isToggleEvent(MouseEvent e) Return true iff this event corresponds to a "toggle" event,
e.g. | public void | paint(Graphics2D g) Paint the selection on top of the given editor pane. | void | setIgnoreCnC(boolean ignore) | public void | setInsertBox(CssBox box, MouseEvent event) Set the view which should be in "insert mode" (have an insert
cursor and a thick component marker rectangle). | public void | startInlineEditing(Element componentRootElement, String propertyName) | public boolean | startInlineEditing(Element componentRootElement, String property, CssBox box, boolean ensureSelected, boolean selectText, String initialEdit, boolean useDefault) Inline edit the given DesignBean, if the bean supports it. | public static void | stopCnCForWebForm(WebForm webform) | public void | syncSelection(boolean update) Call when the selection objects have changed under us. | public static void | translateMousePos(Point loc, Component source) | int | updateDropState(Point p, boolean committed, Transferable transferable) During drag and drop, given a mouse position, decide whether a caret
position applies (and if so, show the caret at that position, otherwise
hide it), show drag & drop feedback messages in the status message
area and highlight parents or link targets. | public void | updateInsertBox() |
ENABLE_DOM_INSPECTOR | final public static boolean ENABLE_DOM_INSPECTOR(Code) | | |
InteractionManager | public InteractionManager(WebForm webform)(Code) | | Creates a new instance of InteractionManager
|
findTextPosition | public DomPosition findTextPosition(int x, int y)(Code) | | Return the text position at the given location - or Position.NONE if
we're not over a text flow area.
|
finishInlineEditing | public void finishInlineEditing(boolean cancel)(Code) | | If there is an inline editor, finish editing in it.
|
getInsertModeBox | public CssBox getInsertModeBox()(Code) | | Return the box whose contents are being edited. Will be null when we're
not in edit mode.
|
getLinkedCursor | Cursor getLinkedCursor()(Code) | | Get cursor to use when dropping over a bean that only allows linking
|
getMouseHandler | public MouseHandler getMouseHandler()(Code) | | |
getPastePoint | public Point getPastePoint()(Code) | | This method returns the position at which a component should be
pasted.
This implementation returns the current position of the mouse cursor.
If the cursor is outside the visual editor or hasn't moved
since the last time this method was invoked, this method will
return a position one grid box below and to the right of the
currently selected component. If no component is selected, this method
returns null .
the point at which to paste a component or null ifthere is no valid paste position |
highlight | public void highlight(Element componentRootElement, Element regionElement)(Code) | | We have a separate "current"/"highlighted" item, unrelated to selection,
which is used to for example indicate which box is being dropped upon.
|
inlineEdit | void inlineEdit(Element[] componentRootElements)(Code) | | Put the designer in inline-editing mode for the first
eligible component in the inserted set of beans
|
isDomEvent | public static boolean isDomEvent(MouseEvent e)(Code) | | Return true iff this event corresponds to a "dom inspector"
event, e.g. an event which overrides normal mouse handling
and causes CSS boxes to be selected and displayed in the
property sheet instead.
|
isHighlighted | public boolean isHighlighted()(Code) | | |
isInlineEditing | public boolean isInlineEditing()(Code) | | Report whether we're inline editing a component
|
isMenuEvent | public static boolean isMenuEvent(MouseEvent e)(Code) | | Return true iff this event corresponds to a "menu" event,
e.g. an event where you want to post a popup menu.
This is typically the case when the "right" mouse button
is pressed.
|
isReadOnlyRegion | static boolean isReadOnlyRegion(DomPosition pos)(Code) | | Report whether the given node is in a read-only region of
the document or not.
|
isToggleEvent | public static boolean isToggleEvent(MouseEvent e)(Code) | | Return true iff this event corresponds to a "toggle" event,
e.g. an event where you want to toggle the selection instead
of replacing it. This is typically the case when some modifier
key is pressed.
|
paint | public void paint(Graphics2D g)(Code) | | Paint the selection on top of the given editor pane.
|
setIgnoreCnC | void setIgnoreCnC(boolean ignore)(Code) | | |
setInsertBox | public void setInsertBox(CssBox box, MouseEvent event)(Code) | | Set the view which should be in "insert mode" (have an insert
cursor and a thick component marker rectangle). May be null
to turn off insert mode.
|
startInlineEditing | public void startInlineEditing(Element componentRootElement, String propertyName)(Code) | | |
startInlineEditing | public boolean startInlineEditing(Element componentRootElement, String property, CssBox box, boolean ensureSelected, boolean selectText, String initialEdit, boolean useDefault)(Code) | | Inline edit the given DesignBean, if the bean supports it.
If so, inline edit the given bean and return true.
Otherwise, return false.
Parameters: ensureSelected - If true, make sure that the component to be inline edited is also selected Parameters: selectText - If true, select all the text in the inline section after initiating editing Parameters: initialEdit - If a non empty string, initiate editing as if the user had typed the string Parameters: box - The box corresponding to the component click, if any Parameters: property - The component to be inline edited Parameters: propertyName - May be null; if so, either the property corresponding to the box clicked should be edited,or the default property provided allow default is true Parameters: useDefault - If true, start editing the property marked default (if any) (marked with a "*" in the metadata) |
stopCnCForWebForm | public static void stopCnCForWebForm(WebForm webform)(Code) | | |
syncSelection | public void syncSelection(boolean update)(Code) | | Call when the selection objects have changed under us. Try to
Update to the current equivalent objects.
|
updateDropState | int updateDropState(Point p, boolean committed, Transferable transferable)(Code) | | During drag and drop, given a mouse position, decide whether a caret
position applies (and if so, show the caret at that position, otherwise
hide it), show drag & drop feedback messages in the status message
area and highlight parents or link targets. If the dropped parameter
is set, perform drop setup too: set the insert position on the
drop handler, and clear other drop state. I used to have separate
feedback-while-dropping and now-dropping-setup-state methods, but
they went out of sync, so by combining them hopefully the feedback will
always reflect what will happen on a drop.
Parameters: committed - If false, we're dragging but haven't dropped; just updatestatus feedback and show caret etc. If true, we've committed tothe drop, so set up the dnd handler, and clear out temporary caretfeedback, etc. The drop type |
updateInsertBox | public void updateInsertBox()(Code) | | Notify the selection manager that the box hierarchy has changed,
so update the insert box reference if necessary
|
|
|