Package com.portal.pfc.infranetui.sce
Class NewClassTree
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTree
com.portal.pfc.infranetui.sce.NewClassTree
- All Implemented Interfaces:
DropTargetListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,Scrollable
Object of this class is created when user wishes to create a new Storable
Class.
DropTargetListner is implemented by this class (i.e this class is the target for the drag and drop process). Fields can be dragged from Class Browser, Field Browser and dropped on this new class. Before accepting the dropped field, all kind of validations are made and the element is added only when the field gets cleared by all validations.
Some of the validations that are made in this class are
- Substructs cannot be added to base class.
- Sub-Classes can only have sub-structs and arrays.
- Fields can only be added to base class, array and sub-structs.
- Portal allows only up to 2 level deep of array or substruct.
- Existence of field in the current class.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JTree
JTree.AccessibleJTree, JTree.DropLocation, JTree.DynamicUtilTreeNode, JTree.EmptySelectionModel, JTree.TreeModelHandler, JTree.TreeSelectionRedirectorNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsFields inherited from class javax.swing.JTree
ANCHOR_SELECTION_PATH_PROPERTY, CELL_EDITOR_PROPERTY, CELL_RENDERER_PROPERTY, cellEditor, cellRenderer, editable, EDITABLE_PROPERTY, EXPANDS_SELECTED_PATHS_PROPERTY, INVOKES_STOP_CELL_EDITING_PROPERTY, invokesStopCellEditing, LARGE_MODEL_PROPERTY, largeModel, LEAD_SELECTION_PATH_PROPERTY, ROOT_VISIBLE_PROPERTY, rootVisible, ROW_HEIGHT_PROPERTY, rowHeight, SCROLLS_ON_EXPAND_PROPERTY, scrollsOnExpand, SELECTION_MODEL_PROPERTY, selectionModel, selectionRedirector, SHOWS_ROOT_HANDLES_PROPERTY, showsRootHandles, TOGGLE_CLICK_COUNT_PROPERTY, toggleClickCount, TREE_MODEL_PROPERTY, treeModel, treeModelListener, VISIBLE_ROW_COUNT_PROPERTY, visibleRowCountFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdds the elements within the array of the passed inDDClassFieldtoJTreeprotected voidaddArrayElementsToTree(DefaultMutableTreeNode parent, DDClassField obj) Adds the elements within the array of the passed inDDClassFieldtoJTreeCalled When FList is read from the file and Tree is built Or When an existing storable class is opened for modifications by double-clicking on the class in the class-browser.booleancanDrop()Check if the currently selected item can be dropped into.protected voidChanges the selection of theJTreeto the passed in parametervoidCreates theDefaultMutableTreeNodevoiddragEnter(DropTargetDragEvent event) Is invoked when you are dragging over the DropSitevoiddragExit(DropTargetEvent event) Is invoked when you are exit the DropSite without droppingvoiddragOver(DropTargetDragEvent event) Is invoked when a drag operation is going onbooleandrop(Transferable data) Add a dropped object to the tree.voiddrop(DropTargetDropEvent event) A drop has occurred.voidIs invoked if the use modifies the current drop gestureexpandAndSelect(String nameToFind) Attempts to locate the tree node representing the given field passed in.protected booleanisAnArray(DDClassField fldObj) Verifies wheather the passed in parameter is anArrayprotected booleanisArrayOrSubstruct(DDClassField fieldObj) Varifies weather the passed in parameter is anArrayor aSub-Struct.protected booleanisASubstruct(DDClassField fldObj) Verifies wheather the passed in parameter is aSubstructprotected booleanVarifies whether the node can be deleted from the currentDDClass.booleanVarifies weather thisDDClassis a subclass or not.protected booleanisUnKnownField(DDClassField classFieldObj) Verifies whether the passed in field is of typeFIELD_NOT_FOUND_DBThis situation shall arise when user is trying to open *.sce file in which some of the custom defined fields are missing in the current data-base.voidremoveElement(DefaultMutableTreeNode nodeToBeDeleted) Removes an element from storable class and update Flist ofDDClassandDDClassField.booleanMethods inherited from class javax.swing.JTree
addSelectionInterval, addSelectionPath, addSelectionPaths, addSelectionRow, addSelectionRows, addTreeExpansionListener, addTreeSelectionListener, addTreeWillExpandListener, cancelEditing, clearSelection, clearToggledPaths, collapsePath, collapseRow, convertValueToText, createTreeModel, createTreeModelListener, expandPath, expandRow, fireTreeCollapsed, fireTreeExpanded, fireTreeWillCollapse, fireTreeWillExpand, fireValueChanged, getAccessibleContext, getAnchorSelectionPath, getCellEditor, getCellRenderer, getClosestPathForLocation, getClosestRowForLocation, getDefaultTreeModel, getDescendantToggledPaths, getDragEnabled, getDropLocation, getDropMode, getEditingPath, getExpandedDescendants, getExpandsSelectedPaths, getInvokesStopCellEditing, getLastSelectedPathComponent, getLeadSelectionPath, getLeadSelectionRow, getMaxSelectionRow, getMinSelectionRow, getModel, getNextMatch, getPathBetweenRows, getPathBounds, getPathForLocation, getPathForRow, getPreferredScrollableViewportSize, getRowBounds, getRowCount, getRowForLocation, getRowForPath, getRowHeight, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getScrollsOnExpand, getSelectionCount, getSelectionModel, getSelectionPath, getSelectionPaths, getSelectionRows, getShowsRootHandles, getToggleClickCount, getToolTipText, getTreeExpansionListeners, getTreeSelectionListeners, getTreeWillExpandListeners, getUI, getUIClassID, getVisibleRowCount, hasBeenExpanded, isCollapsed, isCollapsed, isEditable, isEditing, isExpanded, isExpanded, isFixedRowHeight, isLargeModel, isPathEditable, isPathSelected, isRootVisible, isRowSelected, isSelectionEmpty, isVisible, makeVisible, paramString, removeDescendantSelectedPaths, removeDescendantToggledPaths, removeSelectionInterval, removeSelectionPath, removeSelectionPaths, removeSelectionRow, removeSelectionRows, removeTreeExpansionListener, removeTreeSelectionListener, removeTreeWillExpandListener, scrollPathToVisible, scrollRowToVisible, setAnchorSelectionPath, setCellEditor, setCellRenderer, setDragEnabled, setDropMode, setEditable, setExpandedState, setExpandsSelectedPaths, setInvokesStopCellEditing, setLargeModel, setLeadSelectionPath, setModel, setRootVisible, setRowHeight, setScrollsOnExpand, setSelectionInterval, setSelectionModel, setSelectionPath, setSelectionPaths, setSelectionRow, setSelectionRows, setShowsRootHandles, setToggleClickCount, setUI, setVisibleRowCount, startEditingAtPath, stopEditing, treeDidChange, updateUIMethods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
resManager
-
-
Constructor Details
-
NewClassTree
Constructor- Parameters:
rootClass- ADDClassobject which is getting created by the user as a new storable class. FList for this DDClass is converted to JTree component and is displayed inside JInternal Frame.dataDictionary- Object ofDataDictionarywhich know all about Portal.- Throws:
EBufException- JAVAPCM API's EBufException is thrown
-
-
Method Details
-
isUnKnownField
Verifies whether the passed in field is of typeFIELD_NOT_FOUND_DBThis situation shall arise when user is trying to open *.sce file in which some of the custom defined fields are missing in the current data-base. It will happen because the *.sce file was created using different data-base.- Parameters:
fieldObj-DDClassFieldobject that is to checked for the "FIELD_NOT_FOUND_DB" type.- Returns:
- Returns
trueif the passed in field is of type "FIELD_NOT_FOUND_DB" andfalseotherwise. - Throws:
EBufException
-
unKnownFieldsDetected
public boolean unKnownFieldsDetected()- Returns:
- Returns
trueif any unknown fields were detected andfalseotherwise.
-
isArrayOrSubstruct
Varifies weather the passed in parameter is anArrayor aSub-Struct.- Parameters:
fieldObj-DDClassFieldobject that is to checked weather it is an array or a substruct.- Returns:
- Returns
trueif the passed in parameter is an array or substruct;falseotherwise.
-
isAnArray
Verifies wheather the passed in parameter is anArray- Parameters:
fieldObj-DDClassFieldobject that is to checked weather it is an array- Returns:
- Returns
trueif the passed in parameter is an array;falseotherwise.
-
isASubstruct
Verifies wheather the passed in parameter is aSubstruct- Parameters:
fieldObj-DDClassFieldobject that is to checked weather it is a Substruct- Returns:
- Returns
trueif the passed in parameter is a Substruct;falseotherwise.
-
createNodes
Creates theDefaultMutableTreeNode- Parameters:
top-DefaultMutableTreeNodethat is to be created.
-
expandAndSelect
Attempts to locate the tree node representing the given field passed in. If found, that node will be expanded and selected. You can retrieve the actual DDClassField for the expanded node via the getUserObject() method on the last path component in the returned TreePath.- Parameters:
nameToFind- The field- Returns:
- The TreePath to the node representing the storable class; null if not found.
-
dragEnter
Is invoked when you are dragging over the DropSite- Specified by:
dragEnterin interfaceDropTargetListener- Parameters:
event- Event causing drag
-
dragOver
Is invoked when a drag operation is going on- Specified by:
dragOverin interfaceDropTargetListener- Parameters:
event- Event causing drag
-
drop
A drop has occurred. This the method which does all sorts of validations before the element is added to theJTreeofDDClass.- Specified by:
dropin interfaceDropTargetListener- Parameters:
event- Event causing drag
-
drop
Add a dropped object to the tree.- Parameters:
data- dropped object.- Returns:
- true if the object was dropped / pasted successfully.
-
dragExit
Is invoked when you are exit the DropSite without dropping- Specified by:
dragExitin interfaceDropTargetListener- Parameters:
event- Event causing Drag.
-
dropActionChanged
Is invoked if the use modifies the current drop gesture- Specified by:
dropActionChangedin interfaceDropTargetListener- Parameters:
event- Event causing Drag.
-
changeSelection
Changes the selection of theJTreeto the passed in parameter- Parameters:
child- Its aDefaultMutableTreeNodeto which the selection is to be changed.
-
addArrayElementsToTree
Adds the elements within the array of the passed inDDClassFieldtoJTree- Parameters:
obj- Object ofDDClassFieldwhose elements are to be added as nodes toJTree- Throws:
EBufException- JAVAPCM's exception is thrown.
-
addArrayElementsToTree
protected void addArrayElementsToTree(DefaultMutableTreeNode parent, DDClassField obj) throws EBufException Adds the elements within the array of the passed inDDClassFieldtoJTreeCalled When FList is read from the file and Tree is built Or When an existing storable class is opened for modifications by double-clicking on the class in the class-browser.- Parameters:
parent- ADefaultMutableTreeNodeto which the elements are to be added.obj- Object ofDDClassFieldwhose elements are to be added as nodes toJTree- Throws:
EBufException- JAVAPCM's exception is thrown.
-
removeElement
Removes an element from storable class and update Flist ofDDClassandDDClassField.- Parameters:
nodeToBeDeleted- ADefaultMutableTreeNodethat is be removed fromJTress
-
isNodeRemovable
Varifies whether the node can be deleted from the currentDDClass.- Parameters:
node-DefaultMutableTreeNodethat is to be removed or deleted from theDDClass.- Returns:
- Returns
trueif the node is removable;Falseotherwise.
-
isThisASubClass
public boolean isThisASubClass()Varifies weather thisDDClassis a subclass or not.- Returns:
- Returns
trueif thisDDClassis a subclass;Falseotherwise.
-
canDrop
public boolean canDrop()Check if the currently selected item can be dropped into.- Returns:
- true if a valid drop target is selected.
-