|
Lines 87-92
Link Here
|
| 87 |
return Control.this.backgroundImage; |
87 |
return Control.this.backgroundImage; |
| 88 |
} |
88 |
} |
| 89 |
|
89 |
|
|
|
90 |
public String getUserBackgroundRepeat() { |
| 91 |
switch( Control.this.backgroundRepeat ) { |
| 92 |
case SWT.BACKGROUND_REPEAT_REPEAT: |
| 93 |
return "repeat"; |
| 94 |
case SWT.BACKGROUND_REPEAT_REPEAT_X: |
| 95 |
return "repeat-x"; |
| 96 |
case SWT.BACKGROUND_REPEAT_REPEAT_Y: |
| 97 |
return "repeat-y"; |
| 98 |
case SWT.BACKGROUND_REPEAT_NO_REPEAT: |
| 99 |
return "no-repeat"; |
| 100 |
default: |
| 101 |
return null; |
| 102 |
} |
| 103 |
} |
| 104 |
|
| 105 |
public String getUserBackgroundPosition() { |
| 106 |
switch( Control.this.backgroundPosition ) { |
| 107 |
case SWT.BACKGROUND_POSITION_LEFT_TOP: |
| 108 |
return "left top"; |
| 109 |
case SWT.BACKGROUND_POSITION_LEFT_CENTER: |
| 110 |
return "left center"; |
| 111 |
case SWT.BACKGROUND_POSITION_LEFT_BOTTOM: |
| 112 |
return "left bottom"; |
| 113 |
case SWT.BACKGROUND_POSITION_RIGHT_TOP: |
| 114 |
return "right top"; |
| 115 |
case SWT.BACKGROUND_POSITION_RIGHT_CENTER: |
| 116 |
return "right center"; |
| 117 |
case SWT.BACKGROUND_POSITION_RIGHT_BOTTOM: |
| 118 |
return "right bottom"; |
| 119 |
case SWT.BACKGROUND_POSITION_CENTER_TOP: |
| 120 |
return "center top"; |
| 121 |
case SWT.BACKGROUND_POSITION_CENTER_CENTER: |
| 122 |
return "center center"; |
| 123 |
case SWT.BACKGROUND_POSITION_CENTER_BOTTOM: |
| 124 |
return "center bottom"; |
| 125 |
default: |
| 126 |
return null; |
| 127 |
} |
| 128 |
} |
| 129 |
|
| 90 |
public boolean getBackgroundTransparency() { |
130 |
public boolean getBackgroundTransparency() { |
| 91 |
return Control.this.backgroundTransparency; |
131 |
return Control.this.backgroundTransparency; |
| 92 |
} |
132 |
} |
|
Lines 107-112
Link Here
|
| 107 |
private Color foreground; |
147 |
private Color foreground; |
| 108 |
private Color background; |
148 |
private Color background; |
| 109 |
private Image backgroundImage; |
149 |
private Image backgroundImage; |
|
|
150 |
private int backgroundRepeat; |
| 151 |
private int backgroundPosition; |
| 110 |
private boolean backgroundTransparency; |
152 |
private boolean backgroundTransparency; |
| 111 |
private Font font; |
153 |
private Font font; |
| 112 |
private Cursor cursor; |
154 |
private Cursor cursor; |
|
Lines 502-507
Link Here
|
| 502 |
} |
544 |
} |
| 503 |
|
545 |
|
| 504 |
/** |
546 |
/** |
|
|
547 |
* |
| 548 |
* Sets the repeat property of the background to the receiver, which must be one of the following values: |
| 549 |
* <dl> |
| 550 |
* <dt><code>BACKGROUND_REPEAT_REPEAT</code></dt> |
| 551 |
* <dt><code>BACKGROUND_REPEAT_REPEAT_X</code></dt> |
| 552 |
* <dt><code>BACKGROUND_REPEAT_REPEAT_Y</code></dt> |
| 553 |
* <dt><code>BACKGROUND_REPEAT_NO_REPEAT</code></dt> |
| 554 |
* </dl> |
| 555 |
* |
| 556 |
* @param repeat new repeat style |
| 557 |
* |
| 558 |
* @exception SWTException <ul> |
| 559 |
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
| 560 |
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
| 561 |
* </ul> |
| 562 |
* |
| 563 |
* @since 1.4 |
| 564 |
*/ |
| 565 |
public void setBackgroundRepeat( final int repeat) { |
| 566 |
checkWidget(); |
| 567 |
if( backgroundRepeat != repeat ) { |
| 568 |
backgroundRepeat = repeat; |
| 569 |
} |
| 570 |
} |
| 571 |
|
| 572 |
/** |
| 573 |
* Returns the receiver's background repeat property. |
| 574 |
* |
| 575 |
* @return the background repeat property |
| 576 |
* |
| 577 |
* @exception SWTException <ul> |
| 578 |
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
| 579 |
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
| 580 |
* </ul> |
| 581 |
* |
| 582 |
* @since 1.4 |
| 583 |
*/ |
| 584 |
public int getBackgroundRepeat() { |
| 585 |
checkWidget(); |
| 586 |
Control control = findBackgroundControl(); |
| 587 |
if( control == null ) { |
| 588 |
control = this; |
| 589 |
} |
| 590 |
return control.backgroundRepeat; |
| 591 |
} |
| 592 |
|
| 593 |
/** |
| 594 |
* |
| 595 |
* Sets the position property of the background to the receiver, which must be one of the following values: |
| 596 |
* <dl> |
| 597 |
* <dt><code>BACKGROUND_POSITION_LEFT_TOP</code></dt> |
| 598 |
* <dt><code>BACKGROUND_POSITION_LEFT_CENTER</code></dt> |
| 599 |
* <dt><code>BACKGROUND_POSITION_LEFT_BOTTOM</code></dt> |
| 600 |
* <dt><code>BACKGROUND_POSITION_RIGHT_TOP</code></dt> |
| 601 |
* <dt><code>BACKGROUND_POSITION_RIGHT_CENTER</code></dt> |
| 602 |
* <dt><code>BACKGROUND_POSITION_RIGHT_BOTTOM</code></dt> |
| 603 |
* <dt><code>BACKGROUND_POSITION_CENTER_TOP</code></dt> |
| 604 |
* <dt><code>BACKGROUND_POSITION_CENTER_CENTER</code></dt> |
| 605 |
* <dt><code>BACKGROUND_POSITION_CENTER_BOTTOM</code></dt> |
| 606 |
* </dl> |
| 607 |
* |
| 608 |
* @param repeat new position style |
| 609 |
* |
| 610 |
* @exception SWTException <ul> |
| 611 |
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
| 612 |
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
| 613 |
* </ul> |
| 614 |
* |
| 615 |
* @since 1.4 |
| 616 |
*/ |
| 617 |
public void setBackgroundPosition( final int position) { |
| 618 |
checkWidget(); |
| 619 |
if( backgroundPosition != position ) { |
| 620 |
backgroundPosition = position; |
| 621 |
} |
| 622 |
} |
| 623 |
|
| 624 |
/** |
| 625 |
* Returns the receiver's background position property. |
| 626 |
* |
| 627 |
* @return the background position property |
| 628 |
* |
| 629 |
* @exception SWTException <ul> |
| 630 |
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> |
| 631 |
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> |
| 632 |
* </ul> |
| 633 |
* |
| 634 |
* @since 1.4 |
| 635 |
*/ |
| 636 |
public int getBackgroundPosition() { |
| 637 |
checkWidget(); |
| 638 |
Control control = findBackgroundControl(); |
| 639 |
if( control == null ) { |
| 640 |
control = this; |
| 641 |
} |
| 642 |
return control.backgroundPosition; |
| 643 |
} |
| 644 |
|
| 645 |
/** |
| 505 |
* Sets the receiver's foreground color to the color specified |
646 |
* Sets the receiver's foreground color to the color specified |
| 506 |
* by the argument, or to the default system color for the control |
647 |
* by the argument, or to the default system color for the control |
| 507 |
* if the argument is null. |
648 |
* if the argument is null. |