Statistics
| Revision:

root / branches / v10 / applications / appgvSIG / src / com / iver / cit / gvsig / gui / layout / fframes / FFrameText.java @ 20910

History | View | Annotate | Download (23.9 KB)

1
/*
2
 * Created on 22-jun-2004
3
 *
4
 */
5
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
6
 *
7
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
22
 *
23
 * For more information, contact:
24
 *
25
 *  Generalitat Valenciana
26
 *   Conselleria d'Infraestructures i Transport
27
 *   Av. Blasco Ib??ez, 50
28
 *   46010 VALENCIA
29
 *   SPAIN
30
 *
31
 *      +34 963862235
32
 *   gvsig@gva.es
33
 *      www.gvsig.gva.es
34
 *
35
 *    or
36
 *
37
 *   IVER T.I. S.A
38
 *   Salamanca 50
39
 *   46005 Valencia
40
 *   Spain
41
 *
42
 *   +34 963163400
43
 *   dac@iver.es
44
 */
45
package com.iver.cit.gvsig.gui.layout.fframes;
46

    
47
import java.awt.BasicStroke;
48
import java.awt.Color;
49
import java.awt.Component;
50
import java.awt.Font;
51
import java.awt.Graphics2D;
52
import java.awt.font.FontRenderContext;
53
import java.awt.font.TextLayout;
54
import java.awt.geom.AffineTransform;
55
import java.awt.geom.Rectangle2D;
56
import java.awt.geom.Rectangle2D.Double;
57
import java.awt.image.BufferedImage;
58
import java.util.ArrayList;
59

    
60
import javax.swing.JOptionPane;
61

    
62
import com.iver.andami.PluginServices;
63
import com.iver.cit.gvsig.gui.layout.Layout;
64
import com.iver.cit.gvsig.project.documents.exceptions.SaveException;
65
import com.iver.cit.gvsig.project.documents.layout.FLayoutUtilities;
66
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame;
67
import com.iver.utiles.StringUtilities;
68
import com.iver.utiles.XMLEntity;
69

    
70

    
71
/**
72
 * FFrame para introducir un texto en el Layout.
73
 *
74
 * @author Vicente Caballero Navarro
75
 */
76
public class FFrameText extends FFrame {
77
    /** Localizaci?n del texto. */
78
    public static final int LEFT = 0;
79
    public static final int CENTER = 1;
80
    public static final int RIGTH = 2;
81
    private ArrayList m_text = new ArrayList();
82
    private boolean m_isFixed = false;
83
    private int m_pos = LEFT;
84
    private Color textColor = Color.BLACK;
85

    
86
    //jaume
87
    private boolean surrounded = false; // The text field is surrounded by a rectangle
88
    private double cellPadding = 0; // The gap between the the text field and the surrounding rectangle
89
    private boolean fixedFontSize = false; // The text field font size is constant fixed to the folio's size
90
    private int fontSize; // Text field's font size
91
    private boolean hasTitle; // The text field has title
92
    private String title; // The text for the title
93
    private int titleSize; // The title's font size
94
    private double frameBorderSize = 0; // The surrounding rectangle's border size
95
    private Color frameColor = Color.BLACK; // The surrounding rectangle's color
96
    private Color titleColor = Color.BLACK; // The title's color
97
    private Font m_f = null;
98
    private boolean transicionPixelsMilimetros = true;
99

    
100
    /**
101
     * Crea un nuevo FFrameText.
102
     */
103
    public FFrameText() {
104
        m_f = new Font("SansSerif", Font.PLAIN, 9);
105
    }
106

    
107
    /**
108
     * Inserta la fuente del texto.
109
     *
110
     * @param f Fuente del texto.
111
     */
112
    public void setFont(Font f) {
113
        m_f = f;
114
    }
115

    
116
    /**
117
     * Devuelve el color del texto del FFrameText.
118
     *
119
     * @return Color del texto.
120
     */
121
    public Color getTextColor() {
122
        return textColor;
123
    }
124

    
125
    /**
126
     * Obtiene el fixedFontSize
127
     *
128
     * @return boolean
129
     */
130
    public boolean isFontSizeFixed() {
131
        return fixedFontSize;
132
    }
133

    
134
    /**
135
     * Establece fixedFontSize
136
     *
137
     * @param fixedFontSize
138
     */
139
    public void setFixedFontSize(boolean fixedFontSize) {
140
        this.fixedFontSize = fixedFontSize;
141
    }
142

    
143
    /**
144
     * Obtiene el fontSize
145
     *
146
     * @return int
147
     */
148
    public int getFontSize() {
149
        return fontSize;
150
    }
151

    
152
    /**
153
     * Establece fontSize
154
     *
155
     * @param fontSize
156
     */
157
    public void setFontSize(int fontSize) {
158
        this.fontSize = fontSize;
159
    }
160

    
161
    /**
162
     * Obtiene el cellPadding
163
     *
164
     * @return int
165
     */
166
    public double getCellPadding() {
167
        return cellPadding;
168
    }
169

    
170
    /**
171
     * Inserta el color del texto a escribir.
172
     *
173
     * @param color Color del texto.
174
     */
175
    public void setTextColor(Color color) {
176
        textColor = color;
177
    }
178

    
179
    /**
180
     * Devuelve la fuente del texto.
181
     *
182
     * @return Fuente del texto.
183
     */
184
    public Font getFont() {
185
        return new Font(m_f.getFontName(), m_f.getStyle(), 9);
186
    }
187

    
188
    /**
189
     * Devuelve la posici?n izquierda, centro o derecha del texto.
190
     *
191
     * @return Posici?n del texto.
192
     */
193
    public int getPos() {
194
        return m_pos;
195
    }
196

    
197
    /**
198
     * Pone la posici?n izquierda, centro o derecha del texto.
199
     *
200
     * @param p 0=LEFT,1=CENTER,2=RIGTH.
201
     */
202
    public void setPos(int p) {
203
        m_pos = p;
204
    }
205

    
206
    /**
207
     * M?todo que dibuja sobre el graphics que se le pasa como par?metro, seg?n
208
     * la transformada afin que se debe de aplicar y el rect?ngulo que se debe
209
     * de dibujar.
210
     *
211
     * @param g Graphics
212
     * @param at Transformada af?n.
213
     * @param rv rect?ngulo sobre el que hacer un clip.
214
     * @param imgBase Imagen para acelerar el dibujado.
215
     */
216
    public void draw(Graphics2D g, AffineTransform at, Rectangle2D rv,
217
        BufferedImage imgBase) {
218
        g.setColor(Color.BLACK);
219

    
220
        Rectangle2D.Double rec = getBoundingBox(at);
221
        Rectangle2D.Double raux = (Rectangle2D.Double) rec.clone();
222
        g.rotate(Math.toRadians(getRotation()), raux.x + (raux.width / 2),
223
            raux.y + (raux.height / 2));
224

    
225
        int longmax = 1;
226

    
227
        if (intersects(rv, raux)) { // comprueba que no cae fuera de la pantalla
228

    
229
            if (m_text.isEmpty()) {
230
                drawEmpty(g);
231
            } else {
232
                for (int i = 0; i < m_text.size(); i++) {
233

    
234
                        if (m_text.get(i) == null) {
235
                        m_text.set(i, "<NULL>");
236
                    }
237
                                         String text=(String)m_text.get(i);
238
                    if (text.length() > longmax) {
239
                        longmax = text.length();
240
                    }
241
                }
242

    
243
                FontRenderContext frc = g.getFontRenderContext();
244
                int scaledFontSize;
245

    
246
                // TODO myScale es la escala sobre la que se extraen todos los escalados. Esto
247
                // funciona bien tal cual est? si la ratio de aspecto (alto/ancho) del folio es constante
248
                // porque se toma como medidas el ancho del folio real y el ancho del folio en pantalla.
249
                // No se que pasar? si la ratio cambia, por ejemplo si se usan USLetter en lugar de DIN A4
250
                double myScale = at.getScaleX() * 0.0234; //FLayoutUtilities.fromSheetDistance(folio.getAncho(),at)/rv.getWidth();
251

    
252
                // Distinguish when the font has fixed size or not
253
                if (isFontSizeFixed()) {
254
                    scaledFontSize = (int) (myScale * fontSize);
255
                } else {
256
                    scaledFontSize = ((int) (raux.width)) / longmax;
257

    
258
                    if (scaledFontSize > (int) ((raux.height) / m_text.size())) {
259
                        scaledFontSize = (int) ((raux.height) / m_text.size());
260
                    }
261
                }
262

    
263
                if (m_f != null) {
264
                    // Aqu? se ajusta a partir de las caracter?sticas de la fuente, una nueva fuente con el tama?o ajustado.
265
                    m_f = new Font(m_f.getFontName(), m_f.getStyle(),
266
                            scaledFontSize);
267
                } else {
268
                    // Aqu? pasa cuando se abre el di?logo para seleccionar un tipo de fuente y se cierra sin haber seleccionado ninguna.
269
                    m_f = new Font("SansSerif", Font.PLAIN, scaledFontSize);
270
                }
271

    
272
                // Draw the text title if it exists
273
                if (hasTitle()) {
274
                    int scaledTitleFontSize = (int) (myScale * titleSize);
275
                    int gap = 3;
276

    
277
                    if (isSurrounded()) {
278
                        // Para evitar que el marco se pinte sobre el t?tulo
279
                        gap += (int) (FLayoutUtilities.fromSheetDistance(frameBorderSize,
280
                            at) * myScale);
281
                    }
282

    
283
                    g.setColor(titleColor);
284

    
285
                    Font titleFont = new Font(m_f.getFontName(),
286
                            m_f.getStyle(), scaledTitleFontSize);
287

    
288
                    if (!getTitle().equals("")) {
289
                        TextLayout titleTextLayout = new TextLayout(getTitle(),
290
                                titleFont, frc);
291
                        titleTextLayout.draw(g, (float) raux.getX(),
292
                            (float) (raux.getY() - (gap * myScale)));
293
                    }
294
                }
295

    
296
                // Draw the frame involving the text if it exists
297
                if (isSurrounded()) {
298
                    g.setColor(frameColor);
299
//                    g.drawRect((int) raux.x, (int) raux.y, (int) raux.width,
300
//                        (int) raux.height);
301

    
302
                    double scaledCellPadding = FLayoutUtilities.fromSheetDistance(cellPadding,
303
                            at);
304
                    double sizeBorder = FLayoutUtilities.fromSheetDistance(frameBorderSize,
305
                            at);
306

    
307
                    //if (sizeBorder > 1) {
308
                    int bordermm = (int)(sizeBorder*10);
309
                    int scaledCellPaddingmm = (int)(scaledCellPadding*10);
310
//                    System.out.println("borderSize = " + bordermm);
311
                        g.setStroke(new BasicStroke(bordermm));
312
//                        int scaledBorderSize = (int) (sizeBorder * myScale);
313

    
314
//                        for (int i = scaledBorderSize - 1; i > 0; i--)
315
//                            g.drawRect((int) raux.x - i, (int) raux.y - i,
316
//                                (int) raux.width + (2 * i),
317
//                                (int) raux.height + (2 * i));
318
                        g.drawRect((int) (raux.x+bordermm/2-1), (int) (raux.y+bordermm/2-1),
319
                                (int) (raux.width-bordermm+2),
320
                                (int) (raux.height-bordermm+2));
321
                        g.setStroke(new BasicStroke(0));
322
                    //}
323

    
324
                    // Recalibro el rectangulo para establecer el ?rea donde se dibujan las fuentes
325
                    // al ?rea marcada con el rat?n menos la distancia al marco especificada
326
                    raux.setRect(raux.getX() + scaledCellPaddingmm + bordermm,
327
                        raux.getY() + scaledCellPaddingmm + bordermm,
328
                        raux.getWidth() - (scaledCellPaddingmm * 2) - bordermm * 2,
329
                        raux.getHeight() - (scaledCellPaddingmm * 2) - bordermm * 2);
330

    
331
                    if (raux.getWidth()<=0 || raux.getHeight()<=0){
332
                                                //JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(),PluginServices.getText(this,"too_large_border")+": "+bordermm+ " + "+scaledCellPaddingmm);
333
                                                g.setColor(Color.red);
334
                                                drawError(getBoundingBox(at), 15, g,PluginServices.getText(this,"too_large_border")+": "+frameBorderSize+ "cm + "+cellPadding+"cm");
335
//                                                g.rotate(Math.toRadians(-getRotation()),
336
//                                                    raux.x + (raux.width / 2), raux.y + (raux.height / 2));
337
                                                return;
338
                                        }
339
                }
340

    
341
                g.setColor(textColor);
342

    
343
                drawText(raux, scaledFontSize, g);
344
                g.rotate(Math.toRadians(-getRotation()),
345
                    raux.x + (raux.width / 2), raux.y + (raux.height / 2));
346
            }
347
        }
348

    
349
        raux = null;
350
    }
351

    
352
    private void drawError(Rectangle2D r, int sfs, Graphics2D g,String error) {
353
            FontRenderContext frc = g.getFontRenderContext();
354
        TextLayout textLayout = null;
355
               m_f = new Font(m_f.getFontName(), m_f.getStyle(), sfs);
356
        textLayout = new TextLayout(error, m_f, frc);
357
        textLayout.draw(g, (float) r.getCenterX(),
358
                            (float) (r.getCenterY()));
359

    
360
        }
361

    
362
        /**
363
     * Dibuja el texto sobre el graphics con el tama?o adecuado.
364
     *
365
     * @param r Rect?ngulo sobre el que dibujar.
366
     * @param sfs Tama?o aproximado del texto.
367
     * @param g Graphics sobre el que dibujar el texto.
368
     */
369
    private void drawText(Rectangle2D r, int sfs, Graphics2D g) {
370
        int minSFS = Integer.MAX_VALUE;
371
        FontRenderContext frc = g.getFontRenderContext();
372
        int ht = (int) (r.getHeight() / m_text.size());
373

    
374
        if (isFontSizeFixed()) {
375
            minSFS = sfs;
376
        } else {
377
            for (int i = 0; i < m_text.size(); i++) {
378
                if (!((String) m_text.get(i)).equals("") && !((String) m_text.get(i)).equals("\n")) {
379
                    TextLayout textaux = new TextLayout((String) m_text.get(i),
380
                            m_f, frc);
381
                    Rectangle2D txtBound = textaux.getBounds();
382
                    double difW = txtBound.getWidth() / r.getWidth();
383
                    double difH = (txtBound.getHeight() * m_text.size()) / (r.getHeight());
384

    
385
                    if (difW > difH) {
386
                        if (minSFS > sfs) {
387
                            minSFS = (int) (sfs / difW);
388
                        }
389
                    } else {
390
                        if (minSFS > sfs) {
391
                            minSFS = (int) (sfs / difH);
392
                        }
393
                    }
394
                }
395
            }
396
        }
397

    
398
        TextLayout textLayout = null;
399

    
400
        for (int i = 0; i < m_text.size(); i++) {
401
            if (!((String) m_text.get(i)).equals("")) {
402
                    m_f = new Font(m_f.getFontName(), m_f.getStyle(), minSFS);
403

    
404
                textLayout = new TextLayout((String) m_text.get(i), m_f, frc);
405

    
406
                Rectangle2D txtBound = textLayout.getBounds();
407
                float difW = (float) (r.getWidth() - txtBound.getWidth());
408

    
409
                switch (m_pos) {
410
                    case (LEFT):
411
                        textLayout.draw(g, (float) r.getX(),
412
                            (float) (r.getY() + (ht * (i + 0.8))));
413

    
414
                        break;
415

    
416
                    case (CENTER):
417
                        textLayout.draw(g, (float) r.getX() + (difW / 2),
418
                            (float) (r.getY() + (ht * (i + 0.8))));
419

    
420
                        break;
421

    
422
                    case (RIGTH):
423
                        textLayout.draw(g, (float) r.getX() + difW,
424
                            (float) (r.getY() + (ht * (i + 0.8)))); //- (ht / 2))));
425

    
426
                        break;
427
                }
428
            }
429
        }
430
    }
431

    
432
    /**
433
     * @see com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame#print(java.awt.Graphics2D,
434
     *      java.awt.geom.AffineTransform)
435
     */
436
    public void print(Graphics2D g, AffineTransform at) {
437
        draw(g, at, null, null);
438
    }
439

    
440
    /**
441
     * Rellenar el texto que se quiere a?adir al Layout.
442
     *
443
     * @param s String a a?adir.
444
     */
445
    public void addText(String s) {
446
        m_text.add(s);
447
    }
448

    
449
    /**
450
     * Devuelve el ArrayList que contiene las l?neas de texto.
451
     *
452
     * @return ArrayList.
453
     */
454
    public ArrayList getText() {
455
        return m_text;
456
    }
457

    
458
    /**
459
     * Seleccionar si se quiere un tama?o fijo o adecuado a la escala.
460
     *
461
     * @param b true si se quiere tama?o fijo.
462
     */
463
    public void setSizeFixed(boolean b) {
464
        m_isFixed = b;
465
    }
466

    
467
    /**
468
     * Devuelve si est? fijado el tama?o.
469
     *
470
     * @return True si est? fijado el tama?o.
471
     */
472
    public boolean isSizeFixed() {
473
        return m_isFixed;
474
    }
475

    
476
    /**
477
     * DOCUMENT ME!
478
     *
479
     * @return DOCUMENT ME!
480
     *
481
     * @throws SaveException
482
     *
483
     * @see com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame#getXMLEntity()
484
     */
485
    public XMLEntity getXMLEntity() throws SaveException {
486
        XMLEntity xml = super.getXMLEntity();
487

    
488
        try {
489
            xml.putProperty("type", Layout.RECTANGLETEXT);
490

    
491
            String[] s = (String[]) m_text.toArray(new String[0]);
492
            xml.putProperty("s", s);
493
            xml.putProperty("m_isFixed", m_isFixed);
494

    
495
            if (m_isFixed) {
496
                xml.putProperty("fontSize", m_f.getSize());
497
            }
498

    
499
            xml.putProperty("m_pos", m_pos);
500

    
501
            xml.putProperty("fontName", m_f.getName());
502
            xml.putProperty("fontStyle", m_f.getStyle());
503
            xml.putProperty("textColor", StringUtilities.color2String(textColor));
504

    
505
            xml.putProperty("transicionPixelsMilimetros",
506
                transicionPixelsMilimetros);
507

    
508
            // jaume
509
            xml.putProperty("cellPadding", cellPadding);
510
            xml.putProperty("fontSize", fontSize);
511
            xml.putProperty("fixedFontSize", fixedFontSize);
512
            xml.putProperty("surrounded", surrounded);
513
            xml.putProperty("hasTitle", hasTitle);
514
            xml.putProperty("title", title);
515
            xml.putProperty("titleSize", titleSize);
516
            xml.putProperty("frameBorderSize", frameBorderSize);
517
            xml.putProperty("frameColor",
518
                StringUtilities.color2String(frameColor));
519
            xml.putProperty("titleColor",
520
                StringUtilities.color2String(titleColor));
521
        } catch (Exception e) {
522
            throw new SaveException(e, this.getClass().getName());
523
        }
524

    
525
        return xml;
526
    }
527

    
528
    /**
529
     * @see com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame#setXMLEntity(com.iver.utiles.XMLEntity,
530
     *      com.iver.cit.gvsig.project.Project)
531
     */
532
    public void setXMLEntity03(XMLEntity xml, Layout l) {
533
        if (xml.getIntProperty("m_Selected") != 0) {
534
            this.setSelected(true);
535
        } else {
536
            this.setSelected(false);
537
        }
538

    
539
        String[] s = xml.getStringArrayProperty("s");
540

    
541
        for (int i = 0; i < s.length; i++) {
542
            this.m_text.add(s[i]);
543
        }
544

    
545
        this.m_isFixed = xml.getBooleanProperty("m_isFixed");
546
        this.m_pos = xml.getIntProperty("m_pos");
547
        setRotation(xml.getDoubleProperty("m_rotation"));
548

    
549
        this.m_f = new Font(xml.getStringProperty("fontName"),
550
                xml.getIntProperty("fontStyle"), 9);
551

    
552
        if (xml.contains("textColor")) {
553
            this.textColor = StringUtilities.string2Color(xml.getStringProperty(
554
                        "textColor"));
555
        }
556
    }
557

    
558
    /**
559
     * @see com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame#setXMLEntity(com.iver.utiles.XMLEntity,
560
     *      com.iver.cit.gvsig.project.Project)
561
     */
562
    public void setXMLEntity(XMLEntity xml) {
563
        if (xml.getIntProperty("m_Selected") != 0) {
564
            this.setSelected(true);
565
        } else {
566
            this.setSelected(false);
567
        }
568

    
569
        String[] s = xml.getStringArrayProperty("s");
570

    
571
        for (int i = 0; i < s.length; i++) {
572
            this.m_text.add(s[i]);
573
        }
574

    
575
        this.m_isFixed = xml.getBooleanProperty("m_isFixed");
576

    
577
        int size = 9;
578

    
579
        if (m_isFixed && xml.contains("fontSize")) {
580
            size = xml.getIntProperty("fontSize");
581
        }
582

    
583
        this.m_pos = xml.getIntProperty("m_pos");
584
        setRotation(xml.getDoubleProperty("m_rotation"));
585
        this.m_f = new Font(xml.getStringProperty("fontName"),
586
                xml.getIntProperty("fontStyle"), size);
587

    
588
        if (xml.contains("textColor")) {
589
            this.textColor = StringUtilities.string2Color(xml.getStringProperty(
590
                        "textColor"));
591
        }
592

    
593
        // jaume
594
        if (xml.contains("cellPadding")) {
595
            this.cellPadding = xml.getDoubleProperty("cellPadding");
596
        }
597

    
598
        if (xml.contains("fontSize")) {
599
            this.fontSize = xml.getIntProperty("fontSize");
600
        }
601

    
602
        if (xml.contains("fixedFontSize")) {
603
            this.fixedFontSize = xml.getBooleanProperty("fixedFontSize");
604
        }
605

    
606
        if (xml.contains("surrounded")) {
607
            this.surrounded = xml.getBooleanProperty("surrounded");
608
        }
609

    
610
        if (xml.contains("hasTitle")) {
611
            this.hasTitle = xml.getBooleanProperty("hasTitle");
612
        }
613

    
614
        if (xml.contains("title")) {
615
            this.title = xml.getStringProperty("title");
616
        }
617

    
618
        if (xml.contains("titleSize")) {
619
            this.titleSize = xml.getIntProperty("titleSize");
620
        }
621

    
622
        if (xml.contains("frameBorderSize")) {
623
            this.frameBorderSize = xml.getDoubleProperty("frameBorderSize");
624
        }
625

    
626
        if (xml.contains("frameColor")) {
627
            this.frameColor = StringUtilities.string2Color(xml.getStringProperty(
628
                        "frameColor"));
629
        }
630

    
631
        if (xml.contains("titleColor")) {
632
            this.titleColor = StringUtilities.string2Color(xml.getStringProperty(
633
                        "titleColor"));
634
        }
635

    
636
        if (!xml.contains("transicionPixelsMilimetros")) {
637
            cellPadding = 0.05;
638
            frameBorderSize = 0.01;
639
        }
640
    }
641

    
642
    /**
643
     * @see com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame#getNameFFrame()
644
     */
645
    public String getNameFFrame() {
646
        return PluginServices.getText(this, "texto")+ num;
647
    }
648

    
649
    /**
650
     * Sets FFrameText to draw an involving rectangle
651
     *
652
     * @param b
653
     */
654
    public void setSurrounded(boolean b) {
655
        surrounded = b;
656
    }
657

    
658
    /**
659
     * True if the FFrameText is set to draw an involving rectangle, or false
660
     * if not.
661
     *
662
     * @return boolean
663
     */
664
    public boolean isSurrounded() {
665
        return surrounded;
666
    }
667

    
668
    /**
669
     * Sets the gap between the involving rectangle and the text
670
     *
671
     * @param i
672
     */
673
    public void setCellPadding(double i) {
674
        cellPadding = i;
675
    }
676

    
677
    /**
678
     * Devuelve true si tiene un t?tulo.
679
     *
680
     * @return
681
     */
682
    public boolean hasTitle() {
683
        return hasTitle;
684
    }
685

    
686
    /**
687
     * Devuelve un string con el t?tulo.
688
     *
689
     * @return
690
     */
691
    public String getTitle() {
692
        return title;
693
    }
694

    
695
    /**
696
     * Inserta true si tiene t?tulo
697
     *
698
     * @param b
699
     */
700
    public void setHasTitle(boolean b) {
701
        hasTitle = b;
702
    }
703

    
704
    /**
705
     * Inserta un string con el t?tulo.
706
     *
707
     * @param text
708
     */
709
    public void setTitle(String text) {
710
        title = text;
711
    }
712

    
713
    /**
714
     * Devuelve el tama?o del t?tulo.
715
     *
716
     * @return
717
     */
718
    public int getTitleSize() {
719
        return titleSize;
720
    }
721

    
722
    /**
723
     * Inserta el tama?o del t?tulo.
724
     *
725
     * @param size DOCUMENT ME!
726
     */
727
    public void setTitleSize(int size) {
728
        titleSize = size;
729
    }
730

    
731
    /**
732
     * Inserta el tama?o del borde.
733
     *
734
     * @param size
735
     */
736
    public void setFrameBorderSize(double size) {
737
        frameBorderSize = size;
738
    }
739

    
740
    /**
741
     * Devuelve el tama?o del borde.
742
     *
743
     * @return
744
     */
745
    public double getFrameBorderSize() {
746
        return frameBorderSize;
747
    }
748

    
749
    /**
750
     * DOCUMENT ME!
751
     *
752
     * @param frameColor
753
     */
754
    public void setFrameColor(Color frameColor) {
755
        this.frameColor = frameColor;
756
    }
757

    
758
    /**
759
     * DOCUMENT ME!
760
     *
761
     * @param titleColor DOCUMENT ME!
762
     */
763
    public void setTitleColor(Color titleColor) {
764
        this.titleColor = titleColor;
765
    }
766

    
767
    /**
768
     * DOCUMENT ME!
769
     *
770
     * @return DOCUMENT ME!
771
     */
772
    public Color getFrameColor() {
773
        return frameColor;
774
    }
775

    
776
    /**
777
     * DOCUMENT ME!
778
     *
779
     * @return DOCUMENT ME!
780
     */
781
    public Color getTitleColor() {
782
        return titleColor;
783
    }
784

    
785
    /**
786
     * Use this method if you want the text in the FFrameText to be removed.
787
     */
788
    public void clearText() {
789
        m_text.clear();
790
    }
791

    
792
        public void initialize() {
793
                // TODO Auto-generated method stub
794

    
795
        }
796

    
797
        public void cloneActions(IFFrame frame) {
798
                // TODO Auto-generated method stub
799

    
800
        }
801
}