X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.diagram.connection%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fconnection%2FDirections.java;fp=bundles%2Forg.simantics.diagram.connection%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fconnection%2FDirections.java;h=3b105c4154b6b10d53ffe8b64e57b14e949004ce;hp=e4b174b72a558e2735875b863432b6ec06e764a1;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.diagram.connection/src/org/simantics/diagram/connection/Directions.java b/bundles/org.simantics.diagram.connection/src/org/simantics/diagram/connection/Directions.java index e4b174b72..3b105c415 100644 --- a/bundles/org.simantics.diagram.connection/src/org/simantics/diagram/connection/Directions.java +++ b/bundles/org.simantics.diagram.connection/src/org/simantics/diagram/connection/Directions.java @@ -1,28 +1,28 @@ -/******************************************************************************* - * Copyright (c) 2011 Association for Decentralized Information Management in - * Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.diagram.connection; - -public class Directions { - - public static boolean isAllowed(int allowedDirection, int direction) { - return ((allowedDirection >> direction)&1) == 1; - } - - public static int firstAllowedDirection(int allowedDirections) { - for(int dir=0;dir<4;++dir,allowedDirections>>=1) { - if((allowedDirections&1) == 1) - return dir; - } - return 0; - } - -} +/******************************************************************************* + * Copyright (c) 2011 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.diagram.connection; + +public class Directions { + + public static boolean isAllowed(int allowedDirection, int direction) { + return ((allowedDirection >> direction)&1) == 1; + } + + public static int firstAllowedDirection(int allowedDirections) { + for(int dir=0;dir<4;++dir,allowedDirections>>=1) { + if((allowedDirections&1) == 1) + return dir; + } + return 0; + } + +}