11package com .mgs .fantasi .driver .swing ;
22
33import com .mgs .fantasi .driver .RenderingManager ;
4- import com .mgs .fantasi .driver .swing .jPanelCreation .JPanelDto ;
5- import com .mgs .fantasi .driver .swing .jPanelCreation .JPanelDtoFactory ;
4+ import com .mgs .fantasi .driver .swing .jPanelCreation .*;
65import com .mgs .fantasi .profile .UIProfile ;
6+ import com .mgs .fantasi .properties .JPanelDecorator ;
77import com .mgs .fantasi .properties .UIPropertiesManager ;
88import com .mgs .fantasi .properties .UIPropertiesProvider ;
9+ import com .mgs .fantasi .properties .data .Padding ;
10+ import com .mgs .fantasi .properties .data .polygon .PolygonPointsIterator ;
911import com .mgs .fantasi .structure .CollocationInfo ;
1012import com .mgs .fantasi .structure .Structure ;
1113import com .mgs .fantasi .structure .treeAux .WireframeNode ;
1416import java .util .Map ;
1517
1618public class JPanelRenderingManager implements RenderingManager <JPanel > {
17- private final JPanelDtoFactory jPanelDtoFactory ;
1819 private final UIPropertiesManager uiPropertiesManager ;
20+ private final JPanelLayoutTranslator jPanelLayoutTranslator ;
21+ private final JPanelDecorator <Padding > paddingDecorator ;
1922
2023
21- public JPanelRenderingManager (JPanelDtoFactory jPanelDtoFactory , UIPropertiesManager uiPropertiesManager ) {
22- this .jPanelDtoFactory = jPanelDtoFactory ;
24+ public JPanelRenderingManager (UIPropertiesManager uiPropertiesManager , JPanelLayoutTranslator jPanelLayoutTranslator , JPanelDecorator <Padding > paddingDecorator ) {
2325 this .uiPropertiesManager = uiPropertiesManager ;
26+ this .jPanelLayoutTranslator = jPanelLayoutTranslator ;
27+ this .paddingDecorator = paddingDecorator ;
2428 }
2529
2630 @ Override
@@ -32,7 +36,9 @@ private JPanelDto createDto(Structure structure, UIProfile uiProfile) {
3236 WireframeNode root = structure .getRoot ();
3337
3438 UIPropertiesProvider withStylesApplied = uiPropertiesManager .applyStyles (root .getUiProperties (), uiProfile .findStylesFor (root ));
35- JPanelDto containerJPanelDto = jPanelDtoFactory .forUIProperties (withStylesApplied , root .getShape ());
39+ PolygonPointsIterator shape = root .getShape ();
40+ JPanelFactory jPanelFactory = shape .isRectangular () ? new StandardJPanelFactory () : new NonRectangularJPanelFactory ();
41+ JPanelDto containerJPanelDto = new JPanelDto (withStylesApplied , jPanelLayoutTranslator , shape , jPanelFactory , paddingDecorator );
3642
3743 for (Map .Entry <CollocationInfo , Structure > childNode : structure .getChildren ().entrySet ()) {
3844 JPanelDto childJPanelDto = createDto (childNode .getValue (), uiProfile );
0 commit comments