-/*******************************************************************************\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.spreadsheet;\r
-\r
-import java.awt.Rectangle;\r
-import java.util.Collection;\r
-import java.util.List;\r
-\r
-import org.simantics.utils.datastructures.Pair;\r
-\r
-\r
-public interface ClientModel extends CellModifier {\r
- \r
- public enum OperationMode {\r
- OPERATION,\r
- EDIT_MODE\r
- }\r
-\r
- public interface ClientModelListener {\r
- \r
- public void rows(int amount);\r
- public void columns(int amount);\r
-\r
- public void columnLabels(String[] labels);\r
- public void rowLabels(String[] labels);\r
- public void columnWidths(int[] widths);\r
- \r
- public void sources(String[] available, String current);\r
- \r
- public void propertyChange(String location, String property, Object value);\r
- public void cleared(String location);\r
- public void flush();\r
- \r
- }\r
-\r
- public static final String EXCEL = "Excel";\r
- public static final String EXCEL_VISIBLE = "Visible";\r
-\r
- /**\r
- * The location argument to use for setting header properties.\r
- * @see #HEADERS_COL_LABELS\r
- * @see #HEADERS_COL_WIDTHS\r
- * @see #HEADERS_ROW_HEIGHTS\r
- * @see #HEADERS_ROW_LABELS\r
- */\r
- public static final String HEADERS = "Headers";\r
- public static final String HEADERS_COL_WIDTHS = "columnWidths";\r
- public static final String HEADERS_ROW_HEIGHTS = "rowHeights";\r
- public static final String HEADERS_COL_LABELS = "columnLabels";\r
- public static final String HEADERS_ROW_LABELS = "rowLabels";\r
- \r
- /**\r
- * The location argument to use for setting dimension properties.\r
- * @see #DIMENSIONS_COL_COUNT\r
- * @see #DIMENSIONS_FIT_COLS\r
- * @see #DIMENSIONS_FIT_ROWS\r
- * @see #DIMENSIONS_ROW_COUNT\r
- */\r
- public static final String DIMENSIONS = "Dimensions";\r
- public static final String DIMENSIONS_FIT_ROWS = "fitRows";\r
- public static final String DIMENSIONS_FIT_COLS = "fitColumns";\r
- public static final String DIMENSIONS_COL_COUNT = "columnCount";\r
- public static final String DIMENSIONS_ROW_COUNT = "rowCount";\r
-\r
- public static final String SOURCES = "Sources";\r
- public static final String SOURCES_AVAILABLE = "available";\r
- public static final String SOURCES_CURRENT = "current";\r
-\r
- public static final String SHEETS = "Sheets";\r
- public static final String SHEETS_AVAILABLE = "available";\r
- public static final String SHEETS_CURRENT = "current";\r
- \r
- public static final String CONTEXT = "Context";\r
- public static final String CONTEXT_CURRENT = "current";\r
- \r
- public static final String MODE = "Mode";\r
- public static final String MODE_CURRENT = "current";\r
- \r
- public static final String STATES = "States";\r
- public static final String STATES_AVAILABLE = "available";\r
- public static final String STATES_CURRENT = "current";\r
-\r
- public static final String FONT = "font";\r
- public static final String FOREGROUND = "foreground";\r
- public static final String BACKGROUND = "background";\r
- public static final String BORDER = "border";\r
- public static final String ALIGN = "align";\r
- public static final String LABEL = "label";\r
- public static final String CONTENT = "content";\r
- public static final String CONTENT_EXPRESSION = "content#expression";\r
- public static final String COMPUTED = "Computed";\r
- public static final String LOCKED = "locked";\r
- public static final String ROW_SPAN = "rowSpan";\r
- public static final String COLUMN_SPAN = "columnSpan";\r
- \r
- public static final String ITERATION_ENABLED = "iterationEnabled";\r
- \r
- void addListener(ClientModelListener listener);\r
- void removeListener(ClientModelListener listener);\r
- <T> T getPropertyAt(String location, String property);\r
- <T> T getPossiblePropertyAt(String location, String property);\r
- \r
- int[] getColumnWidths();\r
- int[] getRowHeights();\r
- \r
- int getRows();\r
- int getColumns();\r
-\r
- public Collection<Pair<String, Object>> listAll(String property);\r
- \r
- /*\r
- * Returns a copy of the span. Null if not found.\r
- */\r
- public Rectangle getSpan(int row, int column);\r
-\r
- /*\r
- * Returns a copy of the span list.\r
- */ \r
- public List<Rectangle> getSpans();\r
- \r
-}\r
+/*******************************************************************************
+ * 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.spreadsheet;
+
+import java.awt.Rectangle;
+import java.util.Collection;
+import java.util.List;
+
+import org.simantics.utils.datastructures.Pair;
+
+
+public interface ClientModel extends CellModifier {
+
+ public enum OperationMode {
+ OPERATION,
+ EDIT_MODE
+ }
+
+ public interface ClientModelListener {
+
+ public void rows(int amount);
+ public void columns(int amount);
+
+ public void columnLabels(String[] labels);
+ public void rowLabels(String[] labels);
+ public void columnWidths(int[] widths);
+
+ public void sources(String[] available, String current);
+
+ public void propertyChange(String location, String property, Object value);
+ public void cleared(String location);
+ public void flush();
+
+ }
+
+ public static final String EXCEL = "Excel";
+ public static final String EXCEL_VISIBLE = "Visible";
+
+ /**
+ * The location argument to use for setting header properties.
+ * @see #HEADERS_COL_LABELS
+ * @see #HEADERS_COL_WIDTHS
+ * @see #HEADERS_ROW_HEIGHTS
+ * @see #HEADERS_ROW_LABELS
+ */
+ public static final String HEADERS = "Headers";
+ public static final String HEADERS_COL_WIDTHS = "columnWidths";
+ public static final String HEADERS_ROW_HEIGHTS = "rowHeights";
+ public static final String HEADERS_COL_LABELS = "columnLabels";
+ public static final String HEADERS_ROW_LABELS = "rowLabels";
+
+ /**
+ * The location argument to use for setting dimension properties.
+ * @see #DIMENSIONS_COL_COUNT
+ * @see #DIMENSIONS_FIT_COLS
+ * @see #DIMENSIONS_FIT_ROWS
+ * @see #DIMENSIONS_ROW_COUNT
+ */
+ public static final String DIMENSIONS = "Dimensions";
+ public static final String DIMENSIONS_FIT_ROWS = "fitRows";
+ public static final String DIMENSIONS_FIT_COLS = "fitColumns";
+ public static final String DIMENSIONS_COL_COUNT = "columnCount";
+ public static final String DIMENSIONS_ROW_COUNT = "rowCount";
+
+ public static final String SOURCES = "Sources";
+ public static final String SOURCES_AVAILABLE = "available";
+ public static final String SOURCES_CURRENT = "current";
+
+ public static final String SHEETS = "Sheets";
+ public static final String SHEETS_AVAILABLE = "available";
+ public static final String SHEETS_CURRENT = "current";
+
+ public static final String CONTEXT = "Context";
+ public static final String CONTEXT_CURRENT = "current";
+
+ public static final String MODE = "Mode";
+ public static final String MODE_CURRENT = "current";
+
+ public static final String STATES = "States";
+ public static final String STATES_AVAILABLE = "available";
+ public static final String STATES_CURRENT = "current";
+
+ public static final String FONT = "font";
+ public static final String FOREGROUND = "foreground";
+ public static final String BACKGROUND = "background";
+ public static final String BORDER = "border";
+ public static final String ALIGN = "align";
+ public static final String LABEL = "label";
+ public static final String CONTENT = "content";
+ public static final String CONTENT_EXPRESSION = "content#expression";
+ public static final String COMPUTED = "Computed";
+ public static final String LOCKED = "locked";
+ public static final String ROW_SPAN = "rowSpan";
+ public static final String COLUMN_SPAN = "columnSpan";
+
+ public static final String ITERATION_ENABLED = "iterationEnabled";
+
+ void addListener(ClientModelListener listener);
+ void removeListener(ClientModelListener listener);
+ <T> T getPropertyAt(String location, String property);
+ <T> T getPossiblePropertyAt(String location, String property);
+
+ int[] getColumnWidths();
+ int[] getRowHeights();
+
+ int getRows();
+ int getColumns();
+
+ public Collection<Pair<String, Object>> listAll(String property);
+
+ /*
+ * Returns a copy of the span. Null if not found.
+ */
+ public Rectangle getSpan(int row, int column);
+
+ /*
+ * Returns a copy of the span list.
+ */
+ public List<Rectangle> getSpans();
+
+}