update copyright
[fedora-idea.git] / plugins / ui-designer / src / com / intellij / uiDesigner / actions / MoveSelectionToRightAction.java
blob33b00d1c82039b12f19a6521d3fda57470ba5680
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.intellij.uiDesigner.actions;
18 import com.intellij.uiDesigner.designSurface.GuiEditor;
20 import java.awt.*;
22 /**
23 * @author Anton Katilin
24 * @author Vladimir Kondratyev
26 public final class MoveSelectionToRightAction extends AbstractMoveSelectionAction{
27 public MoveSelectionToRightAction(final GuiEditor editor, final boolean extend, final boolean moveToLast) {
28 super(editor, extend, moveToLast);
31 protected int calcDistance(final Point source, final Point point) {
32 if(source.x >= point.x){
33 return Integer.MAX_VALUE;
35 else{
36 final int scale = (point.y - source.y) <= 0 ? 3 : 4;
37 return (point.x - source.x) + Math.abs(point.y - source.y) * scale;
41 protected int getColumnMoveDelta() {
42 return 1;