MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / DataToolTab

Class DataToolTab

src/org/opensourcephysics/tools/DataToolTab.java:134–5010  ·  view source on GitHub ↗

This tab displays and analyzes a single Data object in a DataTool. @author Douglas Brown @version 1.0

Source from the content-addressed store, hash-verified

132 * @version 1.0
133 */
134@SuppressWarnings("serial")
135public class DataToolTab extends JPanel implements Tool, PropertyChangeListener {
136
137 // static fields
138
139 protected static DecimalFormat correlationFormat = (DecimalFormat) NumberFormat.getInstance();
140 private static final Cursor SELECT_CURSOR, SELECT_ZOOM_CURSOR;
141 private static final Cursor SELECT_REMOVE_CURSOR, SELECT_ADD_CURSOR;
142 // mouse states
143 private final static int STATE_INACTIVE = 0;
144 private final static int STATE_SELECT = 1;
145 private final static int STATE_SELECT_ADD = 2;
146 private final static int STATE_SELECT_REMOVE = 3;
147 private final static int STATE_MOVE = 4;
148 private final static int STATE_ZOOM = 5;
149
150 static {
151 if (correlationFormat instanceof DecimalFormat) {
152 DecimalFormat format = correlationFormat;
153 format.applyPattern("0.000"); //$NON-NLS-1$
154 }
155 // create cursors
156 String imageFile = "/org/opensourcephysics/resources/tools/images/selectcursor.gif"; //$NON-NLS-1$
157 Image im = ResourceLoader.getImage(imageFile);
158 SELECT_CURSOR = GUIUtils.createCustomCursor(im, new Point(0, 0), "Select points", Cursor.CROSSHAIR_CURSOR); //$NON-NLS-1$
159 imageFile = "/org/opensourcephysics/resources/tools/images/selectremovecursor.gif"; //$NON-NLS-1$
160 im = ResourceLoader.getImage(imageFile);
161 SELECT_REMOVE_CURSOR = GUIUtils.createCustomCursor(im, new Point(0, 0), "Remove points", //$NON-NLS-1$
162 Cursor.CROSSHAIR_CURSOR);
163 imageFile = "/org/opensourcephysics/resources/tools/images/selectaddcursor.gif"; //$NON-NLS-1$
164 im = ResourceLoader.getImage(imageFile);
165 SELECT_ADD_CURSOR = GUIUtils.createCustomCursor(im, new Point(0, 0), "Add points", //$NON-NLS-1$
166 Cursor.CROSSHAIR_CURSOR);
167 imageFile = "/org/opensourcephysics/resources/tools/images/selectzoomcursor.gif"; //$NON-NLS-1$
168 im = ResourceLoader.getImage(imageFile);
169 SELECT_ZOOM_CURSOR = GUIUtils.createCustomCursor(im, new Point(8, 8), "Zoom", Cursor.CROSSHAIR_CURSOR); //$NON-NLS-1$
170 }
171
172 // instance fields
173
174 private DatasetCurveFitter curveFitter;
175
176 public DatasetCurveFitter getCurveFitter() {
177 checkGUI();
178 return curveFitter;
179 }
180
181 protected DataTool dataTool; // the DataTool that displays this tab
182 protected int originatorID = 0; // the ID of the Data object that owns this tab
183 protected DatasetManager dataManager = new DatasetManager(); // datasets in this tab
184 protected JSplitPane[] splitPanes;
185 protected DataToolPlotter plot;
186 protected DataToolTable dataTable;
187 protected DataToolStatsTable statsTable;
188 protected DataToolPropsTable propsTable;
189 protected JScrollPane dataScroller, statsScroller, propsScroller, tableScroller;
190 protected JToolBar toolbar;
191 protected JCheckBoxMenuItem statsCheckbox, propsCheckbox, fourierCheckbox;

Callers

nothing calls this directly

Calls 4

getImageMethod · 0.95
createCustomCursorMethod · 0.95
getInstanceMethod · 0.45
applyPatternMethod · 0.45

Tested by

no test coverage detected