X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.spreadsheet.ui%2Fsrc%2Forg%2Fsimantics%2Fspreadsheet%2Fui%2FCellValue.java;h=829a7d7e290a1eabb098b42266829dd27b60daf7;hb=5915c1bbd6d0c6125aa3c815c7843339190f28e4;hp=2e82d3734d13e3369f3e20b8172521f40bf794ad;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.spreadsheet.ui/src/org/simantics/spreadsheet/ui/CellValue.java b/bundles/org.simantics.spreadsheet.ui/src/org/simantics/spreadsheet/ui/CellValue.java index 2e82d3734..829a7d7e2 100644 --- a/bundles/org.simantics.spreadsheet.ui/src/org/simantics/spreadsheet/ui/CellValue.java +++ b/bundles/org.simantics.spreadsheet.ui/src/org/simantics/spreadsheet/ui/CellValue.java @@ -1,52 +1,52 @@ -package org.simantics.spreadsheet.ui; - -import java.awt.Color; -import java.awt.Font; - -import javax.swing.border.Border; - -public class CellValue { - - public boolean editable = false; - - public String label; - public int border; - public int align; - public Font font; - public Color foreground; - public Color background; - public CellValue(String label, Font font, Color foreground, Color background, int border, int align, boolean editable) { - this.editable = editable; - this.label = label; - this.font = font; - this.foreground = foreground; - - if (editable) { - this.background = background; - } else { - this.background = new Color(220, 220, 220, 100); - } - this.border = border; - this.align = align; - } - - final SheetBorder BORDER0 = new SheetBorder(1,1,1,1,false, false); - final SheetBorder BORDER1 = new SheetBorder(1,1,1,1,false, true); - final SheetBorder BORDER2 = new SheetBorder(1,1,1,1,true, false); - final SheetBorder BORDER3 = new SheetBorder(1,1,1,1,true, true); - - /* - * 1 = right - * 2 = bottom - */ - public Border getBorder() { - switch(border) { - case 0: return BORDER0; - case 1: return BORDER1; - case 2: return BORDER2; - case 3: return BORDER3; - } - return BORDER0; - } - -} +package org.simantics.spreadsheet.ui; + +import java.awt.Color; +import java.awt.Font; + +import javax.swing.border.Border; + +public class CellValue { + + public boolean editable = false; + + public String label; + public int border; + public int align; + public Font font; + public Color foreground; + public Color background; + public CellValue(String label, Font font, Color foreground, Color background, int border, int align, boolean editable) { + this.editable = editable; + this.label = label; + this.font = font; + this.foreground = foreground; + + if (editable) { + this.background = background; + } else { + this.background = new Color(220, 220, 220, 100); + } + this.border = border; + this.align = align; + } + + final SheetBorder BORDER0 = new SheetBorder(1,1,1,1,false, false); + final SheetBorder BORDER1 = new SheetBorder(1,1,1,1,false, true); + final SheetBorder BORDER2 = new SheetBorder(1,1,1,1,true, false); + final SheetBorder BORDER3 = new SheetBorder(1,1,1,1,true, true); + + /* + * 1 = right + * 2 = bottom + */ + public Border getBorder() { + switch(border) { + case 0: return BORDER0; + case 1: return BORDER1; + case 2: return BORDER2; + case 3: return BORDER3; + } + return BORDER0; + } + +}