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