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

« back to all changes in this revision

Viewing changes to substance/src/main/java/org/pushingpixels/substance/api/SubstanceConstants.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 Substance 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 Substance 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.substance.api;
 
31
 
 
32
import java.awt.*;
 
33
import java.awt.geom.GeneralPath;
 
34
 
 
35
import javax.swing.*;
 
36
 
 
37
import org.pushingpixels.substance.api.shaper.SubstanceButtonShaper;
 
38
import org.pushingpixels.substance.internal.animation.TransitionAwareUI;
 
39
import org.pushingpixels.substance.internal.utils.*;
 
40
 
 
41
/**
 
42
 * <b>Substance</b> constants.
 
43
 * 
 
44
 * @author Kirill Grouchnikov
 
45
 */
 
46
public class SubstanceConstants {
 
47
        /**
 
48
         * Enumerates available sides.
 
49
         * 
 
50
         * @author Kirill Grouchnikov
 
51
         * @see SubstanceLookAndFeel#BUTTON_OPEN_SIDE_PROPERTY
 
52
         * @see SubstanceLookAndFeel#BUTTON_SIDE_PROPERTY
 
53
         */
 
54
        public static enum Side {
 
55
                /**
 
56
                 * Left side.
 
57
                 */
 
58
                LEFT,
 
59
 
 
60
                /**
 
61
                 * Right side.
 
62
                 */
 
63
                RIGHT,
 
64
 
 
65
                /**
 
66
                 * Top side.
 
67
                 */
 
68
                TOP,
 
69
 
 
70
                /**
 
71
                 * Bottom side.
 
72
                 */
 
73
                BOTTOM;
 
74
        }
 
75
 
 
76
        /**
 
77
         * Enumerates focus indication kinds.
 
78
         * 
 
79
         * @author Kirill Grouchnikov
 
80
         * @see SubstanceLookAndFeel#FOCUS_KIND
 
81
         */
 
82
        public enum FocusKind {
 
83
                /**
 
84
                 * No focus indication.
 
85
                 */
 
86
                NONE {
 
87
                        @Override
 
88
                        public void paintFocus(Component mainComp, Component focusedComp,
 
89
                                        TransitionAwareUI transitionAwareUI, Graphics2D graphics,
 
90
                                        Shape focusShape, Rectangle textRect, int extraPadding) {
 
91
                        }
 
92
                },
 
93
 
 
94
                /**
 
95
                 * Focus indication around the text.
 
96
                 */
 
97
                TEXT {
 
98
                        @Override
 
99
                        public void paintFocus(Component mainComp, Component focusedComp,
 
100
                                        TransitionAwareUI transitionAwareUI, Graphics2D graphics,
 
101
                                        Shape focusShape, Rectangle textRect, int extraPadding) {
 
102
                                if (textRect == null)
 
103
                                        return;
 
104
                                if ((textRect.width == 0) || (textRect.height == 0))
 
105
                                        return;
 
106
 
 
107
                                int fontSize = SubstanceSizeUtils
 
108
                                                .getComponentFontSize(mainComp);
 
109
                                float dashLength = getDashLength(fontSize);
 
110
                                float dashGap = getDashGap(fontSize);
 
111
                                float dashPhase = (dashLength + dashGap)
 
112
                                                * (1.0f - transitionAwareUI.getTransitionTracker()
 
113
                                                                .getFocusLoopPosition());
 
114
 
 
115
                                graphics.setStroke(new BasicStroke(SubstanceSizeUtils
 
116
                                                .getFocusStrokeWidth(fontSize), BasicStroke.CAP_BUTT,
 
117
                                                BasicStroke.JOIN_ROUND, 0.0f, new float[] { dashLength,
 
118
                                                                dashGap }, dashPhase));
 
119
 
 
120
                                int delta = ((mainComp instanceof JComboBox) || (mainComp instanceof JSpinner)) ? 0
 
121
                                                : 1;
 
122
                                GeneralPath contour = SubstanceOutlineUtilities.getBaseOutline(
 
123
                                                textRect.width + 2 * delta, textRect.height,
 
124
                                                SubstanceSizeUtils
 
125
                                                                .getClassicButtonCornerRadius(fontSize), null);
 
126
 
 
127
                                graphics.translate(textRect.x - delta, textRect.y);
 
128
                                graphics.draw(contour);
 
129
                        }
 
130
 
 
131
                        /*
 
132
                         * (non-Javadoc)
 
133
                         * 
 
134
                         * @see
 
135
                         * org.pushingpixels.substance.utils.SubstanceConstants.FocusKind
 
136
                         * #isAnimated ()
 
137
                         */
 
138
                        @Override
 
139
                        public boolean isAnimated() {
 
140
                                return true;
 
141
                        }
 
142
                },
 
143
 
 
144
                /**
 
145
                 * Focus indication around the whole component.
 
146
                 */
 
147
                ALL {
 
148
                        @Override
 
149
                        public void paintFocus(Component mainComp, Component focusedComp,
 
150
                                        TransitionAwareUI transitionAwareUI, Graphics2D graphics,
 
151
                                        Shape focusShape, Rectangle textRect, int extraPadding) {
 
152
                                if ((focusShape == null)
 
153
                                                && ((mainComp instanceof AbstractButton)
 
154
                                                                && !(mainComp instanceof JCheckBox) && !(mainComp instanceof JRadioButton))) {
 
155
                                        SubstanceButtonShaper shaper = SubstanceCoreUtilities
 
156
                                                        .getButtonShaper(mainComp);
 
157
                                        if (shaper == null)
 
158
                                                return;
 
159
 
 
160
                                        int fontSize = SubstanceSizeUtils
 
161
                                                        .getComponentFontSize(mainComp);
 
162
                                        float dashLength = getDashLength(fontSize);
 
163
                                        float dashGap = getDashGap(fontSize);
 
164
                                        float dashPhase = (dashLength + dashGap)
 
165
                                                        * (1.0f - transitionAwareUI.getTransitionTracker()
 
166
                                                                        .getFocusLoopPosition());
 
167
                                        graphics.setStroke(new BasicStroke(SubstanceSizeUtils
 
168
                                                        .getFocusStrokeWidth(fontSize),
 
169
                                                        BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 0.0f,
 
170
                                                        new float[] { dashLength, dashGap }, dashPhase));
 
171
 
 
172
                                        Shape contour = shaper.getButtonOutline(
 
173
                                                        (AbstractButton) mainComp, null, mainComp
 
174
                                                                        .getWidth(), mainComp.getHeight(), false);
 
175
                                        graphics.draw(contour);
 
176
                                        // }
 
177
                                } else {
 
178
                                        // graphics.translate(textRect.x - 1, textRect.y - 1);
 
179
                                        graphics.translate(1, 1);
 
180
                                        Shape contour = (focusShape != null) ? focusShape
 
181
                                                        : SubstanceOutlineUtilities
 
182
                                                                        .getBaseOutline(
 
183
                                                                                        mainComp.getWidth() - 2,
 
184
                                                                                        mainComp.getHeight() - 2,
 
185
                                                                                        SubstanceSizeUtils
 
186
                                                                                                        .getClassicButtonCornerRadius(SubstanceSizeUtils
 
187
                                                                                                                        .getComponentFontSize(mainComp)),
 
188
                                                                                        null);
 
189
 
 
190
                                        int fontSize = SubstanceSizeUtils
 
191
                                                        .getComponentFontSize(mainComp);
 
192
                                        float dashLength = getDashLength(fontSize);
 
193
                                        float dashGap = getDashGap(fontSize);
 
194
                                        float dashPhase = (dashLength + dashGap)
 
195
                                                        * (1.0f - transitionAwareUI.getTransitionTracker()
 
196
                                                                        .getFocusLoopPosition());
 
197
                                        graphics.setStroke(new BasicStroke(SubstanceSizeUtils
 
198
                                                        .getFocusStrokeWidth(fontSize),
 
199
                                                        BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 0.0f,
 
200
                                                        new float[] { dashLength, dashGap }, dashPhase));
 
201
                                        graphics.draw(contour);
 
202
                                }
 
203
                        }
 
204
 
 
205
                        /*
 
206
                         * (non-Javadoc)
 
207
                         * 
 
208
                         * @see
 
209
                         * org.pushingpixels.substance.utils.SubstanceConstants.FocusKind
 
210
                         * #isAnimated ()
 
211
                         */
 
212
                        @Override
 
213
                        public boolean isAnimated() {
 
214
                                return true;
 
215
                        }
 
216
                },
 
217
 
 
218
                /**
 
219
                 * Focus indication around the whole component, but moved 1 pixel inside
 
220
                 * the component.
 
221
                 */
 
222
                ALL_INNER {
 
223
                        @Override
 
224
                        public void paintFocus(Component mainComp, Component focusedComp,
 
225
                                        TransitionAwareUI transitionAwareUI, Graphics2D graphics,
 
226
                                        Shape focusShape, Rectangle textRect, int extraPadding) {
 
227
 
 
228
                                if ((focusShape == null)
 
229
                                                && ((mainComp instanceof AbstractButton)
 
230
                                                                && !(mainComp instanceof JCheckBox) && !(mainComp instanceof JRadioButton))) {
 
231
                                        SubstanceButtonShaper shaper = SubstanceCoreUtilities
 
232
                                                        .getButtonShaper(mainComp);
 
233
                                        if (shaper == null)
 
234
                                                return;
 
235
 
 
236
                                        if (shaper.isProportionate()) {
 
237
                                                int fontSize = SubstanceSizeUtils
 
238
                                                                .getComponentFontSize(mainComp);
 
239
                                                float dashLength = getDashLength(fontSize);
 
240
                                                float dashGap = getDashGap(fontSize);
 
241
                                                float dashPhase = (dashLength + dashGap)
 
242
                                                                * (1.0f - transitionAwareUI
 
243
                                                                                .getTransitionTracker()
 
244
                                                                                .getFocusLoopPosition());
 
245
                                                float focusStrokeWidth = SubstanceSizeUtils
 
246
                                                                .getFocusStrokeWidth(fontSize);
 
247
                                                graphics.setStroke(new BasicStroke(focusStrokeWidth,
 
248
                                                                BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND,
 
249
                                                                0.0f, new float[] { dashLength, dashGap },
 
250
                                                                dashPhase));
 
251
                                                int insetsPix = extraPadding;
 
252
                                                Insets insets = new Insets(insetsPix, insetsPix,
 
253
                                                                insetsPix, insetsPix);
 
254
 
 
255
                                                Shape contour = shaper.getButtonOutline(
 
256
                                                                (AbstractButton) mainComp, insets, mainComp
 
257
                                                                                .getWidth(), mainComp.getHeight(),
 
258
                                                                false);
 
259
                                                graphics.draw(contour);
 
260
                                        }
 
261
                                } else {
 
262
                                        graphics.translate(extraPadding / 2, extraPadding / 2);
 
263
                                        int fontSize = SubstanceSizeUtils
 
264
                                                        .getComponentFontSize(mainComp);
 
265
                                        Shape contour = (focusShape != null) ? focusShape
 
266
                                                        : SubstanceOutlineUtilities.getBaseOutline(mainComp
 
267
                                                                        .getWidth()
 
268
                                                                        - extraPadding, mainComp.getHeight()
 
269
                                                                        - extraPadding, SubstanceSizeUtils
 
270
                                                                        .getClassicButtonCornerRadius(fontSize),
 
271
                                                                        null);
 
272
 
 
273
                                        float dashLength = getDashLength(fontSize);
 
274
                                        float dashGap = getDashGap(fontSize);
 
275
                                        float dashPhase = (dashLength + dashGap)
 
276
                                                        * (1.0f - transitionAwareUI.getTransitionTracker()
 
277
                                                                        .getFocusLoopPosition());
 
278
 
 
279
                                        graphics.setStroke(new BasicStroke(SubstanceSizeUtils
 
280
                                                        .getFocusStrokeWidth(fontSize),
 
281
                                                        BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 0.0f,
 
282
                                                        new float[] { dashLength, dashGap }, dashPhase));
 
283
                                        graphics.draw(contour);
 
284
                                }
 
285
                        }
 
286
 
 
287
                        /*
 
288
                         * (non-Javadoc)
 
289
                         * 
 
290
                         * @see
 
291
                         * org.pushingpixels.substance.utils.SubstanceConstants.FocusKind
 
292
                         * #isAnimated ()
 
293
                         */
 
294
                        @Override
 
295
                        public boolean isAnimated() {
 
296
                                return true;
 
297
                        }
 
298
                },
 
299
 
 
300
                /**
 
301
                 * Focus indication around the whole component, but moved 1 pixel inside
 
302
                 * the component.
 
303
                 */
 
304
                ALL_STRONG_INNER {
 
305
                        @Override
 
306
                        public void paintFocus(Component mainComp, Component focusedComp,
 
307
                                        TransitionAwareUI transitionAwareUI, Graphics2D graphics,
 
308
                                        Shape focusShape, Rectangle textRect, int extraPadding) {
 
309
                                if ((focusShape == null)
 
310
                                                && ((mainComp instanceof AbstractButton)
 
311
                                                                && !(mainComp instanceof JCheckBox) && !(mainComp instanceof JRadioButton))) {
 
312
                                        SubstanceButtonShaper shaper = SubstanceCoreUtilities
 
313
                                                        .getButtonShaper(mainComp);
 
314
                                        if (shaper == null)
 
315
                                                return;
 
316
 
 
317
                                        if (shaper.isProportionate()) {
 
318
                                                Insets insets = new Insets(extraPadding, extraPadding,
 
319
                                                                extraPadding, extraPadding);
 
320
 
 
321
                                                Shape contour = shaper.getButtonOutline(
 
322
                                                                (AbstractButton) mainComp, insets, mainComp
 
323
                                                                                .getWidth(), mainComp.getHeight(),
 
324
                                                                false);
 
325
                                                graphics.draw(contour);
 
326
                                        }
 
327
                                } else {
 
328
                                        graphics.translate(extraPadding / 2, extraPadding / 2);
 
329
                                        Shape contour = (focusShape != null) ? focusShape
 
330
                                                        : SubstanceOutlineUtilities
 
331
                                                                        .getBaseOutline(
 
332
                                                                                        mainComp.getWidth() - extraPadding,
 
333
                                                                                        mainComp.getHeight() - extraPadding,
 
334
                                                                                        SubstanceSizeUtils
 
335
                                                                                                        .getClassicButtonCornerRadius(SubstanceSizeUtils
 
336
                                                                                                                        .getComponentFontSize(mainComp)),
 
337
                                                                                        null);
 
338
 
 
339
                                        graphics.draw(contour);
 
340
                                }
 
341
                        }
 
342
                },
 
343
 
 
344
                /**
 
345
                 * Focus indication under the component text.
 
346
                 */
 
347
                UNDERLINE {
 
348
                        @Override
 
349
                        public void paintFocus(Component mainComp, Component focusedComp,
 
350
                                        TransitionAwareUI transitionAwareUI, Graphics2D graphics,
 
351
                                        Shape focusShape, Rectangle textRect, int extraPadding) {
 
352
                                if (textRect == null)
 
353
                                        return;
 
354
 
 
355
                                int fontSize = SubstanceSizeUtils
 
356
                                                .getComponentFontSize(mainComp);
 
357
                                float dashLength = getDashLength(fontSize);
 
358
                                float dashGap = getDashGap(fontSize);
 
359
                                float dashPhase = (dashLength + dashGap)
 
360
                                                * (1.0f - transitionAwareUI.getTransitionTracker()
 
361
                                                                .getFocusLoopPosition());
 
362
 
 
363
                                graphics.setStroke(new BasicStroke(SubstanceSizeUtils
 
364
                                                .getFocusStrokeWidth(fontSize), BasicStroke.CAP_BUTT,
 
365
                                                BasicStroke.JOIN_ROUND, 0.0f, new float[] { dashLength,
 
366
                                                                dashGap }, dashPhase));
 
367
 
 
368
                                graphics.translate(textRect.x - 1, textRect.y);
 
369
                                graphics.drawLine(0, textRect.height - 1, textRect.width,
 
370
                                                textRect.height - 1);
 
371
                                graphics.dispose();
 
372
                        }
 
373
 
 
374
                        /*
 
375
                         * (non-Javadoc)
 
376
                         * 
 
377
                         * @see
 
378
                         * org.pushingpixels.substance.utils.SubstanceConstants.FocusKind
 
379
                         * #isAnimated ()
 
380
                         */
 
381
                        @Override
 
382
                        public boolean isAnimated() {
 
383
                                return true;
 
384
                        }
 
385
                },
 
386
 
 
387
                /**
 
388
                 * Strong focus indication under the component text.
 
389
                 */
 
390
                STRONG_UNDERLINE {
 
391
                        @Override
 
392
                        public void paintFocus(Component mainComp, Component focusedComp,
 
393
                                        TransitionAwareUI transitionAwareUI, Graphics2D graphics,
 
394
                                        Shape focusShape, Rectangle textRect, int extraPadding) {
 
395
                                if (textRect == null)
 
396
                                        return;
 
397
 
 
398
                                graphics.translate(textRect.x - 1, textRect.y);
 
399
                                graphics.drawLine(0, textRect.height - 1, textRect.width,
 
400
                                                textRect.height - 1);
 
401
                        }
 
402
                };
 
403
 
 
404
                /**
 
405
                 * Paints the focus ring on the specified component.
 
406
                 * 
 
407
                 * @param mainComp
 
408
                 *            The main component for the focus painting.
 
409
                 * @param focusedComp
 
410
                 *            The actual component that has the focus. For example, the
 
411
                 *            main component can be a {@link JSpinner}, while the
 
412
                 *            focused component is a text field inside the the spinner
 
413
                 *            editor.
 
414
                 * @param graphics
 
415
                 *            Graphics context.
 
416
                 * @param focusShape
 
417
                 *            Focus shape. May be <code>null</code> - in this case, the
 
418
                 *            bounds of <code>mainComp</code> will be used.
 
419
                 * @param textRect
 
420
                 *            Text rectangle (if relevant).
 
421
                 * @param extraPadding
 
422
                 *            Extra padding between the component bounds and the focus
 
423
                 *            ring painting.
 
424
                 */
 
425
                public abstract void paintFocus(Component mainComp,
 
426
                                Component focusedComp, TransitionAwareUI transitionAwareUI,
 
427
                                Graphics2D graphics, Shape focusShape, Rectangle textRect,
 
428
                                int extraPadding);
 
429
 
 
430
                /**
 
431
                 * Returns DPI-aware dash length for dash-based focus painting.
 
432
                 * 
 
433
                 * @param fontSize
 
434
                 *            The font size of the component for focus painting.
 
435
                 * @return DPI-aware dash length for dash-based focus painting.
 
436
                 */
 
437
                protected static float getDashLength(int fontSize) {
 
438
                        return 2.0f + SubstanceSizeUtils.getExtraPadding(fontSize);
 
439
                }
 
440
 
 
441
                /**
 
442
                 * Returns DPI-aware dash gap for dash-based focus painting.
 
443
                 * 
 
444
                 * @param fontSize
 
445
                 *            The font size of the component for focus painting.
 
446
                 * @return DPI-aware dash gap for dash-based focus painting.
 
447
                 */
 
448
                protected static float getDashGap(int fontSize) {
 
449
                        return getDashLength(fontSize) / 2.0f;
 
450
                }
 
451
 
 
452
                /**
 
453
                 * Returns indication whether <code>this</code> focus kind can be
 
454
                 * animated. For example, focus rings painted with solid lines are
 
455
                 * generally static.
 
456
                 * 
 
457
                 * @return <code>true</code> if <code>this</code> focus kind can be
 
458
                 *         animated, <code>false</code> otherwise.
 
459
                 */
 
460
                public boolean isAnimated() {
 
461
                        return false;
 
462
                }
 
463
        }
 
464
 
 
465
        /**
 
466
         * Enumerates of image-based watermarks kinds.
 
467
         * 
 
468
         * @author Kirill Grouchnikov
 
469
         * @see org.pushingpixels.substance.api.watermark.SubstanceImageWatermark#setKind(org.pushingpixels.substance.api.SubstanceConstants.ImageWatermarkKind)
 
470
         * @see org.pushingpixels.substance.api.watermark.SubstanceImageWatermark#getKind()
 
471
         */
 
472
        public enum ImageWatermarkKind {
 
473
                /**
 
474
                 * The default behaviour. The image is centered in the screen and scaled
 
475
                 * down if necessary.
 
476
                 */
 
477
                SCREEN_CENTER_SCALE,
 
478
 
 
479
                /**
 
480
                 * The image is tiled starting from the screen top-left corner and not
 
481
                 * scaled.
 
482
                 */
 
483
                SCREEN_TILE,
 
484
 
 
485
                /**
 
486
                 * The image is anchored to the top-left corner of the application frame
 
487
                 * and not scaled.
 
488
                 */
 
489
                APP_ANCHOR,
 
490
 
 
491
                /**
 
492
                 * The image is anchored to the center of the application frame and not
 
493
                 * scaled.
 
494
                 */
 
495
                APP_CENTER,
 
496
 
 
497
                /**
 
498
                 * The image is tiled starting from the top-left corner of the
 
499
                 * application frame and not scaled.
 
500
                 */
 
501
                APP_TILE
 
502
        }
 
503
 
 
504
        /**
 
505
         * Enumerates possible modes of closing tabs.
 
506
         * 
 
507
         * @author Kirill Grouchnikov
 
508
         * @see SubstanceLookAndFeel#TABBED_PANE_CLOSE_CALLBACK
 
509
         */
 
510
        public enum TabCloseKind {
 
511
                /**
 
512
                 * Indicates that no tabs should be closed.
 
513
                 */
 
514
                NONE,
 
515
 
 
516
                /**
 
517
                 * Indicates that the specified tab should be closed.
 
518
                 */
 
519
                THIS,
 
520
 
 
521
                /**
 
522
                 * Indicates that all tabs should be closed.
 
523
                 */
 
524
                ALL,
 
525
 
 
526
                /**
 
527
                 * Indicates that all tabs except the specified should be closed.
 
528
                 */
 
529
                ALL_BUT_THIS
 
530
        }
 
531
 
 
532
        /**
 
533
         * Enumerates possible button policies for scroll panes.
 
534
         * 
 
535
         * @author Kirill Grouchnikov
 
536
         * @see SubstanceLookAndFeel#SCROLL_PANE_BUTTONS_POLICY
 
537
         */
 
538
        public enum ScrollPaneButtonPolicyKind {
 
539
                /**
 
540
                 * The <code>empty</code> button policy - no buttons.
 
541
                 */
 
542
                NONE,
 
543
 
 
544
                /**
 
545
                 * The <code>opposite</code> (default) button policy - the decrease
 
546
                 * button is on one side of the scroll bar, and the increase button is
 
547
                 * on the other side of the scroll bar.
 
548
                 */
 
549
                OPPOSITE,
 
550
 
 
551
                /**
 
552
                 * The <code>adjacent</code> button policy - both the decrease button
 
553
                 * and the increase button are on the same side of the scroll bar
 
554
                 * adjacent to each other (like on Mac).
 
555
                 */
 
556
                ADJACENT,
 
557
 
 
558
                /**
 
559
                 * The <code>multiple</code> button policy - there are two decrease
 
560
                 * buttons on the opposite side of the scroll bar and the increase
 
561
                 * button is adjacent to the second decrease button. This combines the
 
562
                 * {@link #OPPOSITE} and the {@link #ADJACENT} policies together.
 
563
                 */
 
564
                MULTIPLE,
 
565
 
 
566
                /**
 
567
                 * The <code>multiple both</code> button policy - there are two pairs of
 
568
                 * decrease-increase buttons on the opposite sides of the scroll bar.
 
569
                 * This extends the {@link #MULTIPLE} policy.
 
570
                 */
 
571
                MULTIPLE_BOTH
 
572
        }
 
573
 
 
574
        /**
 
575
         * Enumerates possible values for menu gutter fill kind.
 
576
         * 
 
577
         * @author Kirill Grouchnikov
 
578
         * @see SubstanceLookAndFeel#MENU_GUTTER_FILL_KIND
 
579
         */
 
580
        public enum MenuGutterFillKind {
 
581
                /**
 
582
                 * The <code>none</code> fill kind - draws no background in the menu
 
583
                 * gutter.
 
584
                 */
 
585
                NONE,
 
586
 
 
587
                /**
 
588
                 * The <code>soft fill</code> fill kind - draws light fill background in
 
589
                 * the menu gutter.
 
590
                 */
 
591
                SOFT_FILL,
 
592
 
 
593
                /**
 
594
                 * The <code>hard fill</code> fill kind - draws darker fill background
 
595
                 * in the menu gutter.
 
596
                 */
 
597
                HARD_FILL,
 
598
 
 
599
                /**
 
600
                 * The <code>soft</code> fill kind - draws gradient ranging from darker
 
601
                 * to light in the menu gutter.
 
602
                 */
 
603
                SOFT,
 
604
 
 
605
                /**
 
606
                 * The <code>hard</code> (default) fill kind - draws gradient ranging
 
607
                 * from darker to light in the menu gutter.
 
608
                 */
 
609
                HARD
 
610
        }
 
611
 
 
612
        /**
 
613
         * Tab content pane border kind.
 
614
         * 
 
615
         * @author Kirill Grouchnikov
 
616
         * @since version 4.1
 
617
         */
 
618
        public enum TabContentPaneBorderKind {
 
619
                /**
 
620
                 * The content pane has full border on all sides plus an additional line
 
621
                 * along the tab placement side (as in Firefox 2.0, Internet Explorer
 
622
                 * 7.0 and Nimbus). This is the default kind starting from version 4.1.
 
623
                 */
 
624
                DOUBLE_FULL,
 
625
 
 
626
                /**
 
627
                 * The content pane has full single border on all sides. This has been
 
628
                 * the default kind prior to version 4.1.
 
629
                 */
 
630
                SINGLE_FULL,
 
631
 
 
632
                /**
 
633
                 * The content pane has double border along the tab placement side.
 
634
                 */
 
635
                DOUBLE_PLACEMENT,
 
636
 
 
637
                /**
 
638
                 * The content pane has single border along the tab placement side.
 
639
                 */
 
640
                SINGLE_PLACEMENT
 
641
        }
 
642
 
 
643
        /**
 
644
         * Enumerates configurable Substance-specific widget types for
 
645
         * {@link SubstanceLookAndFeel#setWidgetVisible(javax.swing.JRootPane, boolean, org.pushingpixels.substance.api.SubstanceConstants.SubstanceWidgetType...)}
 
646
         * API.
 
647
         * 
 
648
         * @author Kirill Grouchnikov
 
649
         */
 
650
        public enum SubstanceWidgetType {
 
651
                /**
 
652
                 * Menu search widget.
 
653
                 */
 
654
                MENU_SEARCH,
 
655
 
 
656
                /**
 
657
                 * Title pane heap status widget.
 
658
                 */
 
659
                TITLE_PANE_HEAP_STATUS
 
660
        }
 
661
}