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 interface ClientModelListener {
24 public void rows(int amount);
25 public void columns(int amount);
27 public void columnLabels(String[] labels);
28 public void rowLabels(String[] labels);
29 public void columnWidths(int[] widths);
31 public void sources(String[] available, String current);
33 public void propertyChange(String location, String property, Object value);
34 public void cleared(String location);
39 public static final String EXCEL = "Excel";
40 public static final String EXCEL_VISIBLE = "Visible";
43 * The location argument to use for setting header properties.
44 * @see #HEADERS_COL_LABELS
45 * @see #HEADERS_COL_WIDTHS
46 * @see #HEADERS_ROW_HEIGHTS
47 * @see #HEADERS_ROW_LABELS
49 public static final String HEADERS = "Headers";
50 public static final String HEADERS_COL_WIDTHS = "columnWidths";
51 public static final String HEADERS_ROW_HEIGHTS = "rowHeights";
52 public static final String HEADERS_COL_LABELS = "columnLabels";
53 public static final String HEADERS_ROW_LABELS = "rowLabels";
56 * The location argument to use for setting dimension properties.
57 * @see #DIMENSIONS_COL_COUNT
58 * @see #DIMENSIONS_FIT_COLS
59 * @see #DIMENSIONS_FIT_ROWS
60 * @see #DIMENSIONS_ROW_COUNT
62 public static final String DIMENSIONS = "Dimensions";
63 public static final String DIMENSIONS_FIT_ROWS = "fitRows";
64 public static final String DIMENSIONS_FIT_COLS = "fitColumns";
65 public static final String DIMENSIONS_COL_COUNT = "columnCount";
66 public static final String DIMENSIONS_ROW_COUNT = "rowCount";
68 public static final String SOURCES = "Sources";
69 public static final String SOURCES_AVAILABLE = "available";
70 public static final String SOURCES_CURRENT = "current";
72 public static final String SHEETS = "Sheets";
73 public static final String SHEETS_AVAILABLE = "available";
74 public static final String SHEETS_CURRENT = "current";
76 public static final String CONTEXT = "Context";
77 public static final String CONTEXT_CURRENT = "current";
79 public static final String MODE = "Mode";
80 public static final String MODE_CURRENT = "current";
82 public static final String STATES = "States";
83 public static final String STATES_AVAILABLE = "available";
84 public static final String STATES_CURRENT = "current";
86 public static final String FONT = "font";
87 public static final String FOREGROUND = "foreground";
88 public static final String BACKGROUND = "background";
89 public static final String BORDER = "border";
90 public static final String ALIGN = "align";
91 public static final String LABEL = "label";
92 public static final String CONTENT = "content";
93 public static final String CONTENT_EXPRESSION = "content#expression";
94 public static final String COMPUTED = "Computed";
95 public static final String LOCKED = "locked";
96 public static final String ROW_SPAN = "rowSpan";
97 public static final String COLUMN_SPAN = "columnSpan";
99 public static final String ITERATION_ENABLED = "iterationEnabled";
101 void addListener(ClientModelListener listener);
102 void removeListener(ClientModelListener listener);
103 <T> T getPropertyAt(String location, String property);
104 <T> T getPossiblePropertyAt(String location, String property);
106 int[] getColumnWidths();
107 int[] getRowHeights();
112 public Collection<Pair<String, Object>> listAll(String property);
115 * Returns a copy of the span. Null if not found.
117 public Rectangle getSpan(int row, int column);
120 * Returns a copy of the span list.
122 public List<Rectangle> getSpans();