Package net.helipilot50.stocktrade.displayproject.controls

Examples of net.helipilot50.stocktrade.displayproject.controls.ToggleField


     * 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

  @Override
  // ITC_CONV:Start:TF:25-Mar-08:Handle SkipOnTab focus traversal
  public Component getComponentAfter(Container aContainer, Component aComponent) {

    // Traversing out of an ArrayField is handled via code inside the ArrayField. CraigM 29/08/2007.
    ArrayField af = ArrayFieldCellHelper.getArrayField(aComponent);
    if (af != null && isSwingDisplayerIgnoreArrayField() == false) {
      return af; // Stay in the ArrayField
    }
    Component result = super.getComponentAfter(aContainer, aComponent);
    while (result instanceof JComponent && SkipOnTab.get((JComponent)result)) {
View Full Code Here

          }
        }
        else {
          ListSelectionModel model = getSelectionModel();
          if (!(model instanceof ReadOnlyButtonModel)) {
            this.setSelectionModel(new ReadOnlyListSelectionModel(model));
          }
        }
        this.isCalledFromSetEditable = false;
        this.firePropertyChange("editable", !editable, editable);
      }
View Full Code Here

     * Create a new toggleField that maps the java events to the forte events
     *
     * @return a new instance of a checkbox
     */
    public static JCheckBox newToggleField() {
        final JCheckBox result = new ToggleField();

        // CraigM:29/04/2008 -  If the check box is not enabled but is focusable, don't let the
        //             toggle field disabled text be hard to read.
        result.setUI(new WindowsCheckBoxUI() {
          @Override
          protected void paintText(Graphics g, AbstractButton b, Rectangle textRect, String text) {
            if (UIManager.getLookAndFeel() instanceof Win32LookAndFeel && result.isEnabled() == false && result.isFocusable()) {
              String version = System.getProperty("java.version", ".");

              // CraigM:30/04/2008 - Java1.6 uses the Button.shadow as the foreground colour on disabled check boxes.
              if (version.startsWith("1.6")) {
                Color foreground  = UIManager.getColor("Button.shadow");
                Color shadow = UIManager.getColor("Button.disabledShadow");
                UIManager.getDefaults().put("Button.shadow", SystemColor.controlText);
                UIManager.getDefaults().put("Button.disabledShadow", result.getBackground());
                super.paintText(g, b, textRect, text);
                UIManager.getDefaults().put("Button.shadow", foreground);
                UIManager.getDefaults().put("Button.disabledShadow", shadow);
              }
              else {
                Color foreground  = UIManager.getColor("Button.disabledForeground");
                Color shadow = UIManager.getColor("Button.disabledShadow");
                UIManager.getDefaults().put("Button.disabledForeground", SystemColor.controlText);
                UIManager.getDefaults().put("Button.disabledShadow", result.getBackground());
                super.paintText(g, b, textRect, text);
                UIManager.getDefaults().put("Button.disabledForeground", foreground);
                UIManager.getDefaults().put("Button.disabledShadow", shadow);
              }
            }
            else {
              super.paintText(g, b, textRect, text);
            }
          }
        });

        // added to fix ARD-32
        // The data changed flag is now set when a Chack Box is changed
        result.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
                UIutils.setDataChangedFlag((JComponent) e.getSource());
            }
        });
        result.setBackground(null);
        return result;
    }
View Full Code Here

        for (ActionListener listener : listeners){
            if (listener instanceof PrintActionListener){
                target.addActionListener(new PrintActionListener(((PrintActionListener)listener).getWindow()));
            } else
            if (listener instanceof AboutMenuListener){
                target.addActionListener(new AboutMenuListener());
            }
        }
        CloneHelper.cloneClientProperties(source, target);
        return target;
    }
View Full Code Here

        target.setMnemonic(source.getMnemonic());
        target.setAccelerator(source.getAccelerator());
        ActionListener[] listeners = source.getActionListeners();
        for (ActionListener listener : listeners){
            if (listener instanceof PrintActionListener){
                target.addActionListener(new PrintActionListener(((PrintActionListener)listener).getWindow()));
            } else
            if (listener instanceof AboutMenuListener){
                target.addActionListener(new AboutMenuListener());
            }
        }
View Full Code Here

        this.editor = editor;
       
        // Wrap the cell editor in an ArrayFieldCellEditor to handle JTable sizing issues
        // TF:04/05/2009:If we don't have an editor (eg a listview) then we don't perform this code
        if (editor != null) {
          this.setCellEditor(new ArrayFieldCellEditor(editor));
        }
    }
View Full Code Here

TOP

Related Classes of net.helipilot50.stocktrade.displayproject.controls.ToggleField

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.