--- /dev/null
+package org.simantics.spreadsheet.ui;\r
+\r
+import java.awt.Color;\r
+import java.awt.Font;\r
+\r
+import javax.swing.border.Border;\r
+\r
+public class CellValue {\r
+ \r
+ public boolean editable = false;\r
+ \r
+ public String label;\r
+ public int border;\r
+ public int align;\r
+ public Font font;\r
+ public Color foreground;\r
+ public Color background;\r
+ public CellValue(String label, Font font, Color foreground, Color background, int border, int align, boolean editable) {\r
+ this.editable = editable;\r
+ this.label = label;\r
+ this.font = font;\r
+ this.foreground = foreground;\r
+ \r
+ if (editable) {\r
+ this.background = background;\r
+ } else {\r
+ this.background = new Color(220, 220, 220, 100);\r
+ }\r
+ this.border = border;\r
+ this.align = align;\r
+ }\r
+ \r
+ final SheetBorder BORDER0 = new SheetBorder(1,1,1,1,false, false); \r
+ final SheetBorder BORDER1 = new SheetBorder(1,1,1,1,false, true); \r
+ final SheetBorder BORDER2 = new SheetBorder(1,1,1,1,true, false); \r
+ final SheetBorder BORDER3 = new SheetBorder(1,1,1,1,true, true);\r
+ \r
+ /*\r
+ * 1 = right\r
+ * 2 = bottom\r
+ */\r
+ public Border getBorder() {\r
+ switch(border) {\r
+ case 0: return BORDER0;\r
+ case 1: return BORDER1;\r
+ case 2: return BORDER2;\r
+ case 3: return BORDER3;\r
+ }\r
+ return BORDER0;\r
+ }\r
+ \r
+}\r