Extension SDK

oracle.jdevimpl.uieditor.assistant
Class NullLayoutAssistant

java.lang.Object
  extended byoracle.jdevimpl.uieditor.assistant.BasicLayoutAssistant
      extended byoracle.jdevimpl.uieditor.assistant.NullLayoutAssistant
All Implemented Interfaces:
javax.swing.event.ChangeListener, java.util.EventListener, LayoutAssistant
Direct Known Subclasses:
XYLayoutAssistant

public class NullLayoutAssistant
extends BasicLayoutAssistant
implements javax.swing.event.ChangeListener


Field Summary
protected static IdeAction ALIGN_BOTTOM_ACTION
           
static int ALIGN_BOTTOM_CMD_ID
           
static javax.swing.JMenuItem ALIGN_BOTTOM_ITEM
           
protected static IdeAction ALIGN_CENTER_ACTION
           
static int ALIGN_CENTER_CMD_ID
           
static javax.swing.JMenuItem ALIGN_CENTER_ITEM
           
protected static IdeAction ALIGN_LEFT_ACTION
           
static int ALIGN_LEFT_CMD_ID
           
static javax.swing.JMenuItem ALIGN_LEFT_ITEM
           
static javax.swing.JMenu ALIGN_MENU
           
protected static IdeAction ALIGN_MIDDLE_ACTION
           
static int ALIGN_MIDDLE_CMD_ID
           
static javax.swing.JMenuItem ALIGN_MIDDLE_ITEM
           
protected static IdeAction ALIGN_RIGHT_ACTION
           
static int ALIGN_RIGHT_CMD_ID
           
static javax.swing.JMenuItem ALIGN_RIGHT_ITEM
           
protected static IdeAction ALIGN_TOP_ACTION
           
static int ALIGN_TOP_CMD_ID
           
static javax.swing.JMenuItem ALIGN_TOP_ITEM
           
static javax.swing.JSeparator ALIGN_VERT_SEPARATOR
           
protected static IdeAction EVEN_SPACE_HORIZ_ACTION
           
static int EVEN_SPACE_HORIZ_CMD_ID
           
static javax.swing.JMenuItem EVEN_SPACE_HORIZ_ITEM
           
static javax.swing.JSeparator EVEN_SPACE_SEPARATOR
           
protected static IdeAction EVEN_SPACE_VERT_ACTION
           
static int EVEN_SPACE_VERT_CMD_ID
           
static javax.swing.JMenuItem EVEN_SPACE_VERT_ITEM
           
protected  oracle.jdevimpl.uieditor.assistant.GridEffects gridEffects
           
protected  int gridSpacing
           
protected  boolean gridVisible
           
protected static IdeAction SAME_SIZE_HORIZ_ACTION
           
static int SAME_SIZE_HORIZ_CMD_ID
           
static javax.swing.JMenuItem SAME_SIZE_HORIZ_ITEM
           
protected static IdeAction SAME_SIZE_VERT_ACTION
           
static int SAME_SIZE_VERT_CMD_ID
           
static javax.swing.JMenuItem SAME_SIZE_VERT_ITEM
           
static javax.swing.JMenu SIZE_AND_SPACE_MENU
           
protected  boolean snapToGrid
           
protected  boolean useInsets
           
 
Fields inherited from class oracle.jdevimpl.uieditor.assistant.BasicLayoutAssistant
BIG_DECREASE_HEIGHT_ACTION, BIG_DECREASE_HEIGHT_CMD_ID, BIG_DECREASE_WIDTH_ACTION, BIG_DECREASE_WIDTH_CMD_ID, BIG_INCREASE_HEIGHT_ACTION, BIG_INCREASE_HEIGHT_CMD_ID, BIG_INCREASE_WIDTH_ACTION, BIG_INCREASE_WIDTH_CMD_ID, BIG_MOVE_DOWN_ACTION, BIG_MOVE_DOWN_CMD_ID, BIG_MOVE_LEFT_ACTION, BIG_MOVE_LEFT_CMD_ID, BIG_MOVE_RIGHT_ACTION, BIG_MOVE_RIGHT_CMD_ID, BIG_MOVE_UP_ACTION, BIG_MOVE_UP_CMD_ID, DECREASE_HEIGHT_ACTION, DECREASE_HEIGHT_CMD_ID, DECREASE_WIDTH_ACTION, DECREASE_WIDTH_CMD_ID, INCREASE_HEIGHT_ACTION, INCREASE_HEIGHT_CMD_ID, INCREASE_WIDTH_ACTION, INCREASE_WIDTH_CMD_ID, MOVE_DOWN_ACTION, MOVE_DOWN_CMD_ID, MOVE_LEFT_ACTION, MOVE_LEFT_CMD_ID, MOVE_RIGHT_ACTION, MOVE_RIGHT_CMD_ID, MOVE_TO_FIRST_ACTION, MOVE_TO_FIRST_CMD_ID, MOVE_TO_FIRST_ITEM, MOVE_TO_LAST_ACTION, MOVE_TO_LAST_CMD_ID, MOVE_TO_LAST_ITEM, MOVE_UP_ACTION, MOVE_UP_CMD_ID, ZORDER_MENU, ZORDER_SEPARATOR
 
Fields inherited from interface oracle.jdevimpl.uieditor.LayoutAssistant
TOOLBAR_ITEM, TOOLBAR_ITEM_COUNT
 
Constructor Summary
NullLayoutAssistant()
           
 
Method Summary
 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.
protected  java.awt.Rectangle getConstraints(oracle.jdevimpl.uieditor.uicanvas.ModelNode node)
           
 javax.swing.JComponent[] getContextMenuItems(Context context)
          Get an array of JComponent for population onto a ContextMenu.
 javax.swing.JComponent getEffects(java.awt.Container c)
          Get a JComponent whose redering provides any special effects applicable during object creation, object resize or object move for the LayoutManager being represented.
protected  java.awt.Dimension getPreferredSize(oracle.jdevimpl.uieditor.uicanvas.ModelNode node)
           
 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 parent)
          Layout has been switched.
protected  void move(int id, Context context)
           
 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 parent)
          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.
 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 node, oracle.jdevimpl.uieditor.uicanvas.UICanvas canvas)
          An immedate child node has been selected.
 java.lang.String resizeAction(java.awt.Point newPos, 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.
protected  void setConstraints(oracle.jdevimpl.uieditor.uicanvas.ModelNode node, oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode, java.awt.Point location, java.awt.Dimension size)
           
 void stateChanged(javax.swing.event.ChangeEvent e)
           
 boolean update(IdeAction action, Context context)
          Update the enabled state of the given action within the given context.
protected  void updateSettings()
           
 boolean usesReverseZOrder()
          Determine whether or not z-order is reversed.
 
Methods inherited from class oracle.jdevimpl.uieditor.assistant.BasicLayoutAssistant
calcBestZ, changeSize, changeZ, cleanupRemovedComponent, getConstraintsEditor, getConstraintsType, getKey, getPropertyEditor, getSelectedSiblings, lessThan, prepareResizeComponent, prepareSelectDescendant, raiseChildToView, removeBoundsSetting, sort, sortedNodes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIGN_LEFT_CMD_ID

public static final int ALIGN_LEFT_CMD_ID

ALIGN_CENTER_CMD_ID

public static final int ALIGN_CENTER_CMD_ID

ALIGN_RIGHT_CMD_ID

public static final int ALIGN_RIGHT_CMD_ID

ALIGN_TOP_CMD_ID

public static final int ALIGN_TOP_CMD_ID

ALIGN_MIDDLE_CMD_ID

public static final int ALIGN_MIDDLE_CMD_ID

ALIGN_BOTTOM_CMD_ID

public static final int ALIGN_BOTTOM_CMD_ID

SAME_SIZE_HORIZ_CMD_ID

public static final int SAME_SIZE_HORIZ_CMD_ID

SAME_SIZE_VERT_CMD_ID

public static final int SAME_SIZE_VERT_CMD_ID

EVEN_SPACE_HORIZ_CMD_ID

public static final int EVEN_SPACE_HORIZ_CMD_ID

EVEN_SPACE_VERT_CMD_ID

public static final int EVEN_SPACE_VERT_CMD_ID

ALIGN_MENU

public static javax.swing.JMenu ALIGN_MENU

ALIGN_LEFT_ITEM

public static javax.swing.JMenuItem ALIGN_LEFT_ITEM

ALIGN_CENTER_ITEM

public static javax.swing.JMenuItem ALIGN_CENTER_ITEM

ALIGN_RIGHT_ITEM

public static javax.swing.JMenuItem ALIGN_RIGHT_ITEM

ALIGN_VERT_SEPARATOR

public static javax.swing.JSeparator ALIGN_VERT_SEPARATOR

ALIGN_TOP_ITEM

public static javax.swing.JMenuItem ALIGN_TOP_ITEM

ALIGN_MIDDLE_ITEM

public static javax.swing.JMenuItem ALIGN_MIDDLE_ITEM

ALIGN_BOTTOM_ITEM

public static javax.swing.JMenuItem ALIGN_BOTTOM_ITEM

SIZE_AND_SPACE_MENU

public static javax.swing.JMenu SIZE_AND_SPACE_MENU

SAME_SIZE_HORIZ_ITEM

public static javax.swing.JMenuItem SAME_SIZE_HORIZ_ITEM

SAME_SIZE_VERT_ITEM

public static javax.swing.JMenuItem SAME_SIZE_VERT_ITEM

EVEN_SPACE_SEPARATOR

public static javax.swing.JSeparator EVEN_SPACE_SEPARATOR

EVEN_SPACE_HORIZ_ITEM

public static javax.swing.JMenuItem EVEN_SPACE_HORIZ_ITEM

EVEN_SPACE_VERT_ITEM

public static javax.swing.JMenuItem EVEN_SPACE_VERT_ITEM

ALIGN_LEFT_ACTION

protected static IdeAction ALIGN_LEFT_ACTION

ALIGN_CENTER_ACTION

protected static IdeAction ALIGN_CENTER_ACTION

ALIGN_RIGHT_ACTION

protected static IdeAction ALIGN_RIGHT_ACTION

ALIGN_TOP_ACTION

protected static IdeAction ALIGN_TOP_ACTION

ALIGN_MIDDLE_ACTION

protected static IdeAction ALIGN_MIDDLE_ACTION

ALIGN_BOTTOM_ACTION

protected static IdeAction ALIGN_BOTTOM_ACTION

EVEN_SPACE_HORIZ_ACTION

protected static IdeAction EVEN_SPACE_HORIZ_ACTION

EVEN_SPACE_VERT_ACTION

protected static IdeAction EVEN_SPACE_VERT_ACTION

SAME_SIZE_HORIZ_ACTION

protected static IdeAction SAME_SIZE_HORIZ_ACTION

SAME_SIZE_VERT_ACTION

protected static IdeAction SAME_SIZE_VERT_ACTION

gridEffects

protected oracle.jdevimpl.uieditor.assistant.GridEffects gridEffects

snapToGrid

protected boolean snapToGrid

gridVisible

protected boolean gridVisible

gridSpacing

protected int gridSpacing

useInsets

protected boolean useInsets
Constructor Detail

NullLayoutAssistant

public NullLayoutAssistant()
Method Detail

updateSettings

protected void updateSettings()

prepareAddComponent

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)
Description copied from interface: LayoutAssistant
Perform any preparation on a child component that will be added into to a container. Typically this involves setting the node's constraint value. The new component has already been added to the container via container.add(component). After the constraint is set by this method and/or the add order of the components manipulated, it will be re-added with the supplied constraint.

Specified by:
prepareAddComponent in interface LayoutAssistant
Overrides:
prepareAddComponent in class BasicLayoutAssistant

prepareAddStatus

public final java.lang.String prepareAddStatus(oracle.jdevimpl.uieditor.uicanvas.ModelNode node,
                                               oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode,
                                               java.awt.Point location,
                                               java.awt.Dimension size)
Description copied from interface: LayoutAssistant
Return a string for display during the add process.

Specified by:
prepareAddStatus in interface LayoutAssistant
Overrides:
prepareAddStatus in class BasicLayoutAssistant

prepareMoveComponent

public void prepareMoveComponent(oracle.jdevimpl.uieditor.uicanvas.ModelNode node,
                                 oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode,
                                 java.awt.Point location,
                                 java.awt.Point offset)
Description copied from interface: LayoutAssistant
Child is being moved. Often implemented by calling prepareAddComponent

Specified by:
prepareMoveComponent in interface LayoutAssistant
Overrides:
prepareMoveComponent in class BasicLayoutAssistant

constrainMove

public final 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)
Description copied from interface: LayoutAssistant
Optionally modify size and position of an object being moved to conform to the constraints imposed by the LayoutManager being represented. This method may be called from the UIEditor during a move operation such that it may provide dynamic feedback to the user depicting the expected bounds of the object throughout the operation.

Specified by:
constrainMove in interface LayoutAssistant
Overrides:
constrainMove in class BasicLayoutAssistant

constrainAdd

public final void constrainAdd(oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode,
                               java.awt.Point mouseOrigin,
                               java.awt.Point mousePos,
                               java.awt.Point newPos,
                               java.awt.Dimension newSize)
Description copied from interface: LayoutAssistant
Optionally modify size and position of an object being added to conform to the constraints imposed by the LayoutManager being represented. This method may be called from the UIEditor during an add operation such that it may provide dynamic feedback to the user depicting the expected bounds of the object throughout the operation.

Specified by:
constrainAdd in interface LayoutAssistant
Overrides:
constrainAdd in class BasicLayoutAssistant

resizeAction

public final java.lang.String resizeAction(java.awt.Point newPos,
                                           oracle.jdevimpl.uieditor.uicanvas.UICanvas canvas,
                                           oracle.jdevimpl.uieditor.uicanvas.SelectNib nib)
Description copied from interface: LayoutAssistant
Return a status message string that will be displayed while the user is dragging the nib. Called once for each mouse dragged event processed during a resize operation

Specified by:
resizeAction in interface LayoutAssistant
Overrides:
resizeAction in class BasicLayoutAssistant

prepareResizeStatus

public final java.lang.String prepareResizeStatus(oracle.jdevimpl.uieditor.uicanvas.ModelNode node,
                                                  java.awt.Point location,
                                                  java.awt.Dimension size)
Description copied from interface: LayoutAssistant
Return a string for display during the resize process.

Specified by:
prepareResizeStatus in interface LayoutAssistant
Overrides:
prepareResizeStatus in class BasicLayoutAssistant

prepareMouseMoveStatus

public final java.lang.String prepareMouseMoveStatus(oracle.jdevimpl.uieditor.uicanvas.ModelNode node,
                                                     oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode,
                                                     java.awt.Point location)
Description copied from interface: LayoutAssistant
Return a string for display while the user is moving the mouse over a component. Typically used to identify the node and display the constraint for the component that would be selected if the user were to release the mouse.

Specified by:
prepareMouseMoveStatus in interface LayoutAssistant
Overrides:
prepareMouseMoveStatus in class BasicLayoutAssistant

prepareSelectComponent

public final void prepareSelectComponent(oracle.jdevimpl.uieditor.uicanvas.ModelNode node,
                                         oracle.jdevimpl.uieditor.uicanvas.UICanvas canvas)
Description copied from interface: LayoutAssistant
An immedate child node has been selected. Display selection nibs as desired and raise child to view as necessary via prepareSelectDescendant such that the child will be visible.

Specified by:
prepareSelectComponent in interface LayoutAssistant
Overrides:
prepareSelectComponent in class BasicLayoutAssistant

getContextMenuItems

public final javax.swing.JComponent[] getContextMenuItems(Context context)
Description copied from interface: LayoutAssistant
Get an array of JComponent for population onto a ContextMenu. Implementations are expected to return a non null array which may contain zero or more instances of JComponent. Implementations are expected to handle all associated listener registration on those items.

Specified by:
getContextMenuItems in interface LayoutAssistant
Overrides:
getContextMenuItems in class BasicLayoutAssistant

update

public final boolean update(IdeAction action,
                            Context context)
Description copied from interface: LayoutAssistant
Update the enabled state of the given action within the given context.

Specified by:
update in interface LayoutAssistant
Overrides:
update in class BasicLayoutAssistant

handleEvent

public final boolean handleEvent(IdeAction action,
                                 Context context)
Description copied from interface: LayoutAssistant
Respond to the given user action within the given context.

Specified by:
handleEvent in interface LayoutAssistant
Overrides:
handleEvent in class BasicLayoutAssistant

getToolbarPrefix

public final java.lang.String getToolbarPrefix()
Description copied from interface: LayoutAssistant
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.

Specified by:
getToolbarPrefix in interface LayoutAssistant
Overrides:
getToolbarPrefix in class BasicLayoutAssistant

usesReverseZOrder

public final boolean usesReverseZOrder()
Description copied from interface: LayoutAssistant
Determine whether or not z-order is reversed. Normally, z-order is based on addition order in that the most recently added child is at the top of the z-order (i.e. would obscure any lower z-order sibling with whom it's bounds overlapped). However, some layouts reverse this in that the most recently added child is at the bottom of the z-order (i.e. would be obscured by any higher z-order siblings with whom it's bounds overlapped).

Specified by:
usesReverseZOrder in interface LayoutAssistant
Overrides:
usesReverseZOrder in class BasicLayoutAssistant

move

protected void move(int id,
                    Context context)
Overrides:
move in class BasicLayoutAssistant

layoutChanged

public void layoutChanged(oracle.jdevimpl.uieditor.uicanvas.ModelNode parent)
Description copied from interface: LayoutAssistant
Layout has been switched. Chance for the old Container to clean up its mess. For instance; when switching from null layout, the NullLayoutAssistant uses this call to remove the Bounds property settings for each component in the Container.

Specified by:
layoutChanged in interface LayoutAssistant
Overrides:
layoutChanged in class BasicLayoutAssistant

prepareChangeLayout

public final void prepareChangeLayout(oracle.jdevimpl.uieditor.uicanvas.ModelNode parent)
Description copied from interface: LayoutAssistant
Perform changes on children of a container to best handle a layout type change. Should set the contraints for each Component in the container. The layout of the container has already been switched when this call is made.

Specified by:
prepareChangeLayout in interface LayoutAssistant
Overrides:
prepareChangeLayout in class BasicLayoutAssistant

getConstraints

protected java.awt.Rectangle getConstraints(oracle.jdevimpl.uieditor.uicanvas.ModelNode node)

getPreferredSize

protected java.awt.Dimension getPreferredSize(oracle.jdevimpl.uieditor.uicanvas.ModelNode node)

setConstraints

protected void setConstraints(oracle.jdevimpl.uieditor.uicanvas.ModelNode node,
                              oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode,
                              java.awt.Point location,
                              java.awt.Dimension size)

getEffects

public final javax.swing.JComponent getEffects(java.awt.Container c)
Description copied from interface: LayoutAssistant
Get a JComponent whose redering provides any special effects applicable during object creation, object resize or object move for the LayoutManager being represented. The effects object will be added to the UIEditor design surface between the glass paen and the content pane such that the effects will overlap the content. An example might be a simple transparent JPanel whose paint method renders equally spaced grid points in support of an XYLayout or Null layout.

Specified by:
getEffects in interface LayoutAssistant
Overrides:
getEffects in class BasicLayoutAssistant

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Specified by:
stateChanged in interface javax.swing.event.ChangeListener

Extension SDK

 

Copyright ©1997, 2003, Oracle. All rights reserved.