Package DisplayProject

Examples of DisplayProject.DisplayNode$qq_Resolver


    public TextData getFred() {
        return this.fred;
    }

    public void setAListView(DisplayNode aListView) {
        DisplayNode oldValue = this.getAListView();
        this.getqq_aListView().setRootNode(aListView);
        this.qq_Listeners.firePropertyChange("AListView", oldValue, aListView);
    }
View Full Code Here


        }
        return bindingManager;
    }

    public void setTv(DisplayNode tv) {
        DisplayNode oldValue = this.tv;
        this.tv = tv;
        RootNode.set(this.getqq_tv(), tv);
        this.qq_Listeners.firePropertyChange("tv", oldValue, this.tv);
    }
View Full Code Here

    /**
     * display<p>
     * <p>
     */
    public void display() {
        this.setTv(new DisplayNode(new TextData("ROOT"), true, true, true, DisplayNode.qq_Resolver.cDVNODETEXT_ISFILLED_ISFOLDER_ISOPENED));

        DisplayNode dn1 = new DisplayNode(new TextData("Folder"), true, true, true, DisplayNode.qq_Resolver.cDVNODETEXT_ISFILLED_ISFOLDER_ISOPENED);
        dn1.setParent(this.getTv());

        DisplayNode dn2 = new DisplayNode(new TextData("Child"), false, DisplayNode.qq_Resolver.cDVNODETEXT_ISFOLDER);
        dn2.setParent(dn1);

        this.getqq_tv().setDraggableFoldersIgnoreDoubleClick(true);

        UserWindow.open(this);
        // ----------
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

      // TF:26/07/2009:forced this onto the GUI thread
      ActionMgr.addAction(new PendingAction(null) {
        @Override
        public void performAction() {
              try {
                DisplayNode nodeToSet = pCurrentNode;
                // TF:29/07/2010:Fixed an issue from DaveC if the passed node is not found in the listview then the
                // first row in the table should be selected
                if (nodeToSet != null && tableModel.getRowIndex(nodeToSet) < 0 && tableModel.getSize() > 0) {
                  nodeToSet = tableModel.getRow(0);
                }
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

     * 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

    /**
     * Method to recalculate how wide each column should be
     */
    private void calculateColumnWidths() {
        DisplayNode[] nodes = null;
        DisplayNode root = this.getRoot(false);

        this.columnSizes = new int[this.headerLabels.length];

        if (root != null) {

            if (this.tree.isRootVisible()) {
                nodes = new DisplayNode[1];
                nodes[0] = root;
            }
            else {
                nodes = new DisplayNode[(root == null) ? 0 : root.getChildCount()];

                for (int i=0; i<nodes.length; i++) {
                    if (root != null)
                        nodes[i] = (DisplayNode)root.getChildAt(i);
                }
            }
        }

        // Loop through each column
View Full Code Here

     * @param pNode
     */
    public void nodeAdded(DisplayNode pNode) {
        int depthLevel = 0;
        boolean requiresRedraw = false;
        DisplayNode tmp = (DisplayNode)pNode.getParent();

        // Expand the parent if necessary
        if (tmp!= null && tmp.isOpened() && this.tree.isExpanded(new TreePath(tmp)) == false) {
            this.tree.expandPath(new TreePath(tmp.getPath()));
        }

        // Calculate the depth
        while (tmp != null) {
            tmp = (DisplayNode)tmp.getParent();
            depthLevel++;
        }

        if (isRootDisplayed() == false) {
            depthLevel--;
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.