1 /*******************************************************************************
\r
2 * in Industry THTH ry.
\r
3 * All rights reserved. This program and the accompanying materials
\r
4 * are made available under the terms of the Eclipse Public License v1.0
\r
5 * which accompanies this distribution, and is available at
\r
6 * http://www.eclipse.org/legal/epl-v10.html
\r
9 * VTT Technical Research Centre of Finland - initial API and implementation
\r
10 *******************************************************************************/
\r
11 package org.simantics.spreadsheet;
\r
13 import java.awt.Rectangle;
\r
14 import java.util.Collection;
\r
15 import java.util.List;
\r
17 import org.simantics.utils.datastructures.Pair;
\r
20 public interface ClientModel extends CellModifier {
\r
22 public enum OperationMode {
\r
27 public interface ClientModelListener {
\r
29 public void rows(int amount);
\r
30 public void columns(int amount);
\r
32 public void columnLabels(String[] labels);
\r
33 public void rowLabels(String[] labels);
\r
34 public void columnWidths(int[] widths);
\r
36 public void sources(String[] available, String current);
\r
38 public void propertyChange(String location, String property, Object value);
\r
39 public void cleared(String location);
\r
40 public void flush();
\r
44 public static final String EXCEL = "Excel";
\r
45 public static final String EXCEL_VISIBLE = "Visible";
\r
48 * The location argument to use for setting header properties.
\r
49 * @see #HEADERS_COL_LABELS
\r
50 * @see #HEADERS_COL_WIDTHS
\r
51 * @see #HEADERS_ROW_HEIGHTS
\r
52 * @see #HEADERS_ROW_LABELS
\r
54 public static final String HEADERS = "Headers";
\r
55 public static final String HEADERS_COL_WIDTHS = "columnWidths";
\r
56 public static final String HEADERS_ROW_HEIGHTS = "rowHeights";
\r
57 public static final String HEADERS_COL_LABELS = "columnLabels";
\r
58 public static final String HEADERS_ROW_LABELS = "rowLabels";
\r
61 * The location argument to use for setting dimension properties.
\r
62 * @see #DIMENSIONS_COL_COUNT
\r
63 * @see #DIMENSIONS_FIT_COLS
\r
64 * @see #DIMENSIONS_FIT_ROWS
\r
65 * @see #DIMENSIONS_ROW_COUNT
\r
67 public static final String DIMENSIONS = "Dimensions";
\r
68 public static final String DIMENSIONS_FIT_ROWS = "fitRows";
\r
69 public static final String DIMENSIONS_FIT_COLS = "fitColumns";
\r
70 public static final String DIMENSIONS_COL_COUNT = "columnCount";
\r
71 public static final String DIMENSIONS_ROW_COUNT = "rowCount";
\r
73 public static final String SOURCES = "Sources";
\r
74 public static final String SOURCES_AVAILABLE = "available";
\r
75 public static final String SOURCES_CURRENT = "current";
\r
77 public static final String SHEETS = "Sheets";
\r
78 public static final String SHEETS_AVAILABLE = "available";
\r
79 public static final String SHEETS_CURRENT = "current";
\r
81 public static final String CONTEXT = "Context";
\r
82 public static final String CONTEXT_CURRENT = "current";
\r
84 public static final String MODE = "Mode";
\r
85 public static final String MODE_CURRENT = "current";
\r
87 public static final String STATES = "States";
\r
88 public static final String STATES_AVAILABLE = "available";
\r
89 public static final String STATES_CURRENT = "current";
\r
91 public static final String FONT = "font";
\r
92 public static final String FOREGROUND = "foreground";
\r
93 public static final String BACKGROUND = "background";
\r
94 public static final String BORDER = "border";
\r
95 public static final String ALIGN = "align";
\r
96 public static final String LABEL = "label";
\r
97 public static final String CONTENT = "content";
\r
98 public static final String CONTENT_EXPRESSION = "content#expression";
\r
99 public static final String COMPUTED = "Computed";
\r
100 public static final String LOCKED = "locked";
\r
101 public static final String ROW_SPAN = "rowSpan";
\r
102 public static final String COLUMN_SPAN = "columnSpan";
\r
104 public static final String ITERATION_ENABLED = "iterationEnabled";
\r
106 void addListener(ClientModelListener listener);
\r
107 void removeListener(ClientModelListener listener);
\r
108 <T> T getPropertyAt(String location, String property);
\r
109 <T> T getPossiblePropertyAt(String location, String property);
\r
111 int[] getColumnWidths();
\r
112 int[] getRowHeights();
\r
117 public Collection<Pair<String, Object>> listAll(String property);
\r
120 * Returns a copy of the span. Null if not found.
\r
122 public Rectangle getSpan(int row, int column);
\r
125 * Returns a copy of the span list.
\r
127 public List<Rectangle> getSpans();
\r