1 /*
2 * Copyright 2006 - 2012 Christina Bohk and Roland Ewald
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package p3j.gui.dialogs;
17
18 import java.awt.BorderLayout;
19
20 import javax.swing.JLabel;
21 import javax.swing.JPanel;
22
23 import org.jamesii.gui.utils.BasicUtilities;
24
25 import p3j.misc.gui.GUI;
26 import p3j.pppm.ProjectionModel;
27
28 /**
29 * Super class for dialogs letting the user process the {@link ProjectionModel}
30 * in some way.
31 *
32 * @author Christina Bohk
33 * @author Roland Ewald
34 */
35 public abstract class ProcessProjectionDialog extends ProjectionDialog {
36
37 /** The Constant serialVersionUID. */
38 private static final long serialVersionUID = -6055434273943848669L;
39
40 /** The projection model of which the age shall be adjusted. */
41 private final ProjectionModel projectionModel;
42
43 /**
44 * Instantiates a new process projection dialog.
45 *
46 * @param projection
47 * the projection
48 */
49 public ProcessProjectionDialog(ProjectionModel projection) {
50 projectionModel = projection;
51 }
52
53 /**
54 * Reinitializes user interface for age class adjustment.
55 *
56 * @return the reference to the status message label
57 */
58 protected JLabel reinitializeUIForAdjustment() {
59 getContentPane().removeAll();
60 JPanel content = new JPanel(new BorderLayout());
61 content.add(GUI.getLabelToWait(), BorderLayout.CENTER);
62 final JLabel status = new JLabel("Initializing...");
63 content.add(status, BorderLayout.SOUTH);
64 getContentPane().add(content);
65 BasicUtilities.repaintOnEDT(this);
66 return status;
67 }
68
69 public ProjectionModel getProjectionModel() {
70 return projectionModel;
71 }
72
73 }