Search in sources :

Example 1 with NormalHTS

use of net.parostroj.timetable.gui.utils.NormalHTS in project grafikon by jub77.

the class TrainsPane method setModel.

/**
 * sets model.
 *
 * @param model application model
 */
public void setModel(final ApplicationModel model) {
    trainListView.setModel(model);
    trainView.setModel(model);
    NormalHTS hts = new NormalHTS(model, Color.GREEN, graphicalTimetableView);
    graphicalTimetableView.setParameter(GTDraw.HIGHLIGHTED_TRAINS, hts);
    graphicalTimetableView.setRegionSelector(hts, TimeInterval.class);
}
Also used : NormalHTS(net.parostroj.timetable.gui.utils.NormalHTS)

Example 2 with NormalHTS

use of net.parostroj.timetable.gui.utils.NormalHTS in project grafikon by jub77.

the class FloatingWindowsFactory method createGTViewDialog.

private static FloatingWindow createGTViewDialog(Frame frame, Mediator mediator, ApplicationModel model) {
    final GraphicalTimetableView gtView = new GraphicalTimetableView();
    final GTLayeredPane2 scrollPane = new GTLayeredPane2(gtView);
    NormalHTS hts = new NormalHTS(model, Color.GREEN, gtView);
    gtView.setParameter(GTDraw.HIGHLIGHTED_TRAINS, hts);
    gtView.setRegionSelector(hts, TimeInterval.class);
    FloatingFrame dialog = new FloatingFrame(frame, scrollPane, "dialog.gtview.title", "gt.view") {

        private static final long serialVersionUID = 1L;

        @Override
        public IniConfigSection saveToPreferences(IniConfig prefs) {
            IniConfigSection section = super.saveToPreferences(prefs);
            section.put("gtv", gtView.getSettings().getStorageString());
            return section;
        }

        @Override
        public IniConfigSection loadFromPreferences(IniConfig prefs) {
            IniConfigSection section = super.loadFromPreferences(prefs);
            try {
                GTViewSettings gtvs = GTViewSettings.parseStorageString(section.get("gtv"));
                gtView.setSettings(gtView.getSettings().merge(gtvs));
            } catch (Exception e) {
                log.warn("Wrong GTView settings - using default values.");
            }
            return section;
        }
    };
    return dialog;
}
Also used : IniConfig(net.parostroj.timetable.gui.ini.IniConfig) NormalHTS(net.parostroj.timetable.gui.utils.NormalHTS) IniConfigSection(net.parostroj.timetable.gui.ini.IniConfigSection)

Aggregations

NormalHTS (net.parostroj.timetable.gui.utils.NormalHTS)2 IniConfig (net.parostroj.timetable.gui.ini.IniConfig)1 IniConfigSection (net.parostroj.timetable.gui.ini.IniConfigSection)1