Extension SDK

oracle.jdevimpl.uieditor.assistant
Class GridBagLayoutAssistant

java.lang.Object
  extended byoracle.jdevimpl.uieditor.assistant.BasicLayoutAssistant
      extended byoracle.jdevimpl.uieditor.assistant.GridBagLayoutAssistant
All Implemented Interfaces:
LayoutAssistant

public final class GridBagLayoutAssistant
extends BasicLayoutAssistant


Field Summary
static int ANCHOR_C_CMD_ID
           
static javax.swing.JMenuItem ANCHOR_C_ITEM
           
static int ANCHOR_CMD_ID
           
static int ANCHOR_E_CMD_ID
           
static javax.swing.JMenuItem ANCHOR_E_ITEM
           
static java.lang.String ANCHOR_GROUP
           
static javax.swing.JMenu ANCHOR_MENU
           
static int ANCHOR_N_CMD_ID
           
static javax.swing.JMenuItem ANCHOR_N_ITEM
           
static int ANCHOR_NE_CMD_ID
           
static javax.swing.JMenuItem ANCHOR_NE_ITEM
           
static int ANCHOR_NW_CMD_ID
           
static javax.swing.JMenuItem ANCHOR_NW_ITEM
           
static int ANCHOR_S_CMD_ID
           
static javax.swing.JMenuItem ANCHOR_S_ITEM
           
static int ANCHOR_SE_CMD_ID
           
static javax.swing.JMenuItem ANCHOR_SE_ITEM
           
static int ANCHOR_SW_CMD_ID
           
static javax.swing.JMenuItem ANCHOR_SW_ITEM
           
static int ANCHOR_W_CMD_ID
           
static javax.swing.JMenuItem ANCHOR_W_ITEM
           
static int FILL_BOTH_CMD_ID
           
static javax.swing.JMenuItem FILL_BOTH_ITEM
           
static int FILL_CMD_ID
           
static java.lang.String FILL_GROUP
           
static int FILL_HORIZ_CMD_ID
           
static javax.swing.JMenuItem FILL_HORIZ_ITEM
           
static javax.swing.JMenu FILL_MENU
           
static int FILL_VERT_CMD_ID
           
static javax.swing.JMenuItem FILL_VERT_ITEM
           
static javax.swing.JSeparator GRID_SEPARATOR
           
static javax.swing.JSeparator IPAD_SEPARATOR
           
static int NO_FILL_CMD_ID
           
static javax.swing.JMenuItem NO_FILL_ITEM
           
static int NO_WEIGHT_CMD_ID
           
static javax.swing.JMenuItem NO_WEIGHT_ITEM
           
static int REMOVE_INSETS_CMD_ID
           
static javax.swing.JMenuItem REMOVE_INSETS_ITEM
           
static int REMOVE_IPAD_CMD_ID
           
static javax.swing.JMenuItem REMOVE_IPAD_ITEM
           
static int SHOW_GRID_CMD_ID
           
static javax.swing.JMenuItem SHOW_GRID_ITEM
           
static int WEIGHT_BOTH_CMD_ID
           
static javax.swing.JMenuItem WEIGHT_BOTH_ITEM
           
static int WEIGHT_CMD_ID
           
static java.lang.String WEIGHT_GROUP
           
static int WEIGHT_HORIZ_CMD_ID
           
static javax.swing.JMenuItem WEIGHT_HORIZ_ITEM
           
static javax.swing.JMenu WEIGHT_MENU
           
static int WEIGHT_VERT_CMD_ID
           
static javax.swing.JMenuItem WEIGHT_VERT_ITEM
           
 
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
GridBagLayoutAssistant()
           
 
Method Summary
 void cleanupRemovedComponent(oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode)
          A child of this node's container has been removed.
 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.
 boolean execute(java.lang.Object first, java.lang.Object second)
           
 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.
 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 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 mousePos, java.awt.Dimension newSize)
          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.
 void prepareResizeComponent(oracle.jdevimpl.uieditor.uicanvas.ModelNode node, java.awt.Point location, java.awt.Dimension size)
           
 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 d)
          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 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.
 
Methods inherited from class oracle.jdevimpl.uieditor.assistant.BasicLayoutAssistant
calcBestZ, changeSize, changeZ, constrainAdd, getEffects, getKey, getSelectedSiblings, layoutChanged, lessThan, move, prepareSelectDescendant, raiseChildToView, removeBoundsSetting, sort, sortedNodes, usesReverseZOrder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WEIGHT_CMD_ID

public static final int WEIGHT_CMD_ID

WEIGHT_HORIZ_CMD_ID

public static final int WEIGHT_HORIZ_CMD_ID

WEIGHT_VERT_CMD_ID

public static final int WEIGHT_VERT_CMD_ID

WEIGHT_BOTH_CMD_ID

public static final int WEIGHT_BOTH_CMD_ID

NO_WEIGHT_CMD_ID

public static final int NO_WEIGHT_CMD_ID

FILL_CMD_ID

public static final int FILL_CMD_ID

FILL_HORIZ_CMD_ID

public static final int FILL_HORIZ_CMD_ID

FILL_VERT_CMD_ID

public static final int FILL_VERT_CMD_ID

FILL_BOTH_CMD_ID

public static final int FILL_BOTH_CMD_ID

NO_FILL_CMD_ID

public static final int NO_FILL_CMD_ID

ANCHOR_CMD_ID

public static final int ANCHOR_CMD_ID

ANCHOR_NW_CMD_ID

public static final int ANCHOR_NW_CMD_ID

ANCHOR_N_CMD_ID

public static final int ANCHOR_N_CMD_ID

ANCHOR_NE_CMD_ID

public static final int ANCHOR_NE_CMD_ID

ANCHOR_W_CMD_ID

public static final int ANCHOR_W_CMD_ID

ANCHOR_C_CMD_ID

public static final int ANCHOR_C_CMD_ID

ANCHOR_E_CMD_ID

public static final int ANCHOR_E_CMD_ID

ANCHOR_SW_CMD_ID

public static final int ANCHOR_SW_CMD_ID

ANCHOR_S_CMD_ID

public static final int ANCHOR_S_CMD_ID

ANCHOR_SE_CMD_ID

public static final int ANCHOR_SE_CMD_ID

REMOVE_IPAD_CMD_ID

public static final int REMOVE_IPAD_CMD_ID

REMOVE_INSETS_CMD_ID

public static final int REMOVE_INSETS_CMD_ID

SHOW_GRID_CMD_ID

public static final int SHOW_GRID_CMD_ID

WEIGHT_GROUP

public static final java.lang.String WEIGHT_GROUP
See Also:
Constant Field Values

FILL_GROUP

public static final java.lang.String FILL_GROUP
See Also:
Constant Field Values

ANCHOR_GROUP

public static final java.lang.String ANCHOR_GROUP
See Also:
Constant Field Values

WEIGHT_MENU

public static javax.swing.JMenu WEIGHT_MENU

WEIGHT_HORIZ_ITEM

public static javax.swing.JMenuItem WEIGHT_HORIZ_ITEM

WEIGHT_VERT_ITEM

public static javax.swing.JMenuItem WEIGHT_VERT_ITEM

WEIGHT_BOTH_ITEM

public static javax.swing.JMenuItem WEIGHT_BOTH_ITEM

NO_WEIGHT_ITEM

public static javax.swing.JMenuItem NO_WEIGHT_ITEM

FILL_MENU

public static javax.swing.JMenu FILL_MENU

FILL_HORIZ_ITEM

public static javax.swing.JMenuItem FILL_HORIZ_ITEM

FILL_VERT_ITEM

public static javax.swing.JMenuItem FILL_VERT_ITEM

FILL_BOTH_ITEM

public static javax.swing.JMenuItem FILL_BOTH_ITEM

NO_FILL_ITEM

public static javax.swing.JMenuItem NO_FILL_ITEM

ANCHOR_MENU

public static javax.swing.JMenu ANCHOR_MENU

ANCHOR_NW_ITEM

public static javax.swing.JMenuItem ANCHOR_NW_ITEM

ANCHOR_N_ITEM

public static javax.swing.JMenuItem ANCHOR_N_ITEM

ANCHOR_NE_ITEM

public static javax.swing.JMenuItem ANCHOR_NE_ITEM

ANCHOR_W_ITEM

public static javax.swing.JMenuItem ANCHOR_W_ITEM

ANCHOR_C_ITEM

public static javax.swing.JMenuItem ANCHOR_C_ITEM

ANCHOR_E_ITEM

public static javax.swing.JMenuItem ANCHOR_E_ITEM

ANCHOR_SW_ITEM

public static javax.swing.JMenuItem ANCHOR_SW_ITEM

ANCHOR_S_ITEM

public static javax.swing.JMenuItem ANCHOR_S_ITEM

ANCHOR_SE_ITEM

public static javax.swing.JMenuItem ANCHOR_SE_ITEM

IPAD_SEPARATOR

public static javax.swing.JSeparator IPAD_SEPARATOR

REMOVE_IPAD_ITEM

public static javax.swing.JMenuItem REMOVE_IPAD_ITEM

REMOVE_INSETS_ITEM

public static javax.swing.JMenuItem REMOVE_INSETS_ITEM

GRID_SEPARATOR

public static javax.swing.JSeparator GRID_SEPARATOR

SHOW_GRID_ITEM

public static javax.swing.JMenuItem SHOW_GRID_ITEM
Constructor Detail

GridBagLayoutAssistant

public GridBagLayoutAssistant()
Method Detail

getConstraintsType

public java.lang.String getConstraintsType()
Specified by:
getConstraintsType in interface LayoutAssistant
Overrides:
getConstraintsType in class BasicLayoutAssistant

getPropertyEditor

public java.beans.PropertyEditor getPropertyEditor()
Specified by:
getPropertyEditor in interface LayoutAssistant
Overrides:
getPropertyEditor in class BasicLayoutAssistant

prepareChangeLayout

public 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

constrainMove

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)
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

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

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

prepareSelectComponent

public 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

prepareResizeComponent

public void prepareResizeComponent(oracle.jdevimpl.uieditor.uicanvas.ModelNode node,
                                   oracle.jdevimpl.uieditor.uicanvas.SelectNib nib)
Description copied from interface: LayoutAssistant
Perform a requested resize on a child. Calculate a new constraint value for the node

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

prepareResizeComponent

public void prepareResizeComponent(oracle.jdevimpl.uieditor.uicanvas.ModelNode node,
                                   java.awt.Point location,
                                   java.awt.Dimension size)

cleanupRemovedComponent

public void cleanupRemovedComponent(oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode)
Description copied from interface: LayoutAssistant
A child of this node's container has been removed. This offers the LayoutAssistant the chance to clean up any data structures that it keeps for the container.

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

getContextMenuItems

public 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 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 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

getConstraintsEditor

public Explorer getConstraintsEditor(Context context)
Description copied from interface: LayoutAssistant
Get an Explorer implementation with which to modify the constraints settings, else null.

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

prepareAddStatus

public java.lang.String prepareAddStatus(oracle.jdevimpl.uieditor.uicanvas.ModelNode node,
                                         oracle.jdevimpl.uieditor.uicanvas.ModelNode toNode,
                                         java.awt.Point mousePos,
                                         java.awt.Dimension newSize)
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

resizeAction

public java.lang.String resizeAction(java.awt.Point newNibLocation,
                                     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 java.lang.String prepareResizeStatus(oracle.jdevimpl.uieditor.uicanvas.ModelNode node,
                                            java.awt.Point location,
                                            java.awt.Dimension d)
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 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

execute

public boolean execute(java.lang.Object first,
                       java.lang.Object second)

Extension SDK

 

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