Subversion Repository Public Repository

litesoft

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package org.litesoft.GWT.client.widgets.sliderbar.client.solution.iph;

import org.litesoft.GWT.client.widgets.sliderbar.client.view.*;

import com.google.gwt.user.client.ui.*;

public class IScale extends TouchableAbsolutePanelPK {

    Label leftLabel = new Label(), rightLabel = new Label();
    Image image;
    int imgHeight;
    int imgWidth;

    public IScale( String leftTxt, String rightTxt, int imgWidth, int imgHeight ) {
        this.imgWidth = imgWidth;
        this.imgHeight = imgHeight;
        leftLabel.setText( leftTxt );
        rightLabel.setText( rightTxt );
    }

    public void addLeftStyleName( String styleName ) {
        leftLabel.addStyleName( styleName );
    }

    public void addRightStyleName( String styleName ) {
        rightLabel.addStyleName( styleName );
    }

    public void setBackGroundImage( Image image ) {
        this.image = image;
        this.add( image, 0, 0 );
        this.add( leftLabel, 0, 0 );
        this.add( rightLabel, 0, 0 );
    }

    protected void placeLabels() {
        this.setWidgetPosition( leftLabel,
                                (imgWidth / 2 - leftLabel.getOffsetWidth()) / 2,
                                (imgHeight - leftLabel.getOffsetHeight()) / 2 );
        this.setWidgetPosition( rightLabel,
                                imgWidth / 2 + (imgWidth / 2 - rightLabel.getOffsetWidth()) / 2,
                                (imgHeight - rightLabel.getOffsetHeight()) / 2 );
    }

    protected void onLoad() {
        super.onLoad();
        setPixelSize( image.getOffsetWidth(), image.getOffsetHeight() );
        placeLabels();
    }
}

Commits for litesoft/trunk/Java/GWT/Client/src/org/litesoft/GWT/client/widgets/sliderbar/client/solution/iph/IScale.java

Diff revisions: vs.
Revision Author Commited Message
950 Diff Diff GeorgeS picture GeorgeS Thu 19 Jun, 2014 17:57:04 +0000

New Lines

948 Diff Diff GeorgeS picture GeorgeS Sat 07 Jun, 2014 23:42:39 +0000

Jusefuls Formatter Updated to New Code Format

917 GeorgeS picture GeorgeS Sun 08 Dec, 2013 20:49:56 +0000

1.7 prep & VersionedStaticContentFilter upgrade to new “/ver” model!