Examples of DisplayNode


Examples of net.helipilot50.stocktrade.displayproject.DisplayNode

        }
        else if (pControl != null && pControl instanceof JTable)
        {
            JTable table = (JTable)pControl;
            if (table.getModel() instanceof TableSorter) {
                DisplayNode dn = ((DisplayNode)((ArrayFieldModel)((TableSorter)table.getModel()).getTableModel()).getData().get(table.getSelectedRow()));
                params.put( "node", new ParameterHolder(dn) );
            }
            else {
                params.put( "node", new ParameterHolder(null) );
            }
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.DisplayNode

   *
   * @param parent
     * CraigM:29/07/2008.
   */
    private void checkExpand(TreePath parent) {
      DisplayNode node = (DisplayNode)parent.getLastPathComponent();
      HashMap<DisplayNode, Boolean> isOpenedStates = new HashMap<DisplayNode, Boolean>();
    ArrayList<DisplayNode> nodes = this.getNodes(node);

    for (DisplayNode aNode : nodes) {
      isOpenedStates.put(aNode, aNode.isOpened());
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.DisplayNode

     * Recursive method only to be called from {@link TreeViewWidget#checkExpand(TreePath)}
     * CraigM:29/07/2008.
     */
    @SuppressWarnings("unchecked")
  private void checkExpand(TreePath parent, HashMap<DisplayNode, Boolean> isOpenedStates) {
      DisplayNode node = (DisplayNode)parent.getLastPathComponent();

      // CraigM:29/07/2008 - We need to store all the isOpened states as when we ask a node to expand/collapse, the parent
      // nodes are automatically expanded, which overrides the correct isOpened value.
      if (isOpenedStates == null) {
        isOpenedStates = new HashMap<DisplayNode, Boolean>();
        ArrayList<DisplayNode> nodes = this.getNodes(node);
        for (DisplayNode aNode : nodes) {
          isOpenedStates.put(aNode, aNode.isOpened());
        }
      }
     
        if (node.getChildCount() > 0){
            for (Enumeration<DisplayNode> e = node.children(); e.hasMoreElements();){
                TreePath path = parent.pathByAddingChild(e.nextElement());
                checkExpand(path, isOpenedStates);
            }
        }
        // CraigM:29/07/2008 - Use the stored isOpened value
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.DisplayNode

      // override this method to get the same behaviour that forte had for its trees

        Object value = path.getLastPathComponent();
        if (value instanceof DisplayNode) {
            DisplayNode dn = (DisplayNode)value;

            if (dn.isFolder()) {
                int middleXOfKnob = bounds.x - (getRightChildIndent() - 1);
                int middleYOfKnob = bounds.y + (bounds.height / 2);

                Icon icon = null;
                if (dn.isOpened() && dn.getChildCount() > 0) {
                    icon = getExpandedIcon();
                }
                else {
                    icon = getCollapsedIcon();
                }
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.DisplayNode

            return false;
        }

        Object value = path.getLastPathComponent();
        if (value instanceof DisplayNode) {
            DisplayNode dn = (DisplayNode)value;
            if (dn.isFolder()) {
                int                     boxWidth;
                Insets                  i = tree.getInsets();

                if(getExpandedIcon() != null)
                    boxWidth = getExpandedIcon().getIconWidth();
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.DisplayNode

        if (this.outlnFldTree.getOutlineField().isControlsDisplayed()) {
            Object value = path.getLastPathComponent();

            if (value instanceof DisplayNode) {
                DisplayNode dn = (DisplayNode)value;

                if (dn.isFolder()) {
                    int middleXOfKnob = bounds.x - (getRightChildIndent() - 1);
                    int middleYOfKnob = bounds.y + (bounds.height / 2);

                    Icon icon = null;
                    if (dn.isOpened()) {
                        icon = getExpandedIcon();
                    }
                    else {
                        icon = getCollapsedIcon();
                    }
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.DisplayNode

        }
    }

    @SuppressWarnings("unchecked")
  private void checkExpand(TreePath parent){
        DisplayNode node = (DisplayNode)parent.getLastPathComponent();

        if (node.getChildCount() > 0) {

            for (Enumeration<DisplayNode> e = node.children(); e.hasMoreElements();){
                TreePath path = parent.pathByAddingChild(e.nextElement());
                checkExpand(path);
            }
        }

        if (node.getIsOpened()){
            expandPath(parent);
        } else {
          collapsePath(parent);
        }
    }
View Full Code Here

Examples of net.helipilot50.stocktrade.displayproject.DisplayNode

      // 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

Examples of net.helipilot50.stocktrade.displayproject.DisplayNode

                    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

Examples of net.helipilot50.stocktrade.displayproject.DisplayNode

      // 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
TOP
Copyright © 2018 www.massapi.com. 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.