@@ -0,0 +1,2938 @@
+/*%0A * Copyright (C) 2017 team-cachebox.de%0A *%0A * Licensed under the : GNU General Public License (GPL);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.gnu.org/licenses/gpl.html%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage de.longri.cachebox3.gui.activities;%0A%0Aimport com.badlogic.gdx.Gdx;%0Aimport com.badlogic.gdx.scenes.scene2d.InputEvent;%0Aimport com.badlogic.gdx.scenes.scene2d.ui.Table;%0Aimport com.badlogic.gdx.scenes.scene2d.ui.Value;%0Aimport com.badlogic.gdx.scenes.scene2d.utils.ClickListener;%0Aimport de.longri.cachebox3.CB;%0Aimport de.longri.cachebox3.gui.ActivityBase;%0Aimport de.longri.cachebox3.gui.widgets.CharSequenceButton;%0Aimport de.longri.cachebox3.locator.Coordinate;%0Aimport de.longri.cachebox3.translation.Translation;%0A%0A/**%0A * Created by Longri on 14.11.2017.%0A */%0Apublic class ProjectionCoordinate extends ActivityBase %7B%0A%0A    private final Coordinate coord;%0A%0A    protected ProjectionCoordinate(Coordinate coordinate) %7B%0A        super(%22project%22);%0A        this.coord = coordinate;%0A        createOkCancel();%0A    %7D%0A%0A    public void callBack(Coordinate coordinate) %7B%0A    %7D%0A%0A    private final ClickListener cancelListener = new ClickListener() %7B%0A        @Override%0A        public void clicked(InputEvent event, float x, float y) %7B%0A            callBack(null);%0A            finish();%0A        %7D%0A    %7D;%0A    private final ClickListener okListener = new ClickListener() %7B%0A        @Override%0A        public void clicked(InputEvent event, float x, float y) %7B%0A            finish();%0A            Gdx.app.postRunnable(new Runnable() %7B%0A                @Override%0A                public void run() %7B%0A                    float distance = 0;%0A                    float direction = 0;%0A                    Coordinate project = Coordinate.Project(coord, direction, distance);%0A                    callBack(project);%0A                %7D%0A            %7D);%0A        %7D%0A    %7D;%0A%0A    private void createOkCancel() %7B%0A        this.row();%0A        Table cancelOkTable = new Table();%0A%0A        CharSequenceButton btnOk = new CharSequenceButton(Translation.get(%22ok%22));%0A        CharSequenceButton btnCancel = new CharSequenceButton(Translation.get(%22cancel%22));%0A%0A        btnOk.addListener(okListener);%0A        btnCancel.addListener(cancelListener);%0A%0A        float btnWidth = (Gdx.graphics.getWidth() - CB.scaledSizes.MARGIN_HALF * 3) / 2;%0A%0A        cancelOkTable.add(btnOk).width(new Value.Fixed(btnWidth));%0A        cancelOkTable.add(btnCancel).width(new Value.Fixed(btnWidth));%0A%0A        this.add(cancelOkTable).bottom().width(new Value.Fixed(Gdx.graphics.getWidth() - CB.scaledSizes.MARGINx2));%0A    %7D%0A%0A%7D%0A

add ProjectionCoordinate Activity