Statistics
| Revision:

svn-document-layout / branches / usability_v2 / org.gvsig.app.document.layout.app / org.gvsig.app.document.layout.app.mainplugin / src / main / java / org / gvsig / app / project / documents / layout / DefaultLayoutControl.java @ 140

History | View | Annotate | Download (20.4 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 2
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 */
22
package org.gvsig.app.project.documents.layout;
23

    
24
import java.awt.Color;
25
import java.awt.Cursor;
26
import java.awt.Graphics;
27
import java.awt.Graphics2D;
28
import java.awt.Image;
29
import java.awt.Point;
30
import java.awt.Rectangle;
31
import java.awt.Toolkit;
32
import java.awt.geom.AffineTransform;
33
import java.awt.geom.Rectangle2D;
34
import java.awt.image.BufferedImage;
35
import java.awt.image.MemoryImageSource;
36
import java.util.HashMap;
37

    
38
import javax.swing.JComponent;
39

    
40
import org.gvsig.app.project.documents.layout.fframes.IFFrame;
41
import org.gvsig.app.project.documents.layout.fframes.IFFrameEditableVertex;
42
import org.gvsig.app.project.documents.layout.fframes.IFFrameUseFMap;
43
import org.gvsig.app.project.documents.layout.geometryadapters.GeometryAdapter;
44
import org.gvsig.app.project.documents.layout.geometryadapters.PolyLineAdapter;
45
import org.gvsig.app.project.documents.layout.gui.LayoutPanel;
46
import org.gvsig.app.project.documents.layout.tools.LayoutAddBoxListenerImpl;
47
import org.gvsig.app.project.documents.layout.tools.LayoutAddCircleListenerImpl;
48
import org.gvsig.app.project.documents.layout.tools.LayoutAddLegendListenerImpl;
49
import org.gvsig.app.project.documents.layout.tools.LayoutAddLineListenerImpl;
50
import org.gvsig.app.project.documents.layout.tools.LayoutAddNorthListenerImpl;
51
import org.gvsig.app.project.documents.layout.tools.LayoutAddOverViewListenerImpl;
52
import org.gvsig.app.project.documents.layout.tools.LayoutAddPictureListenerImpl;
53
import org.gvsig.app.project.documents.layout.tools.LayoutAddPointListenerImpl;
54
import org.gvsig.app.project.documents.layout.tools.LayoutAddPolygonListenerImpl;
55
import org.gvsig.app.project.documents.layout.tools.LayoutAddPolylineListenerImpl;
56
import org.gvsig.app.project.documents.layout.tools.LayoutAddRectangleListenerImpl;
57
import org.gvsig.app.project.documents.layout.tools.LayoutAddScaleListenerImpl;
58
import org.gvsig.app.project.documents.layout.tools.LayoutAddTextListenerImpl;
59
import org.gvsig.app.project.documents.layout.tools.LayoutAddViewListenerImpl;
60
import org.gvsig.app.project.documents.layout.tools.LayoutEditGraphicsListenerImpl;
61
import org.gvsig.app.project.documents.layout.tools.LayoutPanListenerImpl;
62
import org.gvsig.app.project.documents.layout.tools.LayoutSelectListenerImpl;
63
import org.gvsig.app.project.documents.layout.tools.LayoutViewPanListenerImpl;
64
import org.gvsig.app.project.documents.layout.tools.LayoutViewZoomInListenerImpl;
65
import org.gvsig.app.project.documents.layout.tools.LayoutViewZoomOutListenerImpl;
66
import org.gvsig.app.project.documents.layout.tools.LayoutZoomInListenerImpl;
67
import org.gvsig.app.project.documents.layout.tools.LayoutZoomOutListenerImpl;
68
import org.gvsig.app.project.documents.layout.tools.behavior.LayoutBehavior;
69
import org.gvsig.app.project.documents.layout.tools.behavior.LayoutEditBehavior;
70
import org.gvsig.app.project.documents.layout.tools.behavior.LayoutMoveBehavior;
71
import org.gvsig.app.project.documents.layout.tools.behavior.LayoutPointBehavior;
72
import org.gvsig.app.project.documents.layout.tools.behavior.LayoutRectangleBehavior;
73
import org.gvsig.app.project.documents.layout.tools.behavior.LayoutSelectBehavior;
74
import org.gvsig.app.project.documents.layout.tools.behavior.LayoutViewMoveBehavior;
75
import org.gvsig.app.project.documents.layout.tools.behavior.LayoutViewZoomBehavior;
76
import org.gvsig.app.project.documents.layout.tools.behavior.LayoutZoomBehavior;
77
import org.gvsig.app.project.documents.layout.tools.listener.ILayoutGraphicListener;
78
import org.gvsig.fmap.dal.exception.ReadException;
79
import org.gvsig.tools.observer.Observable;
80

    
81
/**
82
 * Control of Layout.
83
 * 
84
 * @author Vicente Caballero Navarro
85
 */
86
public class DefaultLayoutControl extends JComponent implements LayoutControl {
87
    private static final int DESACTUALIZADO = 4;
88
    private static final int ACTUALIZADO = 5;
89
    
90
    private static final long serialVersionUID = -8290006366669291510L;
91

    
92
    public static final String PERSISTENCE_DEFINITION_NAME = "LayoutControl";
93

    
94
    private int status = DESACTUALIZADO;
95
    private Rectangle2D rectVisible;
96
    private BufferedImage img = null;
97
    private BufferedImage imgRuler = null;
98
    private boolean initial = true;
99
    private LayoutContext layoutContext;
100
    private Point origin = new Point(50, 50);
101
    private Point rectOrigin = new Point(origin);
102
    private Rectangle2D.Double rect = new Rectangle2D.Double(rectOrigin.x,
103
        rectOrigin.y, 400, 300);
104
    private FLayoutDraw layoutDraw = null;
105
    private FLayoutFunctions layoutFunctions = null;
106
    private LayoutBehavior currentLayoutTool = null;
107
    private Image imageCursor = null;
108
    private HashMap namesLayoutTools = new HashMap();
109
    private Point m_FirstPoint = new Point(0, 0);
110
    private Point m_PointAnt = new Point(0, 0);
111
    private Point m_LastPoint = new Point(0, 0);
112
    private LayoutEvents layoutEvents;
113
    private Point position;
114
    private GeometryAdapter geometryAdapter = new PolyLineAdapter();
115

    
116
    // private String prevTool;
117
    private String currentTool;
118
    private boolean m_bCancelDrawing = false;
119
    private Rectangle reSel = null;
120
    private boolean isReSel = true;
121
    private FLayoutZooms layoutZooms;
122

    
123
    private static Cursor transparentCursor = Toolkit.getDefaultToolkit()
124
        .createCustomCursor(
125
            Toolkit.getDefaultToolkit().createImage(
126
                new MemoryImageSource(16, 16, new int[16 * 16], 0, 16)),
127
            new Point(0, 0), "invisiblecursor");
128

    
129
    /**
130
     * Create a new object of LayoutControl.
131
     * 
132
     * @param layout
133
     */
134
    public DefaultLayoutControl() {  
135
               
136
    }
137
    
138
    public void initialize(LayoutPanel layoutPanel){
139
        layoutDraw = new FLayoutDraw(layoutPanel);
140
        layoutEvents = new LayoutEvents(layoutPanel);
141
        layoutZooms = new FLayoutZooms(layoutPanel);
142
        layoutFunctions = new FLayoutFunctions(layoutPanel);
143
        addComponentListener(layoutEvents);
144
        addMouseMotionListener(layoutEvents);
145
        addMouseListener(layoutEvents);
146

    
147
        LayoutPanListenerImpl lpl = new LayoutPanListenerImpl(layoutPanel);
148
        addLayoutTool("layoutpan", new LayoutMoveBehavior(lpl));
149

    
150
        LayoutZoomInListenerImpl lzil = new LayoutZoomInListenerImpl(layoutPanel);
151
        addLayoutTool("layoutzoomin", new LayoutZoomBehavior(lzil));
152

    
153
        LayoutZoomOutListenerImpl lzol = new LayoutZoomOutListenerImpl(layoutPanel);
154
        addLayoutTool("layoutzoomout", new LayoutZoomBehavior(lzol));
155

    
156
        LayoutAddViewListenerImpl lavl = new LayoutAddViewListenerImpl(layoutPanel);
157
        addLayoutTool("layoutaddview", new LayoutRectangleBehavior(lavl));
158

    
159
        LayoutAddOverViewListenerImpl laovl =
160
            new LayoutAddOverViewListenerImpl(layoutPanel);
161
        addLayoutTool("layoutaddoverview", new LayoutRectangleBehavior(laovl));
162

    
163
        LayoutAddPictureListenerImpl lapl =
164
            new LayoutAddPictureListenerImpl(layoutPanel);
165
        addLayoutTool("layoutaddpicture", new LayoutRectangleBehavior(lapl));
166

    
167
        LayoutAddNorthListenerImpl lanorthl =
168
            new LayoutAddNorthListenerImpl(layoutPanel);
169
        addLayoutTool("layoutaddnorth", new LayoutRectangleBehavior(lanorthl));
170

    
171
        LayoutAddScaleListenerImpl lasl =
172
            new LayoutAddScaleListenerImpl(layoutPanel);
173
        addLayoutTool("layoutaddscale", new LayoutRectangleBehavior(lasl));
174

    
175
        LayoutAddLegendListenerImpl lall =
176
            new LayoutAddLegendListenerImpl(layoutPanel);
177
        addLayoutTool("layoutaddlegend", new LayoutRectangleBehavior(lall));
178

    
179
        LayoutAddTextListenerImpl latl = new LayoutAddTextListenerImpl(layoutPanel);
180
        addLayoutTool("layoutaddtext", new LayoutRectangleBehavior(latl));
181

    
182
        LayoutAddBoxListenerImpl labl = new LayoutAddBoxListenerImpl(layoutPanel);
183
        addLayoutTool("layoutaddbox", new LayoutRectangleBehavior(labl));
184

    
185
        LayoutAddPointListenerImpl lapointl =
186
            new LayoutAddPointListenerImpl(layoutPanel);
187
        addLayoutTool("layoutaddpoint", new LayoutPointBehavior(lapointl));
188

    
189
        LayoutAddLineListenerImpl lalinel =
190
            new LayoutAddLineListenerImpl(layoutPanel);
191
        addLayoutTool("layoutaddline", new LayoutPointBehavior(lalinel));
192

    
193
        LayoutAddPolygonListenerImpl lapolygonl =
194
            new LayoutAddPolygonListenerImpl(layoutPanel);
195
        addLayoutTool("layoutaddpolygon", new LayoutPointBehavior(lapolygonl));
196

    
197
        LayoutAddPolylineListenerImpl lapolylinel =
198
            new LayoutAddPolylineListenerImpl(layoutPanel);
199
        addLayoutTool("layoutaddpolyline", new LayoutPointBehavior(lapolylinel));
200

    
201
        LayoutAddCircleListenerImpl lacirclel =
202
            new LayoutAddCircleListenerImpl(layoutPanel);
203
        addLayoutTool("layoutaddcircle", new LayoutPointBehavior(lacirclel));
204

    
205
        LayoutAddRectangleListenerImpl larectanglel =
206
            new LayoutAddRectangleListenerImpl(layoutPanel);
207
        addLayoutTool("layoutaddrectangle", new LayoutPointBehavior(
208
            larectanglel));
209

    
210
        LayoutViewPanListenerImpl lvpl = new LayoutViewPanListenerImpl(layoutPanel);
211
        addLayoutTool("layoutviewpan", new LayoutViewMoveBehavior(lvpl));
212

    
213
        LayoutViewZoomInListenerImpl lvzil =
214
            new LayoutViewZoomInListenerImpl(layoutPanel);
215
        addLayoutTool("layoutviewzoomin", new LayoutViewZoomBehavior(lvzil));
216

    
217
        LayoutViewZoomOutListenerImpl lvzol =
218
            new LayoutViewZoomOutListenerImpl(layoutPanel);
219
        addLayoutTool("layoutviewzoomout", new LayoutViewZoomBehavior(lvzol));
220

    
221
        LayoutSelectListenerImpl lselectl =
222
            new LayoutSelectListenerImpl(layoutPanel);
223
        addLayoutTool("layoutselect", new LayoutSelectBehavior(lselectl));
224

    
225
        LayoutEditGraphicsListenerImpl leditl =
226
            new LayoutEditGraphicsListenerImpl(layoutPanel);
227
        addLayoutTool("layoutedit", new LayoutEditBehavior(leditl));
228
    }
229

    
230
    public String getCurrentTool() {
231
        return currentTool;
232
    }
233

    
234
    public void addLayoutTool(String name, LayoutBehavior tool) {
235
        namesLayoutTools.put(name, tool);
236
        tool.setLayoutControl(this);
237
    }
238

    
239
    public void setLayoutContext(LayoutContext lc) {
240
        layoutContext = lc;
241
        layoutContext.addObserver(this);
242
    }
243

    
244
    /**
245
     * paintComponent of Layout.
246
     * 
247
     * @param g
248
     *            Graphics of Layout.
249
     */
250
    protected void paintComponent(Graphics g) {
251
        clipVisibleRect((Graphics2D) g);
252

    
253
        Rectangle rClip = g.getClipBounds();
254

    
255
        if (rClip == null) {
256
            System.err.println("clip = null");
257
        }
258

    
259
        switch (status) {
260
        case DESACTUALIZADO:
261
            if (getWidth() == 0) {
262
                return;
263
            }
264

    
265
            img =
266
                new BufferedImage(getWidth(), getHeight(),
267
                    BufferedImage.TYPE_INT_ARGB);
268
            imgRuler =
269
                new BufferedImage(getWidth(), getHeight(),
270
                    BufferedImage.TYPE_INT_ARGB);
271

    
272
            Graphics gimag = img.getGraphics();
273
            Graphics gimgRuler = imgRuler.getGraphics();
274
            clipVisibleRect((Graphics2D) gimag);
275

    
276
            if (initial) {
277
                fullRect();
278
                initial = false;
279
            }
280

    
281
            try {
282
                layoutDraw.drawLayout((Graphics2D) gimag, img);
283
            } catch (ReadException e) {
284
                e.printStackTrace();
285
            }
286

    
287
            g.setClip(rClip);
288
            layoutDraw.drawRectangle((Graphics2D) g);
289

    
290
            g.drawImage(img, 0, 0, this);
291
            g.setClip(rClip);
292

    
293
            layoutDraw.drawGrid((Graphics2D) gimgRuler);
294
            layoutDraw.drawRuler((Graphics2D) gimgRuler, Color.black);
295
            setStatus(ACTUALIZADO);
296
            repaint();
297

    
298
            break;
299

    
300
        case ACTUALIZADO:
301
            layoutDraw.drawRectangle((Graphics2D) g);
302

    
303
            if (currentLayoutTool != null) {
304
                currentLayoutTool.paintComponent(g);
305
            } else {
306
                g.drawImage(img, 0, 0, this);
307

    
308
                layoutDraw.drawHandlers((Graphics2D) g, Color.black);
309
            }
310

    
311
            g.setClip(rClip);
312
            drawCursor(g);
313
        }
314
    }
315

    
316
    private void setStatus(int s) {
317
        status = s;
318
    }
319

    
320
    /**
321
     * Clip on visible rectangle.
322
     * 
323
     * @param g2d
324
     *            Graphics.
325
     */
326
    private void clipVisibleRect(Graphics2D g2d) {
327
        rectVisible = this.getVisibleRect();
328
        g2d.clipRect((int) rectVisible.getMinX(), (int) rectVisible.getMinY(),
329
            (int) rectVisible.getWidth(), (int) rectVisible.getHeight());
330
    }
331

    
332
    public BufferedImage getImgRuler() {
333
        return imgRuler;
334
    }
335

    
336
    public void fullRect() {
337
        rect.setRect(origin.x, origin.y, getWidth() - (origin.x * 2),
338
            getHeight() - (origin.x * 2));
339

    
340
        if (layoutContext.getAttributes().isLandscape()) {
341
            rect =
342
                layoutContext.getAttributes().getRectangleLandscape(rect,
343
                    getWidth(), getHeight());
344
        } else {
345
            rect =
346
                layoutContext.getAttributes().getRectanglePortrait(rect,
347
                    getWidth(), getHeight());
348
        }
349

    
350
        refresh();
351
    }
352

    
353
    public Rectangle2D.Double getRect() {
354
        return rect;
355
    }
356

    
357
    public void setRect(Rectangle2D r) {
358
        rect.setRect(r);
359
    }
360

    
361
    public BufferedImage getImage() {
362
        return img;
363
    }
364

    
365
    /**
366
     * Draw the cursor on the Graphics.
367
     * 
368
     * @param g
369
     *            Graphics.
370
     */
371
    private void drawCursor(Graphics g) {
372
        if ((imageCursor != null) && (position != null)) {
373
            Point pAdjusted = position;
374
            g.drawImage(imageCursor, (int) pAdjusted.getX() - 16,
375
                (int) pAdjusted.getY() - 16, this);
376
        }
377
    }
378

    
379
    public void setMapCursor(Image image) {
380
        imageCursor = image;
381
    }
382

    
383
    public void setTool(String toolName) {
384
        // prevTool=getCurrentTool();
385
        LayoutBehavior layoutTool =
386
            (LayoutBehavior) namesLayoutTools.get(toolName);
387
        currentLayoutTool = layoutTool;
388
        currentLayoutTool.setLayoutControl(this);
389
        currentTool = toolName;
390
        this.setMapCursor(layoutTool.getImageCursor());
391

    
392
        if (getCurrentLayoutTool().getListener() instanceof ILayoutGraphicListener) {
393
            geometryAdapter =
394
                ((ILayoutGraphicListener) getCurrentLayoutTool().getListener())
395
                    .createGeometryAdapter();
396
        }
397

    
398
        if (getCurrentTool().equals("layoutedit")) {
399
            startEdit();
400
        } else {
401
            stopEdit();
402
        }
403
    }
404

    
405
    public void startEdit() {
406
        IFFrame[] fframes = layoutContext.getFFrames();
407

    
408
        for (int i = 0; i < fframes.length; i++) {
409
            IFFrame frame = fframes[i];
410

    
411
            if (frame instanceof IFFrameEditableVertex) {
412
                if (frame.getSelected() != IFFrame.NOSELECT) {
413
                    ((IFFrameEditableVertex) frame).startEditing();
414
                } else {
415
                    ((IFFrameEditableVertex) frame).stopEditing();
416
                }
417
            }
418
        }
419

    
420
        refresh();
421
    }
422

    
423
    public void stopEdit() {
424
        boolean refresh = false;
425
        IFFrame[] fframes = layoutContext.getFFrames();
426

    
427
        for (int i = 0; i < fframes.length; i++) {
428
            IFFrame frame = fframes[i];
429

    
430
            if (frame instanceof IFFrameEditableVertex) {
431
                if (((IFFrameEditableVertex) frame).isEditing()) {
432
                    ((IFFrameEditableVertex) fframes[i]).stopEditing();
433
                    refresh = true;
434
                }
435
            }
436
        }
437

    
438
        if (refresh) {
439
            refresh();
440
        }
441
    }
442

    
443
    public Point getRectOrigin() {
444
        return rectOrigin;
445
    }
446

    
447
    public FLayoutDraw getLayoutDraw() {
448
        return layoutDraw;
449
    }
450

    
451
    public LayoutBehavior getCurrentLayoutTool() {
452
        return currentLayoutTool;
453
    }
454

    
455
    public Point getFirstPoint() {
456
        return m_FirstPoint;
457
    }
458

    
459
    public Point getPointAnt() {
460
        return m_PointAnt;
461
    }
462

    
463
    public Point getLastPoint() {
464
        return m_LastPoint;
465
    }
466

    
467
    public void setFirstPoint() {
468
        m_FirstPoint = position;
469
    }
470

    
471
    public void setPointAnt() {
472
        m_PointAnt = position;
473
    }
474

    
475
    public void setLastPoint() {
476
        m_LastPoint = position;
477
    }
478

    
479
    public void setPosition(Point point2) {
480
        if (layoutContext.isAdjustingToGrid()
481
            && getCurrentLayoutTool().isAdjustable()) {
482
            position =
483
                FLayoutUtilities.getPointGrid(point2, layoutContext
484
                    .getAttributes().getNumUnitsX(), layoutContext
485
                    .getAttributes().getNumUnitsY(), layoutContext.getAT());
486
        } else {
487
            position = point2;
488
        }
489
    }
490

    
491
    public Point getPosition() {
492
        return position;
493
    }
494

    
495
    public AffineTransform getAT() {
496
        return layoutContext.getAT();
497
    }
498

    
499
    public GeometryAdapter getGeometryAdapter() {
500
        return geometryAdapter;
501
    }
502

    
503
    public void delLastPoint() {
504
        getGeometryAdapter().delLastPoint();
505
    }
506

    
507
    public int addGeometryAdapterPoint() {
508
        return getGeometryAdapter().addPoint(
509
            FLayoutUtilities.toSheetPoint(getPosition(), getAT()));
510
    }
511

    
512
    public void setGeometryAdapterPoinPosition() {
513
        getGeometryAdapter().pointPosition(
514
            FLayoutUtilities.toSheetPoint(getPosition(), getAT()));
515
    }
516

    
517
    public void clearMouseImage() {
518
        setCursor(transparentCursor);
519
    }
520

    
521
    public void refresh() {
522
        setStatus(DESACTUALIZADO);
523
        repaint();
524
    }
525

    
526
    public synchronized boolean isDrawingCancelled() {
527
        return m_bCancelDrawing;
528
    }
529

    
530
    public synchronized void setCancelDrawing(boolean b) {
531
        m_bCancelDrawing = b;
532

    
533
        for (int i = 0; i < layoutContext.getFFrames().length; i++) {
534
            IFFrame fframe = layoutContext.getFFrame(i);
535

    
536
            if (fframe instanceof IFFrameUseFMap
537
                && (((IFFrameUseFMap) fframe).getMapContext() != null)) {
538
                // //TODO((FFrameView)
539
                // getFFrames().get(i)).getFMap().setCancelDrawing(b);
540
            }
541
        }
542
    }
543

    
544
    public Rectangle getReSel() {
545
        return reSel;
546
    }
547

    
548
    public boolean isReSel() {
549
        return isReSel;
550
    }
551

    
552
    public void setIsReSel(boolean b) {
553
        isReSel = b;
554
    }
555

    
556
    public void viewFull() throws ReadException {
557
        IFFrame[] fframes = layoutContext.getSelectedFFrames();
558

    
559
        for (int i = 0; i < fframes.length; i++) {
560
            if (fframes[i] instanceof IFFrameUseFMap) {
561
                IFFrameUseFMap fframe = (IFFrameUseFMap) fframes[i];
562

    
563
                if (fframe.getMapContext() != null) {
564
                    fframe.fullExtent();
565
                }
566

    
567
                fframe.refresh();
568
            }
569
        }
570

    
571
        refresh();
572
    }
573

    
574
    public FLayoutZooms getLayoutZooms() {
575
        return layoutZooms;
576
    }
577

    
578
    public FLayoutFunctions getLayoutFunctions() {
579
        return layoutFunctions;
580
    }
581

    
582
    public LayoutContext getLayoutContext() {
583
        return layoutContext;
584
    }
585

    
586
    public void setGeometryAdapter(GeometryAdapter adapter) {
587
        geometryAdapter = adapter;
588
    }
589

    
590
    public JComponent getComponent() {
591
        return this;
592
    }
593

    
594
    public void update(Observable observable, Object notification) {
595
       if ((notification != null) && (notification instanceof LayoutNotification)){
596
           LayoutNotification layoutNotification = (LayoutNotification)notification;
597
           if (LayoutNotification.LAYOUT_VALIDATED.equals(layoutNotification.getType())){
598
               status = ACTUALIZADO;
599
           }else if (LayoutNotification.LAYOUT_INVALIDATED.equals(layoutNotification.getType())){
600
               status = DESACTUALIZADO;
601
           }else if (LayoutNotification.LAYOUT_REFRESH.equals(layoutNotification.getType())){
602
               refresh();
603
           }
604
       }
605
    }
606
}