source: java/main/src/main/java/com/framsticks/gui/controls/TextAreaControl.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.5 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 TextAreaControl extends TextOnlyControl {
13
14        protected final JTextArea textArea;
15        protected final JScrollPane textScrollPane;
16
17        public TextAreaControl(PrimitiveParam<?> valueParam) {
18                super(valueParam);
19                textArea = new JTextArea();
20                textArea.setName("value");
21                textArea.setLineWrap(true);
22                textArea.setWrapStyleWord(true);
23                addDefaultDocumentListener(textArea);
24
25                textScrollPane = new JScrollPane(textArea);
26                this.setLayout(new BorderLayout());
27                this.add(textScrollPane, BorderLayout.CENTER);
28                int maxSize = LINE_HEIGHT * 10;
29                this.setMaximumSize(new Dimension(Integer.MAX_VALUE, maxSize));
30                textArea.setMaximumSize(new Dimension(Integer.MAX_VALUE, maxSize));
31
32                Gui.setupTitledControl(this, textScrollPane);
33                // this.revalidate();
34        }
35
36        @Override
37        public Dimension getPreferredSize() {
38                Dimension result = super.getPreferredSize();
39                return new Dimension(result.width, Math.min(result.height, this.getMaximumSize().height));
40        }
41
42        @Override
43        protected JTextComponent getTextComponent() {
44                return textArea;
45        }
46
47        @Override
48        public void pushValueToUserInterfaceImpl(Object value) {
49                // getTextComponent().setText(getParam().serialize(value));
50                super.pushValueToUserInterfaceImpl(value);
51                this.revalidate();
52        }
53
54        @Override
55        protected void updateEnabled(boolean enabled) {
56                textArea.setEditable(enabled);
57        }
58
59}
Note: See TracBrowser for help on using the repository browser.