Search in sources :

Example 11 with Event

use of net.parostroj.timetable.model.events.Event in project grafikon by jub77.

the class TrainsData method setTrainCompleteNameTemplate.

public void setTrainCompleteNameTemplate(TextTemplate trainCompleteNameTemplate) {
    TextTemplate oldValue = this.trainCompleteNameTemplate;
    this.trainCompleteNameTemplate = trainCompleteNameTemplate;
    this.diagram.fireEvent(new Event(diagram, new AttributeChange(TrainDiagram.ATTR_TRAIN_COMPLETE_NAME_TEMPLATE, oldValue, this.trainCompleteNameTemplate)));
}
Also used : AttributeChange(net.parostroj.timetable.model.events.AttributeChange) Event(net.parostroj.timetable.model.events.Event)

Example 12 with Event

use of net.parostroj.timetable.model.events.Event in project grafikon by jub77.

the class TrainsData method setRunningTimeScript.

public void setRunningTimeScript(Script runningTimeScript) {
    Script oldValue = this.runningTimeScript;
    this.runningTimeScript = runningTimeScript;
    this.diagram.fireEvent(new Event(diagram, new AttributeChange(TrainDiagram.ATTR_RUNNING_SCRIPT, oldValue, this.runningTimeScript)));
}
Also used : AttributeChange(net.parostroj.timetable.model.events.AttributeChange) Event(net.parostroj.timetable.model.events.Event)

Example 13 with Event

use of net.parostroj.timetable.model.events.Event in project grafikon by jub77.

the class TrainsData method setTrainNameTemplate.

public void setTrainNameTemplate(TextTemplate trainNameTemplate) {
    TextTemplate oldValue = this.trainNameTemplate;
    this.trainNameTemplate = trainNameTemplate;
    this.diagram.fireEvent(new Event(diagram, new AttributeChange(TrainDiagram.ATTR_TRAIN_NAME_TEMPLATE, oldValue, this.trainNameTemplate)));
}
Also used : AttributeChange(net.parostroj.timetable.model.events.AttributeChange) Event(net.parostroj.timetable.model.events.Event)

Example 14 with Event

use of net.parostroj.timetable.model.events.Event in project grafikon by jub77.

the class GTVButtonPanel method setTrainDiagram.

protected void setTrainDiagram(TrainDiagram td) {
    this.td = td;
    fill();
    if (td != null) {
        td.addListener(new Listener() {

            @Override
            public void changed(Event event) {
                if (event.getType() == Type.ADDED || event.getType() == Type.REMOVED && event.getObject() instanceof Route) {
                    fill();
                }
            }
        });
    }
}
Also used : ActionListener(java.awt.event.ActionListener) PopupMenuListener(javax.swing.event.PopupMenuListener) Event(net.parostroj.timetable.model.events.Event) ActionEvent(java.awt.event.ActionEvent) MouseEvent(java.awt.event.MouseEvent) PopupMenuEvent(javax.swing.event.PopupMenuEvent) Route(net.parostroj.timetable.model.Route)

Example 15 with Event

use of net.parostroj.timetable.model.events.Event in project grafikon by jub77.

the class TrainNameDelegate method refreshCompleteName.

private void refreshCompleteName() {
    String oldName = _cachedCompleteName.getValue();
    String newName = this.getNameImpl(NameType.COMPLETE);
    if (_cachedCompleteName.set(newName)) {
        train.fireEvent(new Event(train, new AttributeChange(ATTR_COMPLETE_NAME, oldName, newName)));
    }
}
Also used : AttributeChange(net.parostroj.timetable.model.events.AttributeChange) Event(net.parostroj.timetable.model.events.Event)

Aggregations

Event (net.parostroj.timetable.model.events.Event)21 AttributeChange (net.parostroj.timetable.model.events.AttributeChange)12 Color (java.awt.Color)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 ItemEvent (java.awt.event.ItemEvent)1 MouseEvent (java.awt.event.MouseEvent)1 JComponent (javax.swing.JComponent)1 PopupMenuEvent (javax.swing.event.PopupMenuEvent)1 PopupMenuListener (javax.swing.event.PopupMenuListener)1 TCDetailsViewDialog (net.parostroj.timetable.gui.dialogs.TCDetailsViewDialog)1 TCDelegate (net.parostroj.timetable.gui.views.TCDelegate)1 Wrapper (net.parostroj.timetable.gui.wrappers.Wrapper)1 GTEventsReceiverColleague (net.parostroj.timetable.mediator.GTEventsReceiverColleague)1 Route (net.parostroj.timetable.model.Route)1 Train (net.parostroj.timetable.model.Train)1 TrainColorChooser (net.parostroj.timetable.output2.gt.TrainColorChooser)1 AbstractEventVisitor (net.parostroj.timetable.visitors.AbstractEventVisitor)1