Search in sources :

Example 21 with IniConfigSection

use of net.parostroj.timetable.gui.ini.IniConfigSection in project grafikon by jub77.

the class FreightNetPane2 method saveToPreferences.

@Override
public IniConfigSection saveToPreferences(IniConfig prefs) {
    IniConfigSection section = prefs.getSection("freigh.net");
    section.put("gtv", graphicalTimetableView.getSettings().getStorageString());
    return section;
}
Also used : IniConfigSection(net.parostroj.timetable.gui.ini.IniConfigSection)

Example 22 with IniConfigSection

use of net.parostroj.timetable.gui.ini.IniConfigSection in project grafikon by jub77.

the class TrainsCyclesPane method loadFromPreferences.

@Override
public IniConfigSection loadFromPreferences(IniConfig prefs) {
    IniConfigSection section = prefs.getSection(getKey());
    splitPane.setDividerLocation(section.get("divider", Integer.class, -1));
    try {
        GTViewSettings gtvs = GTViewSettings.parseStorageString(section.get("gtv"));
        if (gtvs != null) {
            graphicalTimetableView.setSettings(graphicalTimetableView.getSettings().merge(gtvs));
        }
    } catch (Exception e) {
        log.warn("Wrong GTView settings - using default values.");
    }
    return section;
}
Also used : IniConfigSection(net.parostroj.timetable.gui.ini.IniConfigSection)

Example 23 with IniConfigSection

use of net.parostroj.timetable.gui.ini.IniConfigSection in project grafikon by jub77.

the class FloatingDialog method loadFromPreferences.

@Override
public IniConfigSection loadFromPreferences(IniConfig prefs) {
    IniConfigSection section = prefs.getSection(storageKeyPrefix);
    // set position
    String positionStr = section.get("position");
    GuiUtils.setPosition(positionStr, this);
    // set visibility
    if (section.get("visible", Boolean.class, false)) {
        this.visibleOnInit = true;
    }
    return section;
}
Also used : IniConfigSection(net.parostroj.timetable.gui.ini.IniConfigSection)

Example 24 with IniConfigSection

use of net.parostroj.timetable.gui.ini.IniConfigSection in project grafikon by jub77.

the class FloatingDialog method saveToPreferences.

@Override
public IniConfigSection saveToPreferences(IniConfig prefs) {
    prefs.removeSection(storageKeyPrefix);
    IniConfigSection section = prefs.getSection(storageKeyPrefix);
    section.put("position", GuiUtils.getPosition(this));
    section.put("visible", this.isVisible());
    return section;
}
Also used : IniConfigSection(net.parostroj.timetable.gui.ini.IniConfigSection)

Aggregations

IniConfigSection (net.parostroj.timetable.gui.ini.IniConfigSection)24 IniConfig (net.parostroj.timetable.gui.ini.IniConfig)4 File (java.io.File)3 GTViewSettings (net.parostroj.timetable.gui.components.GTViewSettings)2 IOException (java.io.IOException)1 HashSet (java.util.HashSet)1 ListSelectionEvent (javax.swing.event.ListSelectionEvent)1 ScriptAction (net.parostroj.timetable.actions.scripts.ScriptAction)1 NormalHTS (net.parostroj.timetable.gui.utils.NormalHTS)1 DriverCycleDelegate (net.parostroj.timetable.gui.views.DriverCycleDelegate)1 EngineCycleDelegate (net.parostroj.timetable.gui.views.EngineCycleDelegate)1 TreeType (net.parostroj.timetable.gui.views.TrainListView.TreeType)1 TrainUnitCycleDelegate (net.parostroj.timetable.gui.views.TrainUnitCycleDelegate)1 AbstractColleague (net.parostroj.timetable.mediator.AbstractColleague)1 LengthUnit (net.parostroj.timetable.model.units.LengthUnit)1 SpeedUnit (net.parostroj.timetable.model.units.SpeedUnit)1