source: java/main/src/main/java/com/framsticks/gui/controls/TextFieldControl.java @ 107

Last change on this file since 107 was 107, checked in by psniegowski, 11 years ago

HIGHLIGHTS:

  • add SimultorProviders? hierarchy
  • start Framsticks server over SSH
  • FJF compatible with Framsticks 4.0rc3
  • reading and writing of standard.expt
  • a proof-of-concept implementation of StandardExperiment?

CHANGELOG:
Optionally return FreeAccess? from registry.

Add SimulatorRange?.

StandardExperiment? with genotypes circulation.

Automate registration around StandardState?.

More improvements to StandardExperiment?.

Skeleton version of StandardExperiment?.

Test saving of StandardState?.

Standard experiment state is being loaded.

More development towards StandardState? reading.

Work on reading standard experiment state.

Add classes for standard experiment.

Update example standard.expt

Add FreeAccess? and FreeObject?.

Made compatible with version 4.0rc3

Change deserialization policy.

Improve SSH support.

Working running simulator over SSH.

Fix joining bug in Experiment.

Working version of SimulatorRunner?.

Add more SimulatorProviders?.

Working PrimeExperimentTest? with 4.0rc3

Add references to deserialization.

Add OpaqueObject? and it's serialization.

Add deserialization of dictionaries.

Partial implementation of deserialization.

Add more tests for deserialization.

Prepare tests for deserialization.

Add proper result to prime experiment test.

Minor fixes to simulators providers.

Draft version of SimulatorProvider?.

Add SimulatorProvider? interface.

File size: 1.2 KB
Line 
1package com.framsticks.gui.controls;
2
3import com.framsticks.gui.Gui;
4import com.framsticks.params.PrimitiveParam;
5
6import javax.swing.*;
7import javax.swing.text.JTextComponent;
8
9import java.awt.*;
10
11@SuppressWarnings("serial")
12public class TextFieldControl extends TextOnlyControl {
13
14
15        private static final Color WRONG_COLOR = new Color(255, 180, 215);
16
17        protected final JTextField textField;
18        private final Color correctColor;
19
20        @Override
21        protected boolean notifyOfChange() {
22                boolean result = super.notifyOfChange();
23                textField.setBackground(result ? correctColor : WRONG_COLOR);
24                return result;
25        }
26
27        public TextFieldControl(PrimitiveParam<?> valueParam) {
28                super(valueParam);
29                textField = new JTextField();
30                textField.setName("value");
31                correctColor = textField.getBackground();
32
33                textField.setMinimumSize(new Dimension(0, Control.LINE_HEIGHT));
34                this.setMaximumSize(new Dimension(Integer.MAX_VALUE, Control.LINE_HEIGHT));
35
36                addDefaultDocumentListener(textField);
37
38                Gui.addLeftToLabel(this, textField);
39        }
40
41
42        @Override
43        protected JTextComponent getTextComponent() {
44                return textField;
45        }
46
47        @Override
48        protected void updateEnabled(boolean enabled) {
49                textField.setEnabled(enabled);
50        }
51
52}
Note: See TracBrowser for help on using the repository browser.