File tree Expand file tree Collapse file tree 9 files changed +4252
-0
lines changed
java/gwt/material/design/incubator/client/viewer
resources/gwt/material/design/incubator/client/viewer/resources Expand file tree Collapse file tree 9 files changed +4252
-0
lines changed Original file line number Diff line number Diff line change 1+ package gwt .material .design .incubator .client .viewer ;
2+
3+ import com .google .gwt .user .client .Element ;
4+ import gwt .material .design .client .MaterialDesignBase ;
5+ import gwt .material .design .client .ui .MaterialImage ;
6+ import gwt .material .design .incubator .client .viewer .js .JsImageViewer ;
7+ import gwt .material .design .incubator .client .viewer .js .ViewerOptions ;
8+
9+ public class ImageViewer {
10+
11+ static {
12+ MaterialDesignBase .injectCss (ImageViewerDebugClientBundle .INSTANCE .viewerCss ());
13+ MaterialDesignBase .injectJs (ImageViewerDebugClientBundle .INSTANCE .viewerJs ());
14+ }
15+
16+ protected JsImageViewer viewer ;
17+ protected ViewerOptions options = new ViewerOptions ();
18+ protected MaterialImage image = new MaterialImage ();
19+
20+ public ImageViewer () {
21+ }
22+
23+ public void load (Element element ) {
24+ viewer = new JsImageViewer (element , options );
25+ }
26+
27+ public void destroy () {
28+ viewer .destroy ();
29+ }
30+
31+ public void update () {
32+ viewer .update ();
33+ }
34+
35+ public ViewerOptions getOptions () {
36+ return options ;
37+ }
38+
39+ public void setOptions (ViewerOptions options ) {
40+ this .options = options ;
41+ }
42+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * #%L
3+ * GwtMaterial
4+ * %%
5+ * Copyright (C) 2015 - 2017 GwtMaterialDesign
6+ * %%
7+ * Licensed under the Apache License, Version 2.0 (the "License");
8+ * you may not use this file except in compliance with the License.
9+ * You may obtain a copy of the License at
10+ *
11+ * http://www.apache.org/licenses/LICENSE-2.0
12+ *
13+ * Unless required by applicable law or agreed to in writing, software
14+ * distributed under the License is distributed on an "AS IS" BASIS,
15+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+ * See the License for the specific language governing permissions and
17+ * limitations under the License.
18+ * #L%
19+ */
20+ package gwt .material .design .incubator .client .viewer ;
21+
22+ import com .google .gwt .core .client .GWT ;
23+ import com .google .gwt .resources .client .ClientBundle ;
24+ import com .google .gwt .resources .client .TextResource ;
25+
26+ /**
27+ * Client Bundle resources for GroupToggleButton component<br>
28+ *
29+ * @author kevzlou7979
30+ */
31+ public interface ImageViewerClientBundle extends ClientBundle {
32+ ImageViewerClientBundle INSTANCE = GWT .create (ImageViewerClientBundle .class );
33+
34+ @ Source ("resources/css/viewer.min.css" )
35+ TextResource viewerCss ();
36+
37+ @ Source ("resources/js/viewer.min.js" )
38+ TextResource viewerJs ();
39+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * #%L
3+ * GwtMaterial
4+ * %%
5+ * Copyright (C) 2015 - 2017 GwtMaterialDesign
6+ * %%
7+ * Licensed under the Apache License, Version 2.0 (the "License");
8+ * you may not use this file except in compliance with the License.
9+ * You may obtain a copy of the License at
10+ *
11+ * http://www.apache.org/licenses/LICENSE-2.0
12+ *
13+ * Unless required by applicable law or agreed to in writing, software
14+ * distributed under the License is distributed on an "AS IS" BASIS,
15+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+ * See the License for the specific language governing permissions and
17+ * limitations under the License.
18+ * #L%
19+ */
20+ package gwt .material .design .incubator .client .viewer ;
21+
22+ import com .google .gwt .core .client .GWT ;
23+ import com .google .gwt .resources .client .ClientBundle ;
24+ import com .google .gwt .resources .client .TextResource ;
25+
26+ /**
27+ * Client Bundle resources for GroupToggleButton component<br>
28+ *
29+ * @author kevzlou7979
30+ */
31+ public interface ImageViewerDebugClientBundle extends ClientBundle {
32+ ImageViewerDebugClientBundle INSTANCE = GWT .create (ImageViewerDebugClientBundle .class );
33+
34+ @ Source ("resources/css/viewer.css" )
35+ TextResource viewerCss ();
36+
37+ @ Source ("resources/js/viewer.js" )
38+ TextResource viewerJs ();
39+ }
Original file line number Diff line number Diff line change 1+ package gwt .material .design .incubator .client .viewer .js ;
2+
3+ import jsinterop .annotations .JsConstructor ;
4+ import jsinterop .annotations .JsMethod ;
5+ import jsinterop .annotations .JsPackage ;
6+ import jsinterop .annotations .JsType ;
7+
8+ @ JsType (isNative = true , name = "Viewer" , namespace = JsPackage .GLOBAL )
9+ public class JsImageViewer {
10+
11+ @ JsConstructor
12+ public JsImageViewer (Object element , ViewerOptions options ) {
13+
14+ }
15+
16+ @ JsMethod
17+ public native void destroy ();
18+
19+ @ JsMethod
20+ public native void update ();
21+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * #%L
3+ * GwtMaterial
4+ * %%
5+ * Copyright (C) 2015 - 2017 GwtMaterialDesign
6+ * %%
7+ * Licensed under the Apache License, Version 2.0 (the "License");
8+ * you may not use this file except in compliance with the License.
9+ * You may obtain a copy of the License at
10+ *
11+ * http://www.apache.org/licenses/LICENSE-2.0
12+ *
13+ * Unless required by applicable law or agreed to in writing, software
14+ * distributed under the License is distributed on an "AS IS" BASIS,
15+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+ * See the License for the specific language governing permissions and
17+ * limitations under the License.
18+ * #L%
19+ */
20+ package gwt .material .design .incubator .client .viewer .js ;
21+
22+ import gwt .material .design .jquery .client .api .Functions ;
23+ import jsinterop .annotations .JsPackage ;
24+ import jsinterop .annotations .JsProperty ;
25+ import jsinterop .annotations .JsType ;
26+
27+ /**
28+ * Options for Image Viewer
29+ *
30+ * @author kevzlou7979
31+ */
32+ @ JsType (isNative = true , name = "Object" , namespace = JsPackage .GLOBAL )
33+ public class ViewerOptions {
34+
35+ @ JsProperty
36+ public Integer tapZoomFactor ;
37+
38+ }
You can’t perform that action at this time.
0 commit comments