|
Extension SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A LayoutAssistant is a design time only object representing a LayoutManager and is used by the UIEditor to simplify UI design operations. This might include the offering of convenience functions such as alignment, sizing and spacing, and z-order manipulations, as well as providing textual and/or visual feedback during such operations as adding, moving and resizing of controls. Feedback typically is in the form of a text message on the status line and a bounding box displayed on the design surface to indicate to the user the location and dimensions to be applied for a given add, move or resize operation. Only a single instance of each LayoutAssitant implementation will ever be constructed. Thus, implementations should be stateless as their single instance will be used for all instances of the represented LayoutManager found in the user's UI construction. Implementations that wish to provide convenience functions which are available to be exposed on the UIEditor's toolbar and/or have an associated accelerator, must register the actions with the UIEditorAddin from within a static initializer. The reasons for this are twofold: 1) The IdeAction instances must have been constructed and retrievable from the IdeAction.find method for toolbar item creation during initialization of each UIEditor toolbar. 2) The IdeAction instances must have been constructed and retrievable from the IdeAction.find method for accelerator key mappings during initialization of each UIEditor glass pane.
Field Summary | |
static java.lang.String |
TOOLBAR_ITEM
Property suffix to use in combination with getToolbarPrefix() for fetching individual Toolbar items for this LayoutAssistant from the IDE settings. |
static java.lang.String |
TOOLBAR_ITEM_COUNT
Property suffix to use in combination with getToolbarPrefix() for fetching the number of available Toolbar items for this LayoutAssistant from the IDE settings. |
Method Summary | |
void |
cleanupRemovedComponent(oracle.jdevimpl.uieditor.uicanvas.ModelNode parent)
A child of this node's container has been removed. |
void |
constrainAdd(oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode,
java.awt.Point mouseOrigin,
java.awt.Point mousePos,
java.awt.Point newPos,
java.awt.Dimension newSize)
Optionally modify size and position of an object being added to conform to the constraints imposed by the LayoutManager being represented. |
java.lang.String |
constrainMove(oracle.jdevimpl.uieditor.uicanvas.ModelNode node,
oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode,
java.awt.Point mousePos,
java.awt.Point mouseOffset,
java.awt.Point newPos,
java.awt.Dimension newSize)
Optionally modify size and position of an object being moved to conform to the constraints imposed by the LayoutManager being represented. |
Explorer |
getConstraintsEditor(Context context)
Get an Explorer implementation with which to modify the constraints settings, else null. |
java.lang.String |
getConstraintsType()
|
javax.swing.JComponent[] |
getContextMenuItems(Context context)
Get an array of JComponent for population onto a ContextMenu. |
javax.swing.JComponent |
getEffects(java.awt.Container host)
Get a JComponent whose redering provides any special effects applicable during object creation, object resize or object move for the LayoutManager being represented. |
java.beans.PropertyEditor |
getPropertyEditor()
|
java.lang.String |
getToolbarPrefix()
Get the prefix to use in combination with the TOOLBAR_ITEM_COUNT and TOOLBAR_ITEM suffixes in order to fetch Toolbar related properties for this LayoutAssistant from the IDE settings. |
boolean |
handleEvent(IdeAction action,
Context context)
Respond to the given user action within the given context. |
void |
layoutChanged(oracle.jdevimpl.uieditor.uicanvas.ModelNode container)
Layout has been switched. |
void |
prepareAddComponent(oracle.jdevimpl.uieditor.uicanvas.ModelNode node,
oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode,
java.awt.Point location,
java.awt.Point offset,
java.awt.Dimension size)
Perform any preparation on a child component that will be added into to a container. |
java.lang.String |
prepareAddStatus(oracle.jdevimpl.uieditor.uicanvas.ModelNode node,
oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode,
java.awt.Point location,
java.awt.Dimension size)
Return a string for display during the add process. |
void |
prepareChangeLayout(oracle.jdevimpl.uieditor.uicanvas.ModelNode container)
Perform changes on children of a container to best handle a layout type change. |
java.lang.String |
prepareMouseMoveStatus(oracle.jdevimpl.uieditor.uicanvas.ModelNode node,
oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode,
java.awt.Point location)
Return a string for display while the user is moving the mouse over a component. |
void |
prepareMoveComponent(oracle.jdevimpl.uieditor.uicanvas.ModelNode node,
oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode,
java.awt.Point location,
java.awt.Point offset)
Child is being moved. |
void |
prepareResizeComponent(oracle.jdevimpl.uieditor.uicanvas.ModelNode node,
oracle.jdevimpl.uieditor.uicanvas.SelectNib nib)
Perform a requested resize on a child. |
java.lang.String |
prepareResizeStatus(oracle.jdevimpl.uieditor.uicanvas.ModelNode node,
java.awt.Point location,
java.awt.Dimension size)
Return a string for display during the resize process. |
void |
prepareSelectComponent(oracle.jdevimpl.uieditor.uicanvas.ModelNode child,
oracle.jdevimpl.uieditor.uicanvas.UICanvas canvas)
An immedate child node has been selected. |
void |
prepareSelectDescendant(oracle.jdevimpl.uieditor.uicanvas.ModelNode parent,
oracle.jdevimpl.uieditor.uicanvas.ModelNode child)
A descendant node has been selected. |
java.lang.String |
resizeAction(java.awt.Point newNibLocation,
oracle.jdevimpl.uieditor.uicanvas.UICanvas canvas,
oracle.jdevimpl.uieditor.uicanvas.SelectNib nib)
Return a status message string that will be displayed while the user is dragging the nib. |
boolean |
update(IdeAction action,
Context context)
Update the enabled state of the given action within the given context. |
boolean |
usesReverseZOrder()
Determine whether or not z-order is reversed. |
Field Detail |
public static final java.lang.String TOOLBAR_ITEM_COUNT
public static final java.lang.String TOOLBAR_ITEM
Method Detail |
public java.lang.String getConstraintsType()
public Explorer getConstraintsEditor(Context context)
context
- the Context describing the selection to be edited.
public java.beans.PropertyEditor getPropertyEditor()
public boolean handleEvent(IdeAction action, Context context)
action
- user action to be responded to.context
- context in which action was initiated.
public boolean update(IdeAction action, Context context)
action
- action whose availability is to be updated.context
- the current context.
public java.lang.String getToolbarPrefix()
public void prepareAddComponent(oracle.jdevimpl.uieditor.uicanvas.ModelNode node, oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode, java.awt.Point location, java.awt.Point offset, java.awt.Dimension size)
node
- the node being added.toNode
- ModelNode receiving the node.location
- the location in the parent.offset
- the mouse down position relative to the node.size
- the size of the component.public void prepareResizeComponent(oracle.jdevimpl.uieditor.uicanvas.ModelNode node, oracle.jdevimpl.uieditor.uicanvas.SelectNib nib)
node
- the ModelNode that is being re-sized.nib
- the SelectNib that is being manipulated.public void prepareMoveComponent(oracle.jdevimpl.uieditor.uicanvas.ModelNode node, oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode, java.awt.Point location, java.awt.Point offset)
node
- the ModelNode that has moved.toNode
- ModelNode receiving the node.location
- the new location.offset
- the mouse down position relative to the node.public java.lang.String prepareMouseMoveStatus(oracle.jdevimpl.uieditor.uicanvas.ModelNode node, oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode, java.awt.Point location)
node
- the node that the mouse is over.toNode
- the parent of the node that the mouse is over.location
- Point relative to parent's upper left corner.
public void prepareChangeLayout(oracle.jdevimpl.uieditor.uicanvas.ModelNode container)
container
- the ModelNode for the container that has changed.public void layoutChanged(oracle.jdevimpl.uieditor.uicanvas.ModelNode container)
public java.lang.String resizeAction(java.awt.Point newNibLocation, oracle.jdevimpl.uieditor.uicanvas.UICanvas canvas, oracle.jdevimpl.uieditor.uicanvas.SelectNib nib)
newNibLocation
- new position of nib.
public void prepareSelectComponent(oracle.jdevimpl.uieditor.uicanvas.ModelNode child, oracle.jdevimpl.uieditor.uicanvas.UICanvas canvas)
child
- the selected node.canvas
- provides access back to the class that owns the nibs.prepareSelectDescendant(oracle.jdevimpl.uieditor.uicanvas.ModelNode, oracle.jdevimpl.uieditor.uicanvas.ModelNode)
public void prepareSelectDescendant(oracle.jdevimpl.uieditor.uicanvas.ModelNode parent, oracle.jdevimpl.uieditor.uicanvas.ModelNode child)
parent
- the root of the selection pathchild
- the branch of the selection path stemming from parentpublic java.lang.String prepareAddStatus(oracle.jdevimpl.uieditor.uicanvas.ModelNode node, oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode, java.awt.Point location, java.awt.Dimension size)
node
- the node about to be added.toNode
- the parent that the node will be added to.location
- new Point relative to parent's upper left corner.size
- the size of the new node.
public java.lang.String prepareResizeStatus(oracle.jdevimpl.uieditor.uicanvas.ModelNode node, java.awt.Point location, java.awt.Dimension size)
node
- the node being resized.location
- new Point relative to parent's upper left corner.size
- the size of the new node.
public void cleanupRemovedComponent(oracle.jdevimpl.uieditor.uicanvas.ModelNode parent)
parent
- The node that had a child removed.public javax.swing.JComponent[] getContextMenuItems(Context context)
context
- the current context.
ContextMenu
public javax.swing.JComponent getEffects(java.awt.Container host)
host
- Container upon which an object is being added, resized or
moved.public java.lang.String constrainMove(oracle.jdevimpl.uieditor.uicanvas.ModelNode node, oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode, java.awt.Point mousePos, java.awt.Point mouseOffset, java.awt.Point newPos, java.awt.Dimension newSize)
node
- node being manipulated.toNode
- parent of node being manipulated.mousePos
- current mouse position relative to toNode.mouseOffset
- mouse position relative to node at beginning of move.newPos
- output parameter for receiving constrained drop location.newSize
- output parameter for receiving constrained drop size.public void constrainAdd(oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode, java.awt.Point mouseOrigin, java.awt.Point mousePos, java.awt.Point newPos, java.awt.Dimension newSize)
toNode
- parent of node being added.public boolean usesReverseZOrder()
|
Extension SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright ©1997, 2003, Oracle. All rights reserved.