added contact information in 'about' box
[iDMC.git] / src / java / org / tsho / dmc2 / ui / cycles / CyclesComponent.java
blob3523ee1962a3fd1d41d389940b543c2a358186bb
1 /*
2 * iDMC the interactive Dynamical Model Calculator simulates and performs
3 * graphical and numerical analysis of systems of differential and
4 * difference equations.
6 * Copyright (C) 2004,2005,2006 Marji Lines and Alfredo Medio.
8 * Written by Daniele Pizzoni <auouo@tin.it>.
11 * The software program was developed within a research project financed
12 * by the Italian Ministry of Universities, the Universities of Udine and
13 * Ca'Foscari of Venice, the Friuli-Venezia Giulia Region.
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or any
18 * later version.
20 * This program is distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * General Public License for more details.
25 package org.tsho.dmc2.ui.cycles;
27 import javax.swing.Action;
28 import javax.swing.JButton;
29 import javax.swing.JMenu;
30 import javax.swing.JMenuItem;
31 import javax.swing.JToolBar;
33 import org.tsho.dmc2.core.model.SimpleMap;
34 import org.tsho.dmc2.managers.CyclesManager;
35 import org.tsho.dmc2.sm.Input;
36 import org.tsho.dmc2.ui.AbstractPlotComponent;
37 import org.tsho.dmc2.ui.MainFrame;
39 /**
41 * @author Daniele Pizzoni <auouo@tin.it>
43 public class CyclesComponent extends AbstractPlotComponent
44 implements CyclesSMItf {
46 private final CyclesControlForm2 privateControlForm;
48 private final Action startAction = new StartAction();
49 private final Action stopAction = new StopAction();
50 private final Action clearAction = new ClearAction();
52 public CyclesComponent(final SimpleMap model, MainFrame mainFrame) {
53 super(model,mainFrame);
55 controlForm = privateControlForm = new CyclesControlForm2(model,this);
57 init(new CyclesManager(model, privateControlForm, this),
58 new CyclesFrameSM(this),
59 controlForm, "Cycles");
61 stateMachine.addSensibleItem(controlForm);
62 stateMachine.addSensibleItem(getBigDotsMenuItem());
63 stateMachine.parseInput(Input.go);
64 getBigDotsMenuItem().setSelected(true);
65 ((CyclesManager) getManager()).setBigDots(true);
66 finishInit(controlForm);
69 protected JMenu createPlotMenu() {
70 JMenu menu;
72 menu = new JMenu("Plot");
74 //menu.add(createDefaultsMenu());
76 return menu;
79 public JMenu createCommandMenu() {
80 JMenu menu;
81 JMenuItem menuItem;
83 /* Command menu */
84 menu = new JMenu("Command");
86 /* start */
87 menuItem = new JMenuItem();
88 menuItem.setAction(startAction);
89 menu.add(menuItem);
91 /* stop */
92 menuItem = new JMenuItem();
93 menuItem.setAction(stopAction);
94 menu.add(menuItem);
96 menuItem = new JMenuItem();
97 menuItem.setAction(clearAction);
98 menu.add(menuItem);
100 /* Plot menu */
101 //menu = createPlotMenu();
103 return menu;
106 public JToolBar createToolBar() {
107 JToolBar toolBar = new JToolBar();
109 JButton button;
110 button = new JButton(startAction);
111 toolBar.add(button);
113 button = new JButton(stopAction);
114 toolBar.add(button);
116 toolBar.addSeparator();
118 button = new JButton(clearAction);
119 toolBar.add(button);
121 return toolBar;
124 protected void fillDefaults(int index) {}
127 * @return
129 public Action getClearAction() {
130 return clearAction;
134 * @return
136 public Action getStartAction() {
137 return startAction;
141 * @return
143 public Action getStopAction() {
144 return stopAction;
147 public void callUponStart() {