Examples of MultiLineTextField


Examples of DisplayProject.controls.MultiLineTextField

    public static MultiLineTextField newCharacterField(TextData value){
        return newCharacterField(value.toString());
    }
    public static MultiLineTextField newCharacterField(String value){
        MultiLineTextField characterField = newTextEditField("");
        characterField.setText(value);
        return characterField;
    }
View Full Code Here

Examples of DisplayProject.controls.MultiLineTextField

     */
    public void bind(JComponent control, ValueModel valueModel)
    {
        // Respect the document that already exists on the control, if any
        JTextComponent textControl = (JTextComponent)control;
        MultiLineTextField textArea = null;
        if (textControl instanceof MultiLineTextField) {
            textArea = (MultiLineTextField)textControl;
            // Text area is associated with valueModel so that the former can distinguish between
            // user entered text and model supplied text. Cursor is to be placed at the beginning of model
            // supplied text.
            textArea.setValueModel(valueModel);
            // Register the first PropertyChangeListener on valueModel BEFORE the DocumentAdapter has registered.
            textArea.registerPropertyChangeHandler();
        }
        if (textControl.getDocument() != null) {
          // TF:13/11/2009:LUM-48:Added the parameter to the TextDataToStringConverter to allow the use of identity comparisons when firing property change events
            Bindings.bind((JTextComponent) control,new TextDataToStringConverter(valueModel, textArea != null), textControl.getDocument(), false);
        }
        else {
          // TF:13/11/2009:LUM-48:Added the parameter to the TextDataToStringConverter to allow the use of identity comparisons when firing property change events
            Bindings.bind((JTextComponent) control,new TextDataToStringConverter(valueModel, textArea != null),false);
        }
        if (textArea != null) {
            // Register the second PropertyChangeListener on valueModel AFTER the DocumentAdapter has registered.
            textArea.registerCaratPositionHandler();
        }
    }
View Full Code Here

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

            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 {
                int offset = field.getCaretPosition()-1;
                int lRow = field.getLineOfOffset(offset);
                int lCol = offset - field.getLineStartOffset(lRow);
                params.put("row", new ParameterHolder(lRow));
                params.put("column", new ParameterHolder(lCol));
            }
            catch (BadLocationException ble) {
                Logger.getLogger(ClickListener.class).error("Bad location for text field", ble);
View Full Code Here

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

    private boolean printingRemoveScrollBars;

    public TextFieldCellRenderer(JScrollPane pScrollPane) {
      // CraigM:25/07/2008 - Force any pending actions on the widget through (like colour changes), so when we clone the widget, we get the latest info
      UIutils.processGUIActions(pScrollPane);
        MultiLineTextField tf = (MultiLineTextField)pScrollPane.getViewport().getComponent(0);

        this.sp = new JScrollPane(tf.cloneComponent());
        ArrayFieldCellHelper.setUpCellRenderer(pScrollPane, this.sp); // CraigM: 28/03/2008
        this.sp.setPreferredSize(pScrollPane.getPreferredSize());
        this.sp.setMinimumSize(pScrollPane.getMinimumSize());
        this.sp.setSize(pScrollPane.getSize());
        this.sp.setHorizontalScrollBarPolicy(pScrollPane.getHorizontalScrollBarPolicy());
View Full Code Here

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

                this.getMultiLineTextField().setBackgroundTemporarily(SystemColor.window);
            }
        }
       
        if (this.isPrinting && this.sp.getViewport().getComponentCount() > 0) {
          MultiLineTextField tf = this.getMultiLineTextField();
        sp.setSize(tf.getPreferredSize());
        sp.setMinimumSize(tf.getPreferredSize());
        sp.setPreferredSize(tf.getPreferredSize());
       
        if (printingRemoveScrollBars) {
          sp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
          sp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
        }
View Full Code Here

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

     */
    public BufferedImage getImage(int width) {
    int height = this.sp.getMinimumSize().height;
    // TF:27/11/2009:Changed this to use the passed width
//    int width = this.sp.getMinimumSize().width;
        MultiLineTextField tf = (MultiLineTextField)this.sp.getViewport().getComponent(0);

    if (this.spPainter == null) {
      MultiLineTextField newTF = TextEditFactory.newTextField("painter", tf.getRows(), tf.getColumns());
        this.spPainter = new JScrollPane(newTF);
        this.spPainter.setHorizontalScrollBarPolicy(this.sp.getHorizontalScrollBarPolicy());
        this.spPainter.setVerticalScrollBarPolicy(this.sp.getVerticalScrollBarPolicy());
        newTF.setForeground(tf.getForeground());
        newTF.setBackground(tf.getBackground());
      }
   
    return ArrayFieldCellHelper.createBufferedImage(this.spPainter, width, height);
    }
View Full Code Here

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

       
        // --------------------------------------------------------------------
        // Expand text fields
        // --------------------------------------------------------------------
        else if (comp instanceof MultiLineTextField) {
          MultiLineTextField tf = (MultiLineTextField)comp;
         
          if (tf.getParent() != null && tf.getParent().getParent() instanceof JScrollPane) {
            JScrollPane sp = (JScrollPane)tf.getParent().getParent();
            sp.setSize(tf.getPreferredSize());
            sp.setMinimumSize(tf.getPreferredSize());
            sp.setPreferredSize(tf.getPreferredSize());

            if (removeScrollBars) {
                    sp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
                    sp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
                }
          }
            Container parent = tf.getParent();

            while (parent != null) {
                if (parent instanceof JFrame) {
                    ((JFrame)parent).validate();
                    ((JFrame)parent).pack();
View Full Code Here

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

     */
    public void bind(JComponent control, ValueModel valueModel)
    {
        // Respect the document that already exists on the control, if any
        JTextComponent textControl = (JTextComponent)control;
        MultiLineTextField textArea = null;
        if (textControl instanceof MultiLineTextField) {
            textArea = (MultiLineTextField)textControl;
            // Text area is associated with valueModel so that the former can distinguish between
            // user entered text and model supplied text. Cursor is to be placed at the beginning of model
            // supplied text.
            textArea.setValueModel(valueModel);
            // Register the first PropertyChangeListener on valueModel BEFORE the DocumentAdapter has registered.
            textArea.registerPropertyChangeHandler();
        }
        if (textControl.getDocument() != null) {
          // TF:13/11/2009:LUM-48:Added the parameter to the TextDataToStringConverter to allow the use of identity comparisons when firing property change events
            Bindings.bind((JTextComponent) control,new TextDataToStringConverter(valueModel, textArea != null), textControl.getDocument(), false);
        }
        else {
          // TF:13/11/2009:LUM-48:Added the parameter to the TextDataToStringConverter to allow the use of identity comparisons when firing property change events
            Bindings.bind((JTextComponent) control,new TextDataToStringConverter(valueModel, textArea != null),false);
        }
        if (textArea != null) {
            // Register the second PropertyChangeListener on valueModel AFTER the DocumentAdapter has registered.
            textArea.registerCaratPositionHandler();
        }
    }
View Full Code Here

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

    private TextEditFactory() {
        super();
    }
    public static MultiLineTextField newTextField(String name, int rows, int columns){
        // Switched to use MultiLineTextField.  CraigM: 17/01/2008.
        final MultiLineTextField ta = new MultiLineTextField(name, rows, columns);
        // TF:12/12/2008:Word wrap is off by default in a text edit field
        ta.setLineWrap(false);
        ta.setWrapStyleWord(false);
        //PM:12/10/07 moved to constuctor
        //ta.setDisabledTextColor(SystemColor.windowText);
        ta.setFont(getDefaultFont());

        // TF:26/9/07:Default the color to transparent (inherit)
        //ta.setBackground(null); PM:30/10/07 not sure this is correct

        return ta; //PM:18/1/08 changed to return MultiLineTextField in place of a JTextArea
View Full Code Here

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

        Container parent,
        int row,
        TextData textValue,
        int visibleLines,
        int widthPolicy) {
      final MultiLineTextField ta = new MultiLineTextField();
      AppData.set(ta, appData);
      Column.set(ta, column);
      FieldWidgetGravity.set(ta, gravity);
      ta.setWrapStyleWord(hasWordWrap);
      MaxCharacters.set(ta, maxCharacters);
      ta.setMinimumSize(new Dimension(minWidthInPixels, ta.getMinimumSize().height));
      Row.set(ta, row);
      WidthPolicy.set(ta, widthPolicy);
      VisibleLines.set(ta, visibleLines);
      TextValue.set(ta, textValue);
      Parent.set(ta, parent);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.