Package DisplayProject.controls

Examples of 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


            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

     */
    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

TOP

Related Classes of DisplayProject.controls.MultiLineTextField

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.