Package net.helipilot50.stocktrade.displayproject.controls

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


     * 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

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

            UsageException errorVar = new UsageException("You cannot specify both Width and VisibleColumns");
            ErrorMgr.addError(errorVar);
            throw errorVar;
        }
        setForm(form);
        TextGraphic tg = GraphicFactory.newTextGraphic(text);
        if (font != null)
            tg.setFont(font);
        tg.setSize(tg.getPreferredSize());
        tg.setVisible(true);
        java.awt.Point loc = location(startX, startY);
        switch (horizAlign) {
        case Constants.TA_LEFT:
            tg.setHorizontalAlignment(JLabel.LEFT);
            break;
        case Constants.TA_RIGHT:
            tg.setHorizontalAlignment(JLabel.RIGHT);
            break;
        case Constants.TA_CENTER:
            tg.setHorizontalAlignment(JLabel.CENTER);
            break;
        default:
            tg.setHorizontalAlignment(JLabel.LEFT);

        }
        WidgetX.set(tg, loc.x);
        WidgetY.set(tg, loc.y);
        if (width > -1)
View Full Code Here

            UsageException errorVar = new UsageException("You cannot specify both Width and VisibleColumns");
            ErrorMgr.addError(errorVar);
            throw errorVar;
        }
        setForm(form);
        TextGraphic tg = GraphicFactory.newTextGraphic(text);
        if (font != null)
            tg.setFont(font);
        tg.setSize(tg.getPreferredSize());
        java.awt.Point p = location(startX, startY);
        setYPen(form, p.y);
        tg.setVisible(true);
        ColourChange.setForeground(tg, penColor);
        if (width > -1)
            Width.set(tg, width);
        else if (visibleColumns > -1)
            Width.set(tg, UIutils.pixelsToMils(UIutils.colsToPixels(visibleColumns, tg)));
        switch (horizAlign) {
        case Constants.TA_RIGHT:
            tg.setHorizontalAlignment(JLabel.RIGHT);
            WidgetX.set(tg, p.x - Width.get(tg));
            setXPen(form, WidgetX.get(tg));
            break;
        case Constants.TA_CENTER:
            tg.setHorizontalAlignment(JLabel.CENTER);
            WidgetX.set(tg, WidgetX.get(tg) + (Width.get(tg)/2));
            break;
        default:
            tg.setHorizontalAlignment(JLabel.LEFT);
            WidgetX.set(tg, p.x);
            setXPen(form, WidgetX.get(tg) + Width.get(tg));
            break;
        }
        WidgetY.set(tg, p.getY());
View Full Code Here

     * @param appData - the appData to set on the widget
     * @param text - the text of the JLabel
     * @return the newly created JLabel
     */
    public static TextGraphic newTextGraphic(Object appData, TextData text){
      TextGraphic jl = newTextGraphic(text);
      AppData.set(jl, appData);
      return jl;
    }
View Full Code Here

    public static TextGraphic newTextGraphic(TextData text, String widgetName){
      return newTextGraphic(TextData.valueOf(text), widgetName);
    }
   
    public static TextGraphic newTextGraphic(Font font){
        TextGraphic jl = newTextGraphic((String)null);
        jl.setFont(font);
        return jl;
    }
View Full Code Here

        jl.setFont(font);
        return jl;
    }

    public static TextGraphic newTextGraphic(TextData text){
        TextGraphic jl = newTextGraphic(TextData.valueOf(text));
        return jl;
    }
View Full Code Here

TOP

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

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.