Package net.helipilot50.stocktrade.displayproject.controls

Examples of net.helipilot50.stocktrade.displayproject.controls.OutlineField$VisibleRows


     * rows is more than the passed value, the number of rows will be
     * set to the number of rows used. This method is thread-safe and may be
     * called on or off the GUI thread
     */
    public void setRows(final int pRows) {
        ActionMgr.addAction(new PendingAction(null) {
            @Override
            public String toString() {
                return GridField.this.getName() + ".setRows(" + pRows + ")";
            }
            @Override
View Full Code Here


     * columns is more than the passed value, the number of columns will be
     * set to the number of columns used. This method is thread-safe and may be
     * called on or off the GUI thread
     */
    public void setColumns(final int pColumns) {
        ActionMgr.addAction(new PendingAction(null) {
            @Override
            public String toString() {
                return GridField.this.getName() + ".setColumns(" + pColumns + ")";
            }
            @Override
View Full Code Here

        // TF:8/8/07:Made a shallow clone in case there is a really big object attached to the list element
        Array_Of_ListElement<ListElement> clonedList = CloneHelper.clone(les, false);
        Object currentValue = this.list.getValue();
        ListElement valueToReselect = null;
        if (currentValue instanceof ListElement && clonedList != null && this.list.getSelectionHolder() instanceof TypeAwareValueModel) {
          TypeAwareValueModel tavm = (TypeAwareValueModel)this.list.getSelectionHolder();
          // We need to find an item in the new list which is the same as an item in the old list,
          // depending on the type being considered. For example, if the list is mapped to an int,
          // we need to find an element in the new list with the same IntegerValue.
          Class<?> clazz = tavm.getValueType();
          ListElement currentSelection = (ListElement)currentValue;
          for (ListElement item : clonedList) {
            if (clazz.equals(Integer.TYPE) ||
                clazz.equals(Short.TYPE) ||
                NumericData.class.isAssignableFrom(clazz) ||
View Full Code Here

      }
      else if (list.getSelectionHolder() == null) {
        requiresDefault = true;
      }
      else {
        ValueModel model = list.getSelectionHolder();
        if (model instanceof TypeAwareValueModel) {
          if (DataValue.class.isAssignableFrom(((TypeAwareValueModel)model).getValueType())) {
            requiresDefault = false;
          }
          else {
            requiresDefault = true;
          }
        }
        else {
          requiresDefault = (model.getValue() == null);
        }
      }
      if (requiresDefault) {
        // TF:05/11/2008:Fixed this up so it actually sets the underlying model
        getSelectionModel().setSelectionInterval(0, 0);
View Full Code Here

        // Set nodes and rows and columns on relevant controls

        if (pControl != null && pControl instanceof OutlineFieldJTree) {
            OutlineFieldJTree tree = (OutlineFieldJTree)pControl;
            OutlineField control = (OutlineField)tree.getOutlineField();

            // TF:27/9/07:Made the row and column 1-based indexes instead of 0-based and used Craig's new method. We need to translate
            // the X-offset by the amount the tree is indented.
            params.put("column", new ParameterHolder(control.getColumnIndex(X + OutlineField.cHEADER_MARGIN_LEFT) + 1));
            params.put( "node", new ParameterHolder(((OutlineFieldJTree)pControl).getLastSelectedPathComponent()) );
            params.put( "row", new ParameterHolder(((OutlineFieldJTree)pControl).getRowForLocation(X, Y)+1) ); //CONV_REM: dc - added row parameter

        }
        else if (pControl != null && pControl instanceof JListView) {
            params.put( "node", new ParameterHolder(((JListView)pControl).getCurrentNode()) );
            params.put( "row", new ParameterHolder(0) );
            params.put( "column", new ParameterHolder(0) );
        }
        else if (pControl != null && pControl instanceof ListView) {
            ListView list = (ListView)pControl;
            params.put( "node", new ParameterHolder(((ListView)pControl).getCurrentNode()) );
            // TF:27/9/07:Made the row and column 1-based indexes instead of 0-based
            // TF:26/3/08:getSelectedRow has changed to be 1-based itself, so we need to change this back to remove the +1
            params.put( "row", new ParameterHolder(list.getSelectedRow()));
//            qq_Params.put( "column", new ParameterHolder(0) );
            params.put( "column", new ParameterHolder(list.getTable().getSelectedColumn()+1) );//CONV_REM:dq Need the column that was selected, not a 0.
        }
        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) );
            }
            // TF:23/9/07:We need to return the X and Y coordinates with respect to the cell, not the table. Also, we need
            // to change the child to the renderer or editor for that cell.
            Point loc = new Point(X, Y);
            int row = table.rowAtPoint(loc);
            int column = table.columnAtPoint(loc);
            // TF:27/9/07:Made the row and column 1-based indexes instead of 0-based
            params.put( "row", new ParameterHolder(row+1) );
            params.put( "column", new ParameterHolder(column+1) );

            // make sure we have a valid cell, just in case they click outside the table, eg in the empty scroll pane.
            if (row >= 0 && column >= 0) {
                Rectangle cellBounds = table.getCellRect(row, column, false);
                X -= cellBounds.x;
                Y -= cellBounds.y;

                TableCellRenderer renderer = table.getCellRenderer(row, column);
                if (renderer != null) {
                    Component c = renderer.getTableCellRendererComponent(table, table.getValueAt(row, column), false, false, row, column);
                    params.put("child", new ParameterHolder(c));
                }
            }
        }
        else if (pControl != null && pControl instanceof JTree)
        {
          JTree tree = (JTree) pControl;
            int currentRow = getRowForLocation(Y, tree);
            // TF:27/9/07:Made the row and column 1-based indexes instead of 0-based
            params.put( "row", new ParameterHolder(currentRow+1) );
            TreePath path = tree.getPathForRow(currentRow);
            if (path != null) {
              params.put("node", new ParameterHolder(path.getLastPathComponent()));
            }
            else {
              params.put("node", new ParameterHolder(null));
            }
        }
        else if (pControl instanceof OutlineField) {
          OutlineField outlineField = (OutlineField) pControl;
            int currentRow = getRowForLocation(Y, outlineField.getTree());
            TreePath path = outlineField.getTree().getPathForRow(currentRow);
            if (path != null) {
              params.put("node", new ParameterHolder(path.getLastPathComponent()));
            }
            else {
              params.put("node", new ParameterHolder(null));
            }
            // TF:27/9/07:Made the row and column 1-based indexes instead of 0-based, plus used Craig's new method
            params.put("row", new ParameterHolder(currentRow+1));
            params.put("column", new ParameterHolder(outlineField.getColumnIndex(X + OutlineField.cCOLUMN_SPACING)+1));
            params.put("sizes", new ParameterHolder(outlineField.getColumnSizes()));
            params.put("spacing", new ParameterHolder(OutlineField.cCOLUMN_SPACING));
        }
        else if (pControl instanceof MultiLineTextField){
            MultiLineTextField field = (MultiLineTextField)pControl;
            try {
View Full Code Here

                  titleSetNum = defaultSet;
                }
                lv.loadColumnHeadings(titleSetNum, mcat);
              }
              else if (comp instanceof OutlineField) {
                OutlineField of = (OutlineField)comp;
                of.setDefaultSet(defaultSet, mcat);
              }
              else if (comp instanceof JTable) {
                JTable jt = (JTable) comp;
                ArrayColumnModel acm = (ArrayColumnModel) jt.getColumnModel();
                for (int col = 0; col < acm.allColumns.size(); col++) {
View Full Code Here

      } else {
        info.setSourceDataType(Constants.SD_FIELDWIDGET);
        info.setSourceData(c);
      }
    } else if (c instanceof JTree){
      OutlineField olf = (OutlineField)c.getClientProperty("qq_OutlineField");
      info.setSourceDataType(Constants.SD_NODE);
      if (olf != null){
        info.setSourceData(olf.getCurrentNode());
        info.setSourceField(olf);
      } else {
        info.setSourceData(TreeFieldCurrentNode.get((JTree)c));
      }
    } else if (c instanceof PictureField){
View Full Code Here

            JTableHeader header = lv.getTable().getTableHeader();
            if (header != null){
                header.setFont(this.value);
            }
        } else if (this._component instanceof OutlineField){
            OutlineField of = (OutlineField)this._component;
            of.setTitleFont(this.value);
        }
        if (this._component.isValid())
            this._component.invalidate();
    }
View Full Code Here

    public static void insert(Component pComponent, DisplayNode parent, DisplayNode kid, int index){
            ActionMgr.addAction(new NodeInsert(pComponent, parent, kid, index));
    }
    public void performAction() {
        if (this._component instanceof OutlineField) {
            OutlineField of = (OutlineField)this._component;
            of.getModel().insertNodeInto(kid, parent, index);
            of.getTree().expandPath(new TreePath(of.getModel().getPathToRoot(parent)));
        }else if (this._component instanceof JTree){
            JTree jt = (JTree)this._component;
            DefaultTreeModel tm = ((TreeViewModel)jt.getModel());
            tm.insertNodeInto(kid, parent, index);
View Full Code Here

     * Ths method crates an OutlineField with the Array of Columns
     * @param name
     * @param columns
     */
    public static OutlineField newOutlineField(String name, Array_Of_OutlineColumnDesc<OutlineColumnDesc> columns) {
        OutlineField olf = new OutlineField();
        olf.setName(name);
        olf.setColumnList(columns);
        return olf;
    }
View Full Code Here

TOP

Related Classes of net.helipilot50.stocktrade.displayproject.controls.OutlineField$VisibleRows

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.