aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/shared/ui/AlignmentInfo.java
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-08-13 18:24:51 +0300
committerArtur Signell <artur@vaadin.com>2012-08-13 18:34:53 +0300
commit9bc14b90a3ec265587562f2886ec3da1cd904f44 (patch)
treef823bf5a9a6119b4036bb0facedecdad936f33e4 /src/com/vaadin/shared/ui/AlignmentInfo.java
parent4a1d729534e1232088529afcd48360d868093a67 (diff)
downloadvaadin-framework-9bc14b90a3ec265587562f2886ec3da1cd904f44.tar.gz
vaadin-framework-9bc14b90a3ec265587562f2886ec3da1cd904f44.zip
Moved com.vaadin.shared files to a shared src folder (#9299)
Diffstat (limited to 'src/com/vaadin/shared/ui/AlignmentInfo.java')
-rw-r--r--src/com/vaadin/shared/ui/AlignmentInfo.java89
1 files changed, 0 insertions, 89 deletions
diff --git a/src/com/vaadin/shared/ui/AlignmentInfo.java b/src/com/vaadin/shared/ui/AlignmentInfo.java
deleted file mode 100644
index ff800de646..0000000000
--- a/src/com/vaadin/shared/ui/AlignmentInfo.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
-@VaadinApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.shared.ui;
-
-public final class AlignmentInfo {
- /** Bitmask values for client server communication */
- public static class Bits {
- public static final int ALIGNMENT_LEFT = 1;
- public static final int ALIGNMENT_RIGHT = 2;
- public static final int ALIGNMENT_TOP = 4;
- public static final int ALIGNMENT_BOTTOM = 8;
- public static final int ALIGNMENT_HORIZONTAL_CENTER = 16;
- public static final int ALIGNMENT_VERTICAL_CENTER = 32;
- }
-
- public static final AlignmentInfo LEFT = new AlignmentInfo(
- Bits.ALIGNMENT_LEFT);
- public static final AlignmentInfo RIGHT = new AlignmentInfo(
- Bits.ALIGNMENT_RIGHT);
- public static final AlignmentInfo TOP = new AlignmentInfo(
- Bits.ALIGNMENT_TOP);
- public static final AlignmentInfo BOTTOM = new AlignmentInfo(
- Bits.ALIGNMENT_BOTTOM);
- public static final AlignmentInfo CENTER = new AlignmentInfo(
- Bits.ALIGNMENT_HORIZONTAL_CENTER);
- public static final AlignmentInfo MIDDLE = new AlignmentInfo(
- Bits.ALIGNMENT_VERTICAL_CENTER);
- public static final AlignmentInfo TOP_LEFT = new AlignmentInfo(
- Bits.ALIGNMENT_TOP + Bits.ALIGNMENT_LEFT);
-
- private final int bitMask;
-
- public AlignmentInfo(int bitMask) {
- this.bitMask = bitMask;
- }
-
- public AlignmentInfo(AlignmentInfo horizontal, AlignmentInfo vertical) {
- this(horizontal.getBitMask() + vertical.getBitMask());
- }
-
- public int getBitMask() {
- return bitMask;
- }
-
- public boolean isTop() {
- return (bitMask & Bits.ALIGNMENT_TOP) == Bits.ALIGNMENT_TOP;
- }
-
- public boolean isBottom() {
- return (bitMask & Bits.ALIGNMENT_BOTTOM) == Bits.ALIGNMENT_BOTTOM;
- }
-
- public boolean isLeft() {
- return (bitMask & Bits.ALIGNMENT_LEFT) == Bits.ALIGNMENT_LEFT;
- }
-
- public boolean isRight() {
- return (bitMask & Bits.ALIGNMENT_RIGHT) == Bits.ALIGNMENT_RIGHT;
- }
-
- public boolean isVerticalCenter() {
- return (bitMask & Bits.ALIGNMENT_VERTICAL_CENTER) == Bits.ALIGNMENT_VERTICAL_CENTER;
- }
-
- public boolean isHorizontalCenter() {
- return (bitMask & Bits.ALIGNMENT_HORIZONTAL_CENTER) == Bits.ALIGNMENT_HORIZONTAL_CENTER;
- }
-
- public String getVerticalAlignment() {
- if (isBottom()) {
- return "bottom";
- } else if (isVerticalCenter()) {
- return "middle";
- }
- return "top";
- }
-
- public String getHorizontalAlignment() {
- if (isRight()) {
- return "right";
- } else if (isHorizontalCenter()) {
- return "center";
- }
- return "left";
- }
-
-}