Code Duplication    Length = 47-47 lines in 2 locations

src/eXpansion/Framework/Gui/Components/uiScrollbar.php 2 locations

@@ 71-117 (lines=47) @@
68
        return $frame->render($domDocument);
69
    }
70
71
    private function getScrollbarX()
72
    {
73
        $frame = new Frame();
74
        $frame->setPosition($this->posX, $this->posY)
75
            ->addClass('uiScrollbarControl');
76
77
        $scrollbar = new Quad();
78
        $scrollbar->setPosition(5, 0)
79
            ->setSize($this->scrollbarSize, 5)
80
            ->setBackgroundColor('fffa')
81
            ->setFocusBackgroundColor("ffff")
82
            ->addClass('uiScrollbar')
83
            ->addDataAttribute('axis', $this->axis)
84
            ->setAlign('left', 'bottom')
85
            ->setScriptEvents(true);
86
87
        $leftLabel = new Label();
88
        $leftLabel->setPosition(0, 0)
89
            ->setSize(5, 5)
90
            ->setText("⏴")
91
            ->setScriptEvents(true)
92
            ->setAreaColor('aaa')
93
            ->setAreaFocusColor('777')
94
            ->setAlign("left", "bottom");
95
96
        $rightLabel = new Label();
97
        $rightLabel->setPosition($this->length, 0)
98
            ->setSize(5, 5)
99
            ->setText("⏵")
100
            ->setScriptEvents(true)
101
            ->setAreaColor('aaa')
102
            ->setAreaFocusColor('777')
103
            ->setAlign("right", "bottom");
104
105
        $background = new Quad();
106
        $background->setSize($this->length, 5)
107
            ->setAlign("left", "bottom")
108
            ->setBackgroundColor("000a");
109
110
        $frame->addChild($scrollbar);
111
        $frame->addChild($leftLabel);
112
        $frame->addChild($rightLabel);
113
        $frame->addChild($background);
114
115
        return $frame;
116
117
    }
118
119
    private function getScrollbarY()
120
    {
@@ 119-165 (lines=47) @@
116
117
    }
118
119
    private function getScrollbarY()
120
    {
121
        $frame = new Frame();
122
        $frame->setPosition($this->posX, $this->posY)
123
            ->addClass('uiScrollbarControl');
124
125
126
        $scrollbar = new Quad();
127
        $scrollbar->setPosition(0, -5)
128
            ->setSize(5, $this->scrollbarSize)
129
            ->setBackgroundColor('fffa')
130
            ->setFocusBackgroundColor('ffff')
131
            ->addClass('uiScrollbar')
132
            ->addDataAttribute('axis', $this->axis)
133
            ->setAlign('right', 'top')
134
            ->setScriptEvents(true);
135
136
        $topLabel = new Label();
137
        $topLabel->setPosition(0, 0)
138
            ->setSize(5, 5)
139
            ->setText("⏶")
140
            ->setScriptEvents(true)
141
            ->setAreaColor('aaa')
142
            ->setAreaFocusColor('777')
143
            ->setAlign("right", "top");
144
145
        $bottomLabel = new Label();
146
        $bottomLabel->setPosition(0, -$this->length)
147
            ->setSize(5, 5)
148
            ->setText("⏷")
149
            ->setScriptEvents(true)
150
            ->setAreaColor('aaa')
151
            ->setAreaFocusColor('777')
152
            ->setAlign("right", "bottom");
153
154
        $background = new Quad();
155
        $background->setSize(5, $this->length)
156
            ->setAlign("right", "top")
157
            ->setBackgroundColor("000a");
158
159
        $frame->addChild($scrollbar);
160
        $frame->addChild($topLabel);
161
        $frame->addChild($bottomLabel);
162
        $frame->addChild($background);
163
164
        return $frame;
165
    }
166
167
    /**
168
     * Prepare the given Script for rendering by adding the needed Labels, etc.