Package net.helipilot50.stocktrade.displayproject

Examples of net.helipilot50.stocktrade.displayproject.OutlineColumnDesc


        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


        this.editor = new BorderedComboBoxEditor();
        this.setEditor(this.editor);
        this.setRenderer(new BorderedComboBoxRenderer());
        JTextComponent comp = (JTextComponent)this.editor.getEditorComponent();
        comp.setBackground(this.getBackground());
        comp.setDocument(new FixedLengthDocument(0));

        comp.addKeyListener(new ComboBoxKeyHandler());
    }
View Full Code Here

            }
            if (autoComplete) {
                editComponent.setDocument(new FillinManagementDocument(this, showDropdowns, listEntriesOnly, maxCharacters));
            }
            else {
                editComponent.setDocument(new FixedLengthDocument(maxCharacters));
            }
        }
    }
View Full Code Here

        target.setPreferredSize(source.isPreferredSizeSet() ? source.getPreferredSize() : null);
        target.setMinimumSize(source.isMinimumSizeSet() ? source.getMinimumSize() : null);
        target.setMaximumSize(source.isMaximumSizeSet() ? source.getMaximumSize() : null);
       
        if (source instanceof JComponent) {
          GridCell orig = GridCell.getExisting((JComponent)source);
          if (orig != null) {
            GridCell cell = GridCell.get((JComponent)target);
            cell.setWidthPolicy(orig.getWidthPolicy());
            cell.setHeightPolicy(orig.getHeightPolicy());
          }
          // TF:03/11/2008:We need to clone specific client properties too, otherwise some things won't work.
          ArrayFieldCellHelper.cloneComponentArrayParts((JComponent)source, (JComponent)target);
        }
    }
View Full Code Here

                    ((TitledBorder) border).setTitle("");
                }
            } else {
                if (pCaption != null) {
                    // TitledBorder tb = BorderFactory.createTitledBorder(border, caption.toString(), TitledBorder.LEFT, TitledBorder.TOP);
                    TitledBorder tb = new GridTitledBorder(border, caption.toString(), TitledBorder.LEFT, TitledBorder.TOP);
                    if (this.captionFont != null) {
                        tb.setTitleFont(this.captionFont);
                    }
                    setBorder(tb);
                }
            }
        } else {
          GridTitledBorder gridBorder;
            if (pCaption != null) {
              gridBorder = new GridTitledBorder(pCaption.toString());
            } else {
              gridBorder = new GridTitledBorder("");
            }
            if (this.captionFont != null) {
              gridBorder.setTitleFont(this.captionFont);
            }
            setBorder(gridBorder);
        }
    }
View Full Code Here

            // Add new labels header labels
            int columnCounter = 0;
            int lastVisibleColumn = this.getLastVisibleColumn();
            boolean isFirstVisible = true;
            for (int i=0; i<this.columns.size(); i++) {
                OutlineColumnDesc colDec = (OutlineColumnDesc)this.columns.get(i);
                if (colDec.getState() != Constants.FS_INVISIBLE) {
                  String columnName = colDec.getTitle().asString();
                  gbc = new GridBagConstraints();

                  // CraigM:16/12/2008 - Cater for the fact that the control space pad is on the right of the first column
                  if (isFirstVisible) {
                    gbc.gridx = 0;
                    isFirstVisible = false;
                  }
                  else {
                    gbc.gridx = columnCounter+1;
                  }
                  gbc.gridy = 0;

                  // The last label fills up the rest of the space
                  if (i == lastVisibleColumn) {
                    gbc.weightx = 1;
                  }
                  gbc.anchor = GridBagConstraints.WEST;
                  gbc.insets = new Insets(0,0,0,OutlineField.cCOLUMN_SPACING); // Put a gap between the columns

                  JLabel headerLabel = new JLabel(columnName);
                  if (this.titleFont != null){
                      headerLabel.setFont(this.titleFont);
                  }
                  // Set the column alignment
                  switch (colDec.getAlignment()) {
                      case Constants.TA_RIGHT:
                          headerLabel.setHorizontalAlignment(SwingConstants.RIGHT);
                          break;
                      case Constants.TA_CENTER:
                          headerLabel.setHorizontalAlignment(SwingConstants.CENTER);
View Full Code Here

        }

        // Loop through each column
        int columnCounter = 0;
        for (int i=0; i<this.columns.size(); i++) {
            OutlineColumnDesc colDesc = (OutlineColumnDesc)this.columns.get(i);
            if (colDesc.getState() != Constants.FS_INVISIBLE) {
              // If they have a fixed width, then it's easy
              if (colDesc.getSizePolicy() == Constants.FP_FIXED) {
                  // CraigM:02/07/2008 - Make sure the header is still fully visible (Forte did this)
                  this.columnSizes[i] = Math.max(this.headerLabelSizes[i], (int)(OUTLINE_AVG_CHAR_SCALING_FACTOR * UIutils.colsToPixels(colDesc.getMaxCharacters(), this)));
              }
 
              // Otherwise we need to look at the data in the columns to work out the size
              else {
                  if (this.showHeader) {
View Full Code Here

            // Work out what is our first indented column. It's the one with the firstIndent property
            // set true, or the first one after that if that column is invisible.
            Array_Of_OutlineColumnDesc<OutlineColumnDesc> columnList = this.parent.getColumnList(false);
            boolean found = false;
            for (int col=0; col<columnList.size(); col++) {
                OutlineColumnDesc colDec = columnList.get(col);
                if (colDec.getIsFirstIndent()) {
                    found = true;
                }
                if (colDec.getState() != Constants.FS_INVISIBLE && found) {
                  firstIndentCol = col;
                  break;
                }
            }

            // Layout the data into a grid, setting the correct width of each data item to
            // match the column width.
            int col = 0;
            for (int realCol=0; realCol<columnList.size(); realCol++) {
              OutlineColumnDesc colDec = columnList.get(realCol);
              if (colDec.getState() != Constants.FS_INVISIBLE) {
                  Object data = this.parent.getData((DisplayNode)value,realCol);
                  this.parent.setJLabel(data, this.cachedJLabels[col]);
 
                  // Set the column alignment
                  switch (colDec.getAlignment()) {
                      case Constants.TA_RIGHT:
                          this.cachedJLabels[col].setHorizontalAlignment(SwingConstants.RIGHT);
                          break;
                      case Constants.TA_CENTER:
                          this.cachedJLabels[col].setHorizontalAlignment(SwingConstants.CENTER);
View Full Code Here

      if (this.table.getDragEnabled() && col.isVisible()) {
        state = Constants.FS_DRAG;
      }

      // TF:19/06/2008:Split this out to a separate method
        OutlineColumnDesc desc = new OutlineColumnDesc(col.getAlignment(),
                false,
                false,
                // TF:19/06/2008:The max characters actually reflects the current width
                //col.getMaxCharacters(),
                UIutils.pixelsToCols((int)(col.getWidth() / UIutils.FORTE_COLUMNS_SCALING_FACTOR), this.table),
                col.getName(),
                col.getSizePolicy(),
                state,
                (String)col.getHeaderValue(),
                col.getTitleMsgNumber());
        desc.setActualWidth(col.getWidth());
       
        if (pSetArrayColLink) {
          desc.setArrayColumn(col);
        }
       
        return desc;
    }
View Full Code Here

        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
                "actionMap", // class javax.swing.ActionMap
View Full Code Here

TOP

Related Classes of net.helipilot50.stocktrade.displayproject.OutlineColumnDesc

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.