Subversion Repository Public Repository

litesoft

Diff Revisions 949 vs 950 for /trunk/Java/GWT/Client/src/org/litesoft/GWT/client/widgets/nonpublic/AbstractGwtRenderDimensionAdapter.java

Diff revisions: vs.
  @@ -1,97 +1,97 @@
1 - // This Source Code is in the Public Domain per: http://unlicense.org
2 - package org.litesoft.GWT.client.widgets.nonpublic;
3 -
4 - import org.litesoft.logger.*;
5 - import org.litesoft.render.*;
6 -
7 - import com.google.gwt.user.client.*;
8 - import com.google.gwt.user.client.ui.*;
9 -
10 - public abstract class AbstractGwtRenderDimensionAdapter implements RenderDimensionAdapter {
11 - public static final Logger LOGGER = LoggerFactory.getLogger( AbstractGwtRenderDimensionAdapter.class );
12 -
13 - protected AbstractGwtRenderDimensionAdapter() {
14 - }
15 -
16 - @Override
17 - public final int getInitialNonParticipatingSize() {
18 - return 0;
19 - }
20 -
21 - @Override
22 - public final Object getParent( Object pRectangularRenderableObject ) {
23 - return ((Widget) pRectangularRenderableObject).getParent();
24 - }
25 -
26 - @Override
27 - public int getSize( Object pRectangularRenderableObject ) {
28 - return LLgetWidgetSize( (Widget) pRectangularRenderableObject );
29 - }
30 -
31 - abstract protected int LLgetWidgetSize( Widget pWidget );
32 -
33 - @Override
34 - public void setSize( Object pRectangularRenderableObject, int pRequestedSize ) {
35 - LLsetSize( toGwtRenderableRect( pRectangularRenderableObject ), pRequestedSize );
36 - }
37 -
38 - abstract protected void LLsetSize( GwtRenderableRect pGRR, int pRequestedSize );
39 -
40 - @Override
41 - public void removeSetSize( Object pRectangularRenderableObject ) {
42 - LLremoveSetSize( toGwtRenderableRect( pRectangularRenderableObject ) );
43 - }
44 -
45 - abstract protected void LLremoveSetSize( GwtRenderableRect pGRR );
46 -
47 - @Override
48 - public int getContainerOverheadSize( Object pRectangularRenderableObject ) {
49 - return LLgetContainerOverheadSize( toContainer( pRectangularRenderableObject ) );
50 - }
51 -
52 - abstract protected int LLgetContainerOverheadSize( RenderableContainer pContainer );
53 -
54 - @Override
55 - public int getRelativePosition( Object pRectangularRenderableObject ) {
56 - return LLgetRelativePosition( toPositionAccessable( pRectangularRenderableObject ) );
57 - }
58 -
59 - abstract protected int LLgetRelativePosition( UiPositionAccessable pPositionAccessable );
60 -
61 - @Override
62 - public void setRelativePosition( Object pRectangularRenderableObject, int pRequestedRelativePos ) {
63 - LLsetRelativePosition( toPositionMutable( pRectangularRenderableObject ), pRequestedRelativePos );
64 - }
65 -
66 - abstract protected void LLsetRelativePosition( UiPositionMutable pPositionMutable, int pRequestedRelativePos );
67 -
68 - protected int LLgetParentElementSize( Object pRectangularRenderableObject, GwtElementDimensionHelper pDimensionHelper ) {
69 - Element zElement = ((Widget) pRectangularRenderableObject).getElement();
70 - Element zParent = DOM.getParent( zElement );
71 - return (zParent == null) ? 0 : pDimensionHelper.getOffsetDimension( zParent );
72 - }
73 -
74 - private GwtRenderableRect toGwtRenderableRect( Object pRectangularRenderableObject ) {
75 - return (pRectangularRenderableObject instanceof GwtRenderableRect) ? //
76 - (GwtRenderableRect) pRectangularRenderableObject : //
77 - GwtRenderableRect.NULL_GRR;
78 - }
79 -
80 - private RenderableContainer toContainer( Object pRectangularRenderableObject ) {
81 - return (pRectangularRenderableObject instanceof RenderableContainer) ? //
82 - (RenderableContainer) pRectangularRenderableObject : //
83 - RenderableContainer.NULL_RC;
84 - }
85 -
86 - private UiPositionAccessable toPositionAccessable( Object pRectangularRenderableObject ) {
87 - return (pRectangularRenderableObject instanceof UiPositionAccessable) ? //
88 - (UiPositionAccessable) pRectangularRenderableObject : //
89 - UiPositionAccessable.NULL_UiPA;
90 - }
91 -
92 - private UiPositionMutable toPositionMutable( Object pRectangularRenderableObject ) {
93 - return (pRectangularRenderableObject instanceof UiPositionMutable) ? //
94 - (UiPositionMutable) pRectangularRenderableObject : //
95 - UiPositionMutable.NULL_UiPM;
96 - }
97 - }
1 + // This Source Code is in the Public Domain per: http://unlicense.org
2 + package org.litesoft.GWT.client.widgets.nonpublic;
3 +
4 + import org.litesoft.logger.*;
5 + import org.litesoft.render.*;
6 +
7 + import com.google.gwt.user.client.*;
8 + import com.google.gwt.user.client.ui.*;
9 +
10 + public abstract class AbstractGwtRenderDimensionAdapter implements RenderDimensionAdapter {
11 + public static final Logger LOGGER = LoggerFactory.getLogger( AbstractGwtRenderDimensionAdapter.class );
12 +
13 + protected AbstractGwtRenderDimensionAdapter() {
14 + }
15 +
16 + @Override
17 + public final int getInitialNonParticipatingSize() {
18 + return 0;
19 + }
20 +
21 + @Override
22 + public final Object getParent( Object pRectangularRenderableObject ) {
23 + return ((Widget) pRectangularRenderableObject).getParent();
24 + }
25 +
26 + @Override
27 + public int getSize( Object pRectangularRenderableObject ) {
28 + return LLgetWidgetSize( (Widget) pRectangularRenderableObject );
29 + }
30 +
31 + abstract protected int LLgetWidgetSize( Widget pWidget );
32 +
33 + @Override
34 + public void setSize( Object pRectangularRenderableObject, int pRequestedSize ) {
35 + LLsetSize( toGwtRenderableRect( pRectangularRenderableObject ), pRequestedSize );
36 + }
37 +
38 + abstract protected void LLsetSize( GwtRenderableRect pGRR, int pRequestedSize );
39 +
40 + @Override
41 + public void removeSetSize( Object pRectangularRenderableObject ) {
42 + LLremoveSetSize( toGwtRenderableRect( pRectangularRenderableObject ) );
43 + }
44 +
45 + abstract protected void LLremoveSetSize( GwtRenderableRect pGRR );
46 +
47 + @Override
48 + public int getContainerOverheadSize( Object pRectangularRenderableObject ) {
49 + return LLgetContainerOverheadSize( toContainer( pRectangularRenderableObject ) );
50 + }
51 +
52 + abstract protected int LLgetContainerOverheadSize( RenderableContainer pContainer );
53 +
54 + @Override
55 + public int getRelativePosition( Object pRectangularRenderableObject ) {
56 + return LLgetRelativePosition( toPositionAccessable( pRectangularRenderableObject ) );
57 + }
58 +
59 + abstract protected int LLgetRelativePosition( UiPositionAccessable pPositionAccessable );
60 +
61 + @Override
62 + public void setRelativePosition( Object pRectangularRenderableObject, int pRequestedRelativePos ) {
63 + LLsetRelativePosition( toPositionMutable( pRectangularRenderableObject ), pRequestedRelativePos );
64 + }
65 +
66 + abstract protected void LLsetRelativePosition( UiPositionMutable pPositionMutable, int pRequestedRelativePos );
67 +
68 + protected int LLgetParentElementSize( Object pRectangularRenderableObject, GwtElementDimensionHelper pDimensionHelper ) {
69 + Element zElement = ((Widget) pRectangularRenderableObject).getElement();
70 + Element zParent = DOM.getParent( zElement );
71 + return (zParent == null) ? 0 : pDimensionHelper.getOffsetDimension( zParent );
72 + }
73 +
74 + private GwtRenderableRect toGwtRenderableRect( Object pRectangularRenderableObject ) {
75 + return (pRectangularRenderableObject instanceof GwtRenderableRect) ? //
76 + (GwtRenderableRect) pRectangularRenderableObject : //
77 + GwtRenderableRect.NULL_GRR;
78 + }
79 +
80 + private RenderableContainer toContainer( Object pRectangularRenderableObject ) {
81 + return (pRectangularRenderableObject instanceof RenderableContainer) ? //
82 + (RenderableContainer) pRectangularRenderableObject : //
83 + RenderableContainer.NULL_RC;
84 + }
85 +
86 + private UiPositionAccessable toPositionAccessable( Object pRectangularRenderableObject ) {
87 + return (pRectangularRenderableObject instanceof UiPositionAccessable) ? //
88 + (UiPositionAccessable) pRectangularRenderableObject : //
89 + UiPositionAccessable.NULL_UiPA;
90 + }
91 +
92 + private UiPositionMutable toPositionMutable( Object pRectangularRenderableObject ) {
93 + return (pRectangularRenderableObject instanceof UiPositionMutable) ? //
94 + (UiPositionMutable) pRectangularRenderableObject : //
95 + UiPositionMutable.NULL_UiPM;
96 + }
97 + }