Package DisplayProject

Examples of DisplayProject.DisplayNode$qq_Resolver


        DisplayNode dn = (DisplayNode)tree.getModel().getRoot();
        return (DisplayNode)dn.findRelated(obj);
    }

    public static DisplayNode find(OutlineField pOutlineField, Object pObj) {
        DisplayNode dn = (DisplayNode)pOutlineField.getRoot(true);
        return (DisplayNode)dn.findRelated(pObj);
    }
View Full Code Here


    public static DisplayNode find(ListView list, Object obj ){
        return list.findRelated(obj);
    }

    public static Array_Of_DisplayNode<DisplayNode> findAllRelated(JTree tree, Object obj) {
        DisplayNode dn = (DisplayNode)tree.getModel().getRoot();
        return dn.findAllRelated(obj);
    }
View Full Code Here

        DisplayNode dn = (DisplayNode)tree.getModel().getRoot();
        return dn.findAllRelated(obj);
    }

    public static Array_Of_DisplayNode<DisplayNode> findAllRelated(OutlineField pOutlineField, Object pObj) {
        DisplayNode dn = (DisplayNode)pOutlineField.getRoot(true);
        return dn.findAllRelated(pObj);
    }
View Full Code Here

      // If they type a key we want to match based on the nodes toString
      else if (ke.getID() == KeyEvent.KEY_TYPED) {
        Array_Of_DisplayNode<DisplayNode> nodes = this.getViewNodes();
        long currentTime = System.currentTimeMillis();
        int currentIndex = Math.max(this.getSelectedRow()-1, 0);
        DisplayNode nodeToSelect = null;
        int indexToSelect = 0;
        String strToMatch;

        // If more then 0.7 seconds has passed since the last key press.  Clear out the keys pressed.
        if (currentTime - keyScrollerLastKeyPressTime > 700) {
          keyScrollerKeysPressed = new StringBuilder(5);
        }
       
        // Record the current time and key press
        keyScrollerLastKeyPressTime = currentTime;
        keyScrollerKeysPressed.append(ke.getKeyChar());

        // Check if they keep pressing the same key
        boolean isSameKeyPress = true;
        for (int i=0; i<keyScrollerKeysPressed.length(); i++) {
          if (keyScrollerKeysPressed.charAt(i) != ke.getKeyChar()) {
            isSameKeyPress = false;
            break;
          }
        }

        // If they keep pressing the same key, then only match on the first character
        if (isSameKeyPress) {
          strToMatch = String.valueOf(ke.getKeyChar());
        }

        // Otherwise match on everything they have typed
        else {
          strToMatch = keyScrollerKeysPressed.toString();
        }

        // Start searching from our current location
        for (int i=currentIndex+1; i<nodes.size(); i++) {
          DisplayNode aNode = nodes.get(i);
          int length = strToMatch.length();
          String nodeStr = aNode.toString();

          if nodeStr != null &&
              nodeStr.length() >= length &&
              nodeStr.substring(0, length).equalsIgnoreCase(strToMatch.toString())) {
            nodeToSelect = aNode;
            indexToSelect = i+1;
            break;
          }
        }
       
        // If no match, continue searching from the start
        if (nodeToSelect == null) {
          for (int i=0; i<currentIndex; i++) {
            DisplayNode aNode = nodes.get(i);
            int length = strToMatch.length();
            String nodeStr = (aNode == null) ? null : aNode.toString();

            if nodeStr != null &&
                nodeStr.length() >= length &&
                nodeStr.substring(0, length).equalsIgnoreCase(strToMatch.toString())) {
              nodeToSelect = aNode;
View Full Code Here

                    else {
                        try {
                            rootNode = (DisplayNode)FrameworkUtils.getArrayType(mappedType).newInstance();
                        }
                        catch (InstantiationException e) {
                            rootNode = new DisplayNode();
                        }
                        catch (IllegalAccessException e) {
                            rootNode = new DisplayNode();
                        }
                        rootNode.setIsFolder(true);
                        rootNode.setIsFilled(true);
                        rootNode.setUserObject(ListView.this);
                        tableModel.setViewNodes(nodes);
View Full Code Here

            int index, // cell index
            boolean isSelected, // is the cell selected
            boolean cellHasFocus) // the list and the cell have the focus
        {
          // TF:27/03/2009:Removed lots of extra casting which is unnecessary and adds runtime overhead
          DisplayNode node = (DisplayNode)value;
          // TF:28/04/2009:The list vell renderer should always refer to the first column in the list, not the DVNodeText
          // The DVNodeText is initialised in the constructor, so there's no case where this would be null (unless explicitly
          // set later) so this code stops a valid value being displayed.
/*     
         if (node.getDVNodeText()!= null){
            String text = this.getNodeText(node);
            this._LabelText.setText(text);
          }
          // this is a unique feature of Forte ListView, if the DVNodeText is null than the 1st column is used as the node text
          // So, for example, if the node is mapped to a DisplayNode subclass which has "Name" as it's first column, then the
          // Name will appear in the text next to the icon
          else*/
          this.labelText.setText(getNodeText(node));
         
          UIutils.labelWidth(this.labelText);
          // Set float over text as the label is often truncated.  ISIS-349881.
          this.setToolTipText(this.labelText.getText());

          ImageIcon image = null;
          if (isSelected) {

            if (list.hasFocus()) {
              this.labelText.setBackground(list.getSelectionBackground());
              this.labelText.setForeground(list.getSelectionForeground());
            }
            else {
              this.labelText.setBackground(java.awt.Color.lightGray);
              this.labelText.setForeground(java.awt.Color.black);
            }
            // TF:15/8/07:Moved the selection of the icon here, because it doesn't matter
            // if we have focus or not for which icon we display
            // TF:27/03/2009:Changed this to use the inbuilt method "asIconImage" and removed obsolete logic
            if (node.getDVSelectedIcon() != null) {
              image = node.getDVSelectedIcon().asIconImage();
            }
            else if (node.getDVLargeIcon() != null) {
              image = node.getDVLargeIcon().asIconImage();
            }
            else if (node.getDVSmallIcon() != null) {
              image = node.getDVSmallIcon().asIconImage();
            }
          }
          else {
            this.labelText.setBackground(list.getBackground());
            this.labelText.setForeground(list.getForeground());
           
            if (node.getDVLargeIcon() != null) {
              image = node.getDVLargeIcon().asIconImage();
            }
            else if (node.getDVSmallIcon() != null) {
              image = node.getDVSmallIcon().asIconImage();
            }
          }
          if (image != null){
            image = new ImageIcon(image.getImage().getScaledInstance(this.imageSize, this.imageSize, Image.SCALE_DEFAULT));
            this.labelIcon.setIcon(image);
View Full Code Here

        CloneHelper.cloneClientProperties(source, target);
        return target;
    }

    public static JTree cloneJTree(JTree source) {
        DisplayNode root = clone((DisplayNode) source.getModel().getRoot(), true);
        TreeViewModel dtm = new TreeViewModel(root);
        JTree target = new JTree(dtm);
        CloneHelper.cloneComponent(source, target, new String[] {"UI", // class javax.swing.plaf.TreeUI
                "UIClassID", // class java.lang.String
                "accessibleContext", // class javax.accessibility.AccessibleContext
View Full Code Here

        CloneHelper.cloneClientProperties(source, target);
        return target;
    }

    public static JTree cloneJTree(JTree source) {
        DisplayNode root = clone((DisplayNode) source.getModel().getRoot(), true);
        TreeViewModel dtm = new TreeViewModel(root);
        JTree target = new JTree(dtm);
        CloneHelper.cloneComponent(source, target, new String[] {"UI", // class javax.swing.plaf.TreeUI
                "UIClassID", // class java.lang.String
                "accessibleContext", // class javax.accessibility.AccessibleContext
View Full Code Here

    // ----------------------
    // Accessors and Mutators
    // ----------------------
    public void setOutlineNode(DisplayNode outlineNode) {
        DisplayNode oldValue = this.outlineNode;
        this.outlineNode = outlineNode;
        this.qq_Listeners.firePropertyChange("outlineNode", oldValue, this.outlineNode);
    }
View Full Code Here

     * Assign the root node. This method is not thread-safe and should be called from the EDT, or via the RootNode pending action
     *
     * @param pRootNode
     */
    public void setRoot(DisplayNode pRootNode) {
        DisplayNode currentNode = TreeFieldCurrentNode.get(this);
        this.rootNode = pRootNode;
       
        // TF:24/06/2008:prior to setting the root node, we need to remove the expansion listener,
        // which will fire the expansion events and also redraw the columns and mark children nodes
        // as being expanded. The events shouldn't be fired as this is a programmatic change, we
View Full Code Here

TOP

Related Classes of DisplayProject.DisplayNode$qq_Resolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.