public class NewClassTree extends JTree implements DropTargetListener
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
JTree.AccessibleJTree, JTree.DropLocation, JTree.DynamicUtilTreeNode, JTree.EmptySelectionModel, JTree.TreeModelHandler, JTree.TreeSelectionRedirector
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
static ResourceManager |
resManager |
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
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
NewClassTree(DDClass rootClass,
DataDictionary dataDictionary)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
addArrayElementsToTree(DDClassField obj)
Adds the elements within the array of the passed in
DDClassField to JTree |
protected void |
addArrayElementsToTree(DefaultMutableTreeNode parent,
DDClassField obj)
Adds the elements within the array of the passed in
DDClassField to JTree
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 |
changeSelection(DefaultMutableTreeNode child)
Changes the selection of the
JTree to the passed in
parameter |
void |
createNodes(DefaultMutableTreeNode top)
Creates the
DefaultMutableTreeNode |
void |
dragEnter(DropTargetDragEvent event)
Is invoked when you are dragging over the DropSite
|
void |
dragExit(DropTargetEvent event)
Is invoked when you are exit the DropSite without dropping
|
void |
dragOver(DropTargetDragEvent event)
Is invoked when a drag operation is going on
|
void |
drop(DropTargetDropEvent event)
A drop has occurred.
|
boolean |
drop(Transferable data)
Add a dropped object to the tree.
|
void |
dropActionChanged(DropTargetDragEvent event)
Is invoked if the use modifies the current drop gesture
|
TreePath |
expandAndSelect(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 an
Array |
protected boolean |
isArrayOrSubstruct(DDClassField fieldObj)
Varifies weather the passed in parameter is an
Array or
a Sub-Struct . |
protected boolean |
isASubstruct(DDClassField fldObj)
Verifies wheather the passed in parameter is a
Substruct |
protected boolean |
isNodeRemovable(DefaultMutableTreeNode node)
Varifies whether the node can be deleted from the current
DDClass . |
boolean |
isThisASubClass()
Varifies weather this
DDClass is a subclass or not. |
protected boolean |
isUnKnownField(DDClassField classFieldObj)
Verifies whether the passed in field is of type
FIELD_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
of
DDClass and DDClassField . |
boolean |
unKnownFieldsDetected() |
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
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
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
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, getPeer, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static ResourceManager resManager
public NewClassTree(DDClass rootClass, DataDictionary dataDictionary) throws EBufException
rootClass
- A DDClass
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 of DataDictionary
which know all about Portal.EBufException
- JAVAPCM API's EBufException is thrownprotected boolean isUnKnownField(DDClassField classFieldObj) throws EBufException
FIELD_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.fieldObj
- DDClassField
object that is to checked
for the "FIELD_NOT_FOUND_DB" type. true
if the passed in field is of type
"FIELD_NOT_FOUND_DB" and false
otherwise.EBufException
public boolean unKnownFieldsDetected()
true
if any unknown fields were detected
and false
otherwise.protected boolean isArrayOrSubstruct(DDClassField fieldObj)
Array
or
a Sub-Struct
.fieldObj
- DDClassField
object that is to checked
weather it is an array or a substruct. true
if the passed in parameter is an array
or substruct; false
otherwise.protected boolean isAnArray(DDClassField fldObj)
Array
fieldObj
- DDClassField
object that is to checked
weather it is an array true
if the passed in parameter is an array;
false
otherwise.protected boolean isASubstruct(DDClassField fldObj)
Substruct
fieldObj
- DDClassField
object that is to checked
weather it is a Substruct true
if the passed in parameter is a Substruct;
false
otherwise.public void createNodes(DefaultMutableTreeNode top)
DefaultMutableTreeNode
top
- DefaultMutableTreeNode
that is to be
created.public TreePath expandAndSelect(String nameToFind)
nameToFind
- The fieldpublic void dragEnter(DropTargetDragEvent event)
dragEnter
in interface DropTargetListener
event
- Event causing dragpublic void dragOver(DropTargetDragEvent event)
dragOver
in interface DropTargetListener
event
- Event causing dragpublic void drop(DropTargetDropEvent event)
JTree
of DDClass
.drop
in interface DropTargetListener
event
- Event causing dragpublic boolean drop(Transferable data)
data
- dropped object.public void dragExit(DropTargetEvent event)
dragExit
in interface DropTargetListener
event
- Event causing Drag.public void dropActionChanged(DropTargetDragEvent event)
dropActionChanged
in interface DropTargetListener
event
- Event causing Drag.protected void changeSelection(DefaultMutableTreeNode child)
JTree
to the passed in
parameterchild
- Its a DefaultMutableTreeNode
to which
the selection is to be changed.protected void addArrayElementsToTree(DDClassField obj) throws EBufException
DDClassField
to JTree
obj
- Object of DDClassField
whose elements
are to be added as nodes to JTree
EBufException
- JAVAPCM's exception is thrown.protected void addArrayElementsToTree(DefaultMutableTreeNode parent, DDClassField obj) throws EBufException
DDClassField
to JTree
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.parent
- A DefaultMutableTreeNode
to which the
elements are to be added.obj
- Object of DDClassField
whose elements
are to be added as nodes to JTree
EBufException
- JAVAPCM's exception is thrown.public void removeElement(DefaultMutableTreeNode nodeToBeDeleted)
DDClass
and DDClassField
.nodeToBeDeleted
- A DefaultMutableTreeNode
that is be removed from JTress
protected boolean isNodeRemovable(DefaultMutableTreeNode node)
DDClass
.node
- DefaultMutableTreeNode
that is to be removed or
deleted from the DDClass
. true
if the node is removable; False
otherwise.public boolean isThisASubClass()
DDClass
is a subclass or not. true
if this DDClass
is
a subclass; False
otherwise.public boolean canDrop()
Copyright © 2003, 2023, Oracle and/or its affiliates.