Package org.qi4j.sample.dcicargo.sample_a.data.shipping.itinerary

Examples of org.qi4j.sample.dcicargo.sample_a.data.shipping.itinerary.Leg


            // Next expected handling event ----------------------------------------------

            public ExpectedHandlingEvent expectedEventAfterReceive()
            {
                // After RECEIVE, expect LOAD location and voyage of first itinerary leg
                final Leg firstLeg = itinerary.legs().get().iterator().next();
                return buildEvent( HandlingEventType.LOAD, firstLeg.loadLocation().get(), firstLeg.loadTime()
                    .get(), firstLeg.voyage().get() );
            }
View Full Code Here


            public ExpectedHandlingEvent expectedEventAfterUnloadAt( Location lastUnloadLocation )
            {
                // After UNLOAD, expect LOAD location and voyage of following itinerary leg, or CLAIM if no more legs
                for( Iterator<Leg> it = itinerary.legs().get().iterator(); it.hasNext(); )
                {
                    final Leg leg = it.next();
                    if( leg.unloadLocation().get().equals( lastUnloadLocation ) )
                    {
                        // Cargo has a matching unload location in itinerary

                        if( it.hasNext() )
                        {
                            // Cargo has not arrived yet (uncompleted legs in itinerary)
                            // We expect it to be loaded onto some Carrier
                            final Leg nextLeg = it.next();
                            return buildEvent( HandlingEventType.LOAD, nextLeg.loadLocation().get(), nextLeg.loadTime()
                                .get(), nextLeg.voyage().get() );
                        }
                        else
                        {
                            // Cargo has arrived (no more legs in itinerary)
                            // We expect it to be claimed by the customer
View Full Code Here

            add( new ListView<Leg>( "legs", legListModel )
            {
                @Override
                protected void populateItem( ListItem<Leg> item )
                {
                    Leg leg = item.getModelObject();

                    item.add( new Label( "loadLocation", leg.loadLocation().get().getCode() ) );
                    item.add( new Label( "loadTime", new Model<Date>( leg.loadTime().get() ) ) );
                    item.add( new Label( "voyage", leg.voyage().get().voyageNumber().get().number().get() ) );

                    Boolean isMisrouted = routingStatus == RoutingStatus.MISROUTED && item.getIndex() == ( getList().size() - 1 );
                    item.add( new Label( "unloadLocation", leg.unloadLocation().get().getCode() )
                                  .add( new ErrorColor( isMisrouted ) ) );

                    item.add( new Label( "unloadTime", new Model<Date>( leg.unloadTime().get() ) ) );
                }
            } );
        }
View Full Code Here

        add( new ListView<Leg>( "legs", legListModel )
        {
            @Override
            protected void populateItem( ListItem<Leg> item )
            {
                Leg leg = item.getModelObject();
                item.add( new Label( "voyage", leg.voyage().get().toString() ),
                          new Label( "loadLocation", leg.loadLocation().get().getCode() ),
                          new Label( "loadTime", new Model<Date>( leg.loadTime().get() ) ),
                          new Label( "unloadLocation", leg.unloadLocation().get().getCode() ),
                          new Label( "unloadTime", new Model<Date>( leg.unloadTime().get() ) )
                );
            }
        } );

        Form form = new Form<Void>( "form" );
View Full Code Here

TOP

Related Classes of org.qi4j.sample.dcicargo.sample_a.data.shipping.itinerary.Leg

Copyright © 2018 www.massapicom. 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.