|
@@ -1,8 +1,8 @@ |
1 |
1 |
|
package org.litesoft.GWT.client.widgets.sliderbar.client.solution.iph; |
2 |
2 |
|
|
3 |
|
- |
import com.google.gwt.user.client.ui.Image; |
4 |
|
- |
import com.google.gwt.user.client.ui.Label; |
5 |
|
- |
import org.litesoft.GWT.client.widgets.sliderbar.client.view.TouchableAbsolutePanelPK; |
|
3 |
+ |
import org.litesoft.GWT.client.widgets.sliderbar.client.view.*; |
|
4 |
+ |
|
|
5 |
+ |
import com.google.gwt.user.client.ui.*; |
6 |
6 |
|
|
7 |
7 |
|
public class IScale extends TouchableAbsolutePanelPK { |
8 |
8 |
|
|
|
@@ -11,41 +11,40 @@ |
11 |
11 |
|
int imgHeight; |
12 |
12 |
|
int imgWidth; |
13 |
13 |
|
|
14 |
|
- |
public IScale(String leftTxt, String rightTxt, int imgWidth, int imgHeight){ |
|
14 |
+ |
public IScale( String leftTxt, String rightTxt, int imgWidth, int imgHeight ) { |
15 |
15 |
|
this.imgWidth = imgWidth; |
16 |
16 |
|
this.imgHeight = imgHeight; |
17 |
|
- |
leftLabel.setText(leftTxt); |
18 |
|
- |
rightLabel.setText(rightTxt); |
|
17 |
+ |
leftLabel.setText( leftTxt ); |
|
18 |
+ |
rightLabel.setText( rightTxt ); |
19 |
19 |
|
} |
20 |
20 |
|
|
21 |
|
- |
public void addLeftStyleName(String styleName){ |
22 |
|
- |
leftLabel.addStyleName(styleName); |
|
21 |
+ |
public void addLeftStyleName( String styleName ) { |
|
22 |
+ |
leftLabel.addStyleName( styleName ); |
23 |
23 |
|
} |
24 |
24 |
|
|
25 |
|
- |
public void addRightStyleName(String styleName){ |
26 |
|
- |
rightLabel.addStyleName(styleName); |
|
25 |
+ |
public void addRightStyleName( String styleName ) { |
|
26 |
+ |
rightLabel.addStyleName( styleName ); |
27 |
27 |
|
} |
28 |
28 |
|
|
29 |
|
- |
public void setBackGroundImage(Image image){ |
|
29 |
+ |
public void setBackGroundImage( Image image ) { |
30 |
30 |
|
this.image = image; |
31 |
|
- |
this.add(image, 0,0); |
32 |
|
- |
this.add(leftLabel,0,0); |
33 |
|
- |
this.add(rightLabel,0,0); |
|
31 |
+ |
this.add( image, 0, 0 ); |
|
32 |
+ |
this.add( leftLabel, 0, 0 ); |
|
33 |
+ |
this.add( rightLabel, 0, 0 ); |
34 |
34 |
|
} |
35 |
35 |
|
|
36 |
|
- |
protected void placeLabels(){ |
37 |
|
- |
this.setWidgetPosition(leftLabel, |
38 |
|
- |
(imgWidth/2 - leftLabel.getOffsetWidth())/2, |
39 |
|
- |
(imgHeight - leftLabel.getOffsetHeight())/2); |
40 |
|
- |
this.setWidgetPosition(rightLabel, |
41 |
|
- |
imgWidth/2 +(imgWidth/2 - rightLabel.getOffsetWidth())/2, |
42 |
|
- |
(imgHeight - rightLabel.getOffsetHeight())/2); |
|
36 |
+ |
protected void placeLabels() { |
|
37 |
+ |
this.setWidgetPosition( leftLabel, |
|
38 |
+ |
(imgWidth / 2 - leftLabel.getOffsetWidth()) / 2, |
|
39 |
+ |
(imgHeight - leftLabel.getOffsetHeight()) / 2 ); |
|
40 |
+ |
this.setWidgetPosition( rightLabel, |
|
41 |
+ |
imgWidth / 2 + (imgWidth / 2 - rightLabel.getOffsetWidth()) / 2, |
|
42 |
+ |
(imgHeight - rightLabel.getOffsetHeight()) / 2 ); |
43 |
43 |
|
} |
44 |
44 |
|
|
45 |
45 |
|
protected void onLoad() { |
46 |
46 |
|
super.onLoad(); |
47 |
|
- |
setPixelSize(image.getOffsetWidth(), image.getOffsetHeight()); |
|
47 |
+ |
setPixelSize( image.getOffsetWidth(), image.getOffsetHeight() ); |
48 |
48 |
|
placeLabels(); |
49 |
49 |
|
} |
50 |
|
- |
|
51 |
50 |
|
} |