]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.spreadsheet.common/src/org/simantics/spreadsheet/common/TableCell.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.spreadsheet.common / src / org / simantics / spreadsheet / common / TableCell.java
index 89722abfd0b2f7b40d852624e3cadd7b1ba2de43..aeb6edfd43e2ba75f2358b213d2c6e1a16e88336 100644 (file)
-/*******************************************************************************\r
- * Copyright (c) 2013, 2014 Association for Decentralized \r
- * Information Management in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the THTH Simantics \r
- * Division Member Component License which accompanies this \r
- * distribution, and is available at\r
- * http://www.simantics.org/legal/sdmcl-v10.html\r
- *\r
- * Contributors:\r
- *     Semantum Oy - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.spreadsheet.common;\r
-\r
-import org.simantics.document.server.io.IColor;\r
-import org.simantics.document.server.io.IFont;\r
-import org.simantics.document.server.io.ITableCell;\r
-\r
-public class TableCell implements ITableCell {\r
-\r
-       public int column;\r
-       public int row;\r
-       public int border;\r
-       public int align;\r
-       public String text;\r
-       public IFont font;\r
-       public IColor foreground;\r
-       public IColor background;\r
-       public boolean locked;\r
-       public int rowSpan = 1;\r
-       public int columnSpan = 1;\r
-       \r
-       public TableCell() {\r
-               \r
-       }\r
-\r
-       public TableCell(int column, int row, int border, int align, String text,\r
-                       IFont font, IColor foreground, IColor background, boolean locked,\r
-                       int rowSpan, int columnSpan) {\r
-               super();\r
-               this.column = column;\r
-               this.row = row;\r
-               this.border = border;\r
-               this.align = align;\r
-               this.text = text;\r
-               this.font = font;\r
-               this.foreground = foreground;\r
-               this.background = background;\r
-               this.locked = locked;\r
-               this.rowSpan = rowSpan;\r
-               this.columnSpan = columnSpan;\r
-       }\r
-       \r
-       public TableCell(ITableCell other) {\r
-               this(other.getColumn(), other.getRow(), other.getBorder(), other.getAlign(),\r
-                               other.getText(),other.getFont(), other.getFGColor(), other.getBGColor(),\r
-                               other.getLocked(), other.getRowSpan(), other.getColumnSpan());\r
-       }\r
-       \r
-       @Override\r
-       public String getText() {\r
-               return text;\r
-       }\r
-       @Override\r
-       public int getColumn() {\r
-               return column;\r
-       }\r
-       @Override\r
-       public int getBorder() {\r
-               return border;\r
-       }\r
-       @Override\r
-       public int getAlign() {\r
-               return align;\r
-       }\r
-       @Override\r
-       public int getRow() {\r
-               return row;\r
-       }\r
-       @Override\r
-       public IFont getFont() {\r
-               return font;\r
-       }\r
-\r
-       @Override\r
-       public IColor getFGColor() {\r
-               return foreground;\r
-       }\r
-\r
-       @Override\r
-       public IColor getBGColor() {\r
-               return background;\r
-       }\r
-       \r
-       @Override\r
-       public boolean getLocked() {\r
-               return locked;\r
-       }\r
-       \r
-       @Override\r
-       public int getRowSpan() {\r
-               return rowSpan;\r
-       }\r
-       \r
-       @Override\r
-       public int getColumnSpan() {\r
-               return columnSpan;\r
-       }\r
-       \r
-       @Override\r
-       public int hashCode() {\r
-               final int prime = 31;\r
-               int result = 1;\r
-               result = prime * result + align;\r
-               result = prime * result\r
-                               + ((background == null) ? 0 : background.hashCode());\r
-               result = prime * result + border;\r
-               result = prime * result + column;\r
-               result = prime * result + columnSpan;\r
-               result = prime * result + ((font == null) ? 0 : font.hashCode());\r
-               result = prime * result\r
-                               + ((foreground == null) ? 0 : foreground.hashCode());\r
-               result = prime * result + (locked ? 1231 : 1237);\r
-               result = prime * result + row;\r
-               result = prime * result + rowSpan;\r
-               result = prime * result + ((text == null) ? 0 : text.hashCode());\r
-               return result;\r
-       }\r
-       @Override\r
-       public boolean equals(Object obj) {\r
-               if (this == obj)\r
-                       return true;\r
-               if (obj == null)\r
-                       return false;\r
-               if (getClass() != obj.getClass())\r
-                       return false;\r
-               TableCell other = (TableCell) obj;\r
-               if (align != other.align)\r
-                       return false;\r
-               if (background == null) {\r
-                       if (other.background != null)\r
-                               return false;\r
-               } else if (!background.equals(other.background))\r
-                       return false;\r
-               if (border != other.border)\r
-                       return false;\r
-               if (column != other.column)\r
-                       return false;\r
-               if (columnSpan != other.columnSpan)\r
-                       return false;\r
-               if (font == null) {\r
-                       if (other.font != null)\r
-                               return false;\r
-               } else if (!font.equals(other.font))\r
-                       return false;\r
-               if (foreground == null) {\r
-                       if (other.foreground != null)\r
-                               return false;\r
-               } else if (!foreground.equals(other.foreground))\r
-                       return false;\r
-               if (locked != other.locked)\r
-                       return false;\r
-               if (row != other.row)\r
-                       return false;\r
-               if (rowSpan != other.rowSpan)\r
-                       return false;\r
-               if (text == null) {\r
-                       if (other.text != null)\r
-                               return false;\r
-               } else if (!text.equals(other.text))\r
-                       return false;\r
-               return true;\r
-       }\r
-\r
-       \r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2013, 2014 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 THTH Simantics 
+ * Division Member Component License which accompanies this 
+ * distribution, and is available at
+ * http://www.simantics.org/legal/sdmcl-v10.html
+ *
+ * Contributors:
+ *     Semantum Oy - initial API and implementation
+ *******************************************************************************/
+package org.simantics.spreadsheet.common;
+
+import org.simantics.document.server.io.IColor;
+import org.simantics.document.server.io.IFont;
+import org.simantics.document.server.io.ITableCell;
+
+public class TableCell implements ITableCell {
+
+       public int column;
+       public int row;
+       public int border;
+       public int align;
+       public String text;
+       public IFont font;
+       public IColor foreground;
+       public IColor background;
+       public boolean locked;
+       public int rowSpan = 1;
+       public int columnSpan = 1;
+       
+       public TableCell() {
+               
+       }
+
+       public TableCell(int column, int row, int border, int align, String text,
+                       IFont font, IColor foreground, IColor background, boolean locked,
+                       int rowSpan, int columnSpan) {
+               super();
+               this.column = column;
+               this.row = row;
+               this.border = border;
+               this.align = align;
+               this.text = text;
+               this.font = font;
+               this.foreground = foreground;
+               this.background = background;
+               this.locked = locked;
+               this.rowSpan = rowSpan;
+               this.columnSpan = columnSpan;
+       }
+       
+       public TableCell(ITableCell other) {
+               this(other.getColumn(), other.getRow(), other.getBorder(), other.getAlign(),
+                               other.getText(),other.getFont(), other.getFGColor(), other.getBGColor(),
+                               other.getLocked(), other.getRowSpan(), other.getColumnSpan());
+       }
+       
+       @Override
+       public String getText() {
+               return text;
+       }
+       @Override
+       public int getColumn() {
+               return column;
+       }
+       @Override
+       public int getBorder() {
+               return border;
+       }
+       @Override
+       public int getAlign() {
+               return align;
+       }
+       @Override
+       public int getRow() {
+               return row;
+       }
+       @Override
+       public IFont getFont() {
+               return font;
+       }
+
+       @Override
+       public IColor getFGColor() {
+               return foreground;
+       }
+
+       @Override
+       public IColor getBGColor() {
+               return background;
+       }
+       
+       @Override
+       public boolean getLocked() {
+               return locked;
+       }
+       
+       @Override
+       public int getRowSpan() {
+               return rowSpan;
+       }
+       
+       @Override
+       public int getColumnSpan() {
+               return columnSpan;
+       }
+       
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + align;
+               result = prime * result
+                               + ((background == null) ? 0 : background.hashCode());
+               result = prime * result + border;
+               result = prime * result + column;
+               result = prime * result + columnSpan;
+               result = prime * result + ((font == null) ? 0 : font.hashCode());
+               result = prime * result
+                               + ((foreground == null) ? 0 : foreground.hashCode());
+               result = prime * result + (locked ? 1231 : 1237);
+               result = prime * result + row;
+               result = prime * result + rowSpan;
+               result = prime * result + ((text == null) ? 0 : text.hashCode());
+               return result;
+       }
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               TableCell other = (TableCell) obj;
+               if (align != other.align)
+                       return false;
+               if (background == null) {
+                       if (other.background != null)
+                               return false;
+               } else if (!background.equals(other.background))
+                       return false;
+               if (border != other.border)
+                       return false;
+               if (column != other.column)
+                       return false;
+               if (columnSpan != other.columnSpan)
+                       return false;
+               if (font == null) {
+                       if (other.font != null)
+                               return false;
+               } else if (!font.equals(other.font))
+                       return false;
+               if (foreground == null) {
+                       if (other.foreground != null)
+                               return false;
+               } else if (!foreground.equals(other.foreground))
+                       return false;
+               if (locked != other.locked)
+                       return false;
+               if (row != other.row)
+                       return false;
+               if (rowSpan != other.rowSpan)
+                       return false;
+               if (text == null) {
+                       if (other.text != null)
+                               return false;
+               } else if (!text.equals(other.text))
+                       return false;
+               return true;
+       }
+
+       
+}