Ignore:
Timestamp:
07/14/13 23:20:04 (11 years ago)
Author:
psniegowski
Message:

HIGHLIGHTS:

  • improve tree side notes
  • improve GUI layout
  • add foldable list of occured events to EventControl?
  • improve automatic type conversion in proxy listeners
  • implement several Access functionalities as algorithms independent of Access type
  • introduce draft base classes for distributed experiments
  • automatically register dependant Java classes to FramsClass? registry
  • add testing prime experiment and configuration
  • simplify and improve task dispatching

CHANGELOG:
Improve task dispatching in RemoteTree?.

GUI no longer hangs on connection problems.

Make all dispatchers joinables.

Refactorize Thread dispatcher.

Remove Task and PeriodicTask?.

Use Java utilities in those situations.

Reworking tasks dispatching.

Fix bug in EventControl? listener dispatching.

Minor improvements.

Add testing configuration for ExternalProcess? in GUI.

More improvement to prime.

Support for USERREADONLY in GUI.

Add that flag to various params in Java classes.

Remove redundant register clauses from several FramsClassAnnotations?.

Automatically gather and register dependant classes.

Add configuration for prime.

Improve Simulator class.

Add prime.xml configuration.

Introduce draft Experiment and Simulator classes.

Add prime experiment tests.

Enclose typical map with listeners into SimpleUniqueList?.

Needfile works in GUI.

Improve needfile handling in Browser.

More improvement with NeedFile?.

Implementing needfile.

Update test.

Rename ChangeEvent? to TestChangeEvent?.

Automatic argument type search in RemoteTree? listeners.

MultiParamLoader? uses AccessProvider?. By default old implementation
enclosed in AccessStash? or Registry.

Minor changes.

Rename SourceInterface? to Source.

Also improve toString of File and ListSource?.

Remove unused SimpleSource? class.

Add clearing in HistoryControl?.

Show entries in table at EventControl?.

Improve EventControl?.

Add listeners registration to EventControl?.

Add foldable table to HistoryControl?.

Add control row to Procedure and Event controls.

Improve layout of controls.

Another minor change to gui layout.

Minor improvement in the SliderControl?.

Minor changes.

Move ReflectionAccess?.Backend to separate file.

It was to cluttered.

Cleanup in ReflectionAccess?.

Move setMin, setMax, setDef to AccessOperations?.

Extract loading operation into AccessOperations?.

Append Framsticks to name of UnsupportedOperationException?.

The java.lang.UnsupportedOperationException? was shadowing this class.

Rename params.Util to params.ParamsUtil?.

Several improvements.

Minor changes.

Implement revert functionality.

Improve local changes management.

Minor improvement.

Remove methods rendered superfluous after SideNoteKey? improvement.

Improve SideNoteKey?.

It is now generic type, so explicit type specification at
call site is no more needed.

Introduce SideNoteKey? interface.

Only Objects implementing that key may be used as side note keys.

Minor improvements.

Use strings instead of ValueControls? in several gui mappings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • java/main/src/main/java/com/framsticks/gui/Gui.java

    r100 r101  
    77import javax.swing.Box;
    88import javax.swing.BoxLayout;
     9import javax.swing.JComponent;
    910import javax.swing.JLabel;
    1011import javax.swing.JPanel;
     12import javax.swing.border.TitledBorder;
    1113
    1214import org.apache.logging.log4j.Logger;
     
    2426import com.framsticks.params.CompositeParam;
    2527import com.framsticks.params.Param;
     28import com.framsticks.params.ParamFlags;
    2629import com.framsticks.params.PrimitiveParam;
    2730import com.framsticks.params.types.BinaryParam;
     
    101104        }
    102105
    103         public static <P extends Param, C extends Control> void fillWithControls(ControlOwner owner, Collection<P> params, Map<P, C> components, Class<C> controlType) {
    104                 JPanel panel = owner.getPanelForControls();
     106        public static <P extends Param, C extends Control> void fillWithControls(ControlOwner owner, JPanel panel, Collection<P> params, Map<String, C> components, Class<C> controlType) {
     107                panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
    105108                for (P param : params) {
    106                         if (param.isUserHidden()) {
     109                        if (param.hasFlag(ParamFlags.USERHIDDEN)) {
    107110                                continue;
    108111                        }
     
    122125                        line.setLayout(new BoxLayout(line, BoxLayout.LINE_AXIS));
    123126                        line.setAlignmentX(JPanel.LEFT_ALIGNMENT);
    124                         JLabel label = new JLabel(Strings.notEmpty(param.getName()) ? param.getName() : (Strings.notEmpty(param.getId()) ? param.getId() : "?"));
    125                         label.setToolTipText(control.getToolTipText());
    126                         label.setHorizontalAlignment(JLabel.RIGHT);
    127                         Dimension labelSize = new Dimension(150, 30);
    128                         label.setMaximumSize(labelSize);
    129                         label.setMinimumSize(labelSize);
    130                         label.setPreferredSize(labelSize);
    131                         line.add(label);
    132                         line.add(Box.createRigidArea(new Dimension(8, 0)));
     127
    133128                        line.add(control);
    134129                        line.revalidate();
    135130                        panel.add(line);
    136131                        panel.add(Box.createRigidArea(new Dimension(0, 8)));
     132                        components.put(param.getId(), control);
    137133                        //component.setAlignmentX(LEFT_ALIGNMENT);
    138                         components.put(param, control);
     134                        // components.put(param.getId(), control);
    139135                }
    140136
    141137        }
     138
     139        public static String getBestName(Param param) {
     140                if (Strings.notEmpty(param.getName())) {
     141                        return param.getName();
     142                }
     143                if (Strings.notEmpty(param.getId())) {
     144                        return param.getId();
     145                }
     146                return "?";
     147        }
     148
     149        public static void setupTitledControl(Control control, JComponent... components) {
     150
     151                control.setLayout(new BoxLayout(control, BoxLayout.PAGE_AXIS));
     152                control.setBorder(new TitledBorder(Gui.getBestName(control.getParam())));
     153                for (JComponent c : components) {
     154                        // control.add(Box.createRigidArea(new Dimension(0, 4)));
     155                        control.add(c);
     156                }
     157        }
     158
     159        public static void layoutInRow(JPanel panel, JComponent first, JComponent... components) {
     160                panel.setLayout(new BoxLayout(panel, BoxLayout.LINE_AXIS));
     161                panel.setAlignmentX(JPanel.LEFT_ALIGNMENT);
     162
     163                panel.add(first);
     164                for (JComponent c : components) {
     165                        panel.add(Box.createRigidArea(new Dimension(8, 0)));
     166                        panel.add(c);
     167                }
     168        }
     169
     170        public static void addLeftToLabel(Control control, JComponent... components) {
     171
     172                JLabel label = new JLabel(getBestName(control.getParam()));
     173                label.setToolTipText(control.getToolTipText());
     174                label.setHorizontalAlignment(JLabel.LEFT);
     175                Dimension labelSize = new Dimension(150, 30);
     176                label.setMaximumSize(labelSize);
     177                label.setMinimumSize(labelSize);
     178                label.setPreferredSize(labelSize);
     179
     180                layoutInRow(control, label, components);
     181
     182        }
    142183}
Note: See TracChangeset for help on using the changeset viewer.