Examples of LocomotiveGroup


Examples of ch.fork.AdHocRailway.domain.locomotives.LocomotiveGroup

        public void valueChanged(ListSelectionEvent e) {
            if (e.getValueIsAdjusting())
                return;
            if (locomotiveGroupList.getSelectedIndex() == -1)
                locomotiveGroupList.setSelectedIndex(0);
            LocomotiveGroup selectedGroup = (LocomotiveGroup) locomotiveGroupList
                    .getSelectedValue();
            if (selectedGroup == null)
                return;
            List<Locomotive> locomotives = new ArrayList<Locomotive>(
                    selectedGroup.getLocomotives());
            locomotiveModel.setList(locomotives);
            TableResizer.adjustColumnWidths(locomotivesTable, 5);
        }
View Full Code Here

Examples of ch.fork.AdHocRailway.domain.locomotives.LocomotiveGroup

        public Component getListCellRendererComponent(JList list, Object value,
                int index, boolean isSelected, boolean cellHasFocus) {
            Component component = super.getListCellRendererComponent(list,
                    value, index, isSelected, cellHasFocus);

            LocomotiveGroup group = (LocomotiveGroup) value;
            setText(group == null ? "" : (" " + group.getName()));
            return component;
        }
View Full Code Here

Examples of ch.fork.AdHocRailway.domain.locomotives.LocomotiveGroup

        public void actionPerformed(ActionEvent arg0) {
            String newGroupName = JOptionPane.showInputDialog(
                    LocomotiveConfigurationDialog.this,
                    "Enter the name of the new Locomotive-Group",
                    "Add Locomotive-Group", JOptionPane.QUESTION_MESSAGE);
            LocomotiveGroup newSection = new LocomotiveGroup(0, newGroupName);
            LocomotivePersistenceIface locomotivePersistence = AdHocRailway
                    .getInstance().getLocomotivePersistence();
            locomotivePersistence.addLocomotiveGroup(newSection);
        }
View Full Code Here

Examples of ch.fork.AdHocRailway.domain.locomotives.LocomotiveGroup

        public RemoveLocomotiveGroupAction() {
            super("Remove", ImageTools.createImageIcon("remove.png"));
        }

        public void actionPerformed(ActionEvent arg0) {
            LocomotiveGroup groupToDelete = (LocomotiveGroup) (locomotiveGroupList
                    .getSelectedValue());
            int response = JOptionPane.showConfirmDialog(
                    LocomotiveConfigurationDialog.this,
                    "Really remove Locomotive-Group '"
                            + groupToDelete.getName() + "' ?",
                    "Remove Locomotive-Group", JOptionPane.YES_NO_OPTION);
            if (response == JOptionPane.YES_OPTION) {
                try {
                    LocomotivePersistenceIface locomotivePersistence = AdHocRailway
                            .getInstance().getLocomotivePersistence();
View Full Code Here

Examples of ch.fork.AdHocRailway.domain.locomotives.LocomotiveGroup

                locomotiveComboBox.addItem("");
                for (Locomotive l : sl) {
                    locomotiveComboBox.addItem(l);
                }
            } else {
                LocomotiveGroup lg = (LocomotiveGroup) locomotiveGroupComboBox
                        .getSelectedItem();

                locomotiveComboBox.addItem("");
                for (Locomotive l : lg.getLocomotives()) {
                    locomotiveComboBox.addItem(l);
                }
            }
            locomotiveComboBox.setSelectedIndex(0);
            locomotiveComboBox.revalidate();
View Full Code Here

Examples of ch.fork.AdHocRailway.domain.locomotives.LocomotiveGroup

        public AddLocomotiveAction() {
            super("Add", ImageTools.createImageIcon("add.png"));
        }

        public void actionPerformed(ActionEvent e) {
            LocomotiveGroup selectedLocomotiveGroup = (LocomotiveGroup) (locomotiveGroupList
                    .getSelectedValue());
            Locomotive newLocomotive = new Locomotive();
            newLocomotive.setLocomotiveGroup(selectedLocomotiveGroup);
            selectedLocomotiveGroup.getLocomotives().add(newLocomotive);
            LocomotiveConfig locomotiveConfig = new LocomotiveConfig(
                    LocomotiveConfigurationDialog.this, newLocomotive);
            if (locomotiveConfig.isOkPressed()) {
                selectedLocomotiveGroup.getLocomotives().add(newLocomotive);
                LocomotivePersistenceIface locomotivePersistence = AdHocRailway
                    .getInstance().getLocomotivePersistence();
                locomotivePersistence.addLocomotive(newLocomotive);
            }
            List<Locomotive> locomotives = new ArrayList<Locomotive>(
                    selectedLocomotiveGroup.getLocomotives());
            locomotiveModel.setList(locomotives);
        }
View Full Code Here

Examples of ch.fork.AdHocRailway.domain.locomotives.LocomotiveGroup

            LocomotiveConfig turnoutConfig = new LocomotiveConfig(
                    LocomotiveConfigurationDialog.this, model);
            if (turnoutConfig.isOkPressed()) {
                // locomotivePersistence.updateLocomotive(model.getBean());
            }
            LocomotiveGroup selectedLocomotiveGroup = (LocomotiveGroup) (locomotiveGroupList
                    .getSelectedValue());
            List<Locomotive> locomotives = new ArrayList<Locomotive>(
                    selectedLocomotiveGroup.getLocomotives());
            locomotiveModel.setList(locomotives);
        }
View Full Code Here

Examples of ch.fork.AdHocRailway.domain.locomotives.LocomotiveGroup

        public RemoveLocomotiveAction() {
            super("Remove", ImageTools.createImageIcon("remove.png"));
        }

        public void actionPerformed(ActionEvent e) {
            LocomotiveGroup selectedLocomotiveGroup = (LocomotiveGroup) locomotiveGroupList
                    .getSelectedValue();

            int row = locomotivesTable.getSelectedRow();
            Locomotive locomotiveToDelete = locomotiveModel.getElementAt(row);

            LocomotivePersistenceIface locomotivePersistence = AdHocRailway
                    .getInstance().getLocomotivePersistence();
            locomotivePersistence.deleteLocomotive(locomotiveToDelete);
            List<Locomotive> locomotives = new ArrayList<Locomotive>(
                    selectedLocomotiveGroup.getLocomotives());
            locomotiveModel.setList(locomotives);
        }
View Full Code Here

Examples of ch.fork.AdHocRailway.domain.locomotives.LocomotiveGroup

            int bus = Integer.parseInt(attributes.getValue("bus"));
            actualAddress = new Address(bus, address);
            actualAddresses[actualAddressCounter] = actualAddress;
            actualAddressCounter++;
        } else if (qName.equals("locomotivegroup")) {
            actualLocomotiveGroup = new LocomotiveGroup(0,
                    attributes.getValue("name"));
            locomotivePersistence.addLocomotiveGroup(actualLocomotiveGroup);
        } else if (qName.equals("locomotive")) {
            parseLocomotive(qName, attributes);
        } else if (qName.equals("guiconfigparameter")) {
View Full Code Here

Examples of ch.fork.AdHocRailway.domain.locomotives.LocomotiveGroup

        } else if (qName.equals("route")) {
            parseRoute(qName, attributes);
        } else if (qName.equals("routedswitch")) {
            parseRoutedSwitch(qName, attributes);
        } else if (qName.equals("locomotivegroup")) {
            actualLocomotiveGroup = new LocomotiveGroup(0,
                    attributes.getValue("name"));
            locomotivePersistence.addLocomotiveGroup(actualLocomotiveGroup);
        } else if (qName.equals("locomotive")) {
            parseLocomotive(qName, attributes);
        } else if (qName.equals("guiconfigparameter")) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.