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
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
;
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() {
72 menu
= new JMenu("Plot");
74 //menu.add(createDefaultsMenu());
79 public JMenu
createCommandMenu() {
84 menu
= new JMenu("Command");
87 menuItem
= new JMenuItem();
88 menuItem
.setAction(startAction
);
92 menuItem
= new JMenuItem();
93 menuItem
.setAction(stopAction
);
96 menuItem
= new JMenuItem();
97 menuItem
.setAction(clearAction
);
101 //menu = createPlotMenu();
106 public JToolBar
createToolBar() {
107 JToolBar toolBar
= new JToolBar();
110 button
= new JButton(startAction
);
113 button
= new JButton(stopAction
);
116 toolBar
.addSeparator();
118 button
= new JButton(clearAction
);
124 protected void fillDefaults(int index
) {}
129 public Action
getClearAction() {
136 public Action
getStartAction() {
143 public Action
getStopAction() {
147 public void callUponStart() {