Package net.helipilot50.stocktrade.displayproject

Examples of net.helipilot50.stocktrade.displayproject.GridCell


        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

            // CraigM:16/10/2008 - Size ourselves to our parent (the array column) so the component will be centered
            this.setHeightPolicy(Constants.SP_TO_PARENT);
            this.setWidthPolicy(Constants.SP_TO_PARENT);
            // TF:21/10/2008:Changed this to use grid cells to obey the width and height policies
            GridCell cell = new GridCell(gbc);
            if (comp instanceof JComponent) {
              GridCell oldCell = GridCell.get((JComponent)comp);
              cell.setWidthPolicy(oldCell.getWidthPolicy());
              cell.setHeightPolicy(oldCell.getHeightPolicy());
            }
            // this.add(comp, gbc);
            this.add(comp, cell);
        }
View Full Code Here

    }

    public Component getTableCellRendererComponent(JTable table, Object data, boolean arg2, boolean arg3, int arg4, int arg5) {
        if ((data != null)&&(data instanceof ImageData)) {
            // TF:08/03/2009:Added the following code to make the renderer clone all the properties properly.
            GridCell origCell = GridCell.get(originalPic);
            GridCell clonedCell = GridCell.get(clonedPic);
            clonedCell.setBottomMargin(origCell.getBottomMargin());
            clonedCell.setTopMargin(origCell.getTopMargin());
            clonedCell.setLeftMargin(origCell.getLeftMargin());
            clonedCell.setRightMargin(origCell.getRightMargin());
            clonedCell.setCellGravity(origCell.getCellGravity());
            clonedCell.setHeightPolicy(origCell.getHeightPolicy());
            clonedCell.setWidthPolicy(origCell.getWidthPolicy());

//            clonedPic.setSize(originalPic.getSize());
//          clonedPic.setMinimumSize(originalPic.getMinimumSize());
//          clonedPic.setPreferredSize(originalPic.getPreferredSize());
//          clonedPic.setFrameColor(originalPic.getFrameColor());
View Full Code Here

   * In Forte, the minimum size of a button is a fraction bigger than the ones
   * in Java, so we'll adjust this here.
   */
  @Override
  public Dimension getMinimumSize() {
    GridCell cell = GridField.getConstraints(this);
    Dimension d = new Dimension();

    // If we're natural or to_parent then the minimum size is
    // the UI minimum size
    // TF:8/11/07: The above rule applies only to explicit size, not parent
    // size
    // as we can actually shrink the widget if we need to.
    if (cell.getWidthPolicy() == Constants.SP_NATURAL /*
                               * ||
                               * cell.getWidthPolicy() ==
                               * Constants.SP_TO_PARENT
                               */) {
      d.width = this.getIcon().getIconWidth();
    } else if (cell.getWidthPolicy() == Constants.SP_EXPLICIT) {
      // Must be the same as the current size
      d.width = getWidth();
    } else {
      d.width = 0;
    }
    if (cell.getHeightPolicy() == Constants.SP_NATURAL /*
                               * ||
                               * cell.getHeightPolicy() ==
                               * Constants.SP_TO_PARENT
                               */) {
      d.height = this.getIcon().getIconHeight();
    } else if (cell.getHeightPolicy() == Constants.SP_EXPLICIT) {
      // Must be the same as the current size
      d.height = getHeight();
    } else {
      d.height = 0;
    }
View Full Code Here

   * must be called PRIOR to setting the size of the image.
   *
   * @param pWidthPolicy
   */
  public void setWidthPolicy(int pWidthPolicy) {
    GridCell gbc = GridField.getConstraints(this);
    gbc.setWidthPolicy(pWidthPolicy);
    if (getParent() != null) {
      getParent().invalidate();
      getParent().validate();
    }
  }
View Full Code Here

  /**
   * Get the height policy of this control
   */
  public int getWidthPolicy() {
    GridCell gbc = GridField.getConstraints(this);
    return gbc.getWidthPolicy();
  }
View Full Code Here

   * must be called PRIOR to setting the size of the image.
   *
   * @param pHeightPolicy
   */
  public void setHeightPolicy(int pHeightPolicy) {
    GridCell gbc = GridField.getConstraints(this);
    gbc.setHeightPolicy(pHeightPolicy);
    if (getParent() != null) {
      getParent().invalidate();
      getParent().validate();
    }
  }
View Full Code Here

TOP

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

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.