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