~ubuntu-branches/debian/stretch/insubstantial/stretch

« back to all changes in this revision

Viewing changes to flamingo/src/main/java/org/pushingpixels/flamingo/internal/ui/common/CommandButtonLayoutManagerMedium.java

  • Committer: Package Import Robot
  • Author(s): Felix Natter
  • Date: 2016-01-18 20:58:45 UTC
  • Revision ID: package-import@ubuntu.com-20160118205845-crbmrkda61qsi5qa
Tags: upstream-7.3+dfsg2
ImportĀ upstreamĀ versionĀ 7.3+dfsg2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2005-2010 Flamingo Kirill Grouchnikov. All Rights Reserved.
 
3
 *
 
4
 * Redistribution and use in source and binary forms, with or without 
 
5
 * modification, are permitted provided that the following conditions are met:
 
6
 * 
 
7
 *  o Redistributions of source code must retain the above copyright notice, 
 
8
 *    this list of conditions and the following disclaimer. 
 
9
 *     
 
10
 *  o Redistributions in binary form must reproduce the above copyright notice, 
 
11
 *    this list of conditions and the following disclaimer in the documentation 
 
12
 *    and/or other materials provided with the distribution. 
 
13
 *     
 
14
 *  o Neither the name of Flamingo Kirill Grouchnikov nor the names of 
 
15
 *    its contributors may be used to endorse or promote products derived 
 
16
 *    from this software without specific prior written permission. 
 
17
 *     
 
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
 
19
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
 
20
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
 
21
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
 
22
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
 
23
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
 
24
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 
 
25
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
 
26
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 
 
27
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
 
28
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 
29
 */
 
30
package org.pushingpixels.flamingo.internal.ui.common;
 
31
 
 
32
import java.awt.*;
 
33
import java.beans.PropertyChangeEvent;
 
34
import java.util.ArrayList;
 
35
 
 
36
import javax.swing.JSeparator;
 
37
import javax.swing.SwingConstants;
 
38
 
 
39
import org.pushingpixels.flamingo.api.common.*;
 
40
import org.pushingpixels.flamingo.api.common.JCommandButton.CommandButtonKind;
 
41
import org.pushingpixels.flamingo.internal.ui.common.popup.BasicCommandPopupMenuUI;
 
42
import org.pushingpixels.flamingo.internal.utils.FlamingoUtilities;
 
43
 
 
44
public class CommandButtonLayoutManagerMedium implements
 
45
                CommandButtonLayoutManager {
 
46
        @Override
 
47
        public int getPreferredIconSize() {
 
48
                return 16;
 
49
        }
 
50
 
 
51
        protected float getIconTextGapFactor() {
 
52
                return 1.0f;
 
53
        }
 
54
 
 
55
        private boolean hasIcon(AbstractCommandButton button) {
 
56
        return button.getIcon() != null || Boolean.TRUE.equals(button.getClientProperty(BasicCommandPopupMenuUI.FORCE_ICON));
 
57
    }
 
58
 
 
59
        @Override
 
60
        public Dimension getPreferredSize(AbstractCommandButton commandButton) {
 
61
                Insets borderInsets = commandButton.getInsets();
 
62
                int by = borderInsets.top + borderInsets.bottom;
 
63
                FontMetrics fm = commandButton.getFontMetrics(commandButton.getFont());
 
64
 
 
65
                String buttonText = commandButton.getText();
 
66
                int layoutHGap = FlamingoUtilities.getHLayoutGap(commandButton);
 
67
 
 
68
                boolean hasIcon = this.hasIcon(commandButton);
 
69
                boolean hasText = (buttonText != null);
 
70
                boolean hasPopupIcon = FlamingoUtilities.hasPopupAction(commandButton);
 
71
 
 
72
                int prefIconSize = hasIcon ? this.getPreferredIconSize() : 0;
 
73
 
 
74
                // start with the left insets
 
75
                int width = borderInsets.left;
 
76
                // icon?
 
77
                if (hasIcon) {
 
78
                        // padding before the icon
 
79
                        width += layoutHGap;
 
80
                        // icon width
 
81
                        width += prefIconSize;
 
82
                        // padding after the icon
 
83
                        width += layoutHGap;
 
84
                }
 
85
                // text?
 
86
                if (hasText) {
 
87
                        // padding before the text
 
88
                        if (hasIcon) {
 
89
                                width += (int) (layoutHGap * getIconTextGapFactor());
 
90
                        } else {
 
91
                                width += layoutHGap;
 
92
                        }
 
93
                        // text width
 
94
                        width += fm.stringWidth(buttonText);
 
95
                        // padding after the text
 
96
                        width += layoutHGap;
 
97
                }
 
98
                // popup icon?
 
99
                if (hasPopupIcon) {
 
100
                        // padding before the popup icon
 
101
                        if (hasText && hasIcon) {
 
102
                                width += 2 * layoutHGap;
 
103
                        }
 
104
                        // text width
 
105
                        width += 1 + fm.getHeight() / 2;
 
106
                        // padding after the popup icon
 
107
                        width += 2 * layoutHGap;
 
108
                }
 
109
 
 
110
                // separator?
 
111
                if (commandButton instanceof JCommandButton) {
 
112
                        JCommandButton jcb = (JCommandButton) commandButton;
 
113
                        CommandButtonKind buttonKind = jcb.getCommandButtonKind();
 
114
                        boolean hasSeparator = false;
 
115
                        if (buttonKind == CommandButtonKind.ACTION_AND_POPUP_MAIN_ACTION
 
116
                                        && (hasIcon || hasText)) {
 
117
                                hasSeparator = true;
 
118
                        }
 
119
                        if (buttonKind == CommandButtonKind.ACTION_AND_POPUP_MAIN_POPUP
 
120
                                        && hasIcon) {
 
121
                                hasSeparator = true;
 
122
                        }
 
123
                        if (hasSeparator) {
 
124
                                // space for a vertical separator
 
125
                                width += new JSeparator(JSeparator.VERTICAL).getPreferredSize().width;
 
126
                        }
 
127
                }
 
128
 
 
129
                // right insets
 
130
                width += borderInsets.right;
 
131
 
 
132
                // and remove the padding before the first and after the last elements
 
133
                width -= 2 * layoutHGap;
 
134
 
 
135
                return new Dimension(width, by
 
136
                                + Math.max(prefIconSize, fm.getAscent() + fm.getDescent()));
 
137
        }
 
138
 
 
139
        @Override
 
140
        public void propertyChange(PropertyChangeEvent evt) {
 
141
        }
 
142
 
 
143
        @Override
 
144
        public Point getKeyTipAnchorCenterPoint(AbstractCommandButton commandButton) {
 
145
                Insets ins = commandButton.getInsets();
 
146
                int height = commandButton.getHeight();
 
147
                boolean hasIcon = this.hasIcon(commandButton);
 
148
                int iconSize = this.getPreferredIconSize();
 
149
                if (hasIcon) {
 
150
                        // bottom-right corner of the icon area
 
151
                        return new Point(ins.left + iconSize, (height + iconSize) / 2);
 
152
                } else {
 
153
                        // bottom-left corner of the button
 
154
                        return new Point(ins.left, 3 * height / 4);
 
155
                }
 
156
        }
 
157
 
 
158
        @Override
 
159
        public CommandButtonLayoutInfo getLayoutInfo(
 
160
                        AbstractCommandButton commandButton, Graphics g) {
 
161
                CommandButtonLayoutInfo result = new CommandButtonLayoutInfo();
 
162
 
 
163
                result.actionClickArea = new Rectangle(0, 0, 0, 0);
 
164
                result.popupClickArea = new Rectangle(0, 0, 0, 0);
 
165
 
 
166
                Insets ins = commandButton.getInsets();
 
167
 
 
168
                result.iconRect = new Rectangle();
 
169
                result.popupActionRect = new Rectangle();
 
170
 
 
171
                int width = commandButton.getWidth();
 
172
                int height = commandButton.getHeight();
 
173
 
 
174
                String buttonText = commandButton.getText();
 
175
                int iconSize = this.getPreferredIconSize();
 
176
 
 
177
                boolean hasIcon = this.hasIcon(commandButton);
 
178
                boolean hasText = (buttonText != null);
 
179
                boolean hasPopupIcon = FlamingoUtilities.hasPopupAction(commandButton);
 
180
 
 
181
                boolean ltr = commandButton.getComponentOrientation().isLeftToRight();
 
182
 
 
183
                int prefWidth = this.getPreferredSize(commandButton).width;
 
184
                int shiftX = 0;
 
185
                if (commandButton.getHorizontalAlignment() == SwingConstants.CENTER) {
 
186
                        if (width > prefWidth) {
 
187
                                shiftX = (width - prefWidth) / 2;
 
188
                        }
 
189
                }
 
190
 
 
191
                FontMetrics fm = g.getFontMetrics();
 
192
                int labelHeight = fm.getAscent() + fm.getDescent();
 
193
 
 
194
                JCommandButton.CommandButtonKind buttonKind = (commandButton instanceof JCommandButton) ? ((JCommandButton) commandButton)
 
195
                                .getCommandButtonKind()
 
196
                                : JCommandButton.CommandButtonKind.ACTION_ONLY;
 
197
                int layoutHGap = FlamingoUtilities.getHLayoutGap(commandButton);
 
198
 
 
199
                if (ltr) {
 
200
                        int x = ins.left + shiftX - layoutHGap;
 
201
 
 
202
                        // icon
 
203
                        if (hasIcon) {
 
204
                                x += layoutHGap;
 
205
 
 
206
                                result.iconRect.x = x;
 
207
                                result.iconRect.y = (height - iconSize) / 2;
 
208
                                result.iconRect.width = iconSize;
 
209
                                result.iconRect.height = iconSize;
 
210
 
 
211
                                x += (iconSize + layoutHGap);
 
212
                        }
 
213
 
 
214
                        // text
 
215
                        if (hasText) {
 
216
                                if (hasIcon) {
 
217
                                        x += (int) (layoutHGap * getIconTextGapFactor());
 
218
                                } else {
 
219
                                        x += layoutHGap;
 
220
                                }
 
221
 
 
222
                                TextLayoutInfo lineLayoutInfo = new TextLayoutInfo();
 
223
                                lineLayoutInfo.text = commandButton.getText();
 
224
                                lineLayoutInfo.textRect = new Rectangle();
 
225
                                result.textLayoutInfoList = new ArrayList<TextLayoutInfo>();
 
226
                                result.textLayoutInfoList.add(lineLayoutInfo);
 
227
 
 
228
                                lineLayoutInfo.textRect.x = x;
 
229
                                lineLayoutInfo.textRect.y = (height - labelHeight) / 2;
 
230
                                lineLayoutInfo.textRect.width = (int) fm.getStringBounds(
 
231
                                                buttonText, g).getWidth();
 
232
                                lineLayoutInfo.textRect.height = labelHeight;
 
233
                                x += lineLayoutInfo.textRect.width;
 
234
 
 
235
                                x += layoutHGap;
 
236
                        }
 
237
 
 
238
            int verticalSeparatorWidth = new JSeparator(JSeparator.VERTICAL)
 
239
                    .getPreferredSize().width;
 
240
                        if (hasPopupIcon) {
 
241
                                if (hasText && hasIcon) {
 
242
                                        x += 2 * layoutHGap;
 
243
                                }
 
244
 
 
245
                result.popupActionRect.x = commandButton.getWidth() - 1 - labelHeight / 2 - 3*layoutHGap + verticalSeparatorWidth;
 
246
                                result.popupActionRect.y = (height - labelHeight) / 2 - 1;
 
247
                                result.popupActionRect.width = 1 + labelHeight / 2;
 
248
                                result.popupActionRect.height = labelHeight + 2;
 
249
                                x += result.popupActionRect.width;
 
250
 
 
251
                                x += 2 * layoutHGap;
 
252
                        }
 
253
 
 
254
                        int xBorderBetweenActionAndPopup;
 
255
                        // compute the action and popup click areas
 
256
                        switch (buttonKind) {
 
257
                        case ACTION_ONLY:
 
258
                                result.actionClickArea.x = 0;
 
259
                                result.actionClickArea.y = 0;
 
260
                                result.actionClickArea.width = width;
 
261
                                result.actionClickArea.height = height;
 
262
                                result.isTextInActionArea = true;
 
263
                                break;
 
264
                        case POPUP_ONLY:
 
265
                                result.popupClickArea.x = 0;
 
266
                                result.popupClickArea.y = 0;
 
267
                                result.popupClickArea.width = width;
 
268
                                result.popupClickArea.height = height;
 
269
                                result.isTextInActionArea = false;
 
270
                                break;
 
271
                        case ACTION_AND_POPUP_MAIN_ACTION:
 
272
                                // 1. break before popup icon if button has text or icon
 
273
                                // 2. no break (all popup) if button has no text and no icon
 
274
                                if (hasText || hasIcon) {
 
275
                                        xBorderBetweenActionAndPopup = result.popupActionRect.x - 2
 
276
                                                        * layoutHGap;
 
277
 
 
278
                                        result.actionClickArea.x = 0;
 
279
                                        result.actionClickArea.y = 0;
 
280
                                        result.actionClickArea.width = xBorderBetweenActionAndPopup;
 
281
                                        result.actionClickArea.height = height;
 
282
 
 
283
                                        result.popupClickArea.x = xBorderBetweenActionAndPopup;
 
284
                                        result.popupClickArea.y = 0;
 
285
                                        result.popupClickArea.width = width
 
286
                                                        - xBorderBetweenActionAndPopup;
 
287
                                        result.popupClickArea.height = height;
 
288
 
 
289
                                        result.separatorOrientation = CommandButtonSeparatorOrientation.VERTICAL;
 
290
                                        result.separatorArea = new Rectangle();
 
291
                                        result.separatorArea.x = xBorderBetweenActionAndPopup;
 
292
                                        result.separatorArea.y = 0;
 
293
                                        result.separatorArea.width = verticalSeparatorWidth;
 
294
                                        result.separatorArea.height = height;
 
295
 
 
296
                                        result.isTextInActionArea = true;
 
297
                                } else {
 
298
                                        result.popupClickArea.x = 0;
 
299
                                        result.popupClickArea.y = 0;
 
300
                                        result.popupClickArea.width = width;
 
301
                                        result.popupClickArea.height = height;
 
302
 
 
303
                                        result.isTextInActionArea = false;
 
304
                                }
 
305
                                break;
 
306
                        case ACTION_AND_POPUP_MAIN_POPUP:
 
307
                                // 1. break after icon if button has icon
 
308
                                // 2. no break (all popup) if button has no icon
 
309
                                if (hasIcon) {
 
310
                                        // shift text rectangle to the right
 
311
                                        // to accomodate the vertical separator
 
312
                                        if (result.textLayoutInfoList != null) {
 
313
                                                for (TextLayoutInfo textLayoutInfo : result.textLayoutInfoList) {
 
314
                                                        textLayoutInfo.textRect.x += verticalSeparatorWidth;
 
315
                                                }
 
316
                                        }
 
317
 
 
318
                                        xBorderBetweenActionAndPopup = result.iconRect.x
 
319
                                                        + result.iconRect.width + layoutHGap;
 
320
 
 
321
                                        result.actionClickArea.x = 0;
 
322
                                        result.actionClickArea.y = 0;
 
323
                                        result.actionClickArea.width = xBorderBetweenActionAndPopup;
 
324
                                        result.actionClickArea.height = height;
 
325
 
 
326
                                        result.popupClickArea.x = xBorderBetweenActionAndPopup;
 
327
                                        result.popupClickArea.y = 0;
 
328
                                        result.popupClickArea.width = width
 
329
                                                        - xBorderBetweenActionAndPopup;
 
330
                                        result.popupClickArea.height = height;
 
331
 
 
332
                                        result.separatorOrientation = CommandButtonSeparatorOrientation.VERTICAL;
 
333
                                        result.separatorArea = new Rectangle();
 
334
                                        result.separatorArea.x = xBorderBetweenActionAndPopup;
 
335
                                        result.separatorArea.y = 0;
 
336
                                        result.separatorArea.width = verticalSeparatorWidth;
 
337
                                        result.separatorArea.height = height;
 
338
 
 
339
                                        result.isTextInActionArea = false;
 
340
                                } else {
 
341
                                        result.popupClickArea.x = 0;
 
342
                                        result.popupClickArea.y = 0;
 
343
                                        result.popupClickArea.width = width;
 
344
                                        result.popupClickArea.height = height;
 
345
 
 
346
                                        result.isTextInActionArea = true;
 
347
                                }
 
348
                                break;
 
349
                        }
 
350
                } else {
 
351
                        int x = width - ins.right - shiftX + layoutHGap;
 
352
 
 
353
                        // icon
 
354
                        if (hasIcon) {
 
355
                                x -= layoutHGap;
 
356
 
 
357
                                result.iconRect.x = x - iconSize;
 
358
                                result.iconRect.y = (height - iconSize) / 2;
 
359
                                result.iconRect.width = iconSize;
 
360
                                result.iconRect.height = iconSize;
 
361
 
 
362
                                x -= (iconSize + layoutHGap);
 
363
                        }
 
364
 
 
365
                        // text
 
366
                        if (hasText) {
 
367
                                if (hasIcon) {
 
368
                                        x -= (int) (layoutHGap * getIconTextGapFactor());
 
369
                                } else {
 
370
                                        x -= layoutHGap;
 
371
                                }
 
372
 
 
373
                                TextLayoutInfo lineLayoutInfo = new TextLayoutInfo();
 
374
                                lineLayoutInfo.text = commandButton.getText();
 
375
                                lineLayoutInfo.textRect = new Rectangle();
 
376
                                result.textLayoutInfoList = new ArrayList<TextLayoutInfo>();
 
377
                                result.textLayoutInfoList.add(lineLayoutInfo);
 
378
 
 
379
                                lineLayoutInfo.textRect.width = (int) fm.getStringBounds(
 
380
                                                buttonText, g).getWidth();
 
381
                                lineLayoutInfo.textRect.x = x - lineLayoutInfo.textRect.width;
 
382
                                lineLayoutInfo.textRect.y = (height - labelHeight) / 2;
 
383
                                lineLayoutInfo.textRect.height = labelHeight;
 
384
                                x -= lineLayoutInfo.textRect.width;
 
385
 
 
386
                                x -= layoutHGap;
 
387
                        }
 
388
 
 
389
                        if (hasPopupIcon) {
 
390
                                if (hasText && hasIcon) {
 
391
                                        x -= 2 * layoutHGap;
 
392
                                }
 
393
 
 
394
                                result.popupActionRect.width = 1 + labelHeight / 2;
 
395
                                result.popupActionRect.x = x - result.popupActionRect.width;
 
396
                result.popupActionRect.x = layoutHGap*2;
 
397
                                result.popupActionRect.y = (height - labelHeight) / 2 - 1;
 
398
                                result.popupActionRect.height = labelHeight + 2;
 
399
                                x -= result.popupActionRect.width;
 
400
 
 
401
                                x -= 2 * layoutHGap;
 
402
                        }
 
403
 
 
404
                        int xBorderBetweenActionAndPopup;
 
405
                        int verticalSeparatorWidth = new JSeparator(JSeparator.VERTICAL)
 
406
                                        .getPreferredSize().width;
 
407
                        // compute the action and popup click areas
 
408
                        switch (buttonKind) {
 
409
                        case ACTION_ONLY:
 
410
                                result.actionClickArea.x = 0;
 
411
                                result.actionClickArea.y = 0;
 
412
                                result.actionClickArea.width = width;
 
413
                                result.actionClickArea.height = height;
 
414
                                result.isTextInActionArea = true;
 
415
                                break;
 
416
                        case POPUP_ONLY:
 
417
                                result.popupClickArea.x = 0;
 
418
                                result.popupClickArea.y = 0;
 
419
                                result.popupClickArea.width = width;
 
420
                                result.popupClickArea.height = height;
 
421
                                result.isTextInActionArea = false;
 
422
                                break;
 
423
                        case ACTION_AND_POPUP_MAIN_ACTION:
 
424
                                // 1. break before popup icon if button has text or icon
 
425
                                // 2. no break (all popup) if button has no text and no icon
 
426
                                if (hasText || hasIcon) {
 
427
                                        // shift popup action rectangle to the left to
 
428
                                        // accomodate the vertical separator
 
429
 
 
430
                                        xBorderBetweenActionAndPopup = result.popupActionRect.x
 
431
                                                        + result.popupActionRect.width + 2 * layoutHGap;
 
432
 
 
433
                                        result.actionClickArea.x = xBorderBetweenActionAndPopup;
 
434
                                        result.actionClickArea.y = 0;
 
435
                                        result.actionClickArea.width = width
 
436
                                                        - xBorderBetweenActionAndPopup;
 
437
                                        result.actionClickArea.height = height;
 
438
 
 
439
                                        result.popupClickArea.x = 0;
 
440
                                        result.popupClickArea.y = 0;
 
441
                                        result.popupClickArea.width = xBorderBetweenActionAndPopup;
 
442
                                        result.popupClickArea.height = height;
 
443
 
 
444
                                        result.separatorOrientation = CommandButtonSeparatorOrientation.VERTICAL;
 
445
                                        result.separatorArea = new Rectangle();
 
446
                                        result.separatorArea.x = xBorderBetweenActionAndPopup;
 
447
                                        result.separatorArea.y = 0;
 
448
                                        result.separatorArea.width = verticalSeparatorWidth;
 
449
                                        result.separatorArea.height = height;
 
450
 
 
451
                                        result.isTextInActionArea = true;
 
452
                                } else {
 
453
                                        result.popupClickArea.x = 0;
 
454
                                        result.popupClickArea.y = 0;
 
455
                                        result.popupClickArea.width = width;
 
456
                                        result.popupClickArea.height = height;
 
457
 
 
458
                                        result.isTextInActionArea = false;
 
459
                                }
 
460
                                break;
 
461
                        case ACTION_AND_POPUP_MAIN_POPUP:
 
462
                                // 1. break after icon if button has icon
 
463
                                // 2. no break (all popup) if button has no icon
 
464
                                if (hasIcon) {
 
465
                                        // shift text rectangle and popup action rectangle to the
 
466
                                        // left to accomodate the vertical separator
 
467
                                        if (result.textLayoutInfoList != null) {
 
468
                                                for (TextLayoutInfo textLayoutInfo : result.textLayoutInfoList) {
 
469
                                                        textLayoutInfo.textRect.x -= verticalSeparatorWidth;
 
470
                                                }
 
471
                                        }
 
472
 
 
473
                                        xBorderBetweenActionAndPopup = result.iconRect.x
 
474
                                                        - layoutHGap;
 
475
 
 
476
                                        result.actionClickArea.x = xBorderBetweenActionAndPopup;
 
477
                                        result.actionClickArea.y = 0;
 
478
                                        result.actionClickArea.width = width
 
479
                                                        - xBorderBetweenActionAndPopup;
 
480
                                        result.actionClickArea.height = height;
 
481
 
 
482
                                        result.popupClickArea.x = 0;
 
483
                                        result.popupClickArea.y = 0;
 
484
                                        result.popupClickArea.width = xBorderBetweenActionAndPopup;
 
485
                                        result.popupClickArea.height = height;
 
486
 
 
487
                                        result.separatorOrientation = CommandButtonSeparatorOrientation.VERTICAL;
 
488
                                        result.separatorArea = new Rectangle();
 
489
                                        result.separatorArea.x = xBorderBetweenActionAndPopup;
 
490
                                        result.separatorArea.y = 0;
 
491
                                        result.separatorArea.width = verticalSeparatorWidth;
 
492
                                        result.separatorArea.height = height;
 
493
 
 
494
                                        result.isTextInActionArea = false;
 
495
                                } else {
 
496
                                        result.popupClickArea.x = 0;
 
497
                                        result.popupClickArea.y = 0;
 
498
                                        result.popupClickArea.width = width;
 
499
                                        result.popupClickArea.height = height;
 
500
 
 
501
                                        result.isTextInActionArea = true;
 
502
                                }
 
503
                                break;
 
504
                        }
 
505
                }
 
506
 
 
507
                return result;
 
508
        }
 
509
}