com.altair.hwm.toolkit.page
Class HWMDsgnPage

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.altair.hwm.toolkit.page.HWMPage
                      extended by com.altair.hwm.toolkit.page.HWMDsgnPage
All Implemented Interfaces:
HWMToolkitEventListener, HWMResizeMoveTarget, java.awt.dnd.DropTargetListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class HWMDsgnPage
extends HWMPage
implements java.awt.dnd.DropTargetListener, HWMResizeMoveTarget

Title: HWMDsgnPage

Description: This is the designer page

Company: Altair Engineering, Inc.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static java.lang.String PAGE_EXPORT_VERSION
          The version # for this class
static java.lang.String PROP_IMAGE_OFF
           
static java.lang.String PROP_IMAGE_ON
           
static int SNAP_ALL
          Aligns the component to all sides.
static int SNAP_BOTTOM
          Aligns the component to the bottom.
static int SNAP_LEFT
          Aligns the component to the left.
static int SNAP_LEFTRIGHT
          Aligns the component to left and right.
static int SNAP_RIGHT
          Aligns the component to the right.
static int SNAP_TOP
          Aligns the component to the top.
static int SNAP_TOPBOTTOM
          Aligns the component to top and bottom.
 
Fields inherited from class com.altair.hwm.toolkit.page.HWMPage
PAGE_IMAGE_FILE, PAGE_IMAGE_FILE_VISIBILITY, PAGE_VERSION, PROP_PAGE_ID, PROP_PAGE_NAME
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
HWMDsgnPage(HWMModelInstance hwmModelInstance)
          Constructor
 
Method Summary
 void DeleteBean()
          Deletes the currently selected bean
 void DeleteSelectedBean(HWMBeanWrapper hwmBeanWrapper)
          this will delete the all the selected control from the page...
 void dragEnter(java.awt.dnd.DropTargetDragEvent eventDropTargetDrag)
          Determines whether to accept the drag
 void dragExit(java.awt.dnd.DropTargetEvent eventDropTarget)
          Not implemented
 void dragOver(java.awt.dnd.DropTargetDragEvent eventDropTargetDrag)
          Not implemented
 void drop(java.awt.dnd.DropTargetDropEvent eventDropTargetDrop)
          Adds a new bean to the page.
 void dropActionChanged(java.awt.dnd.DropTargetDragEvent eventDropTargetDrag)
          Not implemented
 void EventPerformed(HWMToolkitEvent evtToolkit)
          The toolkit event listener method
 void Export(java.io.ObjectOutputStream outStream)
          Exports the current page.
 HWMPageConstraints GetConstraints(java.awt.Component comp)
          Sets the constraints for the component in the page
 int GetGridSize()
          Getter method for the grid size to use for this page
 HWMBeanWrapper GetSelectedBean()
          Returns the selected bean
 void Import(HWMObjectInputStream inStream)
          Import everything into this page from file.
 void makeBeanSameSizeAsCopied(HWMBeanInstance from_hwmBeanInstance, HWMBeanInstance to_hwmBeanInstance)
           
 void moveBeanComponent(HWMBeanInstance to_hwmBeanInstance, java.awt.Dimension beanWidthHeight)
          move Bean Component when user cut/copy/paste of bean...
 void OnDeleteOfBeanCleanDataModel(HWMBeanInstance m_hwmBeanInstance)
          this method is cleans up the bean related information from the data model when user deletes the bean from the page in designer....
 void paint(java.awt.Graphics graphics)
          Overridden method that draws a bounding box if necessary.
 void ResizeMoveDone()
          Callback method for Resize and Move bands.
 void SetBeanSelected(java.awt.Component compWrapper)
          Sets the given bean to 'selected' state
 void SetBeanSelected(int nBeanID)
          Sets a bean as 'selected' given a bean id.
 void SetConstraints(HWMBeanWrapper hwmBeanWrapper, HWMPageConstraints hwmPgConstraints)
          Sets the constraints for the component in the page
 void SetGridSize(int nGridSize)
          Setter method for the grid size to use for this page
 void SetupStandardButtons()
          Create the Apply, Prev, Next buttons so that they conform to the Altair standards
 void SnapComponent(HWMBeanWrapper hwmBeanWrapper, int nSnapEdge)
          Aligns the selected component to the closest grid
 void SnapSelectedComponent(int nSnapEdge)
          snap all the selected Component on the page...
 void UpdateBoundingBox(java.awt.Rectangle rectNew)
          Callback method for Resize and Move bands.
 
Methods inherited from class com.altair.hwm.toolkit.page.HWMPage
addPropertyChangeListener, AddToolkitEventListener, DeleteAllBeans, DeleteBean, ExportTCL, GetAllBeanInstances, GetAllBeans, GetAllPageConstraints, GetBeanInstance, GetBeanObject, GetBeanObjects, GetImageOnPage, GetImageVisibilityOnPage, GetPageID, GetPageName, getPreferredSize, InitBeans, InvokePlay, InvokeRun, IsBeanInPage, LoadProject, OnMigrateProject, ReadVersion1_0, ReadVersion2_0, removePropertyChangeListener, RemoveToolkitEventListener, SaveProject, SetImageOnPage, SetImageVisibilityOnPage, SetPageID, SetPageName, toString
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SNAP_LEFT

public static final int SNAP_LEFT
Aligns the component to the left. Used for the API- SnapComponent

See Also:
Constant Field Values

SNAP_RIGHT

public static final int SNAP_RIGHT
Aligns the component to the right. Used for the API- SnapComponent

See Also:
Constant Field Values

SNAP_BOTTOM

public static final int SNAP_BOTTOM
Aligns the component to the bottom. Used for the API- SnapComponent

See Also:
Constant Field Values

SNAP_TOP

public static final int SNAP_TOP
Aligns the component to the top. Used for the API- SnapComponent

See Also:
Constant Field Values

SNAP_ALL

public static final int SNAP_ALL
Aligns the component to all sides. Used for the API- SnapComponent

See Also:
Constant Field Values

SNAP_LEFTRIGHT

public static final int SNAP_LEFTRIGHT
Aligns the component to left and right. Used for the API- SnapComponent

See Also:
Constant Field Values

SNAP_TOPBOTTOM

public static final int SNAP_TOPBOTTOM
Aligns the component to top and bottom. Used for the API- SnapComponent

See Also:
Constant Field Values

PAGE_EXPORT_VERSION

public static final java.lang.String PAGE_EXPORT_VERSION
The version # for this class

See Also:
Constant Field Values

PROP_IMAGE_ON

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

PROP_IMAGE_OFF

public static final java.lang.String PROP_IMAGE_OFF
See Also:
Constant Field Values
Constructor Detail

HWMDsgnPage

public HWMDsgnPage(HWMModelInstance hwmModelInstance)
Constructor

Parameters:
iFrameWork - The framework interface
Method Detail

SetBeanSelected

public void SetBeanSelected(int nBeanID)
Sets a bean as 'selected' given a bean id.

Parameters:
nBeanID - The ID of the bean to select

SetBeanSelected

public void SetBeanSelected(java.awt.Component compWrapper)
Sets the given bean to 'selected' state

Parameters:
compWrapper - The bean to select. If null, the currntly selected bean is unselected

GetSelectedBean

public HWMBeanWrapper GetSelectedBean()
Returns the selected bean

Returns:
HWMBeanWrapper The selected bean wrapper. Can be null if nothing is selected

DeleteBean

public void DeleteBean()
Deletes the currently selected bean


DeleteSelectedBean

public void DeleteSelectedBean(HWMBeanWrapper hwmBeanWrapper)
this will delete the all the selected control from the page...

Parameters:
hwmBeanWrapper -

OnDeleteOfBeanCleanDataModel

public void OnDeleteOfBeanCleanDataModel(HWMBeanInstance m_hwmBeanInstance)
this method is cleans up the bean related information from the data model when user deletes the bean from the page in designer.... -By Surya

Parameters:
m_hwmBeanInstance -

paint

public void paint(java.awt.Graphics graphics)
Overridden method that draws a bounding box if necessary.

Overrides:
paint in class HWMPage

SetConstraints

public void SetConstraints(HWMBeanWrapper hwmBeanWrapper,
                           HWMPageConstraints hwmPgConstraints)
Sets the constraints for the component in the page

Parameters:
hwmBeanWrapper - The bean wrapper
hwmPgConstraints - The constraints to use. If null, the constraints are obtained from the laypout mgr.

GetConstraints

public HWMPageConstraints GetConstraints(java.awt.Component comp)
Sets the constraints for the component in the page

Parameters:
comp - The component whose constraints should be retrieved
Returns:
HWMPageConstraints The constraints used.

SnapComponent

public void SnapComponent(HWMBeanWrapper hwmBeanWrapper,
                          int nSnapEdge)
Aligns the selected component to the closest grid

Parameters:
hwmBeanWrapper - The component that needs to be aligned
nSnapEdge - The side that needs to be aligned. Can be one of the following constants: SNAP_LEFT, SNAP_RIGHT, SNAP_BOTTOM, SNAP_TOP, SNAP_ALL, SNAP_LEFTRIGHT SNAP_TOPBOTTOM

SnapSelectedComponent

public void SnapSelectedComponent(int nSnapEdge)
snap all the selected Component on the page...

Parameters:
nSnapEdge - By Surya

UpdateBoundingBox

public void UpdateBoundingBox(java.awt.Rectangle rectNew)
Callback method for Resize and Move bands.

Specified by:
UpdateBoundingBox in interface HWMResizeMoveTarget
Parameters:
rectNew - The new bounds that should be drawn

ResizeMoveDone

public void ResizeMoveDone()
Callback method for Resize and Move bands. Updates the bean to the new position and/or size

Specified by:
ResizeMoveDone in interface HWMResizeMoveTarget

dragEnter

public void dragEnter(java.awt.dnd.DropTargetDragEvent eventDropTargetDrag)
Determines whether to accept the drag

Specified by:
dragEnter in interface java.awt.dnd.DropTargetListener
Parameters:
dtde - The event that holds info of the transfer object

drop

public void drop(java.awt.dnd.DropTargetDropEvent eventDropTargetDrop)
Adds a new bean to the page.

Specified by:
drop in interface java.awt.dnd.DropTargetListener
Parameters:
dtde - The event that hold info about the bean

dragOver

public void dragOver(java.awt.dnd.DropTargetDragEvent eventDropTargetDrag)
Not implemented

Specified by:
dragOver in interface java.awt.dnd.DropTargetListener

dropActionChanged

public void dropActionChanged(java.awt.dnd.DropTargetDragEvent eventDropTargetDrag)
Not implemented

Specified by:
dropActionChanged in interface java.awt.dnd.DropTargetListener

dragExit

public void dragExit(java.awt.dnd.DropTargetEvent eventDropTarget)
Not implemented

Specified by:
dragExit in interface java.awt.dnd.DropTargetListener

EventPerformed

public void EventPerformed(HWMToolkitEvent evtToolkit)
The toolkit event listener method

Specified by:
EventPerformed in interface HWMToolkitEventListener
Overrides:
EventPerformed in class HWMPage
Parameters:
evtToolkit -

Export

public void Export(java.io.ObjectOutputStream outStream)
            throws java.io.IOException
Exports the current page. The exported file save the page and also gives each bean in that page a shot at saving whatever it needs

Parameters:
outStream - -- The stream to "export" to
Throws:
java.io.IOException

Import

public void Import(HWMObjectInputStream inStream)
            throws java.io.IOException,
                   java.lang.ClassNotFoundException,
                   java.beans.IntrospectionException,
                   java.lang.InstantiationException,
                   java.lang.IllegalAccessException
Import everything into this page from file. The file contains properties of this page, page and also data that has been saved by each bean.

Parameters:
inStream - -- The stream to "import" from
Throws:
IOException, - ClassNotFoundException, IntrospectionException, InstantiationException, IllegalAccessException
java.io.IOException
java.lang.ClassNotFoundException
java.beans.IntrospectionException
java.lang.InstantiationException
java.lang.IllegalAccessException

GetGridSize

public int GetGridSize()
Getter method for the grid size to use for this page


SetGridSize

public void SetGridSize(int nGridSize)
Setter method for the grid size to use for this page


SetupStandardButtons

public void SetupStandardButtons()
Create the Apply, Prev, Next buttons so that they conform to the Altair standards

Parameters:
-

makeBeanSameSizeAsCopied

public void makeBeanSameSizeAsCopied(HWMBeanInstance from_hwmBeanInstance,
                                     HWMBeanInstance to_hwmBeanInstance)
Parameters:
from_hwmBeanInstance -
to_hwmBeanInstance -

moveBeanComponent

public void moveBeanComponent(HWMBeanInstance to_hwmBeanInstance,
                              java.awt.Dimension beanWidthHeight)
move Bean Component when user cut/copy/paste of bean... the bean component should not be overlapped....., this will handle not overlap bean components... its not bean used... has few refreshing issues will addressed later.. By Surya

Parameters:
to_hwmBeanInstance -
beanWidthHeight -