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.TreeSelectionRedirector
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested 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, visibleRowCount
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Adds the elements within the array of the passed inDDClassField
toJTree
protected void
addArrayElementsToTree
(DefaultMutableTreeNode parent, DDClassField obj) Adds the elements within the array of the passed inDDClassField
toJTree
Called 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.boolean
canDrop()
Check if the currently selected item can be dropped into.protected void
Changes the selection of theJTree
to the passed in parametervoid
Creates theDefaultMutableTreeNode
void
dragEnter
(DropTargetDragEvent event) Is invoked when you are dragging over the DropSitevoid
dragExit
(DropTargetEvent event) Is invoked when you are exit the DropSite without droppingvoid
dragOver
(DropTargetDragEvent event) Is invoked when a drag operation is going onboolean
drop
(Transferable data) Add a dropped object to the tree.void
drop
(DropTargetDropEvent event) A drop has occurred.void
Is invoked if the use modifies the current drop gestureexpandAndSelect
(String nameToFind) Attempts to locate the tree node representing the given field passed in.protected boolean
isAnArray
(DDClassField fldObj) Verifies wheather the passed in parameter is anArray
protected boolean
isArrayOrSubstruct
(DDClassField fieldObj) Varifies weather the passed in parameter is anArray
or aSub-Struct
.protected boolean
isASubstruct
(DDClassField fldObj) Verifies wheather the passed in parameter is aSubstruct
protected boolean
Varifies whether the node can be deleted from the currentDDClass
.boolean
Varifies weather thisDDClass
is a subclass or not.protected boolean
isUnKnownField
(DDClassField classFieldObj) Verifies whether the passed in field is of typeFIELD_NOT_FOUND_DB
This 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.void
removeElement
(DefaultMutableTreeNode nodeToBeDeleted) Removes an element from storable class and update Flist ofDDClass
andDDClassField
.boolean
Methods 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, updateUI
Methods 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, update
Methods 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, validateTree
Methods 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
- ADDClass
object 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 ofDataDictionary
which 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_DB
This 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
-DDClassField
object that is to checked for the "FIELD_NOT_FOUND_DB" type.- Returns:
- Returns
true
if the passed in field is of type "FIELD_NOT_FOUND_DB" andfalse
otherwise. - Throws:
EBufException
-
unKnownFieldsDetected
public boolean unKnownFieldsDetected()- Returns:
- Returns
true
if any unknown fields were detected andfalse
otherwise.
-
isArrayOrSubstruct
Varifies weather the passed in parameter is anArray
or aSub-Struct
.- Parameters:
fieldObj
-DDClassField
object that is to checked weather it is an array or a substruct.- Returns:
- Returns
true
if the passed in parameter is an array or substruct;false
otherwise.
-
isAnArray
Verifies wheather the passed in parameter is anArray
- Parameters:
fieldObj
-DDClassField
object that is to checked weather it is an array- Returns:
- Returns
true
if the passed in parameter is an array;false
otherwise.
-
isASubstruct
Verifies wheather the passed in parameter is aSubstruct
- Parameters:
fieldObj
-DDClassField
object that is to checked weather it is a Substruct- Returns:
- Returns
true
if the passed in parameter is a Substruct;false
otherwise.
-
createNodes
Creates theDefaultMutableTreeNode
- Parameters:
top
-DefaultMutableTreeNode
that 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:
dragEnter
in interfaceDropTargetListener
- Parameters:
event
- Event causing drag
-
dragOver
Is invoked when a drag operation is going on- Specified by:
dragOver
in 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 theJTree
ofDDClass
.- Specified by:
drop
in 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:
dragExit
in interfaceDropTargetListener
- Parameters:
event
- Event causing Drag.
-
dropActionChanged
Is invoked if the use modifies the current drop gesture- Specified by:
dropActionChanged
in interfaceDropTargetListener
- Parameters:
event
- Event causing Drag.
-
changeSelection
Changes the selection of theJTree
to the passed in parameter- Parameters:
child
- Its aDefaultMutableTreeNode
to which the selection is to be changed.
-
addArrayElementsToTree
Adds the elements within the array of the passed inDDClassField
toJTree
- Parameters:
obj
- Object ofDDClassField
whose 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 inDDClassField
toJTree
Called 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
- ADefaultMutableTreeNode
to which the elements are to be added.obj
- Object ofDDClassField
whose 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 ofDDClass
andDDClassField
.- Parameters:
nodeToBeDeleted
- ADefaultMutableTreeNode
that is be removed fromJTress
-
isNodeRemovable
Varifies whether the node can be deleted from the currentDDClass
.- Parameters:
node
-DefaultMutableTreeNode
that is to be removed or deleted from theDDClass
.- Returns:
- Returns
true
if the node is removable;False
otherwise.
-
isThisASubClass
public boolean isThisASubClass()Varifies weather thisDDClass
is a subclass or not.- Returns:
- Returns
true
if thisDDClass
is a subclass;False
otherwise.
-
canDrop
public boolean canDrop()Check if the currently selected item can be dropped into.- Returns:
- true if a valid drop target is selected.
-