├── README.md
├── kanbanapp
├── .actionScriptProperties
├── .flexProperties
├── .project
├── built
│ └── PersonalKanban.air
├── libs
│ ├── air-sqlite-v1.0.swc
│ ├── flexunit-4.1.0-x-flex_y.y.y.y.swc
│ ├── hamcrest-as3-flex-1.1.3.swc
│ ├── mockolate-0.11.0-flex.swc
│ └── robotlegs-framework-v1.4.0.swc
├── src
│ ├── PersonalKanban-app.xml
│ ├── PersonalKanban.mxml
│ ├── assets
│ │ ├── data
│ │ │ └── sql
│ │ │ │ ├── create
│ │ │ │ ├── CreateDefaultsStatuses.sql
│ │ │ │ ├── CreateTableStatuses.sql
│ │ │ │ └── CreateTableTasks.sql
│ │ │ │ ├── statuses
│ │ │ │ └── LoadAllStatuses.sql
│ │ │ │ └── tasks
│ │ │ │ ├── DeleteTask.sql
│ │ │ │ ├── LoadAllTasks.sql
│ │ │ │ ├── LoadTask.sql
│ │ │ │ └── SaveTask.sql
│ │ ├── fonts
│ │ │ └── FromWhereYouAre.ttf
│ │ └── images
│ │ │ └── whiteboard.png
│ ├── css
│ │ └── style.css
│ └── robotlegs
│ │ └── examples
│ │ └── kanban
│ │ ├── PersonalKanbanContext.as
│ │ ├── controller
│ │ ├── DatabaseErrorHandlerCommand.as
│ │ ├── DeleteTaskCommand.as
│ │ ├── LoadStatusesCommand.as
│ │ ├── LoadTasksCommand.as
│ │ ├── SaveTaskCommand.as
│ │ ├── UpdateTaskWithStatusCommand.as
│ │ ├── bootstrap
│ │ │ └── ConfigureDatabaseCommand.as
│ │ └── events
│ │ │ ├── ConfigureDatabaseEvent.as
│ │ │ ├── DatabaseErrorHandlerEvent.as
│ │ │ ├── DeleteTaskEvent.as
│ │ │ ├── SaveTaskEvent.as
│ │ │ ├── StatusesLoadedEvent.as
│ │ │ └── UpdateTaskWithStatusEvent.as
│ │ ├── model
│ │ ├── StatusListModel.as
│ │ ├── TaskListModel.as
│ │ ├── events
│ │ │ ├── StatusTaskLimitReachedEvent.as
│ │ │ └── StatusesUpdatedEvent.as
│ │ └── vo
│ │ │ ├── Status.as
│ │ │ └── Task.as
│ │ ├── service
│ │ ├── IStatusService.as
│ │ ├── ITaskService.as
│ │ ├── SQLStatusService.as
│ │ ├── SQLTaskService.as
│ │ ├── events
│ │ │ └── DatabaseReadyEvent.as
│ │ ├── helpers
│ │ │ ├── DatabaseCreator.as
│ │ │ ├── ISQLRunnerDelegate.as
│ │ │ └── SQLRunnerDelegate.as
│ │ └── stub
│ │ │ └── StubStatusService.as
│ │ └── view
│ │ ├── ApplicationHeader.mxml
│ │ ├── StatusGroup.mxml
│ │ ├── StatusGroupMediator.as
│ │ ├── TaskEntryBar.mxml
│ │ ├── TaskEntryBarMediator.as
│ │ ├── TaskLane.mxml
│ │ ├── TaskLaneMediator.as
│ │ ├── controls
│ │ └── TaskList.as
│ │ ├── renderers
│ │ └── TaskItemRenderer.mxml
│ │ └── skins
│ │ ├── StatusGroupSkin.mxml
│ │ └── TaskLaneSkin.mxml
└── test
│ └── robotlegs
│ └── examples
│ └── kanban
│ ├── model
│ ├── StatusListModelTest.as
│ ├── TaskListModelTest.as
│ └── TaskTest.as
│ └── service
│ ├── SQLStatusServiceTest.as
│ ├── SqlTaskServiceTest.as
│ └── mock
│ ├── MockEventDispatcher.as
│ ├── MockSQLRunnerDelegateBase.as
│ ├── MockStatusSQLRunnerDelegate.as
│ └── MockTaskSQLRunnerDelegate.as
└── mosaictool
├── .actionScriptProperties
├── .project
├── README.txt
├── bin
├── mosaictool-debug.swf
└── mosaictoolRunner.swf
├── html-template
├── history
│ ├── history.css
│ ├── history.js
│ └── historyFrame.html
├── index.template.html
├── playerProductInstall.swf
└── swfobject.js
├── lib
├── FLoxy.swc
├── FlashComps.swc
├── asunit3
│ ├── AsUnit.as
│ └── asunit
│ │ ├── errors
│ │ ├── AbstractError.as
│ │ ├── AssertionFailedError.as
│ │ ├── ClassNotFoundError.as
│ │ ├── InstanceNotFoundError.as
│ │ └── UnimplementedFeatureError.as
│ │ ├── framework
│ │ ├── Assert.as
│ │ ├── AsyncOperation.as
│ │ ├── AsynchronousHTTPServiceTestCase.as
│ │ ├── AsynchronousTestCase.as
│ │ ├── AsynchronousTestCaseExample.as
│ │ ├── RemotingTestCase.as
│ │ ├── Test.as
│ │ ├── TestCase.as
│ │ ├── TestCaseExample.as
│ │ ├── TestFailure.as
│ │ ├── TestListener.as
│ │ ├── TestMethod.as
│ │ ├── TestResult.as
│ │ └── TestSuite.as
│ │ ├── runner
│ │ ├── BaseTestRunner.as
│ │ ├── TestSuiteLoader.as
│ │ └── Version.as
│ │ ├── textui
│ │ ├── AirRunner.as
│ │ ├── FlexRunner.as
│ │ ├── FlexTestRunner.as
│ │ ├── ResultPrinter.as
│ │ ├── TestRunner.as
│ │ ├── TestTime.as
│ │ └── XMLResultPrinter.as
│ │ └── util
│ │ ├── ArrayIterator.as
│ │ ├── Iterator.as
│ │ └── Properties.as
├── asx.swc
├── flashComponents.swc
├── greensock
│ └── gs
│ │ ├── OverwriteManager.as
│ │ ├── TweenGroup.as
│ │ ├── TweenLite.as
│ │ ├── TweenMax.as
│ │ ├── easing
│ │ ├── Back.as
│ │ ├── Bounce.as
│ │ ├── Circ.as
│ │ ├── Cubic.as
│ │ ├── EaseLookup.as
│ │ ├── Elastic.as
│ │ ├── Expo.as
│ │ ├── Linear.as
│ │ ├── Quad.as
│ │ ├── Quart.as
│ │ ├── Quint.as
│ │ ├── Sine.as
│ │ ├── Strong.as
│ │ └── easing_readme.txt
│ │ ├── events
│ │ └── TweenEvent.as
│ │ ├── plugins
│ │ ├── AutoAlphaPlugin.as
│ │ ├── BevelFilterPlugin.as
│ │ ├── BezierPlugin.as
│ │ ├── BezierThroughPlugin.as
│ │ ├── BlurFilterPlugin.as
│ │ ├── ColorMatrixFilterPlugin.as
│ │ ├── ColorTransformPlugin.as
│ │ ├── DropShadowFilterPlugin.as
│ │ ├── EndArrayPlugin.as
│ │ ├── FastTransformPlugin.as
│ │ ├── FilterPlugin.as
│ │ ├── FrameLabelPlugin.as
│ │ ├── FramePlugin.as
│ │ ├── GlowFilterPlugin.as
│ │ ├── HexColorsPlugin.as
│ │ ├── QuaternionsPlugin.as
│ │ ├── RemoveTintPlugin.as
│ │ ├── RoundPropsPlugin.as
│ │ ├── ScalePlugin.as
│ │ ├── SetSizePlugin.as
│ │ ├── ShortRotationPlugin.as
│ │ ├── TintPlugin.as
│ │ ├── TweenPlugin.as
│ │ ├── VisiblePlugin.as
│ │ └── VolumePlugin.as
│ │ └── utils
│ │ └── tween
│ │ ├── ArrayTweenInfo.as
│ │ ├── BevelFilterVars.as
│ │ ├── BlurFilterVars.as
│ │ ├── ColorMatrixFilterVars.as
│ │ ├── ColorTransformVars.as
│ │ ├── DropShadowFilterVars.as
│ │ ├── FilterVars.as
│ │ ├── GlowFilterVars.as
│ │ ├── SubVars.as
│ │ ├── TransformAroundCenterVars.as
│ │ ├── TransformAroundPointVars.as
│ │ ├── TweenInfo.as
│ │ ├── TweenLiteVars.as
│ │ └── TweenMaxVars.as
├── hamcrest.swc
├── mockolate
│ └── mockolate
│ │ ├── errors
│ │ ├── ExpectationError.as
│ │ ├── InvocationError.as
│ │ ├── MockolateError.as
│ │ └── VerificationError.as
│ │ ├── ingredients
│ │ ├── Couverture.as
│ │ ├── Expectation.as
│ │ ├── Invocation.as
│ │ ├── InvocationType.as
│ │ ├── MockingCouverture.as
│ │ ├── Mockolate.as
│ │ ├── MockolateFactory.as
│ │ ├── Mockolatier.as
│ │ ├── MockolatierMaster.as
│ │ ├── RecordingCouverture.as
│ │ ├── Verification.as
│ │ ├── VerifyingCouverture.as
│ │ ├── answers
│ │ │ ├── Answer.as
│ │ │ ├── CallsAnswer.as
│ │ │ ├── DispatchesEventAnswer.as
│ │ │ ├── PassThroughAnswer.as
│ │ │ ├── ReturnsAnswer.as
│ │ │ ├── ReturnsCallAnswer.as
│ │ │ ├── ReturnsValueAnswer.as
│ │ │ └── ThrowsAnswer.as
│ │ ├── faux
│ │ │ ├── FauxFloxyInterceptor.as
│ │ │ ├── FauxFloxyInvocation.as
│ │ │ ├── FauxInvocation.as
│ │ │ └── FauxMockolate.as
│ │ ├── floxy
│ │ │ ├── FloxyInvocation.as
│ │ │ ├── FloxyMockolate.as
│ │ │ ├── FloxyMockolateFactory.as
│ │ │ └── InterceptingCouverture.as
│ │ └── mockolate_ingredient.as
│ │ ├── make.as
│ │ ├── mock.as
│ │ ├── nice.as
│ │ ├── prepare.as
│ │ ├── strict.as
│ │ ├── stub.as
│ │ └── verify.as
└── robotlegs
│ └── org
│ ├── robotlegs
│ ├── adapters
│ │ ├── SwiftSuspendersInjector.as
│ │ └── SwiftSuspendersReflector.as
│ ├── base
│ │ ├── CommandMap.as
│ │ ├── ContextBase.as
│ │ ├── ContextError.as
│ │ ├── ContextEvent.as
│ │ ├── EventMap.as
│ │ ├── MediatorBase.as
│ │ ├── MediatorMap.as
│ │ ├── ViewMap.as
│ │ └── ViewMapBase.as
│ ├── core
│ │ ├── ICommandMap.as
│ │ ├── IContext.as
│ │ ├── IContextProvider.as
│ │ ├── IEventMap.as
│ │ ├── IInjector.as
│ │ ├── IMediator.as
│ │ ├── IMediatorMap.as
│ │ ├── IReflector.as
│ │ └── IViewMap.as
│ ├── mvcs
│ │ ├── Actor.as
│ │ ├── Command.as
│ │ ├── Context.as
│ │ └── Mediator.as
│ └── utilities
│ │ ├── modular
│ │ ├── base
│ │ │ ├── ModuleCommandMap.as
│ │ │ ├── ModuleContextEvent.as
│ │ │ └── ModuleEventDispatcher.as
│ │ ├── core
│ │ │ ├── IModuleCommandMap.as
│ │ │ ├── IModuleContext.as
│ │ │ ├── IModuleContextView.as
│ │ │ └── IModuleEventDispatcher.as
│ │ └── mvcs
│ │ │ ├── ModuleContext.as
│ │ │ ├── ModuleContextView.as
│ │ │ └── ModuleMediator.as
│ │ └── signals
│ │ ├── base
│ │ └── SignalCommandMap.as
│ │ ├── core
│ │ ├── ISignalCommandMap.as
│ │ └── ISignalContext.as
│ │ └── mvcs
│ │ ├── SignalCommand.as
│ │ └── SignalContext.as
│ └── swiftsuspenders
│ ├── InjectionConfig.as
│ ├── InjectionType.as
│ ├── Injector.as
│ ├── InjectorError.as
│ ├── Reflector.as
│ ├── injectionpoints
│ ├── ConstructorInjectionPoint.as
│ ├── InjectionPoint.as
│ ├── MethodInjectionPoint.as
│ ├── NoParamsConstructorInjectionPoint.as
│ ├── PostConstructInjectionPoint.as
│ └── PropertyInjectionPoint.as
│ └── injectionresults
│ ├── IInjectionResult.as
│ ├── InjectClassResult.as
│ ├── InjectNullResult.as
│ ├── InjectSingletonResult.as
│ └── InjectValueResult.as
├── mosaictool.tmproj
├── rakefile.rb
├── rakefiles
└── sprouts_test_extensions.rb
├── script
├── generate
└── generators
│ ├── event
│ ├── USAGE
│ ├── event_generator.rb
│ └── templates
│ │ ├── Component.mxml
│ │ ├── Event.as
│ │ ├── TestCase.as
│ │ └── TestSuite.as
│ ├── interface
│ ├── USAGE
│ ├── interface_generator.rb
│ └── templates
│ │ ├── Component.mxml
│ │ └── Interface.as
│ ├── rlcommand
│ ├── USAGE
│ ├── rlcommand_generator.rb
│ └── templates
│ │ ├── Component.mxml
│ │ ├── RLCommand.as
│ │ ├── TestCase.as
│ │ └── TestSuite.as
│ ├── rlcontext
│ ├── USAGE
│ ├── rlcontext_generator.rb
│ └── templates
│ │ ├── Component.mxml
│ │ ├── RLContext.as
│ │ ├── TestCase.as
│ │ └── TestSuite.as
│ ├── rlmediator
│ ├── USAGE
│ ├── rlmediator_generator.rb
│ └── templates
│ │ ├── Component.mxml
│ │ ├── RLMediator.as
│ │ ├── TestCase.as
│ │ └── TestSuite.as
│ ├── rlmodel
│ ├── USAGE
│ ├── rlmodel_generator.rb
│ └── templates
│ │ ├── Component.mxml
│ │ ├── RLModel.as
│ │ ├── TestCase.as
│ │ └── TestSuite.as
│ ├── rlmodule
│ ├── USAGE
│ ├── rlmodule_generator.rb
│ └── templates
│ │ ├── Component.mxml
│ │ ├── RLModule.as
│ │ ├── RLModuleContext.as
│ │ ├── RLModuleContextTest.as
│ │ ├── RLModuleMediator.as
│ │ ├── RLModuleMediatorTest.as
│ │ ├── RLModuleTest.as
│ │ └── TestSuite.as
│ ├── rlservice
│ ├── USAGE
│ ├── rlservice_generator.rb
│ └── templates
│ │ ├── Component.mxml
│ │ ├── RLService.as
│ │ ├── TestCase.as
│ │ └── TestSuite.as
│ ├── rlview_with_mediator
│ ├── USAGE
│ ├── rlview_with_mediator_generator.rb
│ └── templates
│ │ ├── Component.mxml
│ │ ├── MediatorTestCase.as
│ │ ├── RLMediator.as
│ │ ├── RLView.as
│ │ ├── TestSuite.as
│ │ └── ViewTestCase.as
│ ├── rlview_with_signals
│ ├── USAGE
│ ├── rlview_with_signals_generator.rb
│ └── templates
│ │ ├── Component.mxml
│ │ ├── RLView.as
│ │ ├── TestSuite.as
│ │ └── ViewTestCase.as
│ ├── roboteyes_test
│ ├── USAGE
│ ├── roboteyes_test_generator.rb
│ └── templates
│ │ ├── Component.mxml
│ │ ├── TestCase.as
│ │ └── TestSuite.as
│ ├── signal
│ ├── USAGE
│ ├── signal_generator.rb
│ └── templates
│ │ ├── Component.mxml
│ │ ├── Signal.as
│ │ ├── TestCase.as
│ │ └── TestSuite.as
│ └── support
│ ├── USAGE
│ ├── support_generator.rb
│ └── templates
│ ├── Component.mxml
│ └── Support.as
├── src
├── com
│ └── newloop
│ │ └── util
│ │ └── UnitHelpers.as
├── mosaic
│ ├── MosaicContext.as
│ ├── controller
│ │ ├── bootstraps
│ │ │ ├── BootstrapClasses.as
│ │ │ ├── BootstrapCommands.as
│ │ │ ├── BootstrapConfigValues.as
│ │ │ ├── BootstrapModels.as
│ │ │ ├── BootstrapServices.as
│ │ │ ├── BootstrapTileSupplyCommands.as
│ │ │ └── BootstrapViewMediators.as
│ │ ├── commands
│ │ │ ├── AddTileSupplyCommand.as
│ │ │ ├── ApplyConfigWorkspaceColorCommand.as
│ │ │ ├── ChangeDefaultTileColorCommand.as
│ │ │ ├── ChangeGroutColorCommand.as
│ │ │ ├── ChangeTileSupplyColorCommand.as
│ │ │ ├── ChangeWorkspaceColorCommand.as
│ │ │ ├── CombineTileSupplyCommand.as
│ │ │ ├── CreateConfigCommand.as
│ │ │ ├── CreateDesignColorsCommand.as
│ │ │ ├── LoadConfigCommand.as
│ │ │ ├── LoadDesignCommand.as
│ │ │ ├── NewDesignCommand.as
│ │ │ ├── RefreshDesignColorsCommand.as
│ │ │ ├── RemoveTileSupplyCommand.as
│ │ │ ├── RequestLoadFirstDesignCommand.as
│ │ │ ├── RestoreGridStatusCommand.as
│ │ │ ├── SaveConfigCommand.as
│ │ │ ├── SaveDesignCommand.as
│ │ │ ├── SelectTileSupplyCommand.as
│ │ │ ├── UpdateCurrentDesignOnConfigCommand.as
│ │ │ └── UpdateDesignCommand.as
│ │ └── events
│ │ │ ├── ConfigChangedEvent.as
│ │ │ ├── CreateMosaicEvent.as
│ │ │ ├── DesignCreationEvent.as
│ │ │ ├── DesignEvent.as
│ │ │ ├── DesignListEvent.as
│ │ │ ├── DesignLoadEvent.as
│ │ │ ├── DesignSaveEvent.as
│ │ │ ├── GridReadyEvent.as
│ │ │ ├── GroutEvent.as
│ │ │ ├── MosaicConfigServiceEvent.as
│ │ │ ├── NamedDesignEvent.as
│ │ │ ├── TileColorChangeEvent.as
│ │ │ ├── TileSuppliesCombinedEvent.as
│ │ │ ├── TileSupplyEvent.as
│ │ │ ├── TileSupplyListEvent.as
│ │ │ └── WorkspaceColorEvent.as
│ ├── model
│ │ ├── ConfigModel.as
│ │ ├── DesignNamesList.as
│ │ ├── DesignToColorsTranslator.as
│ │ ├── EmptyDesignGrid.as
│ │ ├── IConfigModel.as
│ │ ├── IDesignToColorsTranslator.as
│ │ ├── IMosaicDesignModel.as
│ │ ├── IMosaicSpecModel.as
│ │ ├── ITileSuppliesModel.as
│ │ ├── MosaicDesignModel.as
│ │ ├── MosaicSpecModel.as
│ │ ├── NullTileSupplyVO.as
│ │ ├── TileSuppliesList.as
│ │ ├── TileSuppliesModel.as
│ │ ├── TileSupplyVO.as
│ │ ├── utils
│ │ │ ├── AutoIncrementor.as
│ │ │ ├── FileNameFixer.as
│ │ │ ├── IAutoIncrementor.as
│ │ │ ├── ID.as
│ │ │ └── IDIndexer.as
│ │ └── values
│ │ │ ├── ConfigName.as
│ │ │ ├── DefaultDesignName.as
│ │ │ ├── DefaultGridSize.as
│ │ │ ├── DefaultTileColor.as
│ │ │ ├── DefaultWorkspaceColor.as
│ │ │ ├── StringVO.as
│ │ │ └── uintVO.as
│ ├── services
│ │ ├── BaseSolLoadingService.as
│ │ ├── BaseSolSavingService.as
│ │ ├── config
│ │ │ ├── IMosaicConfigLoadingService.as
│ │ │ ├── IMosaicConfigSavingService.as
│ │ │ ├── MosaicConfigSolLoadingService.as
│ │ │ └── MosaicConfigSolSavingService.as
│ │ └── design
│ │ │ ├── DesignFromSolParser.as
│ │ │ ├── DesignSolLoadingService.as
│ │ │ ├── DesignSolSavingService.as
│ │ │ ├── DesignToSolParser.as
│ │ │ ├── IDesignFromDataParser.as
│ │ │ ├── IDesignLoadingService.as
│ │ │ ├── IDesignSavingService.as
│ │ │ ├── IDesignToDataParser.as
│ │ │ ├── ITileSupplyFromDataParser.as
│ │ │ ├── ITileSupplyToDataParser.as
│ │ │ ├── TileSupplyFromSolParser.as
│ │ │ └── TileSupplyToSolParser.as
│ └── view
│ │ ├── MosaicToolView.as
│ │ ├── MosaicToolViewMediator.as
│ │ ├── grid
│ │ ├── GridLayout.as
│ │ ├── GridTilesView.as
│ │ ├── GridView.as
│ │ ├── GridViewMediator.as
│ │ ├── Griderator.as
│ │ ├── GroutLinesView.as
│ │ ├── IGridView.as
│ │ ├── ITileFactory.as
│ │ ├── ITileView.as
│ │ ├── QuarterTileView.as
│ │ ├── TileFactory.as
│ │ └── TileView.as
│ │ ├── tilesupply
│ │ ├── TileSupplyDetailView.as
│ │ ├── TileSupplyDetailViewMediator.as
│ │ ├── TileSupplyMenu.as
│ │ └── TileSupplyMenuMediator.as
│ │ └── ui
│ │ ├── DesignNameView.as
│ │ ├── DesignNameViewMediator.as
│ │ ├── EditPanelView.as
│ │ ├── LoadSelector.as
│ │ ├── LoadSelectorMediator.as
│ │ ├── Workspace.as
│ │ ├── WorkspaceMediator.as
│ │ ├── buttons
│ │ ├── CreateButton.as
│ │ ├── CreateButtonMediator.as
│ │ ├── SaveAsButton.as
│ │ ├── SaveAsButtonMediator.as
│ │ ├── SaveButton.as
│ │ └── SaveButtonMediator.as
│ │ ├── colorselectors
│ │ ├── BaseColorSelectorView.as
│ │ ├── DefaultTileColorSelectorView.as
│ │ ├── DefaultTileColorSelectorViewMediator.as
│ │ ├── GroutSelectorView.as
│ │ ├── GroutSelectorViewMediator.as
│ │ ├── WorkspaceColorSelectorView.as
│ │ ├── WorkspaceColorSelectorViewMediator.as
│ │ └── events
│ │ │ └── ColorChangeEvent.as
│ │ ├── dialogs
│ │ ├── BaseDialog.as
│ │ ├── CreateMosaicDialog.as
│ │ ├── CreateMosaicDialogMediator.as
│ │ ├── SaveAsDialog.as
│ │ └── SaveAsDialogMediator.as
│ │ ├── events
│ │ └── LoadSelectorEvent.as
│ │ └── parts
│ │ ├── AddTileSupplyButton.as
│ │ ├── DeleteIcon.as
│ │ ├── DeleteTileSupplyButton.as
│ │ ├── LabelledTextInput.as
│ │ └── RightAlignedWhiteLabel.as
├── mosaictool.as
├── mosaictoolRunner.as
└── utils
│ ├── ContrastingColor.as
│ └── vector
│ └── VectorUtils.as
├── support
└── mosaic
│ ├── model
│ ├── MosaicDesignModelSupport.as
│ ├── MosaicSpecModelSupport.as
│ ├── TileSuppliesModelSupport.as
│ └── TileSupplyVOSupport.as
│ └── view
│ └── grid
│ ├── TileFactorySupport.as
│ └── TileViewSupport.as
├── test
├── AllTests.as
└── mosaic
│ ├── MosaicContextTest.as
│ ├── controller
│ ├── commands
│ │ ├── AddTileSupplyCommandTest.as
│ │ ├── ChangeDefaultTileColourCommandTest.as
│ │ ├── ChangeGroutColourCommandTest.as
│ │ ├── ChangeTileSupplyColourCommandTest.as
│ │ ├── ChangeWorkspaceColourCommandTest.as
│ │ ├── CombineTileSupplyCommandTest.as
│ │ ├── CreateConfigCommandTest.as
│ │ ├── LoadConfigCommandTest.as
│ │ ├── LoadDesignCommandTest.as
│ │ ├── NewDesignCommandTest.as
│ │ ├── RefreshDesignColoursCommandTest.as
│ │ ├── RemoveTileSupplyCommandTest.as
│ │ ├── RequestLoadFirstDesignCommandTest.as
│ │ ├── RestoreGridStatusCommandTest.as
│ │ ├── SaveConfigCommandTest.as
│ │ ├── SaveDesignCommandTest.as
│ │ ├── SelectTileSupplyCommandTest.as
│ │ ├── UpdateCurrentDesignOnConfigCommandTest.as
│ │ └── UpdateDesignCommandTest.as
│ └── events
│ │ ├── ConfigChangedEventTest.as
│ │ ├── CreateMosaicEventTest.as
│ │ ├── DesignCreationEventTest.as
│ │ ├── DesignEventTest.as
│ │ ├── DesignListEventTest.as
│ │ ├── DesignLoadEventTest.as
│ │ ├── DesignSaveEventTest.as
│ │ ├── GridReadyEventTest.as
│ │ ├── GroutEventTest.as
│ │ ├── MosaicConfigServiceEventTest.as
│ │ ├── TileColourChangeEventTest.as
│ │ ├── TileSuppliesCombinedEventTest.as
│ │ ├── TileSupplyEventTest.as
│ │ ├── TileSupplyListEventTest.as
│ │ └── WorkspaceColourEventTest.as
│ ├── model
│ ├── ConfigModelTest.as
│ ├── DesignToColoursTranslatorTest.as
│ ├── MosaicDesignModelTest.as
│ ├── MosaicSpecModelTest.as
│ ├── TileSuppliesModelTest.as
│ ├── TileSupplyVOTest.as
│ ├── utils
│ │ ├── AutoIncrementorTest.as
│ │ ├── FileNameFixerTest.as
│ │ └── IDIndexerTest.as
│ └── values
│ │ └── ConfigNameTest.as
│ ├── services
│ ├── config
│ │ ├── MosaicConfigSolLoadingServiceTest.as
│ │ └── MosaicConfigSolSavingServiceTest.as
│ └── design
│ │ ├── DesignFromSolParserTest.as
│ │ ├── DesignSolLoadingServiceTest.as
│ │ ├── DesignSolSavingServiceTest.as
│ │ ├── DesignToSolParserTest.as
│ │ └── TileSupplyFromSolParserTest.as
│ └── view
│ ├── MosaicToolViewMediatorTest.as
│ ├── MosaicToolViewTest.as
│ ├── grid
│ ├── GridViewMediatorTest.as
│ ├── GridViewTest.as
│ ├── GroutLinesViewTest.as
│ ├── QuarterTileViewTest.as
│ ├── TileFactoryTest.as
│ └── TileViewTest.as
│ ├── tilesupply
│ ├── TileSupplyDetailViewMediatorTest.as
│ ├── TileSupplyDetailViewTest.as
│ ├── TileSupplyMenuMediatorTest.as
│ └── TileSupplyMenuTest.as
│ └── ui
│ ├── DesignNameViewMediatorTest.as
│ ├── DesignNameViewTest.as
│ ├── EditPanelViewTest.as
│ ├── LoadSelectorMediatorTest.as
│ ├── LoadSelectorTest.as
│ ├── WorkspaceMediatorTest.as
│ ├── WorkspaceTest.as
│ ├── buttons
│ ├── CreateButtonMediatorTest.as
│ ├── CreateButtonTest.as
│ ├── SaveAsButtonMediatorTest.as
│ ├── SaveAsButtonTest.as
│ ├── SaveButtonMediatorTest.as
│ └── SaveButtonTest.as
│ ├── colourselectors
│ ├── BaseColourSelectorViewTest.as
│ ├── CommonColourSelectorViewTestBase.as
│ ├── DefaultTileColourSelectorViewMediatorTest.as
│ ├── DefaultTileColourSelectorViewTest.as
│ ├── GroutSelectorViewMediatorTest.as
│ ├── GroutSelectorViewTest.as
│ ├── WorkspaceColourSelectorViewMediatorTest.as
│ ├── WorkspaceColourSelectorViewTest.as
│ └── events
│ │ └── ColourChangeEventTest.as
│ ├── dialogs
│ ├── CreateMosaicDialogMediatorTest.as
│ ├── CreateMosaicDialogTest.as
│ ├── SaveAsDialogMediatorTest.as
│ └── SaveAsDialogTest.as
│ └── events
│ └── LoadSelectorEventTest.as
└── tools
├── file_metrics.rb
└── tree_dump.py
/README.md:
--------------------------------------------------------------------------------
1 | This is the source for the example projects contained in the book ActionScript Developer's Guide to Robotlegs
2 |
--------------------------------------------------------------------------------
/kanbanapp/.flexProperties:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/kanbanapp/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | kanbanapp
4 |
5 |
6 |
7 |
8 |
9 | com.adobe.flexbuilder.project.flexbuilder
10 |
11 |
12 |
13 |
14 | com.adobe.flexbuilder.project.apollobuilder
15 |
16 |
17 |
18 |
19 |
20 | com.adobe.flexbuilder.project.apollonature
21 | com.adobe.flexbuilder.project.flexnature
22 | com.adobe.flexbuilder.project.actionscriptnature
23 |
24 |
25 |
--------------------------------------------------------------------------------
/kanbanapp/built/PersonalKanban.air:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joelhooks/robotlegs-examples-OreillyBook/18ac502a6f3f1f49e0ccb90d82256fd5d50b6960/kanbanapp/built/PersonalKanban.air
--------------------------------------------------------------------------------
/kanbanapp/libs/air-sqlite-v1.0.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joelhooks/robotlegs-examples-OreillyBook/18ac502a6f3f1f49e0ccb90d82256fd5d50b6960/kanbanapp/libs/air-sqlite-v1.0.swc
--------------------------------------------------------------------------------
/kanbanapp/libs/flexunit-4.1.0-x-flex_y.y.y.y.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joelhooks/robotlegs-examples-OreillyBook/18ac502a6f3f1f49e0ccb90d82256fd5d50b6960/kanbanapp/libs/flexunit-4.1.0-x-flex_y.y.y.y.swc
--------------------------------------------------------------------------------
/kanbanapp/libs/hamcrest-as3-flex-1.1.3.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joelhooks/robotlegs-examples-OreillyBook/18ac502a6f3f1f49e0ccb90d82256fd5d50b6960/kanbanapp/libs/hamcrest-as3-flex-1.1.3.swc
--------------------------------------------------------------------------------
/kanbanapp/libs/mockolate-0.11.0-flex.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joelhooks/robotlegs-examples-OreillyBook/18ac502a6f3f1f49e0ccb90d82256fd5d50b6960/kanbanapp/libs/mockolate-0.11.0-flex.swc
--------------------------------------------------------------------------------
/kanbanapp/libs/robotlegs-framework-v1.4.0.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joelhooks/robotlegs-examples-OreillyBook/18ac502a6f3f1f49e0ccb90d82256fd5d50b6960/kanbanapp/libs/robotlegs-framework-v1.4.0.swc
--------------------------------------------------------------------------------
/kanbanapp/src/PersonalKanban.mxml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/kanbanapp/src/assets/data/sql/create/CreateDefaultsStatuses.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO main.statuses (statusId, label, taskLimit)
2 | SELECT 1, 'Backlog', 0 UNION
3 | SELECT 2, 'Doing', 3 UNION
4 | SELECT 3, 'Done', 0
--------------------------------------------------------------------------------
/kanbanapp/src/assets/data/sql/create/CreateTableStatuses.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE main.statuses
2 | (
3 | statusId INTEGER PRIMARY KEY AUTOINCREMENT,
4 | taskLimit INTEGER DEFAULT 0,
5 | label String NOT NULL
6 | )
--------------------------------------------------------------------------------
/kanbanapp/src/assets/data/sql/create/CreateTableTasks.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE main.tasks
2 | (
3 | taskId INTEGER PRIMARY KEY AUTOINCREMENT,
4 | name String NOT NULL,
5 | description String,
6 | statusId INTEGER,
7 | FOREIGN KEY(statusId) REFERENCES statuses(statusId)
8 | )
--------------------------------------------------------------------------------
/kanbanapp/src/assets/data/sql/statuses/LoadAllStatuses.sql:
--------------------------------------------------------------------------------
1 | SELECT statusId,
2 | label,
3 | taskLimit
4 | FROM main.statuses
5 | ORDER BY statusId COLLATE NOCASE
--------------------------------------------------------------------------------
/kanbanapp/src/assets/data/sql/tasks/DeleteTask.sql:
--------------------------------------------------------------------------------
1 | DELETE FROM main.tasks
2 | WHERE taskId = :taskId
--------------------------------------------------------------------------------
/kanbanapp/src/assets/data/sql/tasks/LoadAllTasks.sql:
--------------------------------------------------------------------------------
1 | SELECT taskId,
2 | name,
3 | description,
4 | statusId
5 | FROM main.tasks
6 | ORDER BY statusId COLLATE NOCASE
--------------------------------------------------------------------------------
/kanbanapp/src/assets/data/sql/tasks/LoadTask.sql:
--------------------------------------------------------------------------------
1 | SELECT taskId,
2 | name,
3 | description,
4 | statusId
5 | FROM main.tasks
6 | WHERE taskId = :taskId
--------------------------------------------------------------------------------
/kanbanapp/src/assets/data/sql/tasks/SaveTask.sql:
--------------------------------------------------------------------------------
1 | REPLACE INTO main.tasks (taskId, name, description, statusId)
2 | VALUES (:taskId, :name, :description, :statusId)
--------------------------------------------------------------------------------
/kanbanapp/src/assets/fonts/FromWhereYouAre.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joelhooks/robotlegs-examples-OreillyBook/18ac502a6f3f1f49e0ccb90d82256fd5d50b6960/kanbanapp/src/assets/fonts/FromWhereYouAre.ttf
--------------------------------------------------------------------------------
/kanbanapp/src/assets/images/whiteboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joelhooks/robotlegs-examples-OreillyBook/18ac502a6f3f1f49e0ccb90d82256fd5d50b6960/kanbanapp/src/assets/images/whiteboard.png
--------------------------------------------------------------------------------
/kanbanapp/src/css/style.css:
--------------------------------------------------------------------------------
1 | @namespace s "library://ns.adobe.com/flex/spark";
2 |
3 | global {
4 | fontFamily: Verdana;
5 | fontSize: 14;
6 | }
7 |
8 | s|WindowedApplication {
9 | backgroundColor: #D8DACC;
10 | }
11 |
12 | @font-face {
13 | src: url("../assets/fonts/FromWhereYouAre.ttf");
14 | fontFamily: sketchBlock;
15 | embedAsCFF: true;
16 | advancedAntiAliasing: true;
17 | unicodeRange: U+0041-005A, U+0061-007A
18 | }
19 |
20 | @namespace
21 | "robotlegs.examples.kanban.view.*"
22 | ;
23 |
24 | .sketchBlock {
25 | fontFamily: sketchBlock;
26 | }
27 |
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/controller/DatabaseErrorHandlerCommand.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.controller
2 | {
3 | import org.robotlegs.mvcs.Command;
4 |
5 | public class DatabaseErrorHandlerCommand extends Command
6 | {
7 | override public function execute():void
8 | {
9 |
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/controller/DeleteTaskCommand.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.controller
2 | {
3 | import org.robotlegs.mvcs.Command;
4 |
5 | import robotlegs.examples.kanban.controller.events.DeleteTaskEvent;
6 | import robotlegs.examples.kanban.model.StatusListModel;
7 | import robotlegs.examples.kanban.service.ITaskService;
8 |
9 | public class DeleteTaskCommand extends Command
10 | {
11 | [Inject]
12 | public var event:DeleteTaskEvent;
13 |
14 | [Inject]
15 | public var taskService:ITaskService;
16 |
17 | [Inject]
18 | public var statusListModel:StatusListModel;
19 |
20 | override public function execute():void
21 | {
22 | statusListModel.removeTaskFromAllStatuses(event.task);
23 | taskService.deleteTask(event.task);
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/controller/LoadStatusesCommand.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.controller
2 | {
3 | import org.robotlegs.mvcs.Command;
4 |
5 | import robotlegs.examples.kanban.service.IStatusService;
6 |
7 | public class LoadStatusesCommand extends Command
8 | {
9 | [Inject]
10 | public var statusService:IStatusService;
11 |
12 | override public function execute():void
13 | {
14 | statusService.loadStatuses();
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/controller/LoadTasksCommand.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.controller
2 | {
3 | import org.robotlegs.mvcs.Command;
4 |
5 | import robotlegs.examples.kanban.service.ITaskService;
6 |
7 | public class LoadTasksCommand extends Command
8 | {
9 | [Inject]
10 | public var taskService:ITaskService;
11 |
12 | override public function execute():void
13 | {
14 | taskService.loadAllTasks();
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/controller/SaveTaskCommand.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.controller
2 | {
3 | import robotlegs.examples.kanban.controller.events.SaveTaskEvent;
4 | import robotlegs.examples.kanban.service.ITaskService;
5 |
6 | public class SaveTaskCommand
7 | {
8 | [Inject]
9 | public var event:SaveTaskEvent;
10 |
11 | [Inject]
12 | public var taskService:ITaskService;
13 |
14 | public function execute():void
15 | {
16 | taskService.save(event.task);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/controller/UpdateTaskWithStatusCommand.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.controller
2 | {
3 | import org.robotlegs.mvcs.Command;
4 |
5 | import robotlegs.examples.kanban.controller.events.SaveTaskEvent;
6 | import robotlegs.examples.kanban.controller.events.UpdateTaskWithStatusEvent;
7 | import robotlegs.examples.kanban.model.vo.Task;
8 |
9 | public class UpdateTaskWithStatusCommand extends Command
10 | {
11 | [Inject]
12 | public var event:UpdateTaskWithStatusEvent;
13 |
14 | override public function execute():void
15 | {
16 | var task:Task = event.task;
17 | task.statusId = event.status.statusId;
18 |
19 | dispatch(new SaveTaskEvent(task));
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/controller/events/ConfigureDatabaseEvent.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.controller.events
2 | {
3 | import flash.events.Event;
4 |
5 | public class ConfigureDatabaseEvent extends Event
6 | {
7 | public static const CONFIGURE:String = "ConfigureDatabaseEvent";
8 |
9 | public function ConfigureDatabaseEvent(bubbles:Boolean = false, cancelable:Boolean = false)
10 | {
11 | super(CONFIGURE, bubbles, cancelable);
12 | }
13 |
14 | override public function clone():Event
15 | {
16 | return new ConfigureDatabaseEvent(bubbles, cancelable)
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/controller/events/DatabaseErrorHandlerEvent.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.controller.events
2 | {
3 | import flash.events.Event;
4 |
5 | public class DatabaseErrorHandlerEvent extends Event
6 | {
7 | public static const ERROR:String = "DatabaseErrorHandlerEvent";
8 |
9 | private var _message:String;
10 |
11 | public function get message():String
12 | {
13 | return _message;
14 | }
15 |
16 | public function DatabaseErrorHandlerEvent(message:String)
17 | {
18 | super(ERROR);
19 | _message = message;
20 | }
21 |
22 | override public function clone():Event
23 | {
24 | return new DatabaseErrorHandlerEvent(message)
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/controller/events/DeleteTaskEvent.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.controller.events
2 | {
3 | import flash.events.Event;
4 |
5 | import robotlegs.examples.kanban.model.vo.Task;
6 |
7 | public class DeleteTaskEvent extends Event
8 | {
9 | public static const DELETE:String = "DeleteNewTaskEvent";
10 |
11 | private var _task:Task;
12 |
13 | public function get task():Task
14 | {
15 | return _task;
16 | }
17 |
18 | public function DeleteTaskEvent(task:Task)
19 | {
20 | super(DELETE);
21 |
22 | _task = task;
23 | }
24 |
25 | override public function clone():Event
26 | {
27 | return new DeleteTaskEvent(task);
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/controller/events/SaveTaskEvent.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.controller.events
2 | {
3 | import flash.events.Event;
4 |
5 | import robotlegs.examples.kanban.model.vo.Task;
6 |
7 | public class SaveTaskEvent extends Event
8 | {
9 | public static const SAVE:String = "SaveTaskEvent";
10 |
11 | private var _task:Task;
12 |
13 | public function get task():Task
14 | {
15 | return _task;
16 | }
17 |
18 | public function SaveTaskEvent(task:Task)
19 | {
20 | super(SAVE);
21 |
22 | _task = task;
23 | }
24 |
25 | override public function clone():Event
26 | {
27 | return new SaveTaskEvent(task);
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/controller/events/StatusesLoadedEvent.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.controller.events
2 | {
3 | import flash.events.Event;
4 |
5 | public class StatusesLoadedEvent extends Event
6 | {
7 | public static const LOADED:String = "StatusesLoadedEvent";
8 |
9 | public function StatusesLoadedEvent(bubbles:Boolean = false, cancelable:Boolean = false)
10 | {
11 | super(LOADED, bubbles, cancelable);
12 | }
13 |
14 | override public function clone():Event
15 | {
16 | return new StatusesLoadedEvent(bubbles, cancelable)
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/controller/events/UpdateTaskWithStatusEvent.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.controller.events
2 | {
3 | import flash.events.Event;
4 |
5 | import robotlegs.examples.kanban.model.vo.Status;
6 | import robotlegs.examples.kanban.model.vo.Task;
7 |
8 | public class UpdateTaskWithStatusEvent extends Event
9 | {
10 | public static const UPDATE:String = "UpdateTaskWithStatusEvent";
11 |
12 | private var _task:Task;
13 |
14 | public function get task():Task
15 | {
16 | return _task;
17 | }
18 |
19 | private var _status:Status;
20 |
21 | public function get status():Status
22 | {
23 | return _status;
24 | }
25 |
26 | public function UpdateTaskWithStatusEvent(task:Task, status:Status)
27 | {
28 | super(UPDATE);
29 |
30 | _task = task;
31 | _status = status;
32 | }
33 |
34 | override public function clone():Event
35 | {
36 | return new UpdateTaskWithStatusEvent(task, status);
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/model/events/StatusTaskLimitReachedEvent.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.model.events
2 | {
3 | import flash.events.Event;
4 |
5 | public class StatusTaskLimitReachedEvent extends Event
6 | {
7 | public static const LIMIT_REACHED:String = "StatusTaskLimitReachedEvent";
8 |
9 | public function StatusTaskLimitReachedEvent()
10 | {
11 | super(LIMIT_REACHED);
12 | }
13 |
14 | override public function clone():Event
15 | {
16 | return new StatusTaskLimitReachedEvent()
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/model/events/StatusesUpdatedEvent.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.model.events
2 | {
3 | import flash.events.Event;
4 |
5 | import mx.collections.ArrayCollection;
6 |
7 | public class StatusesUpdatedEvent extends Event
8 | {
9 | public static const UPDATED:String = "StatusesUpdatedEvent";
10 |
11 | private var _statuses:ArrayCollection;
12 |
13 | public function get statuses():ArrayCollection
14 | {
15 | return _statuses;
16 | }
17 |
18 | public function StatusesUpdatedEvent(statuses:ArrayCollection)
19 | {
20 | super(UPDATED);
21 |
22 | _statuses = statuses;
23 | }
24 |
25 | override public function clone():Event
26 | {
27 | return new StatusesUpdatedEvent(statuses);
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/model/vo/Status.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.model.vo
2 | {
3 | import mx.collections.ArrayCollection;
4 |
5 | [Bindable]
6 | public class Status
7 | {
8 | public function Status(label:String = "")
9 | {
10 | this.label = label;
11 | }
12 |
13 | public var statusId:int;
14 | public var label:String;
15 | public var taskLimit:int;
16 |
17 | private var _tasks:ArrayCollection;
18 |
19 | public function get tasks():ArrayCollection
20 | {
21 | return _tasks ||= new ArrayCollection();
22 | }
23 |
24 | public function set tasks(value:ArrayCollection):void
25 | {
26 | _tasks = value;
27 | }
28 |
29 | public function toString():String
30 | {
31 | return label + (taskLimit > 0 ? " (" + taskLimit + ")" : "");
32 | }
33 |
34 | public function get isOverLimit():Boolean
35 | {
36 | return taskLimit != 0 && tasks.length >= taskLimit;
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/service/IStatusService.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.service
2 | {
3 | public interface IStatusService
4 | {
5 | function loadStatuses():void;
6 | }
7 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/service/ITaskService.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.service
2 | {
3 | import robotlegs.examples.kanban.model.vo.Task;
4 |
5 | public interface ITaskService
6 | {
7 | function loadAllTasks():void;
8 |
9 | function loadTaskById(id:int):void;
10 |
11 | function save(task:Task):void;
12 |
13 | function deleteTask(task:Task):void
14 | }
15 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/service/events/DatabaseReadyEvent.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.service.events
2 | {
3 | import flash.events.Event;
4 |
5 | public class DatabaseReadyEvent extends Event
6 | {
7 | public static const READY:String = "DatabaseReadyEvent";
8 |
9 | public function DatabaseReadyEvent(bubbles:Boolean = false, cancelable:Boolean = false)
10 | {
11 | super(READY, bubbles, cancelable);
12 | }
13 |
14 | override public function clone():Event
15 | {
16 | return new DatabaseReadyEvent(bubbles, cancelable)
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/service/helpers/ISQLRunnerDelegate.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.service.helpers
2 | {
3 | import com.probertson.data.QueuedStatement;
4 |
5 | public interface ISQLRunnerDelegate
6 | {
7 | function get numConnections():int;
8 |
9 | function get connectionErrorHandler():Function;
10 |
11 | function set connectionErrorHandler(value:Function):void;
12 |
13 | function execute(sql:String, parameters:Object, handler:Function, itemClass:Class = null, errorHandler:Function = null):void;
14 |
15 | function executeModify(statementBatch:Vector., resultHandler:Function, errorHandler:Function, progressHandler:Function = null):void;
16 |
17 | function close(resultHandler:Function, errorHandler:Function = null):void;
18 | }
19 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/view/ApplicationHeader.mxml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/view/StatusGroup.mxml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/view/StatusGroupMediator.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.view
2 | {
3 | import org.robotlegs.mvcs.Mediator;
4 |
5 | import robotlegs.examples.kanban.model.events.StatusesUpdatedEvent;
6 |
7 | public class StatusGroupMediator extends Mediator
8 | {
9 | [Inject]
10 | public var view:StatusGroup;
11 |
12 | override public function onRegister():void
13 | {
14 | addContextListener(StatusesUpdatedEvent.UPDATED, statusesLoadedHandler);
15 | }
16 |
17 | private function statusesLoadedHandler(event:StatusesUpdatedEvent):void
18 | {
19 | view.dataProvider = event.statuses;
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/view/TaskEntryBar.mxml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
28 |
29 |
32 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/view/TaskEntryBarMediator.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.view
2 | {
3 | import org.robotlegs.mvcs.Mediator;
4 |
5 | import robotlegs.examples.kanban.controller.events.SaveTaskEvent;
6 |
7 | public class TaskEntryBarMediator extends Mediator
8 | {
9 | override public function onRegister():void
10 | {
11 | addViewListener(SaveTaskEvent.SAVE, dispatch);
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/view/TaskLaneMediator.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.view
2 | {
3 | import org.robotlegs.mvcs.Mediator;
4 |
5 | import robotlegs.examples.kanban.controller.events.DeleteTaskEvent;
6 | import robotlegs.examples.kanban.controller.events.UpdateTaskWithStatusEvent;
7 |
8 | public class TaskLaneMediator extends Mediator
9 | {
10 | override public function onRegister():void
11 | {
12 | addViewListener(UpdateTaskWithStatusEvent.UPDATE, dispatch);
13 | addViewListener(DeleteTaskEvent.DELETE, dispatch);
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/view/controls/TaskList.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.view.controls
2 | {
3 | import spark.components.List;
4 |
5 | [Event(name="deleteTask", type="flash.events.Event")]
6 |
7 | public class TaskList extends List
8 | {
9 |
10 | }
11 | }
--------------------------------------------------------------------------------
/kanbanapp/src/robotlegs/examples/kanban/view/skins/StatusGroupSkin.mxml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 | [HostComponent("spark.components.SkinnableDataContainer")]
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
21 |
22 |
24 |
25 |
26 |
27 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/kanbanapp/test/robotlegs/examples/kanban/service/mock/MockSQLRunnerDelegateBase.as:
--------------------------------------------------------------------------------
1 | package robotlegs.examples.kanban.service.mock
2 | {
3 | public class MockSQLRunnerDelegateBase
4 | {
5 | public var lastStatementExecuted:String;
6 | public var allStatementsExecuted:Array = [];
7 | public var parametersSent:Object;
8 |
9 | }
10 | }
--------------------------------------------------------------------------------
/mosaictool/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | mosaictool
4 |
5 |
6 |
7 |
8 |
9 | com.adobe.flexbuilder.project.flexbuilder
10 |
11 |
12 |
13 |
14 |
15 | com.adobe.flexbuilder.project.actionscriptnature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/mosaictool/README.txt:
--------------------------------------------------------------------------------
1 | **This is a tool for designing mosaics.**
2 |
3 | It allows designs made up of whole square tiles.
4 | The grid size is set at the start and can be changed later.
5 | It tracks the number of each tile color used - tile supplies are added and can be adjusted during the design.
6 | It saves the design so that you can resume work on it later.
7 |
8 |
9 | This code was built to compile using project sprouts 0.7.
10 |
11 |
12 | Classes in the /support package are used by tests but not by the release source.
--------------------------------------------------------------------------------
/mosaictool/bin/mosaictool-debug.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joelhooks/robotlegs-examples-OreillyBook/18ac502a6f3f1f49e0ccb90d82256fd5d50b6960/mosaictool/bin/mosaictool-debug.swf
--------------------------------------------------------------------------------
/mosaictool/bin/mosaictoolRunner.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joelhooks/robotlegs-examples-OreillyBook/18ac502a6f3f1f49e0ccb90d82256fd5d50b6960/mosaictool/bin/mosaictoolRunner.swf
--------------------------------------------------------------------------------
/mosaictool/html-template/history/history.css:
--------------------------------------------------------------------------------
1 | /* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
2 |
3 | #ie_historyFrame { width: 0px; height: 0px; display:none }
4 | #firefox_anchorDiv { width: 0px; height: 0px; display:none }
5 | #safari_formDiv { width: 0px; height: 0px; display:none }
6 | #safari_rememberDiv { width: 0px; height: 0px; display:none }
7 |
--------------------------------------------------------------------------------
/mosaictool/html-template/history/historyFrame.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
27 | Hidden frame for Browser History support.
28 |
29 |
30 |
--------------------------------------------------------------------------------
/mosaictool/html-template/playerProductInstall.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joelhooks/robotlegs-examples-OreillyBook/18ac502a6f3f1f49e0ccb90d82256fd5d50b6960/mosaictool/html-template/playerProductInstall.swf
--------------------------------------------------------------------------------
/mosaictool/lib/FLoxy.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joelhooks/robotlegs-examples-OreillyBook/18ac502a6f3f1f49e0ccb90d82256fd5d50b6960/mosaictool/lib/FLoxy.swc
--------------------------------------------------------------------------------
/mosaictool/lib/FlashComps.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joelhooks/robotlegs-examples-OreillyBook/18ac502a6f3f1f49e0ccb90d82256fd5d50b6960/mosaictool/lib/FlashComps.swc
--------------------------------------------------------------------------------
/mosaictool/lib/asunit3/asunit/errors/AbstractError.as:
--------------------------------------------------------------------------------
1 | package asunit.errors {
2 |
3 | public class AbstractError extends Error {
4 |
5 | public function AbstractError(message:String) {
6 | super(message);
7 | name = "AbstractError";
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/mosaictool/lib/asunit3/asunit/errors/AssertionFailedError.as:
--------------------------------------------------------------------------------
1 | package asunit.errors {
2 |
3 | public class AssertionFailedError extends Error {
4 |
5 | public function AssertionFailedError(message:String) {
6 | super(message);
7 | name = "AssertionFailedError";
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/mosaictool/lib/asunit3/asunit/errors/ClassNotFoundError.as:
--------------------------------------------------------------------------------
1 | package asunit.errors {
2 |
3 | public class ClassNotFoundError extends Error {
4 |
5 | public function ClassNotFoundError(message:String) {
6 | super(message);
7 | name = "ClassNotFoundError";
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/mosaictool/lib/asunit3/asunit/errors/InstanceNotFoundError.as:
--------------------------------------------------------------------------------
1 | package asunit.errors {
2 |
3 | public class InstanceNotFoundError extends Error {
4 |
5 | public function InstanceNotFoundError(message:String) {
6 | super(message);
7 | name = "InstanceNotFoundError";
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/mosaictool/lib/asunit3/asunit/errors/UnimplementedFeatureError.as:
--------------------------------------------------------------------------------
1 | package asunit.errors {
2 |
3 | public class UnimplementedFeatureError extends Error {
4 |
5 | public function UnimplementedFeatureError(message:String) {
6 | super(message);
7 | name = "UnimplementedFeatureError";
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/mosaictool/lib/asunit3/asunit/framework/Test.as:
--------------------------------------------------------------------------------
1 | package asunit.framework {
2 | import flash.display.DisplayObjectContainer;
3 | import flash.events.IEventDispatcher;
4 |
5 | public interface Test extends IEventDispatcher {
6 | function countTestCases():int;
7 | function getName():String;
8 | function getTestMethods():Array;
9 | function toString():String;
10 | function setResult(result:TestListener):void;
11 | function run():void;
12 | function runBare():void;
13 | function getCurrentMethod():String;
14 | function getIsComplete():Boolean;
15 | function setContext(context:DisplayObjectContainer):void;
16 | function getContext():DisplayObjectContainer;
17 | }
18 | }
--------------------------------------------------------------------------------
/mosaictool/lib/asunit3/asunit/framework/TestListener.as:
--------------------------------------------------------------------------------
1 | package asunit.framework {
2 | import asunit.errors.AssertionFailedError;
3 |
4 | public interface TestListener {
5 |
6 | /**
7 | * Run the provided Test.
8 | */
9 | function run(test:Test):void;
10 | /**
11 | * A test started.
12 | */
13 | function startTest(test:Test):void;
14 | /**
15 | * A failure occurred.
16 | */
17 | function addFailure(test:Test, t:AssertionFailedError):void;
18 | /**
19 | * An error occurred.
20 | */
21 | function addError(test:Test, t:Error):void;
22 | /**
23 | * A test method has begun execution.
24 | */
25 | function startTestMethod(test:Test, methodName:String):void;
26 | /**
27 | * A test method has completed.
28 | */
29 | function endTestMethod(test:Test, methodName:String):void;
30 | /**
31 | * A test ended.
32 | */
33 | function endTest(test:Test):void;
34 | }
35 | }
--------------------------------------------------------------------------------
/mosaictool/lib/asunit3/asunit/framework/TestMethod.as:
--------------------------------------------------------------------------------
1 | package asunit.framework {
2 |
3 | import flash.utils.getTimer;
4 |
5 | /**
6 | * A TestFailure
collects a failed test together with
7 | * the caught exception.
8 | * @see TestResult
9 | */
10 | public class TestMethod {
11 | protected var test:Test;
12 | protected var method:String;
13 |
14 | private var _duration:Number;
15 | private var start:Number;
16 |
17 | /**
18 | * Constructs a TestMethod with a given Test and method name.
19 | */
20 | public function TestMethod(test:Test, method:String) {
21 | this.test = test;
22 | this.method = method;
23 | start = getTimer();
24 | }
25 |
26 | public function getName():String {
27 | return method;
28 | }
29 |
30 | public function endTest(test:Test):void {
31 | _duration = (getTimer() - start) * .001;
32 | }
33 |
34 | public function duration():Number {
35 | return _duration;
36 | }
37 | }
38 | }
--------------------------------------------------------------------------------
/mosaictool/lib/asunit3/asunit/runner/BaseTestRunner.as:
--------------------------------------------------------------------------------
1 | package asunit.runner {
2 | import flash.display.Sprite;
3 |
4 | /**
5 | * Base class for all test runners.
6 | * This class was born live on stage in Sardinia during XP2000.
7 | */
8 | public class BaseTestRunner extends Sprite {
9 |
10 | // Filters stack frames from internal JUnit classes
11 | public static function getFilteredTrace(stack:String):String {
12 | return stack;
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/mosaictool/lib/asunit3/asunit/runner/TestSuiteLoader.as:
--------------------------------------------------------------------------------
1 | package asunit.runner {
2 |
3 | public interface TestSuiteLoader {
4 | // throws ClassNotFoundException
5 | function load(suiteClassName:String):Class;
6 | // throws ClassNotFoundException
7 | function reload(aClass:Class):Class;
8 | }
9 | }
--------------------------------------------------------------------------------
/mosaictool/lib/asunit3/asunit/runner/Version.as:
--------------------------------------------------------------------------------
1 | package asunit.runner {
2 |
3 | public class Version {
4 | private static var version:String = "3.0";
5 |
6 | public static function id():String {
7 | return version.toString();
8 | }
9 |
10 | }
11 | }
--------------------------------------------------------------------------------
/mosaictool/lib/asunit3/asunit/textui/AirRunner.as:
--------------------------------------------------------------------------------
1 | package asunit.textui {
2 | import asunit.framework.TestResult;
3 |
4 | import mx.core.WindowedApplication;
5 |
6 | /**
7 | * The base class for Air application runners that use the Flex framework.
8 | *
9 | * @includeExample AirRunnerExample.mxml
10 | *
11 | * @author Ian
12 | * @playerversion AIR 1.1
13 | **/
14 | public class AirRunner extends WindowedApplication {
15 |
16 | protected var runner:TestRunner;
17 |
18 | override protected function createChildren():void {
19 | super.createChildren();
20 | runner = new FlexTestRunner();
21 | rawChildren.addChild(runner);
22 | }
23 |
24 | public function start(testCase:Class, testMethod:String = null, showTrace:Boolean = false) : TestResult {
25 | return runner.start(testCase, testMethod, showTrace);
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/mosaictool/lib/asunit3/asunit/textui/FlexRunner.as:
--------------------------------------------------------------------------------
1 | package asunit.textui {
2 | import asunit.framework.TestResult;
3 |
4 | import mx.core.Application;
5 |
6 | /**
7 | * The FlexTestRunner
should be the base class for your
8 | * test harness if you're testing a project that uses Flex components.
9 | *
10 | * @includeExample FlexRunnerExample.mxml
11 | **/
12 | public class FlexRunner extends Application {
13 | protected var runner:TestRunner;
14 |
15 | override protected function createChildren():void {
16 | super.createChildren();
17 | runner = new FlexTestRunner();
18 | rawChildren.addChild(runner);
19 | }
20 |
21 | public function start(testCase:Class, testMethod:String = null, showTrace:Boolean = false):TestResult {
22 | return runner.start(testCase, testMethod, showTrace);
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/mosaictool/lib/asunit3/asunit/util/ArrayIterator.as:
--------------------------------------------------------------------------------
1 | package asunit.util {
2 |
3 | import asunit.util.Iterator;
4 |
5 | [ExcludeClass]
6 | public class ArrayIterator implements Iterator {
7 | private var list:Array;
8 | private var index:Number = 0;
9 |
10 | public function ArrayIterator(list:Array) {
11 | this.list = list;
12 | }
13 |
14 | public function hasNext():Boolean {
15 | return list[index] != null;
16 | }
17 |
18 | public function next():Object {
19 | return list[index++];
20 | }
21 |
22 | public function reset():void {
23 | index = 0;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/mosaictool/lib/asunit3/asunit/util/Iterator.as:
--------------------------------------------------------------------------------
1 | package asunit.util {
2 |
3 | [ExcludeClass]
4 | public interface Iterator {
5 | function next():Object;
6 | function hasNext():Boolean;
7 | function reset():void;
8 | }
9 | }
--------------------------------------------------------------------------------
/mosaictool/lib/asunit3/asunit/util/Properties.as:
--------------------------------------------------------------------------------
1 | package asunit.util {
2 | import asunit.errors.UnimplementedFeatureError;
3 | import flash.errors.IllegalOperationError;
4 |
5 | [ExcludeClass]
6 | public dynamic class Properties {
7 |
8 | public function store(sharedObjectId:String):void {
9 | throw new UnimplementedFeatureError("Properties.store");
10 | }
11 |
12 | public function put(key:String, value:Object):void {
13 | this[key] = value;
14 | }
15 |
16 | public function setProperty(key:String, value:Object):void {
17 | put(key, value);
18 | }
19 |
20 | public function getProperty(key:String):Object {
21 | try {
22 | return this[key];
23 | }
24 | catch(e:Error) {
25 | throw IllegalOperationError("Properties.getProperty");
26 | }
27 | return null;
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/mosaictool/lib/asx.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joelhooks/robotlegs-examples-OreillyBook/18ac502a6f3f1f49e0ccb90d82256fd5d50b6960/mosaictool/lib/asx.swc
--------------------------------------------------------------------------------
/mosaictool/lib/flashComponents.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joelhooks/robotlegs-examples-OreillyBook/18ac502a6f3f1f49e0ccb90d82256fd5d50b6960/mosaictool/lib/flashComponents.swc
--------------------------------------------------------------------------------
/mosaictool/lib/greensock/gs/easing/Back.as:
--------------------------------------------------------------------------------
1 | package gs.easing {
2 | public class Back {
3 | public static function easeIn (t:Number, b:Number, c:Number, d:Number, s:Number = 1.70158):Number {
4 | return c*(t/=d)*t*((s+1)*t - s) + b;
5 | }
6 | public static function easeOut (t:Number, b:Number, c:Number, d:Number, s:Number = 1.70158):Number {
7 | return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
8 | }
9 | public static function easeInOut (t:Number, b:Number, c:Number, d:Number, s:Number = 1.70158):Number {
10 | if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
11 | return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/mosaictool/lib/greensock/gs/easing/Bounce.as:
--------------------------------------------------------------------------------
1 | package gs.easing {
2 | public class Bounce {
3 | public static function easeOut (t:Number, b:Number, c:Number, d:Number):Number {
4 | if ((t/=d) < (1/2.75)) {
5 | return c*(7.5625*t*t) + b;
6 | } else if (t < (2/2.75)) {
7 | return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
8 | } else if (t < (2.5/2.75)) {
9 | return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
10 | } else {
11 | return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
12 | }
13 | }
14 | public static function easeIn (t:Number, b:Number, c:Number, d:Number):Number {
15 | return c - easeOut(d-t, 0, c, d) + b;
16 | }
17 | public static function easeInOut (t:Number, b:Number, c:Number, d:Number):Number {
18 | if (t < d/2) return easeIn (t*2, 0, c, d) * .5 + b;
19 | else return easeOut (t*2-d, 0, c, d) * .5 + c*.5 + b;
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/mosaictool/lib/greensock/gs/easing/Circ.as:
--------------------------------------------------------------------------------
1 | package gs.easing {
2 | public class Circ {
3 | public static function easeIn (t:Number, b:Number, c:Number, d:Number):Number {
4 | return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
5 | }
6 | public static function easeOut (t:Number, b:Number, c:Number, d:Number):Number {
7 | return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
8 | }
9 | public static function easeInOut (t:Number, b:Number, c:Number, d:Number):Number {
10 | if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
11 | return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/mosaictool/lib/greensock/gs/easing/Cubic.as:
--------------------------------------------------------------------------------
1 | package gs.easing {
2 | public class Cubic {
3 | public static function easeIn (t:Number, b:Number, c:Number, d:Number):Number {
4 | return c*(t/=d)*t*t + b;
5 | }
6 | public static function easeOut (t:Number, b:Number, c:Number, d:Number):Number {
7 | return c*((t=t/d-1)*t*t + 1) + b;
8 | }
9 | public static function easeInOut (t:Number, b:Number, c:Number, d:Number):Number {
10 | if ((t/=d/2) < 1) return c/2*t*t*t + b;
11 | return c/2*((t-=2)*t*t + 2) + b;
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/mosaictool/lib/greensock/gs/easing/Expo.as:
--------------------------------------------------------------------------------
1 | package gs.easing {
2 | public class Expo {
3 | public static function easeIn(t:Number, b:Number, c:Number, d:Number):Number {
4 | return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b - c * 0.001;
5 | }
6 | public static function easeOut(t:Number, b:Number, c:Number, d:Number):Number {
7 | return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
8 | }
9 | public static function easeInOut(t:Number, b:Number, c:Number, d:Number):Number {
10 | if (t==0) return b;
11 | if (t==d) return b+c;
12 | if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
13 | return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/mosaictool/lib/greensock/gs/easing/Linear.as:
--------------------------------------------------------------------------------
1 | package gs.easing {
2 | public class Linear {
3 | public static function easeNone (t:Number, b:Number, c:Number, d:Number):Number {
4 | return c*t/d + b;
5 | }
6 | public static function easeIn (t:Number, b:Number, c:Number, d:Number):Number {
7 | return c*t/d + b;
8 | }
9 | public static function easeOut (t:Number, b:Number, c:Number, d:Number):Number {
10 | return c*t/d + b;
11 | }
12 | public static function easeInOut (t:Number, b:Number, c:Number, d:Number):Number {
13 | return c*t/d + b;
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/mosaictool/lib/greensock/gs/easing/Quad.as:
--------------------------------------------------------------------------------
1 | package gs.easing {
2 | public class Quad {
3 | public static function easeIn (t:Number, b:Number, c:Number, d:Number):Number {
4 | return c*(t/=d)*t + b;
5 | }
6 | public static function easeOut (t:Number, b:Number, c:Number, d:Number):Number {
7 | return -c *(t/=d)*(t-2) + b;
8 | }
9 | public static function easeInOut (t:Number, b:Number, c:Number, d:Number):Number {
10 | if ((t/=d/2) < 1) return c/2*t*t + b;
11 | return -c/2 * ((--t)*(t-2) - 1) + b;
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/mosaictool/lib/greensock/gs/easing/Quart.as:
--------------------------------------------------------------------------------
1 | package gs.easing {
2 | public class Quart {
3 | public static function easeIn (t:Number, b:Number, c:Number, d:Number):Number {
4 | return c*(t/=d)*t*t*t + b;
5 | }
6 | public static function easeOut (t:Number, b:Number, c:Number, d:Number):Number {
7 | return -c * ((t=t/d-1)*t*t*t - 1) + b;
8 | }
9 | public static function easeInOut (t:Number, b:Number, c:Number, d:Number):Number {
10 | if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
11 | return -c/2 * ((t-=2)*t*t*t - 2) + b;
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/mosaictool/lib/greensock/gs/easing/Quint.as:
--------------------------------------------------------------------------------
1 | package gs.easing {
2 | public class Quint {
3 | public static function easeIn (t:Number, b:Number, c:Number, d:Number):Number {
4 | return c*(t/=d)*t*t*t*t + b;
5 | }
6 | public static function easeOut (t:Number, b:Number, c:Number, d:Number):Number {
7 | return c*((t=t/d-1)*t*t*t*t + 1) + b;
8 | }
9 | public static function easeInOut (t:Number, b:Number, c:Number, d:Number):Number {
10 | if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
11 | return c/2*((t-=2)*t*t*t*t + 2) + b;
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/mosaictool/lib/greensock/gs/easing/Sine.as:
--------------------------------------------------------------------------------
1 | package gs.easing {
2 | public class Sine {
3 | private static const _HALF_PI:Number = Math.PI / 2;
4 |
5 | public static function easeIn (t:Number, b:Number, c:Number, d:Number):Number {
6 | return -c * Math.cos(t/d * _HALF_PI) + c + b;
7 | }
8 | public static function easeOut (t:Number, b:Number, c:Number, d:Number):Number {
9 | return c * Math.sin(t/d * _HALF_PI) + b;
10 | }
11 | public static function easeInOut (t:Number, b:Number, c:Number, d:Number):Number {
12 | return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/mosaictool/lib/greensock/gs/easing/Strong.as:
--------------------------------------------------------------------------------
1 | package gs.easing {
2 | public class Strong {
3 | public static function easeIn(t:Number, b:Number, c:Number, d:Number):Number {
4 | return c*(t/=d)*t*t*t*t + b;
5 | }
6 | public static function easeOut(t:Number, b:Number, c:Number, d:Number):Number {
7 | return c*((t=t/d-1)*t*t*t*t + 1) + b;
8 | }
9 | public static function easeInOut(t:Number, b:Number, c:Number, d:Number):Number {
10 | if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
11 | return c/2*((t-=2)*t*t*t*t + 2) + b;
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/mosaictool/lib/greensock/gs/events/TweenEvent.as:
--------------------------------------------------------------------------------
1 | /*
2 | VERSION: 0.9
3 | DATE: 7/15/2008
4 | ACTIONSCRIPT VERSION: 3.0 (Requires Flash Player 9)
5 | DESCRIPTION:
6 | Used for Event dispatching from the AS3 version of TweenMax (www.tweenmax.com)
7 |
8 |
9 | CODED BY: Jack Doyle, jack@greensock.com
10 | Copyright 2008, GreenSock (This work is subject to the terms at http://www.greensock.com/terms_of_use.html.)
11 | */
12 |
13 | package gs.events {
14 | import flash.events.Event;
15 |
16 | public class TweenEvent extends Event {
17 | public static const version:Number = 0.9;
18 | public static const START:String = "start";
19 | public static const UPDATE:String = "update";
20 | public static const COMPLETE:String = "complete";
21 |
22 | public var info:Object;
23 |
24 | public function TweenEvent($type:String, $info:Object = null, $bubbles:Boolean = false, $cancelable:Boolean = false){
25 | super($type, $bubbles, $cancelable);
26 | this.info = $info;
27 | }
28 |
29 | public override function clone():Event{
30 | return new TweenEvent(this.type, this.info, this.bubbles, this.cancelable);
31 | }
32 |
33 | }
34 |
35 | }
--------------------------------------------------------------------------------
/mosaictool/lib/greensock/gs/utils/tween/ArrayTweenInfo.as:
--------------------------------------------------------------------------------
1 | /*
2 | VERSION: 1.0
3 | DATE: 1/23/2009
4 | ACTIONSCRIPT VERSION: 3.0
5 | UPDATES & MORE DETAILED DOCUMENTATION AT: http://www.TweenLite.com
6 | DESCRIPTION:
7 | Stores basic info about Array tweens in TweenLite/Max.
8 |
9 | AUTHOR: Jack Doyle, jack@greensock.com
10 | Copyright 2009, GreenSock. All rights reserved. This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for corporate Club GreenSock members, the software agreement that was issued with the corporate membership.
11 | */
12 |
13 | package gs.utils.tween {
14 |
15 | public class ArrayTweenInfo {
16 | public var index:uint;
17 | public var start:Number;
18 | public var change:Number;
19 |
20 | public function ArrayTweenInfo($index:uint, $start:Number, $change:Number) {
21 | this.index = $index;
22 | this.start = $start;
23 | this.change = $change;
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/mosaictool/lib/greensock/gs/utils/tween/FilterVars.as:
--------------------------------------------------------------------------------
1 | /*
2 | VERSION: 1.0
3 | DATE: 1/29/2009
4 | ACTIONSCRIPT VERSION: 3.0
5 | DESCRIPTION:
6 | This class works in conjunction with the TweenLiteVars or TweenMaxVars class to grant
7 | strict data typing and code hinting (in most code editors) for filter tweens. See the documentation in
8 | the TweenLiteVars or TweenMaxVars for more information.
9 |
10 |
11 | AUTHOR: Jack Doyle, jack@greensock.com
12 | Copyright 2009, GreenSock. All rights reserved. This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for corporate Club GreenSock members, the software agreement that was issued with the corporate membership.
13 | */
14 |
15 |
16 | package gs.utils.tween {
17 | public class FilterVars extends SubVars {
18 | public var remove:Boolean;
19 | public var index:int;
20 | public var addFilter:Boolean;
21 |
22 | public function FilterVars($remove:Boolean=false, $index:int=-1, $addFilter:Boolean=false) {
23 | super();
24 | this.remove = $remove;
25 | if ($index > -1) {
26 | this.index = $index;
27 | }
28 | this.addFilter = $addFilter;
29 | }
30 |
31 | }
32 | }
--------------------------------------------------------------------------------
/mosaictool/lib/greensock/gs/utils/tween/SubVars.as:
--------------------------------------------------------------------------------
1 | /*
2 | VERSION: 1.0
3 | DATE: 1/29/2009
4 | ACTIONSCRIPT VERSION: 3.0
5 | DESCRIPTION:
6 | This class works in conjunction with the TweenLiteVars or TweenMaxVars class to grant
7 | strict data typing and code hinting (in most code editors) for filter tweens. See the documentation in
8 | the TweenLiteVars or TweenMaxVars for more information.
9 |
10 |
11 | AUTHOR: Jack Doyle, jack@greensock.com
12 | Copyright 2009, GreenSock. All rights reserved. This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for corporate Club GreenSock members, the software agreement that was issued with the corporate membership.
13 | */
14 |
15 |
16 | package gs.utils.tween {
17 | public class SubVars {
18 | public var isTV:Boolean = true;
19 | public var exposedVars:Object;
20 |
21 | public function SubVars() {
22 | this.exposedVars = {};
23 | }
24 |
25 | }
26 | }
--------------------------------------------------------------------------------
/mosaictool/lib/greensock/gs/utils/tween/TweenInfo.as:
--------------------------------------------------------------------------------
1 | /*
2 | VERSION: 1.0
3 | DATE: 1/21/2009
4 | ACTIONSCRIPT VERSION: 3.0
5 | UPDATES & MORE DETAILED DOCUMENTATION AT: http://www.TweenLite.com
6 | DESCRIPTION:
7 | Stores basic info about individual property tweens in TweenLite/Max.
8 |
9 | AUTHOR: Jack Doyle, jack@greensock.com
10 | Copyright 2009, GreenSock. All rights reserved. This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for corporate Club GreenSock members, the software agreement that was issued with the corporate membership.
11 | */
12 |
13 | package gs.utils.tween {
14 |
15 | public class TweenInfo {
16 | public var target:Object;
17 | public var property:String;
18 | public var start:Number;
19 | public var change:Number;
20 | public var name:String;
21 | public var isPlugin:Boolean;
22 |
23 | public function TweenInfo($target:Object, $property:String, $start:Number, $change:Number, $name:String, $isPlugin:Boolean) {
24 | this.target = $target;
25 | this.property = $property;
26 | this.start = $start;
27 | this.change = $change;
28 | this.name = $name;
29 | this.isPlugin = $isPlugin;
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/mosaictool/lib/hamcrest.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/joelhooks/robotlegs-examples-OreillyBook/18ac502a6f3f1f49e0ccb90d82256fd5d50b6960/mosaictool/lib/hamcrest.swc
--------------------------------------------------------------------------------
/mosaictool/lib/mockolate/mockolate/errors/ExpectationError.as:
--------------------------------------------------------------------------------
1 | package mockolate.errors
2 | {
3 | import mockolate.ingredients.Expectation;
4 | import mockolate.ingredients.Mockolate;
5 |
6 | /**
7 | * Expectation-related Error
8 | */
9 | public class ExpectationError extends MockolateError
10 | {
11 | private var _expectation:Expectation;
12 |
13 | /**
14 | * Constructor
15 | */
16 | public function ExpectationError(message:Object, expectation:Expectation, mockolate:Mockolate, target:Object)
17 | {
18 | super(message, mockolate, target);
19 |
20 | _expectation = expectation;
21 | }
22 |
23 | /**
24 | * Expectation instance related to this Error
25 | */
26 | public function get expectation():Expectation
27 | {
28 | return _expectation;
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/mosaictool/lib/mockolate/mockolate/errors/InvocationError.as:
--------------------------------------------------------------------------------
1 | package mockolate.errors
2 | {
3 | import mockolate.ingredients.Invocation;
4 | import mockolate.ingredients.Mockolate;
5 |
6 | /**
7 | * Invocation-related Error
8 | */
9 | public class InvocationError extends MockolateError
10 | {
11 | private var _invocation:Invocation;
12 |
13 | /**
14 | * Constructor.
15 | */
16 | public function InvocationError(message:Object, invocation:Invocation, mockolate:Mockolate, target:Object)
17 | {
18 | super(message, mockolate, target);
19 |
20 | _invocation = invocation;
21 | }
22 |
23 | public function get invocation():Invocation
24 | {
25 | return _invocation;
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/mosaictool/lib/mockolate/mockolate/errors/MockolateError.as:
--------------------------------------------------------------------------------
1 | package mockolate.errors
2 | {
3 | import asx.string.substitute;
4 |
5 | import mockolate.ingredients.Mockolate;
6 |
7 | /**
8 | * Mockolate-related Error
9 | */
10 | public class MockolateError extends Error
11 | {
12 | private var _mockolate:Mockolate;
13 | private var _target:Object;
14 |
15 | /**
16 | * Constructor.
17 | */
18 | public function MockolateError(message:Object, mockolate:Mockolate, target:Object) {
19 |
20 | if (message is Array)
21 | message = substitute(message[0], message[1] || []);
22 |
23 | super(message);
24 |
25 | _mockolate = mockolate;
26 | _target = target;
27 | }
28 |
29 | public function get mockolate():Mockolate {
30 | return _mockolate;
31 | }
32 |
33 | public function get target():Object {
34 | return _target;
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/mosaictool/lib/mockolate/mockolate/errors/VerificationError.as:
--------------------------------------------------------------------------------
1 | package mockolate.errors
2 | {
3 | import mockolate.ingredients.Expectation;
4 | import mockolate.ingredients.Mockolate;
5 | import mockolate.ingredients.Verification;
6 |
7 | /**
8 | * Verification-related Error
9 | */
10 | public class VerificationError extends MockolateError
11 | {
12 | private var _verification:Verification;
13 |
14 | /**
15 | * Constructor.
16 | */
17 | public function VerificationError(
18 | message:Object,
19 | verification:Verification,
20 | mockolate:Mockolate,
21 | target:Object)
22 | {
23 | super(message, mockolate, target);
24 |
25 | _verification = verification;
26 | }
27 |
28 | /**
29 | * Verification instance related to this Error
30 | */
31 | public function get verification():Verification
32 | {
33 | return _verification;
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/mosaictool/lib/mockolate/mockolate/ingredients/answers/Answer.as:
--------------------------------------------------------------------------------
1 | package mockolate.ingredients.answers
2 | {
3 | import mockolate.ingredients.Invocation;
4 |
5 | /**
6 | * Answer instances are used by mock()
and stub()
7 | * to define the behaviour of a method or property invocation.
8 | *
9 | * @author drewbourne
10 | */
11 | public interface Answer
12 | {
13 | /**
14 | * Perform Answer action.
15 | *
16 | * @param invocation
17 | * @returns possible Invocation.returnValue
18 | */
19 | function invoke(invocation:Invocation):*;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/mosaictool/lib/mockolate/mockolate/ingredients/answers/PassThroughAnswer.as:
--------------------------------------------------------------------------------
1 | package mockolate.ingredients.answers
2 | {
3 | import mockolate.ingredients.Invocation;
4 |
5 | /**
6 | * @example
7 | *
8 | * stub.pass();
9 | *
10 | */
11 | public class PassThroughAnswer implements Answer
12 | {
13 | /**
14 | * Constructor.
15 | */
16 | public function PassThroughAnswer()
17 | {
18 | }
19 |
20 | /**
21 | * @inheritDoc
22 | */
23 | public function invoke(invocation:Invocation):*
24 | {
25 | // return invocation.proceed();
26 | return undefined;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/mosaictool/lib/mockolate/mockolate/ingredients/answers/ReturnsCallAnswer.as:
--------------------------------------------------------------------------------
1 | package mockolate.ingredients.answers
2 | {
3 | import mockolate.ingredients.Invocation;
4 |
5 | /**
6 | * Calls a Function and returns the resulting value.
7 | *
8 | * @see ReturnsAnswer
9 | * @see mockolate.ingredients.Invocation#returnValue
10 | * @see mockolate.ingredients.MockingCouverture#returns()
11 | *
12 | * @author drewbourne
13 | */
14 | public class ReturnsCallAnswer implements Answer
15 | {
16 | private var _function:Function;
17 | private var _args:Array;
18 |
19 | /**
20 | * Constructor.
21 | */
22 | public function ReturnsCallAnswer(fn:Function, args:Array=null)
23 | {
24 | _function = fn;
25 | _args = args || [];
26 | }
27 |
28 | /**
29 | * @inheritDoc
30 | */
31 | public function invoke(invocation:Invocation):*
32 | {
33 | return _function.apply(null, _args);
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/mosaictool/lib/mockolate/mockolate/ingredients/answers/ReturnsValueAnswer.as:
--------------------------------------------------------------------------------
1 | package mockolate.ingredients.answers
2 | {
3 | import mockolate.ingredients.Invocation;
4 |
5 | /**
6 | * Returns a value.
7 | *
8 | * @see mockolate.ingredients.Invocation#returnValue
9 | * @see mockolate.ingredients.MockingCouverture#returns()
10 | *
11 | * @author drewbourne
12 | */
13 | public class ReturnsValueAnswer implements Answer
14 | {
15 | private var _value:*;
16 |
17 | public function ReturnsValueAnswer(value:*)
18 | {
19 | _value = value;
20 | }
21 |
22 | public function invoke(invocation:Invocation):*
23 | {
24 | return _value;
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/mosaictool/lib/mockolate/mockolate/ingredients/answers/ThrowsAnswer.as:
--------------------------------------------------------------------------------
1 | package mockolate.ingredients.answers
2 | {
3 | import mockolate.ingredients.Invocation;
4 |
5 | /**
6 | * Throws an Error.
7 | *
8 | * @see mockolate.ingredients.MockingCouverture#throws()
9 | *
10 | * @example
11 | *
12 | * mock(instance).method("explode").throws(new ArgumentError("Oh no!"));
13 | *
14 | */
15 | public class ThrowsAnswer implements Answer
16 | {
17 | private var _error:Error;
18 |
19 | /**
20 | * Constructor.
21 | *
22 | * @param error Error instance to throw.
23 | */
24 | public function ThrowsAnswer(error:Error)
25 | {
26 | _error = error;
27 | }
28 |
29 | /**
30 | * @inheritDoc
31 | */
32 | public function invoke(invocation:Invocation):*
33 | {
34 | throw _error;
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/mosaictool/lib/mockolate/mockolate/ingredients/faux/FauxFloxyInterceptor.as:
--------------------------------------------------------------------------------
1 | package mockolate.ingredients.faux
2 | {
3 | import mockolate.ingredients.Invocation;
4 | import mockolate.ingredients.Mockolate;
5 | import mockolate.ingredients.mockolate_ingredient;
6 |
7 | import org.floxy.IInterceptor;
8 | import org.floxy.IInvocation;
9 |
10 | use namespace mockolate_ingredient;
11 |
12 | public class FauxFloxyInterceptor implements IInterceptor
13 | {
14 | private var _interceptHandler:Function;
15 |
16 | public function FauxFloxyInterceptor(interceptorHandler:Function)
17 | {
18 | super();
19 |
20 | _interceptHandler = interceptorHandler;
21 | }
22 |
23 | public function intercept(invocation:IInvocation):void
24 | {
25 | _interceptHandler(invocation);
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/mosaictool/lib/mockolate/mockolate/ingredients/faux/FauxMockolate.as:
--------------------------------------------------------------------------------
1 | package mockolate.ingredients.faux
2 | {
3 | import mockolate.ingredients.Invocation;
4 | import mockolate.ingredients.Mockolate;
5 | import mockolate.ingredients.mockolate_ingredient;
6 |
7 | import org.floxy.IInterceptor;
8 | import org.floxy.IInvocation;
9 |
10 | use namespace mockolate_ingredient;
11 |
12 | public class FauxMockolate extends Mockolate
13 | {
14 | private var _invokedHandler:Function;
15 |
16 | public function FauxMockolate(invokedHandler:Function, name:String=null)
17 | {
18 | super(name);
19 |
20 | _invokedHandler = invokedHandler;
21 | }
22 |
23 | override mockolate_ingredient function invoked(invocation:Invocation):Mockolate
24 | {
25 | _invokedHandler(invocation);
26 | return this;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/mosaictool/lib/mockolate/mockolate/ingredients/floxy/FloxyMockolate.as:
--------------------------------------------------------------------------------
1 | package mockolate.ingredients.floxy
2 | {
3 | import mockolate.ingredients.Mockolate;
4 | import mockolate.ingredients.mockolate_ingredient;
5 |
6 | use namespace mockolate_ingredient;
7 |
8 | /**
9 | * Mockolate extension for use with FLoxy proxies.
10 | */
11 | public class FloxyMockolate extends Mockolate
12 | {
13 | // couvertures
14 | private var _interceptor:InterceptingCouverture;
15 |
16 | public function FloxyMockolate(name:String)
17 | {
18 | super(name);
19 | }
20 |
21 | /**
22 | * FLoxy IInterceptor.
23 | */
24 | mockolate_ingredient function get interceptor():InterceptingCouverture
25 | {
26 | return _interceptor;
27 | }
28 |
29 | mockolate_ingredient function set interceptor(value:InterceptingCouverture):void
30 | {
31 | _interceptor = value;
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/mosaictool/lib/mockolate/mockolate/ingredients/floxy/InterceptingCouverture.as:
--------------------------------------------------------------------------------
1 | package mockolate.ingredients.floxy
2 | {
3 | import org.floxy.IInterceptor;
4 | import org.floxy.IInvocation;
5 |
6 | import asx.string.substitute;
7 |
8 | import mockolate.ingredients.Couverture;
9 | import mockolate.ingredients.Invocation;
10 | import mockolate.ingredients.Mockolate;
11 | import mockolate.ingredients.mockolate_ingredient;
12 |
13 | use namespace mockolate_ingredient;
14 |
15 | /**
16 | * FLoxy IInterceptor implementation for Mockolate.
17 | */
18 | public class InterceptingCouverture extends Couverture implements IInterceptor
19 | {
20 | /**
21 | * Constructor.
22 | */
23 | public function InterceptingCouverture(mockolate:Mockolate)
24 | {
25 | super(mockolate);
26 | }
27 |
28 | /**
29 | * Called by FLoxy proxy instances.
30 | *
31 | * @private
32 | */
33 | public function intercept(invocation:IInvocation):void
34 | {
35 | mockolate.mockolate_ingredient::invoked(new FloxyInvocation(invocation));
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/mosaictool/lib/mockolate/mockolate/ingredients/mockolate_ingredient.as:
--------------------------------------------------------------------------------
1 | package mockolate.ingredients
2 | {
3 | /**
4 | * This namespace is used for hiding implementation details (methods and properties)
5 | * that cannot be protected as they need to be visible to classes in other packages.
6 | *
7 | * @private
8 | */
9 | public namespace mockolate_ingredient = 'mockolate.ingredients.only';
10 | }
--------------------------------------------------------------------------------
/mosaictool/lib/mockolate/mockolate/make.as:
--------------------------------------------------------------------------------
1 | package mockolate
2 | {
3 | import mockolate.ingredients.MockolatierMaster;
4 |
5 | /**
6 | * Alias of strict()
7 | *
8 | * @see mockolate#strict()
9 | *
10 | * @author drewbourne
11 | */
12 | public function make(klass:Class, name:String=null, constructorArgs:Array=null):*
13 | {
14 | return strict(klass, name, constructorArgs);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/mosaictool/lib/mockolate/mockolate/nice.as:
--------------------------------------------------------------------------------
1 | package mockolate
2 | {
3 | import mockolate.ingredients.MockolatierMaster;
4 |
5 | /**
6 | * Creates an instance of the given Class that will behave as a 'nice' mock.
7 | *
8 | * When a Mockolate is 'nice' it will return false-y values for any method
9 | * or property that does not have a mock()
or
10 | * stub()
Expectation defined.
11 | *
12 | * @param klass Class to create a nice mock for.
13 | * @param name Name for the mock instance.
14 | *
15 | * @see mockolate#strict()
16 | * @see mockolate#mock()
17 | * @see mockolate#stub()
18 | *
19 | * @example
20 | *
21 | * var flavour:Flavour = nice(Flavour);
22 | *
23 | *
24 | * @author drewbourne
25 | */
26 | public function nice(klass:Class, name:String=null, constructorArgs:Array=null):*
27 | {
28 | return MockolatierMaster.nice(klass, name, constructorArgs);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/mosaictool/lib/mockolate/mockolate/prepare.as:
--------------------------------------------------------------------------------
1 | package mockolate
2 | {
3 | import flash.events.EventDispatcher;
4 | import flash.events.IEventDispatcher;
5 |
6 | import mockolate.ingredients.MockolatierMaster;
7 |
8 | // TODO prepare(...classes, Function); if the last param is a function than use it as the completion callback.
9 | /**
10 | * Prepares a Class for use with Mockolate.
11 | *
12 | * Classes are prepared asynchronously. prepare()
returns an IEventDispatcher
13 | * that will fire an Event.COMPLETE
event when finished preparing.
14 | *
15 | * @param ...rest One or more Class references.
16 | * @return IEventDispatcher
17 | *
18 | * @see mockolate#nice()
19 | * @see mockolate#strict()
20 | *
21 | * @example
22 | *
23 | * prepare(Chocolate, Milk, Sugar);
24 | *
25 | *
26 | * @author drewbourne
27 | */
28 | public function prepare(... rest):IEventDispatcher
29 | {
30 | return MockolatierMaster.prepare(rest);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/mosaictool/lib/mockolate/mockolate/strict.as:
--------------------------------------------------------------------------------
1 | package mockolate
2 | {
3 | import mockolate.ingredients.MockolatierMaster;
4 |
5 | /**
6 | * Creates an instance of the given Class that will behave as a 'strict' mock.
7 | *
8 | * When a Mockolate is 'strict' it will throw an UnspecifiedBehaviourError
9 | * for any method or property that does not have a mock()
or
10 | * stub()
Expectation defined.
11 | *
12 | * @param klass Class to create a strict mock for.
13 | * @param name Name for the mock instance.
14 | *
15 | * @see mockolate#strict()
16 | * @see mockolate#mock()
17 | * @see mockolate#stub()
18 | *
19 | * @example
20 | *
21 | * var flavour:Flavour = nice(Flavour);
22 | *
23 | *
24 | * @author drewbourne
25 | */
26 | public function strict(klass:Class, name:String=null, constructorArgs:Array=null):*
27 | {
28 | return MockolatierMaster.strict(klass, name, constructorArgs);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/mosaictool/lib/mockolate/mockolate/verify.as:
--------------------------------------------------------------------------------
1 | package mockolate
2 | {
3 | import mockolate.ingredients.MockolatierMaster;
4 | import mockolate.ingredients.VerifyingCouverture;
5 |
6 | /**
7 | * Verify Expectations and Invocations.
8 | *
9 | * Calling verify()
will verify that any Expectations defined
10 | * by mock()
have been invoked their expected number of times.
11 | *
12 | * Using the VerifyingCouverture additional verification can be performed
13 | * on the Invocations recorded by the Mockolate instance.
14 | *
15 | * @see mockolate.ingredients.VerifyingCouverture
16 | *
17 | * @example
18 | *
19 | *
20 | *
21 | * @author drewbourne
22 | */
23 | public function verify(target:*):VerifyingCouverture
24 | {
25 | return MockolatierMaster.verify(target);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/mosaictool/lib/robotlegs/org/robotlegs/adapters/SwiftSuspendersReflector.as:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009 the original author or authors
3 | *
4 | * Permission is hereby granted to use, modify, and distribute this file
5 | * in accordance with the terms of the license agreement accompanying it.
6 | */
7 |
8 | package org.robotlegs.adapters
9 | {
10 | import org.robotlegs.core.IReflector;
11 | import org.swiftsuspenders.Reflector;
12 |
13 | /**
14 | * SwiftSuspender IReflector
adpater - See: SwiftSuspenders
15 | *
16 | * @author tschneidereit
17 | */
18 | public class SwiftSuspendersReflector extends Reflector implements IReflector
19 | {
20 | }
21 | }
--------------------------------------------------------------------------------
/mosaictool/lib/robotlegs/org/robotlegs/base/ContextError.as:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009 the original author or authors
3 | *
4 | * Permission is hereby granted to use, modify, and distribute this file
5 | * in accordance with the terms of the license agreement accompanying it.
6 | */
7 |
8 | package org.robotlegs.base
9 | {
10 |
11 | /**
12 | * A framework Error implementation
13 | */
14 | public class ContextError extends Error
15 | {
16 | public static const E_COMMANDMAP_NOIMPL:String = 'Command Class does not implement an execute() method';
17 | public static const E_COMMANDMAP_OVR:String = 'Cannot overwrite map';
18 |
19 | public static const E_MEDIATORMAP_NOIMPL:String = 'Mediator Class does not implement IMediator';
20 | public static const E_MEDIATORMAP_OVR:String = 'Mediator Class has already been mapped to a View Class in this context';
21 |
22 | public static const E_EVENTMAP_NOSNOOPING:String = 'Listening to the context eventDispatcher is not enabled for this EventMap';
23 |
24 | public function ContextError(message:String = "", id:int = 0)
25 | {
26 | super(message, id);
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/mosaictool/lib/robotlegs/org/robotlegs/core/IContext.as:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009 the original author or authors
3 | *
4 | * Permission is hereby granted to use, modify, and distribute this file
5 | * in accordance with the terms of the license agreement accompanying it.
6 | */
7 |
8 | package org.robotlegs.core
9 | {
10 | import flash.events.IEventDispatcher;
11 |
12 | /**
13 | * The Robotlegs Context contract
14 | */
15 | public interface IContext
16 | {
17 | /**
18 | * The IContext
's IEventDispatcher
19 | */
20 | function get eventDispatcher():IEventDispatcher;
21 |
22 | }
23 | }
--------------------------------------------------------------------------------
/mosaictool/lib/robotlegs/org/robotlegs/core/IContextProvider.as:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009 the original author or authors
3 | *
4 | * Permission is hereby granted to use, modify, and distribute this file
5 | * in accordance with the terms of the license agreement accompanying it.
6 | */
7 |
8 | package org.robotlegs.core
9 | {
10 |
11 | /**
12 | * The Robotlegs Context Provider contract
13 | */
14 | public interface IContextProvider
15 | {
16 | /**
17 | * Retrieve the IContext
18 | * @return The IContext
19 | */
20 | function getContext():IContext;
21 | }
22 | }
--------------------------------------------------------------------------------
/mosaictool/lib/robotlegs/org/robotlegs/utilities/modular/base/ModuleCommandMap.as:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009 the original author or authors
3 | *
4 | * Permission is hereby granted to use, modify, and distribute this file
5 | * in accordance with the terms of the license agreement accompanying it.
6 | */
7 |
8 | package org.robotlegs.utilities.modular.base
9 | {
10 | import org.robotlegs.base.CommandMap;
11 | import org.robotlegs.core.IInjector;
12 | import org.robotlegs.core.IReflector;
13 | import org.robotlegs.utilities.modular.core.IModuleCommandMap;
14 | import org.robotlegs.utilities.modular.core.IModuleEventDispatcher;
15 |
16 | public class ModuleCommandMap extends CommandMap implements IModuleCommandMap
17 | {
18 | public function ModuleCommandMap(eventDispatcher:IModuleEventDispatcher, injector:IInjector, reflector:IReflector)
19 | {
20 | super(eventDispatcher, injector, reflector);
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/mosaictool/lib/robotlegs/org/robotlegs/utilities/modular/base/ModuleEventDispatcher.as:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009 the original author or authors
3 | *
4 | * Permission is hereby granted to use, modify, and distribute this file
5 | * in accordance with the terms of the license agreement accompanying it.
6 | */
7 |
8 | package org.robotlegs.utilities.modular.base
9 | {
10 | import flash.events.EventDispatcher;
11 | import flash.events.IEventDispatcher;
12 |
13 | import org.robotlegs.utilities.modular.core.IModuleEventDispatcher;
14 |
15 | public class ModuleEventDispatcher extends EventDispatcher implements IModuleEventDispatcher
16 | {
17 | public function ModuleEventDispatcher(target:IEventDispatcher = null)
18 | {
19 | super(target);
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/mosaictool/lib/robotlegs/org/robotlegs/utilities/modular/core/IModuleCommandMap.as:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009 the original author or authors
3 | *
4 | * Permission is hereby granted to use, modify, and distribute this file
5 | * in accordance with the terms of the license agreement accompanying it.
6 | */
7 |
8 | package org.robotlegs.utilities.modular.core
9 | {
10 | import org.robotlegs.core.ICommandMap;
11 |
12 | public interface IModuleCommandMap extends ICommandMap
13 | {
14 |
15 | }
16 | }
--------------------------------------------------------------------------------
/mosaictool/lib/robotlegs/org/robotlegs/utilities/modular/core/IModuleContext.as:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009 the original author or authors
3 | *
4 | * Permission is hereby granted to use, modify, and distribute this file
5 | * in accordance with the terms of the license agreement accompanying it.
6 | */
7 |
8 | package org.robotlegs.utilities.modular.core
9 | {
10 |
11 | public interface IModuleContext
12 | {
13 | function setModuleDispatcher(dispatcher:IModuleEventDispatcher):void;
14 | }
15 | }
--------------------------------------------------------------------------------
/mosaictool/lib/robotlegs/org/robotlegs/utilities/modular/core/IModuleContextView.as:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009 the original author or authors
3 | *
4 | * Permission is hereby granted to use, modify, and distribute this file
5 | * in accordance with the terms of the license agreement accompanying it.
6 | */
7 |
8 | package org.robotlegs.utilities.modular.core
9 | {
10 |
11 | public interface IModuleContextView
12 | {
13 | function setModuleDispatcher(dispatcher:IModuleEventDispatcher):void;
14 |
15 | function startup():void;
16 |
17 | }
18 | }
--------------------------------------------------------------------------------
/mosaictool/lib/robotlegs/org/robotlegs/utilities/modular/core/IModuleEventDispatcher.as:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009 the original author or authors
3 | *
4 | * Permission is hereby granted to use, modify, and distribute this file
5 | * in accordance with the terms of the license agreement accompanying it.
6 | */
7 |
8 | package org.robotlegs.utilities.modular.core
9 | {
10 | import flash.events.IEventDispatcher;
11 |
12 | public interface IModuleEventDispatcher extends IEventDispatcher
13 | {
14 |
15 | }
16 | }
--------------------------------------------------------------------------------
/mosaictool/lib/robotlegs/org/robotlegs/utilities/modular/mvcs/ModuleContextView.as:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009 the original author or authors
3 | *
4 | * Permission is hereby granted to use, modify, and distribute this file
5 | * in accordance with the terms of the license agreement accompanying it.
6 | */
7 |
8 | package org.robotlegs.utilities.modular.mvcs
9 | {
10 | import flash.display.Sprite;
11 |
12 | import org.robotlegs.utilities.modular.core.IModuleContextView;
13 | import org.robotlegs.utilities.modular.core.IModuleEventDispatcher;
14 |
15 | public class ModuleContextView extends Sprite implements IModuleContextView
16 | {
17 | protected var context:ModuleContext;
18 |
19 | public function ModuleContextView()
20 | {
21 | }
22 |
23 | public function setModuleDispatcher(dispatcher:IModuleEventDispatcher):void
24 | {
25 | context.setModuleDispatcher(dispatcher);
26 | }
27 |
28 | public function startup():void
29 | {
30 | context.startup();
31 | }
32 |
33 | public function getModuleContext():ModuleContext{
34 | return context;
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/mosaictool/lib/robotlegs/org/robotlegs/utilities/signals/core/ISignalCommandMap.as:
--------------------------------------------------------------------------------
1 | package org.robotlegs.utilities.signals.core
2 | {
3 | import org.osflash.signals.ISignal;
4 |
5 | public interface ISignalCommandMap
6 | {
7 | function mapSignal(signal:ISignal, commandClass:Class, oneShot:Boolean = false):void;
8 |
9 | function mapSignalClass(signalClass:Class, commandClass:Class, oneShot:Boolean = false):ISignal;
10 |
11 | function hasSignalCommand(signal:ISignal, commandClass:Class):Boolean;
12 |
13 | function unmapSignal(signal:ISignal, commandClass:Class):void;
14 |
15 | function unmapSignalClass(signalClass:Class, commandClass:Class):void;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/mosaictool/lib/robotlegs/org/robotlegs/utilities/signals/core/ISignalContext.as:
--------------------------------------------------------------------------------
1 | package org.robotlegs.utilities.signals.core
2 | {
3 |
4 | import org.robotlegs.core.IContext;
5 |
6 | public interface ISignalContext extends IContext
7 | {
8 | function get signalCommandMap():ISignalCommandMap;
9 | function set signalCommandMap(value:ISignalCommandMap):void;
10 | }
11 | }
--------------------------------------------------------------------------------
/mosaictool/lib/robotlegs/org/robotlegs/utilities/signals/mvcs/SignalCommand.as:
--------------------------------------------------------------------------------
1 | package org.robotlegs.utilities.signals.mvcs
2 | {
3 | import org.robotlegs.utilities.signals.core.ISignalCommandMap;
4 |
5 | import org.robotlegs.mvcs.Command;
6 |
7 | public class SignalCommand extends Command
8 | {
9 | [Inject]
10 | public var signalCommandMap:ISignalCommandMap;
11 | }
12 | }
--------------------------------------------------------------------------------
/mosaictool/lib/robotlegs/org/swiftsuspenders/injectionpoints/NoParamsConstructorInjectionPoint.as:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009 the original author or authors
3 | *
4 | * Permission is hereby granted to use, modify, and distribute this file
5 | * in accordance with the terms of the license agreement accompanying it.
6 | */
7 |
8 | package org.swiftsuspenders.injectionpoints
9 | {
10 | import flash.utils.Dictionary;
11 | import org.swiftsuspenders.Injector;
12 |
13 | public class NoParamsConstructorInjectionPoint extends InjectionPoint
14 | {
15 | public function NoParamsConstructorInjectionPoint()
16 | {
17 | super(null, null);
18 | }
19 |
20 | override public function applyInjection(target : Object, injector : Injector, singletons : Dictionary) : Object
21 | {
22 | return new target();
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/mosaictool/mosaictool.tmproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | documents
6 |
7 |
8 | expanded
9 |
10 | name
11 | mosaictool
12 | regexFolderFilter
13 | !.*/(\.[^/]*|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$
14 | sourceDirectory
15 |
16 |
17 |
18 | fileHierarchyDrawerWidth
19 | 403
20 | metaData
21 |
22 | showFileHierarchyDrawer
23 |
24 | windowFrame
25 | {{415, 100}, {1023, 778}}
26 |
27 |
28 |
--------------------------------------------------------------------------------
/mosaictool/script/generate:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require 'rubygems'
3 | require 'sprout'
4 | sprout 'sprout-as3-bundle'
5 |
6 | # Add a class name if TestSuites were generated
7 | if(ARGV.size == 1 && ARGV[0] == 'suite')
8 | ARGV << 'AllTests'
9 | end
10 |
11 | # Insert class type by default
12 | if(ARGV.size == 1)
13 | ARGV.unshift('class')
14 | end
15 |
16 | # Execute generators like this:
17 | # script/generate class utils.MathUtil
18 | # script/generate suite
19 | # script/generate test utils.MathUtilTest
20 |
21 | Sprout::Sprout.generate('as3', ARGV.shift, ARGV, File.dirname(File.dirname(__FILE__)))
22 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/event/event_generator.rb:
--------------------------------------------------------------------------------
1 |
2 | class EventGenerator < Sprout::Generator::NamedBase # :nodoc:
3 |
4 | def manifest
5 | record do |m|
6 | # m.class_collisions class_dir, "#{class_name}Controller", "#{class_name}ControllerTest", "#{class_name}Helper"
7 |
8 | if(!user_requested_test)
9 | m.directory full_class_dir
10 | m.template 'Event.as', full_class_path
11 | end
12 |
13 | m.directory full_test_dir
14 | m.template 'TestCase.as', full_test_case_path
15 |
16 | m.template 'TestSuite.as', File.join(test_dir, 'AllTests.as'), :collision => :force
17 | end
18 | end
19 |
20 | end
21 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/event/templates/Component.mxml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/event/templates/Event.as:
--------------------------------------------------------------------------------
1 | package <%= package_name %>
2 | {
3 | import flash.events.Event;
4 |
5 | public class <%= class_name %> extends Event {
6 |
7 | public static const <%= subject_class_name %>:String = "<%= class_name %>.";
8 |
9 | public function <%= class_name %>(type:String){
10 | super(type);
11 | }
12 |
13 | override public function clone() : Event {
14 | return new <%= class_name %>(type);
15 | }
16 |
17 | }
18 | }
--------------------------------------------------------------------------------
/mosaictool/script/generators/event/templates/TestSuite.as:
--------------------------------------------------------------------------------
1 | package {
2 | /**
3 | * This file has been automatically created using
4 | * #!/usr/bin/ruby script/generate suite
5 | * If you modify it and run this script, your
6 | * modifications will be lost!
7 | */
8 |
9 | import asunit.framework.TestSuite;<% test_case_classes.each do |test_case| %>
10 | import <%= test_case %>;<% end %>
11 |
12 | public class AllTests extends TestSuite {
13 |
14 | public function AllTests() {<% test_case_classes.each do |test_case| %>
15 | addTest(new <%= test_case %>());<% end %>
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/interface/interface_generator.rb:
--------------------------------------------------------------------------------
1 |
2 | class InterfaceGenerator < Sprout::Generator::NamedBase # :nodoc:
3 |
4 | def manifest
5 | record do |m|
6 | # m.class_collisions class_dir, "#{class_name}Controller", "#{class_name}ControllerTest", "#{class_name}Helper"
7 |
8 | if(!user_requested_test)
9 | m.directory full_class_dir
10 | m.template 'Interface.as', full_class_path
11 | end
12 |
13 | end
14 | end
15 |
16 | end
17 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/interface/templates/Component.mxml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/interface/templates/Interface.as:
--------------------------------------------------------------------------------
1 | package <%= package_name %> {
2 |
3 | public interface <%= class_name %> {
4 |
5 | function <%= class_name %>():void;
6 |
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlcommand/rlcommand_generator.rb:
--------------------------------------------------------------------------------
1 |
2 | class RlcommandGenerator < Sprout::Generator::NamedBase # :nodoc:
3 |
4 | def manifest
5 | record do |m|
6 | # m.class_collisions class_dir, "#{class_name}Controller", "#{class_name}ControllerTest", "#{class_name}Helper"
7 |
8 | if(!user_requested_test)
9 | m.directory full_class_dir
10 | m.template 'RLCommand.as', full_class_path
11 | end
12 |
13 | m.directory full_test_dir
14 | m.template 'TestCase.as', full_test_case_path
15 |
16 | m.template 'TestSuite.as', File.join(test_dir, 'AllTests.as'), :collision => :force
17 | end
18 | end
19 |
20 | end
21 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlcommand/templates/Component.mxml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlcommand/templates/RLCommand.as:
--------------------------------------------------------------------------------
1 | package <%= package_name %>
2 | {
3 |
4 | import org.robotlegs.mvcs.Command;
5 |
6 | public class <%= class_name %> extends Command
7 | {
8 |
9 | override public function execute():void
10 | {
11 | // do stuff here
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlcommand/templates/TestSuite.as:
--------------------------------------------------------------------------------
1 | package {
2 | /**
3 | * This file has been automatically created using
4 | * #!/usr/bin/ruby script/generate suite
5 | * If you modify it and run this script, your
6 | * modifications will be lost!
7 | */
8 |
9 | import asunit.framework.TestSuite;<% test_case_classes.each do |test_case| %>
10 | import <%= test_case %>;<% end %>
11 |
12 | public class AllTests extends TestSuite {
13 |
14 | public function AllTests() {<% test_case_classes.each do |test_case| %>
15 | addTest(new <%= test_case %>());<% end %>
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlcontext/rlcontext_generator.rb:
--------------------------------------------------------------------------------
1 |
2 | class RlcontextGenerator < Sprout::Generator::NamedBase # :nodoc:
3 |
4 | def manifest
5 | record do |m|
6 | # m.class_collisions class_dir, "#{class_name}Controller", "#{class_name}ControllerTest", "#{class_name}Helper"
7 |
8 | if(!user_requested_test)
9 | m.directory full_class_dir
10 | m.template 'RLContext.as', full_class_path
11 | end
12 |
13 | m.directory full_test_dir
14 | m.template 'TestCase.as', full_test_case_path
15 |
16 | m.template 'TestSuite.as', File.join(test_dir, 'AllTests.as'), :collision => :force
17 | end
18 | end
19 |
20 | end
21 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlcontext/templates/Component.mxml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlcontext/templates/TestCase.as:
--------------------------------------------------------------------------------
1 | package <%= package_name %> {
2 |
3 | import asunit.framework.TestCase;
4 |
5 | import org.robotlegs.mvcs.Context;
6 |
7 | public class <%= test_case_name %> extends TestCase {
8 | protected var <%= instance_name %>:<%= class_name %>;
9 |
10 | public function <%= test_case_name %>(methodName:String=null) {
11 | super(methodName)
12 | }
13 |
14 | override protected function setUp():void {
15 | super.setUp();
16 | <%= instance_name %> = new <%= class_name %>();
17 | }
18 |
19 | override protected function tearDown():void {
20 | super.tearDown();
21 | <%= instance_name %> = null;
22 | }
23 |
24 | public function testInstantiated():void {
25 | assertTrue("<%= instance_name %> is <%= class_name %>", <%= instance_name %> is <%= class_name %>);
26 | }
27 |
28 | public function testIsContext():void{
29 | assertTrue("<%= instance_name %> is robotlegs Context", <%= instance_name %> is Context);
30 | }
31 |
32 | public function testFailure():void {
33 | assertTrue("Failing test", false);
34 | }
35 |
36 | }
37 | }
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlcontext/templates/TestSuite.as:
--------------------------------------------------------------------------------
1 | package {
2 | /**
3 | * This file has been automatically created using
4 | * #!/usr/bin/ruby script/generate suite
5 | * If you modify it and run this script, your
6 | * modifications will be lost!
7 | */
8 |
9 | import asunit.framework.TestSuite;<% test_case_classes.each do |test_case| %>
10 | import <%= test_case %>;<% end %>
11 |
12 | public class AllTests extends TestSuite {
13 |
14 | public function AllTests() {<% test_case_classes.each do |test_case| %>
15 | addTest(new <%= test_case %>());<% end %>
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlmediator/rlmediator_generator.rb:
--------------------------------------------------------------------------------
1 |
2 | class RlmediatorGenerator < Sprout::Generator::NamedBase # :nodoc:
3 |
4 | def manifest
5 | record do |m|
6 | # m.class_collisions class_dir, "#{class_name}Controller", "#{class_name}ControllerTest", "#{class_name}Helper"
7 |
8 | if(!user_requested_test)
9 | m.directory full_class_dir
10 | m.template 'RLMediator.as', full_class_dir + '/' + class_name + 'Mediator.as'
11 | end
12 |
13 | m.directory full_test_dir
14 | m.template 'TestCase.as', full_test_dir + '/' + class_name + 'MediatorTest.as'
15 |
16 | m.template 'TestSuite.as', File.join(test_dir, 'AllTests.as'), :collision => :force
17 | end
18 | end
19 |
20 | end
21 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlmediator/templates/Component.mxml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlmediator/templates/TestSuite.as:
--------------------------------------------------------------------------------
1 | package {
2 | /**
3 | * This file has been automatically created using
4 | * #!/usr/bin/ruby script/generate suite
5 | * If you modify it and run this script, your
6 | * modifications will be lost!
7 | */
8 |
9 | import asunit.framework.TestSuite;<% test_case_classes.each do |test_case| %>
10 | import <%= test_case %>;<% end %>
11 |
12 | public class AllTests extends TestSuite {
13 |
14 | public function AllTests() {<% test_case_classes.each do |test_case| %>
15 | addTest(new <%= test_case %>());<% end %>
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlmodel/rlmodel_generator.rb:
--------------------------------------------------------------------------------
1 |
2 | class RlmodelGenerator < Sprout::Generator::NamedBase # :nodoc:
3 |
4 | def manifest
5 | record do |m|
6 | # m.class_collisions class_dir, "#{class_name}Controller", "#{class_name}ControllerTest", "#{class_name}Helper"
7 |
8 | if(!user_requested_test)
9 | m.directory full_class_dir
10 | m.template 'RLModel.as', full_class_path
11 | end
12 |
13 | m.directory full_test_dir
14 | m.template 'TestCase.as', full_test_case_path
15 |
16 | m.template 'TestSuite.as', File.join(test_dir, 'AllTests.as'), :collision => :force
17 | end
18 | end
19 |
20 | end
21 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlmodel/templates/Component.mxml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlmodel/templates/RLModel.as:
--------------------------------------------------------------------------------
1 | package <%= package_name %> {
2 |
3 | import org.robotlegs.mvcs.Actor;
4 |
5 | public class <%= class_name %> extends Actor {
6 |
7 | public function <%= class_name %>() {
8 | }
9 |
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlmodel/templates/TestCase.as:
--------------------------------------------------------------------------------
1 | package <%= package_name %> {
2 |
3 | import asunit.framework.TestCase;
4 |
5 | import org.robotlegs.mvcs.Actor;
6 |
7 | public class <%= test_case_name %> extends TestCase {
8 | protected var <%= instance_name %>:<%= class_name %>;
9 |
10 | public function <%= test_case_name %>(methodName:String=null) {
11 | super(methodName)
12 | }
13 |
14 | override protected function setUp():void {
15 | super.setUp();
16 | <%= instance_name %> = new <%= class_name %>();
17 | }
18 |
19 | override protected function tearDown():void {
20 | super.tearDown();
21 | <%= instance_name %> = null;
22 | }
23 |
24 | public function testInstantiated():void {
25 | assertTrue("<%= instance_name %> is <%= class_name %>", <%= instance_name %> is <%= class_name %>);
26 | }
27 |
28 | public function testIsModel():void{
29 | assertTrue("<%= instance_name %> is robotlegs Actor", <%= instance_name %> is Actor);
30 | }
31 |
32 | public function testFailure():void {
33 | assertTrue("Failing test", false);
34 | }
35 |
36 | }
37 | }
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlmodel/templates/TestSuite.as:
--------------------------------------------------------------------------------
1 | package {
2 | /**
3 | * This file has been automatically created using
4 | * #!/usr/bin/ruby script/generate suite
5 | * If you modify it and run this script, your
6 | * modifications will be lost!
7 | */
8 |
9 | import asunit.framework.TestSuite;<% test_case_classes.each do |test_case| %>
10 | import <%= test_case %>;<% end %>
11 |
12 | public class AllTests extends TestSuite {
13 |
14 | public function AllTests() {<% test_case_classes.each do |test_case| %>
15 | addTest(new <%= test_case %>());<% end %>
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlmodule/rlmodule_generator.rb:
--------------------------------------------------------------------------------
1 |
2 | class RlmoduleGenerator < Sprout::Generator::NamedBase # :nodoc:
3 |
4 | def manifest
5 | record do |m|
6 | # m.class_collisions class_dir, "#{class_name}Controller", "#{class_name}ControllerTest", "#{class_name}Helper"
7 |
8 | if(!user_requested_test)
9 | m.directory full_class_dir
10 | m.template 'RLModule.as', full_class_path
11 | m.template 'RLModuleMediator.as', full_class_dir + '/' + class_name + 'Mediator.as'
12 | m.template 'RLModuleContext.as', full_class_dir + '/' + class_name + 'Context.as'
13 | end
14 |
15 | m.directory full_test_dir
16 | m.template 'RLModuleTest.as', full_test_case_path
17 | m.template 'RLModuleMediatorTest.as', full_test_dir + '/' + class_name + 'MediatorTest.as'
18 | m.template 'RLModuleContextTest.as', full_test_dir + '/' + class_name + 'ContextTest.as'
19 |
20 | m.template 'TestSuite.as', File.join(test_dir, 'AllTests.as'), :collision => :force
21 | end
22 | end
23 |
24 | end
25 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlmodule/templates/Component.mxml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlmodule/templates/RLModule.as:
--------------------------------------------------------------------------------
1 | package <%= package_name %> {
2 |
3 | import org.robotlegs.utilities.modular.mvcs.ModuleContext;
4 | import org.robotlegs.utilities.modular.mvcs.ModuleContextView;
5 |
6 | public class <%= class_name %> extends ModuleContextView {
7 |
8 | public function <%= class_name %>() {
9 |
10 | context = new <%= class_name %>Context(this);
11 |
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlmodule/templates/RLModuleContextTest.as:
--------------------------------------------------------------------------------
1 | package <%= package_name %> {
2 |
3 | import asunit.framework.TestCase;
4 | import org.robotlegs.utilities.modular.mvcs.ModuleContext;
5 |
6 | public class <%= class_name %>ContextTest extends TestCase {
7 | protected var instance:<%= class_name %>Context;
8 |
9 | public function <%= class_name %>ContextTest(methodName:String=null) {
10 | super(methodName)
11 | }
12 |
13 | override protected function setUp():void {
14 | super.setUp();
15 | instance = new <%= class_name %>Context();
16 | }
17 |
18 | override protected function tearDown():void {
19 | super.tearDown();
20 | instance = null;
21 | }
22 |
23 | public function testInstantiated():void {
24 | assertTrue("instance is <%= class_name %>Context", instance is <%= class_name %>Context);
25 | }
26 |
27 | public function testIsModuleContext():void {
28 | assertTrue("instance is ModuleContext", instance is ModuleContext);
29 | }
30 |
31 | public function testFailure():void {
32 | assertTrue("Failing test", false);
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlmodule/templates/RLModuleTest.as:
--------------------------------------------------------------------------------
1 | package <%= package_name %> {
2 |
3 | import asunit.framework.TestCase;
4 | import org.robotlegs.utilities.modular.mvcs.ModuleContextView;
5 |
6 | public class <%= class_name %>Test extends TestCase {
7 | protected var instance:<%= class_name %>;
8 |
9 | public function <%= class_name %>Test(methodName:String=null) {
10 | super(methodName)
11 | }
12 |
13 | override protected function setUp():void {
14 | super.setUp();
15 | instance = new <%= class_name %>();
16 | }
17 |
18 | override protected function tearDown():void {
19 | super.tearDown();
20 | instance = null;
21 | }
22 |
23 | public function testInstantiated():void {
24 | assertTrue("instance is <%= class_name %>", instance is <%= class_name %>);
25 | }
26 |
27 | public function testIsModuleContextView():void {
28 | assertTrue("instance is ModuleContextView", instance is ModuleContextView);
29 | }
30 |
31 | public function testFailure():void {
32 | assertTrue("Failing test", false);
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlmodule/templates/TestSuite.as:
--------------------------------------------------------------------------------
1 | package {
2 | /**
3 | * This file has been automatically created using
4 | * #!/usr/bin/ruby script/generate suite
5 | * If you modify it and run this script, your
6 | * modifications will be lost!
7 | */
8 |
9 | import asunit.framework.TestSuite;<% test_case_classes.each do |test_case| %>
10 | import <%= test_case %>;<% end %>
11 |
12 | public class AllTests extends TestSuite {
13 |
14 | public function AllTests() {<% test_case_classes.each do |test_case| %>
15 | addTest(new <%= test_case %>());<% end %>
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlservice/rlservice_generator.rb:
--------------------------------------------------------------------------------
1 |
2 | class RlserviceGenerator < Sprout::Generator::NamedBase # :nodoc:
3 |
4 | def manifest
5 | record do |m|
6 | # m.class_collisions class_dir, "#{class_name}Controller", "#{class_name}ControllerTest", "#{class_name}Helper"
7 |
8 | if(!user_requested_test)
9 | m.directory full_class_dir
10 | m.template 'RLService.as', full_class_path
11 | end
12 |
13 | m.directory full_test_dir
14 | m.template 'TestCase.as', full_test_case_path
15 |
16 | m.template 'TestSuite.as', File.join(test_dir, 'AllTests.as'), :collision => :force
17 | end
18 | end
19 |
20 | end
21 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlservice/templates/Component.mxml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlservice/templates/RLService.as:
--------------------------------------------------------------------------------
1 | package <%= package_name %> {
2 |
3 | import org.robotlegs.mvcs.Actor;
4 |
5 | public class <%= class_name %> extends Actor{
6 |
7 | /* INHERITED INJECTIONS:
8 | [Inject(name='mvcsEventDispatcher')]
9 | public var eventDispatcher:IEventDispatcher;
10 |
11 | [Inject(name='mvcsEventMap')]
12 | public var eventMap:IEventMap;
13 | */
14 |
15 | //--------------------------------------------------------------------------
16 | //
17 | // Initialization
18 | //
19 | //--------------------------------------------------------------------------
20 | /**
21 | * No comment.
22 | *
23 | */
24 | public function <%= class_name %>()
25 | {
26 | super();
27 | }
28 |
29 | //--------------------------------------------------------------------------
30 | //
31 | // API
32 | //
33 | //--------------------------------------------------------------------------
34 |
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlservice/templates/TestCase.as:
--------------------------------------------------------------------------------
1 | package <%= package_name %> {
2 |
3 | import asunit.framework.TestCase;
4 |
5 | import org.robotlegs.mvcs.Actor;
6 |
7 | public class <%= test_case_name %> extends TestCase {
8 | protected var <%= instance_name %>:<%= class_name %>;
9 |
10 | public function <%= test_case_name %>(methodName:String=null) {
11 | super(methodName)
12 | }
13 |
14 | override protected function setUp():void {
15 | super.setUp();
16 | <%= instance_name %> = new <%= class_name %>();
17 | }
18 |
19 | override protected function tearDown():void {
20 | super.tearDown();
21 | <%= instance_name %> = null;
22 | }
23 |
24 | public function testInstantiated():void {
25 | assertTrue("<%= instance_name %> is <%= class_name %>", <%= instance_name %> is <%= class_name %>);
26 | }
27 |
28 | public function testIsService():void{
29 | assertTrue("<%= instance_name %> is robotlegs Actor", <%= instance_name %> is Actor);
30 | }
31 |
32 | public function testFailure():void {
33 | assertTrue("Failing test", false);
34 | }
35 |
36 | }
37 | }
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlservice/templates/TestSuite.as:
--------------------------------------------------------------------------------
1 | package {
2 | /**
3 | * This file has been automatically created using
4 | * #!/usr/bin/ruby script/generate suite
5 | * If you modify it and run this script, your
6 | * modifications will be lost!
7 | */
8 |
9 | import asunit.framework.TestSuite;<% test_case_classes.each do |test_case| %>
10 | import <%= test_case %>;<% end %>
11 |
12 | public class AllTests extends TestSuite {
13 |
14 | public function AllTests() {<% test_case_classes.each do |test_case| %>
15 | addTest(new <%= test_case %>());<% end %>
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlview_with_mediator/rlview_with_mediator_generator.rb:
--------------------------------------------------------------------------------
1 |
2 | class RlviewWithMediatorGenerator < Sprout::Generator::NamedBase # :nodoc:
3 |
4 | def manifest
5 | record do |m|
6 | # m.class_collisions class_dir, "#{class_name}Controller", "#{class_name}ControllerTest", "#{class_name}Helper"
7 |
8 | if(!user_requested_test)
9 | m.directory full_class_dir
10 | m.template 'RLView.as', full_class_path
11 | m.template 'RLMediator.as', full_class_dir + '/' + class_name + 'Mediator.as'
12 | end
13 |
14 | m.directory full_test_dir
15 | m.template 'ViewTestCase.as', full_test_case_path
16 | m.template 'MediatorTestCase.as', full_test_dir + '/' + class_name + 'MediatorTest.as'
17 |
18 | m.template 'TestSuite.as', File.join(test_dir, 'AllTests.as'), :collision => :force
19 | end
20 | end
21 |
22 | end
23 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlview_with_mediator/templates/Component.mxml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlview_with_mediator/templates/RLMediator.as:
--------------------------------------------------------------------------------
1 | package <%= package_name %>
2 | {
3 | import org.robotlegs.mvcs.Mediator;
4 |
5 | public class <%= class_name %>Mediator extends Mediator
6 | {
7 | // declare the view to be injected
8 | [Inject]
9 | public var view:<%= class_name %>;
10 |
11 | public function <%= class_name %>Mediator() {
12 | // Try not to put stuff in the constructor of the mediator
13 | }
14 |
15 | /**
16 | * Initialize the view and register for events.
17 | *
18 | */
19 | override public function onRegister():void
20 | {
21 |
22 | }
23 |
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlview_with_mediator/templates/RLView.as:
--------------------------------------------------------------------------------
1 | package <%= package_name %>
2 | {
3 | import flash.display.Sprite;
4 |
5 | public class <%= class_name %> extends Sprite
6 | {
7 |
8 | public function <%= class_name %>()
9 | {
10 |
11 | }
12 |
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlview_with_mediator/templates/TestSuite.as:
--------------------------------------------------------------------------------
1 | package {
2 | /**
3 | * This file has been automatically created using
4 | * #!/usr/bin/ruby script/generate suite
5 | * If you modify it and run this script, your
6 | * modifications will be lost!
7 | */
8 |
9 | import asunit.framework.TestSuite;<% test_case_classes.each do |test_case| %>
10 | import <%= test_case %>;<% end %>
11 |
12 | public class AllTests extends TestSuite {
13 |
14 | public function AllTests() {<% test_case_classes.each do |test_case| %>
15 | addTest(new <%= test_case %>());<% end %>
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlview_with_mediator/templates/ViewTestCase.as:
--------------------------------------------------------------------------------
1 | package <%= package_name %> {
2 |
3 | import asunit.framework.TestCase;
4 |
5 | import flash.display.Sprite;
6 |
7 | public class <%= test_case_name %> extends TestCase {
8 | protected var <%= instance_name %>:<%= class_name %>;
9 |
10 | public function <%= test_case_name %>(methodName:String=null) {
11 | super(methodName)
12 | }
13 |
14 | override protected function setUp():void {
15 | super.setUp();
16 | <%= instance_name %> = new <%= class_name %>();
17 | }
18 |
19 | override protected function tearDown():void {
20 | super.tearDown();
21 | <%= instance_name %> = null;
22 | }
23 |
24 | public function testInstantiated():void {
25 | assertTrue("<%= instance_name %> is <%= class_name %>", <%= instance_name %> is <%= class_name %>);
26 | }
27 |
28 | public function testIsSprite():void{
29 | assertTrue("<%= instance_name %> is Sprite", <%= instance_name %> is Sprite);
30 | }
31 |
32 | public function testFailure():void {
33 | assertTrue("Failing test", false);
34 | }
35 |
36 | }
37 | }
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlview_with_signals/rlview_with_signals_generator.rb:
--------------------------------------------------------------------------------
1 |
2 | class RlviewWithSignalsGenerator < Sprout::Generator::NamedBase # :nodoc:
3 |
4 | def manifest
5 | record do |m|
6 | # m.class_collisions class_dir, "#{class_name}Controller", "#{class_name}ControllerTest", "#{class_name}Helper"
7 |
8 | if(!user_requested_test)
9 | m.directory full_class_dir
10 | m.template 'RLView.as', full_class_path
11 | end
12 |
13 | m.directory full_test_dir
14 | m.template 'ViewTestCase.as', full_test_case_path
15 | m.template 'TestSuite.as', File.join(test_dir, 'AllTests.as'), :collision => :force
16 | end
17 | end
18 |
19 | end
20 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlview_with_signals/templates/Component.mxml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlview_with_signals/templates/RLView.as:
--------------------------------------------------------------------------------
1 | package <%= package_name %> {
2 |
3 | import flash.display.Sprite;
4 |
5 | import org.osflash.signals.Signal;
6 |
7 | public class <%= class_name %> extends Sprite {
8 |
9 |
10 | protected var var _signal:Signal;
11 |
12 | //--------------------------------------------------------------------------
13 | //
14 | // Initialization
15 | //
16 | //--------------------------------------------------------------------------
17 | /**
18 | * Event handling takes place via the mediator: <%= class_name %>Mediator
19 | *
20 | */
21 |
22 | public function <%= class_name %>() {
23 | initSignals();
24 | }
25 |
26 |
27 |
28 |
29 | protected function initSignals():void
30 | {
31 | _signal = new Signal();
32 | }
33 |
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/rlview_with_signals/templates/TestSuite.as:
--------------------------------------------------------------------------------
1 | package {
2 | /**
3 | * This file has been automatically created using
4 | * #!/usr/bin/ruby script/generate suite
5 | * If you modify it and run this script, your
6 | * modifications will be lost!
7 | */
8 |
9 | import asunit.framework.TestSuite;<% test_case_classes.each do |test_case| %>
10 | import <%= test_case %>;<% end %>
11 |
12 | public class AllTests extends TestSuite {
13 |
14 | public function AllTests() {<% test_case_classes.each do |test_case| %>
15 | addTest(new <%= test_case %>());<% end %>
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/roboteyes_test/roboteyes_test_generator.rb:
--------------------------------------------------------------------------------
1 |
2 | class RoboteyesTestGenerator < Sprout::Generator::NamedBase # :nodoc:
3 |
4 | def manifest
5 | record do |m|
6 | # m.class_collisions class_dir, "#{class_name}Controller", "#{class_name}ControllerTest", "#{class_name}Helper"
7 |
8 | m.directory model.endtoend_test_dir
9 | m.template 'TestCase.as', model.endtoend_test_dir + '/' + class_name + 'EndToEndTest.as'
10 |
11 | m.template 'TestSuite.as', File.join(test_dir, 'AllTests.as'), :collision => :force
12 | end
13 | end
14 |
15 | end
16 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/roboteyes_test/templates/Component.mxml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/roboteyes_test/templates/TestSuite.as:
--------------------------------------------------------------------------------
1 | package {
2 | /**
3 | * This file has been automatically created using
4 | * #!/usr/bin/ruby script/generate suite
5 | * If you modify it and run this script, your
6 | * modifications will be lost!
7 | */
8 |
9 | import asunit.framework.TestSuite;<% test_case_classes.each do |test_case| %>
10 | import <%= test_case %>;<% end %>
11 |
12 | public class AllTests extends TestSuite {
13 |
14 | public function AllTests() {<% test_case_classes.each do |test_case| %>
15 | addTest(new <%= test_case %>());<% end %>
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/signal/signal_generator.rb:
--------------------------------------------------------------------------------
1 |
2 | class SignalGenerator < Sprout::Generator::NamedBase # :nodoc:
3 |
4 | def manifest
5 | record do |m|
6 | # m.class_collisions class_dir, "#{class_name}Controller", "#{class_name}ControllerTest", "#{class_name}Helper"
7 |
8 | if(!user_requested_test)
9 | m.directory full_class_dir
10 | m.template 'Signal.as', full_class_path
11 | end
12 |
13 | m.directory full_test_dir
14 | m.template 'TestCase.as', full_test_case_path
15 |
16 | m.template 'TestSuite.as', File.join(test_dir, 'AllTests.as'), :collision => :force
17 | end
18 | end
19 |
20 | end
21 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/signal/templates/Component.mxml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/signal/templates/Signal.as:
--------------------------------------------------------------------------------
1 | package <%= package_name %> {
2 |
3 | import org.osflash.signals.Signal;
4 |
5 | public class <%= class_name %> extends Signal {
6 |
7 | public function <%= class_name %>() {
8 | super();
9 | }
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/signal/templates/TestSuite.as:
--------------------------------------------------------------------------------
1 | package {
2 | /**
3 | * This file has been automatically created using
4 | * #!/usr/bin/ruby script/generate suite
5 | * If you modify it and run this script, your
6 | * modifications will be lost!
7 | */
8 |
9 | import asunit.framework.TestSuite;<% test_case_classes.each do |test_case| %>
10 | import <%= test_case %>;<% end %>
11 |
12 | public class AllTests extends TestSuite {
13 |
14 | public function AllTests() {<% test_case_classes.each do |test_case| %>
15 | addTest(new <%= test_case %>());<% end %>
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/support/support_generator.rb:
--------------------------------------------------------------------------------
1 |
2 | class SupportGenerator < Sprout::Generator::NamedBase # :nodoc:
3 |
4 | # Support class name - auto generated to className + Support if not specified
5 | attr_reader :support_class_name
6 |
7 | def manifest
8 | record do |m|
9 |
10 | if(ARGV.size == 2)
11 | @support_class_name = class_name + ARGV[1]
12 | else
13 | @support_class_name = class_name + 'Support'
14 | end
15 |
16 | full_support_dir = full_class_dir.gsub(src_dir, model.support_dir)
17 | m.directory full_support_dir
18 | m.template 'Support.as', full_support_dir + '/' + support_class_name + '.as'
19 |
20 | end
21 | end
22 |
23 |
24 | end
25 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/support/templates/Component.mxml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/mosaictool/script/generators/support/templates/Support.as:
--------------------------------------------------------------------------------
1 | package <%= package_name %> {
2 |
3 | import <%= package_name %>.<%= class_name %>;
4 |
5 | public class <%= support_class_name %> extends <%= class_name %> {
6 |
7 | // Testable constants
8 | //public static const MY_CONST:String = 'myConstant';
9 |
10 | //--------------------------------------------------------------------------
11 | //
12 | // Initialization
13 | //
14 | //--------------------------------------------------------------------------
15 |
16 | public function <%= support_class_name %>() {
17 | // pass constants to the super constructor for properties
18 | super();
19 | }
20 |
21 | //--------------------------------------------------------------------------
22 | //
23 | // Overridden API
24 | //
25 | //--------------------------------------------------------------------------
26 |
27 |
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/bootstraps/BootstrapClasses.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.bootstraps
2 | {
3 | import mosaic.model.DesignToColorsTranslator;
4 | import mosaic.model.IDesignToColorsTranslator;
5 |
6 | import org.robotlegs.core.IInjector;
7 |
8 | public class BootstrapClasses extends Object
9 | {
10 | public function BootstrapClasses(injector:IInjector)
11 | {
12 | injector.mapClass(IDesignToColorsTranslator, DesignToColorsTranslator);
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/bootstraps/BootstrapConfigValues.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.bootstraps
2 | {
3 | import mosaic.model.values.ConfigName;
4 | import mosaic.model.values.DefaultDesignName;
5 | import mosaic.model.values.DefaultGridSize;
6 | import mosaic.model.values.DefaultTileColor;
7 | import mosaic.model.values.DefaultWorkspaceColor;
8 |
9 | import org.robotlegs.core.IInjector;
10 |
11 | public class BootstrapConfigValues
12 | {
13 | public function BootstrapConfigValues(injector:IInjector)
14 | {
15 | injector.mapValue(ConfigName, new ConfigName("MosaicDesignerConfig"));
16 | injector.mapValue(DefaultDesignName, new DefaultDesignName("Practice Design"));
17 | injector.mapValue(DefaultGridSize, new DefaultGridSize(15, 20));
18 | injector.mapValue(DefaultTileColor, new DefaultTileColor(0x333333));
19 | injector.mapValue(DefaultWorkspaceColor, new DefaultWorkspaceColor(0x000000));
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/bootstraps/BootstrapModels.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.bootstraps
2 | {
3 | import mosaic.model.ConfigModel;
4 | import mosaic.model.IConfigModel;
5 | import mosaic.model.IMosaicDesignModel;
6 | import mosaic.model.IMosaicSpecModel;
7 | import mosaic.model.ITileSuppliesModel;
8 | import mosaic.model.MosaicDesignModel;
9 | import mosaic.model.MosaicSpecModel;
10 | import mosaic.model.TileSuppliesModel;
11 | import mosaic.model.utils.AutoIncrementor;
12 | import mosaic.model.utils.IAutoIncrementor;
13 |
14 | import org.robotlegs.core.IInjector;
15 |
16 | public class BootstrapModels
17 | {
18 | public function BootstrapModels(injector:IInjector)
19 | {
20 | injector.mapSingletonOf(IConfigModel, ConfigModel);
21 | injector.mapSingletonOf(IMosaicDesignModel, MosaicDesignModel);
22 | injector.mapSingletonOf(ITileSuppliesModel, TileSuppliesModel);
23 | injector.mapSingletonOf(IMosaicSpecModel, MosaicSpecModel);
24 | injector.mapSingletonOf(IAutoIncrementor, AutoIncrementor);
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/commands/AddTileSupplyCommand.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.commands
2 | {
3 | import mosaic.controller.events.TileSupplyEvent;
4 | import mosaic.model.ITileSuppliesModel;
5 | import mosaic.model.utils.IAutoIncrementor;
6 |
7 | import org.robotlegs.mvcs.Command;
8 |
9 | public class AddTileSupplyCommand extends Command
10 | {
11 | [Inject]
12 | public var tileSupplyEvent:TileSupplyEvent;
13 |
14 | [Inject]
15 | public var tileSuppliesModel:ITileSuppliesModel;
16 |
17 | [Inject]
18 | public var tileSupplyIndexAutoIncrementor:IAutoIncrementor;
19 |
20 | override public function execute():void
21 | {
22 | var id:uint = tileSupplyIndexAutoIncrementor.nextIndex;
23 | var color:uint = tileSupplyEvent.color;
24 |
25 | tileSuppliesModel.addSupply(id, color);
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/commands/ApplyConfigWorkspaceColorCommand.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.commands
2 | {
3 | import mosaic.controller.events.WorkspaceColorEvent;
4 | import mosaic.model.IConfigModel;
5 |
6 | import org.robotlegs.mvcs.Command;
7 |
8 | public class ApplyConfigWorkspaceColorCommand extends Command
9 | {
10 |
11 | [Inject]
12 | public var configModel:IConfigModel;
13 |
14 | override public function execute():void
15 | {
16 | var workspaceColor:uint = configModel.workspaceColor;
17 | dispatch(new WorkspaceColorEvent(WorkspaceColorEvent.COLOR_LOADED, workspaceColor));
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/commands/ChangeDefaultTileColorCommand.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.commands
2 | {
3 | import mosaic.controller.events.TileColorChangeEvent;
4 | import mosaic.model.IMosaicSpecModel;
5 |
6 | import org.robotlegs.mvcs.Command;
7 |
8 | public class ChangeDefaultTileColorCommand extends Command
9 | {
10 | [Inject]
11 | public var specModel:IMosaicSpecModel;
12 |
13 | [Inject]
14 | public var defaultColorChangeEvent:TileColorChangeEvent;
15 |
16 | override public function execute():void
17 | {
18 | specModel.defaultTileColor = defaultColorChangeEvent.color;
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/commands/ChangeGroutColorCommand.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.commands
2 | {
3 | import mosaic.controller.events.GroutEvent;
4 | import mosaic.model.IMosaicSpecModel;
5 |
6 | import org.robotlegs.mvcs.Command;
7 |
8 | public class ChangeGroutColorCommand extends Command
9 | {
10 | [Inject]
11 | public var groutEvent:GroutEvent;
12 |
13 | [Inject]
14 | public var mosaicSpecModel:IMosaicSpecModel;
15 |
16 | override public function execute():void
17 | {
18 | mosaicSpecModel.groutColor = groutEvent.color;
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/commands/ChangeTileSupplyColorCommand.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.commands
2 | {
3 | import mosaic.controller.events.TileSupplyEvent;
4 | import mosaic.model.ITileSuppliesModel;
5 |
6 | import org.robotlegs.mvcs.Command;
7 |
8 | public class ChangeTileSupplyColorCommand extends Command
9 | {
10 | [Inject]
11 | public var tileSupplyEvent:TileSupplyEvent;
12 |
13 | [Inject]
14 | public var tileSuppliesModel:ITileSuppliesModel;
15 |
16 | override public function execute():void
17 | {
18 | var id:uint = tileSupplyEvent.id;
19 | var color:uint = tileSupplyEvent.color;
20 |
21 | tileSuppliesModel.changeSupplyColor(id, color);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/commands/ChangeWorkspaceColorCommand.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.commands
2 | {
3 |
4 | import mosaic.controller.events.WorkspaceColorEvent;
5 | import mosaic.model.IConfigModel;
6 |
7 | import org.robotlegs.mvcs.Command;
8 |
9 | public class ChangeWorkspaceColorCommand extends Command
10 | {
11 | [Inject]
12 | public var configModel:IConfigModel;
13 |
14 | [Inject]
15 | public var workspaceColorEvent:WorkspaceColorEvent;
16 |
17 | override public function execute():void
18 | {
19 | configModel.workspaceColor = workspaceColorEvent.color;
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/commands/CombineTileSupplyCommand.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.commands
2 | {
3 | import mosaic.controller.events.TileSuppliesCombinedEvent;
4 | import mosaic.model.IMosaicDesignModel;
5 | import mosaic.model.ITileSuppliesModel;
6 |
7 | import org.robotlegs.mvcs.Command;
8 |
9 | public class CombineTileSupplyCommand extends Command
10 | {
11 | [Inject]
12 | public var tileSuppliesCombinedEvent:TileSuppliesCombinedEvent;
13 |
14 | [Inject]
15 | public var tileSuppliesModel:ITileSuppliesModel;
16 |
17 | [Inject]
18 | public var designModel:IMosaicDesignModel;
19 |
20 | override public function execute():void
21 | {
22 | var idWas:uint = tileSuppliesCombinedEvent.deleteID;
23 | var idNow:uint = tileSuppliesCombinedEvent.combineWithID;
24 |
25 | tileSuppliesModel.combineSupplies(idWas, idNow);
26 | designModel.switchTileColors(idWas, idNow);
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/commands/CreateDesignColorsCommand.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.commands
2 | {
3 | import mosaic.controller.events.DesignEvent;
4 | import mosaic.controller.events.GroutEvent;
5 | import mosaic.controller.events.TileColorChangeEvent;
6 |
7 | public class CreateDesignColorsCommand extends RefreshDesignColorsCommand
8 | {
9 |
10 | override protected function dispatchDesign(design:Vector.>):void
11 | {
12 | var evt:DesignEvent = new DesignEvent(DesignEvent.DESIGN_COLORS_LOADED, design);
13 | dispatch(evt);
14 |
15 | var groutEvent:GroutEvent = new GroutEvent(GroutEvent.COLOR_LOADED, specModel.groutColor);
16 | dispatch(groutEvent);
17 |
18 | var defaultTileColorEvent:TileColorChangeEvent = new TileColorChangeEvent(TileColorChangeEvent.DEFAULT_LOADED,
19 | 0, 0, specModel.defaultTileColor);
20 | dispatch(defaultTileColorEvent);
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/commands/LoadConfigCommand.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.commands
2 | {
3 | import mosaic.model.values.ConfigName;
4 | import mosaic.services.config.IMosaicConfigLoadingService;
5 |
6 | import org.robotlegs.mvcs.Command;
7 |
8 | public class LoadConfigCommand extends Command
9 | {
10 | [Inject]
11 | public var configName:ConfigName;
12 |
13 | [Inject]
14 | public var configLoadingService:IMosaicConfigLoadingService;
15 |
16 | override public function execute():void
17 | {
18 | configLoadingService.loadConfig(configName.toString());
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/commands/LoadDesignCommand.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.commands
2 | {
3 | import mosaic.controller.events.DesignLoadEvent;
4 | import mosaic.services.design.IDesignLoadingService;
5 |
6 | import org.robotlegs.mvcs.Command;
7 |
8 | public class LoadDesignCommand extends Command
9 | {
10 | [Inject]
11 | public var designLoadingService:IDesignLoadingService;
12 |
13 | [Inject]
14 | public var designLoadEvent:DesignLoadEvent;
15 |
16 | override public function execute():void
17 | {
18 | var designName:String = designLoadEvent.designName;
19 | designLoadingService.loadDesign(designName);
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/commands/RemoveTileSupplyCommand.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.commands
2 | {
3 | import mosaic.controller.events.TileSupplyEvent;
4 | import mosaic.model.ITileSuppliesModel;
5 |
6 | import org.robotlegs.mvcs.Command;
7 |
8 | public class RemoveTileSupplyCommand extends Command
9 | {
10 | [Inject]
11 | public var tileSupplyEvent:TileSupplyEvent;
12 |
13 | [Inject]
14 | public var tileSuppliesModel:ITileSuppliesModel
15 |
16 | override public function execute():void
17 | {
18 | tileSuppliesModel.removeSupply(tileSupplyEvent.id);
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/commands/RequestLoadFirstDesignCommand.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.commands
2 | {
3 | import mosaic.controller.events.DesignLoadEvent;
4 | import mosaic.model.IConfigModel;
5 |
6 | import org.robotlegs.mvcs.Command;
7 |
8 | public class RequestLoadFirstDesignCommand extends Command
9 | {
10 | [Inject]
11 | public var configModel:IConfigModel;
12 |
13 | override public function execute():void
14 | {
15 | dispatch(new DesignLoadEvent(DesignLoadEvent.LOAD_REQUESTED, configModel.currentDesign));
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/commands/RestoreGridStatusCommand.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.commands
2 | {
3 |
4 | import mosaic.controller.events.GroutEvent;
5 | import mosaic.controller.events.TileSupplyEvent;
6 | import mosaic.model.TileSupplyVO;
7 |
8 | public class RestoreGridStatusCommand extends RefreshDesignColorsCommand
9 | {
10 | override protected function dispatchDesign(design:Vector.>):void
11 | {
12 | super.dispatchDesign(design);
13 |
14 | var groutEvent:GroutEvent = new GroutEvent(GroutEvent.COLOR_LOADED, specModel.groutColor);
15 | dispatch(groutEvent);
16 |
17 | if (tileSupplies.supplyList.length > 0)
18 | {
19 | var tileSupply:TileSupplyVO = tileSupplies.supplyList[0];
20 |
21 | var selectedTileEvent:TileSupplyEvent = new TileSupplyEvent(TileSupplyEvent.SELECTED_SUPPLY_COLOR_CHANGED, tileSupply.id, tileSupply.color, 0);
22 | dispatch(selectedTileEvent);
23 | }
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/commands/SaveConfigCommand.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.commands
2 | {
3 |
4 | import mosaic.model.values.ConfigName;
5 | import mosaic.services.config.IMosaicConfigSavingService;
6 |
7 | import org.robotlegs.mvcs.Command;
8 |
9 | public class SaveConfigCommand extends Command
10 | {
11 | [Inject]
12 | public var configSavingService:IMosaicConfigSavingService;
13 |
14 | [Inject]
15 | public var configName:ConfigName;
16 |
17 | override public function execute():void
18 | {
19 | configSavingService.saveConfig(configName.toString());
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/commands/SaveDesignCommand.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.commands
2 | {
3 | import mosaic.model.IConfigModel;
4 | import mosaic.services.design.IDesignSavingService;
5 |
6 | import org.robotlegs.mvcs.Command;
7 |
8 | public class SaveDesignCommand extends Command
9 | {
10 | [Inject]
11 | public var designSavingService:IDesignSavingService;
12 |
13 | [Inject]
14 | public var configModel:IConfigModel
15 |
16 | override public function execute():void
17 | {
18 | designSavingService.saveDesign(configModel.currentDesign);
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/commands/SelectTileSupplyCommand.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.commands
2 | {
3 | import mosaic.controller.events.TileSupplyEvent;
4 | import mosaic.model.ITileSuppliesModel;
5 |
6 | import org.robotlegs.mvcs.Command;
7 |
8 | public class SelectTileSupplyCommand extends Command
9 | {
10 | [Inject]
11 | public var tileSuppliesModel:ITileSuppliesModel;
12 |
13 | [Inject]
14 | public var tileSupplyEvent:TileSupplyEvent;
15 |
16 | override public function execute():void
17 | {
18 | tileSuppliesModel.selectedSupplyID = tileSupplyEvent.id;
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/commands/UpdateCurrentDesignOnConfigCommand.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.commands
2 | {
3 |
4 | import mosaic.controller.events.NamedDesignEvent;
5 | import mosaic.model.IConfigModel;
6 |
7 | import org.robotlegs.mvcs.Command;
8 |
9 | public class UpdateCurrentDesignOnConfigCommand extends Command
10 | {
11 | [Inject]
12 | public var namedDesignEvent:NamedDesignEvent;
13 |
14 | [Inject]
15 | public var configModel:IConfigModel;
16 |
17 | override public function execute():void
18 | {
19 | configModel.currentDesign = namedDesignEvent.designName;
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/commands/UpdateDesignCommand.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.commands
2 | {
3 |
4 | import mosaic.controller.events.TileColorChangeEvent;
5 | import mosaic.model.IMosaicDesignModel;
6 | import mosaic.model.ITileSuppliesModel;
7 |
8 | import org.robotlegs.mvcs.Command;
9 |
10 | public class UpdateDesignCommand extends Command
11 | {
12 | [Inject]
13 | public var designModel:IMosaicDesignModel;
14 |
15 | [Inject]
16 | public var tileSuppliesModel:ITileSuppliesModel;
17 |
18 | [Inject]
19 | public var tileColorChangeEvent:TileColorChangeEvent;
20 |
21 |
22 | override public function execute():void
23 | {
24 | var row:uint = tileColorChangeEvent.row;
25 | var column:uint = tileColorChangeEvent.column;
26 |
27 | var idNow:uint = tileSuppliesModel.selectedSupplyID;
28 |
29 | var idWas:uint = designModel.changeTileColorAt(row, column, idNow);
30 |
31 | if (idNow != idWas)
32 | {
33 | tileSuppliesModel.switchTiles(idWas, idNow);
34 | }
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/events/ConfigChangedEvent.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.events
2 | {
3 | import flash.events.Event;
4 |
5 | public class ConfigChangedEvent extends Event
6 | {
7 |
8 | public static const CHANGED:String = "ConfigChangedEvent.changed";
9 |
10 | public function ConfigChangedEvent(type:String)
11 | {
12 | super(type);
13 | }
14 |
15 | override public function clone():Event
16 | {
17 | return new ConfigChangedEvent(type);
18 | }
19 |
20 | }
21 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/events/CreateMosaicEvent.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.events
2 | {
3 |
4 | import flash.events.Event;
5 |
6 | public class CreateMosaicEvent extends Event
7 | {
8 |
9 | public static const NEW_MOSAIC_REQUESTED:String = "CreateMosaicEvent.newMosaicRequested"
10 |
11 | public function CreateMosaicEvent(type:String)
12 | {
13 | super(type);
14 | }
15 |
16 | override public function clone():Event
17 | {
18 | return new CreateMosaicEvent(type);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/events/DesignCreationEvent.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.events
2 | {
3 | import flash.events.Event;
4 |
5 | public class DesignCreationEvent extends NamedDesignEvent
6 | {
7 | public static const DESIGN_CREATED:String = 'DesignCreationEvent.designCreated';
8 |
9 | protected var _rows:uint;
10 | protected var _columns:uint;
11 |
12 | public function DesignCreationEvent(type:String, rows:uint, columns:uint, designName:String)
13 | {
14 | _rows = rows;
15 | _columns = columns;
16 | super(type, designName);
17 | }
18 |
19 | public function get rows():uint
20 | {
21 | return _rows;
22 | }
23 |
24 | public function get columns():uint
25 | {
26 | return _columns;
27 | }
28 |
29 | override public function clone():Event
30 | {
31 | return new DesignCreationEvent(type, _rows, _columns, _designName);
32 | }
33 |
34 | }
35 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/events/DesignEvent.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.events
2 | {
3 |
4 | import flash.events.Event;
5 |
6 | public class DesignEvent extends Event
7 | {
8 |
9 | public static const DESIGN_COLORS_CHANGED:String = "DesignEvent.designColorsChanged";
10 | public static const DESIGN_MODEL_CHANGED:String = "DesignEvent.designModelChanged";
11 | public static const DESIGN_COLORS_LOADED:String = "DesignEvent.designColorsLoaded";
12 |
13 | /**
14 | * @constructor
15 | */
16 | public function DesignEvent(type:String, colors:Vector.>)
17 | {
18 | _colors = colors;
19 | super(type);
20 | }
21 |
22 | protected var _colors:Vector.>;
23 |
24 | public function get colors():Vector.>
25 | {
26 | return _colors;
27 | }
28 |
29 | override public function clone():Event
30 | {
31 | return new DesignEvent(type, _colors);
32 | }
33 |
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/events/DesignListEvent.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.events
2 | {
3 | import flash.events.Event;
4 |
5 | public class DesignListEvent extends Event
6 | {
7 | public static const CHANGED:String = "DesignListEvent.changed";
8 |
9 | public function DesignListEvent(type:String, designList:Vector.)
10 | {
11 | _designList = designList;
12 | super(type);
13 | }
14 |
15 | protected var _designList:Vector.;
16 |
17 | public function get designList():Vector.
18 | {
19 | return _designList;
20 | }
21 |
22 | override public function clone():Event
23 | {
24 | return new DesignListEvent(type, _designList);
25 | }
26 |
27 | }
28 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/events/DesignLoadEvent.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.events
2 | {
3 | import flash.events.Event;
4 |
5 | public class DesignLoadEvent extends NamedDesignEvent
6 | {
7 | public static const LOAD_REQUESTED:String = "DesignLoadEvent.saveRequested";
8 | public static const LOAD_COMPLETED:String = "DesignLoadEvent.saveCompleted";
9 | public static const LOAD_FAILED:String = "DesignLoadEvent.saveFailed";
10 |
11 |
12 | public function DesignLoadEvent(type:String, designName:String)
13 | {
14 | super(type, designName);
15 | }
16 |
17 | override public function clone():Event
18 | {
19 | return new DesignLoadEvent(type, _designName);
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/events/DesignSaveEvent.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.events
2 | {
3 | import flash.events.Event;
4 |
5 | public class DesignSaveEvent extends NamedDesignEvent
6 | {
7 | public static const SAVE_REQUESTED:String = "DesignSaveEvent.saveRequested";
8 | public static const SAVE_AS_REQUESTED:String = "DesignSaveEvent.saveAsRequested";
9 | public static const SAVE_COMPLETED:String = "DesignSaveEvent.saveCompleted";
10 | public static const SAVE_FAILED:String = "DesignSaveEvent.saveFailed";
11 |
12 |
13 | public function DesignSaveEvent(type:String, designName:String)
14 | {
15 | super(type, designName);
16 | }
17 |
18 | override public function clone():Event
19 | {
20 | return new DesignSaveEvent(type, _designName);
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/events/GridReadyEvent.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.events
2 | {
3 | import flash.events.Event;
4 |
5 | public class GridReadyEvent extends Event
6 | {
7 |
8 | public static const READY:String = "GridReadyEvent.ready";
9 |
10 | public function GridReadyEvent(type:String)
11 | {
12 | super(type);
13 | }
14 |
15 | override public function clone():Event
16 | {
17 | return new GridReadyEvent(type);
18 | }
19 |
20 | }
21 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/events/GroutEvent.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.events
2 | {
3 |
4 | import flash.events.Event;
5 |
6 | import mosaic.view.ui.colorselectors.events.ColorChangeEvent;
7 |
8 | public class GroutEvent extends ColorChangeEvent
9 | {
10 |
11 | public static const COLOR_CHANGED:String = "GroutEvent.colorChanged";
12 | public static const COLOR_LOADED:String = "GroutEvent.colorLoaded";
13 |
14 | public function GroutEvent(type:String, color:uint)
15 | {
16 | super(type, color);
17 | }
18 |
19 | override public function clone():Event
20 | {
21 | return new GroutEvent(type, _color);
22 | }
23 |
24 | }
25 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/events/MosaicConfigServiceEvent.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.events
2 | {
3 |
4 | import flash.events.Event;
5 |
6 | public class MosaicConfigServiceEvent extends Event
7 | {
8 |
9 | public static const LOAD_REQUESTED:String = "MosaicConfigServiceEvent.loadRequested";
10 | public static const LOAD_COMPLETED:String = "MosaicConfigServiceEvent.loadCompleted";
11 | public static const LOAD_FAILED:String = "MosaicConfigServiceEvent.loadFailed";
12 | public static const CONFIG_CREATED:String = "MosaicConfigServiceEvent.configCreated";
13 | public static const CONFIG_NOT_FOUND:String = "MosaicConfigServiceEvent.configNotFound";
14 | public static const SAVE_COMPLETED:String = "MosaicConfigServiceEvent.saveCompleted";
15 |
16 | /**
17 | * @constructor
18 | */
19 | public function MosaicConfigServiceEvent(type:String)
20 | {
21 | super(type);
22 | }
23 |
24 | override public function clone():Event
25 | {
26 | return new MosaicConfigServiceEvent(type);
27 | }
28 |
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/events/NamedDesignEvent.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.events
2 | {
3 | import flash.events.Event;
4 |
5 | public class NamedDesignEvent extends Event
6 | {
7 |
8 | public function NamedDesignEvent(type:String, designName:String)
9 | {
10 | _designName = designName;
11 | super(type);
12 | }
13 |
14 | protected var _designName:String;
15 |
16 | public function get designName():String
17 | {
18 | return _designName;
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/events/TileSuppliesCombinedEvent.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.events
2 | {
3 |
4 | import flash.events.Event;
5 |
6 | public class TileSuppliesCombinedEvent extends Event
7 | {
8 |
9 | public static const SUPPLIES_COMBINED:String = "TileSuppliesCombinedEvent.suppliesCombined";
10 |
11 | /**
12 | * @constructor
13 | */
14 | public function TileSuppliesCombinedEvent(type:String, deleteID:uint, combineWithID:uint)
15 | {
16 | _deleteID = deleteID;
17 | _combineWithID = combineWithID;
18 | super(type);
19 | }
20 |
21 | protected var _deleteID:uint;
22 |
23 | public function get deleteID():uint
24 | {
25 | return _deleteID;
26 | }
27 |
28 | protected var _combineWithID:uint;
29 |
30 | public function get combineWithID():uint
31 | {
32 | return _combineWithID;
33 | }
34 |
35 | override public function clone():Event
36 | {
37 | return new TileSuppliesCombinedEvent(type, _deleteID, _combineWithID);
38 | }
39 |
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/events/TileSupplyListEvent.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.events
2 | {
3 |
4 | import flash.events.Event;
5 |
6 | import mosaic.model.TileSupplyVO;
7 |
8 | public class TileSupplyListEvent extends Event
9 | {
10 |
11 | public static const CHANGED:String = "TileSupplyListEvent.changed";
12 |
13 | protected var _supplyList:Vector.;
14 |
15 | public function TileSupplyListEvent(type:String, supplyList:Vector.)
16 | {
17 | _supplyList = supplyList;
18 | super(type);
19 | }
20 |
21 | public function get supplyList():Vector.
22 | {
23 | return _supplyList;
24 | }
25 |
26 | override public function clone():Event
27 | {
28 | return new TileSupplyListEvent(type, _supplyList);
29 | }
30 |
31 | }
32 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/controller/events/WorkspaceColorEvent.as:
--------------------------------------------------------------------------------
1 | package mosaic.controller.events
2 | {
3 |
4 | import flash.events.Event;
5 |
6 | import mosaic.view.ui.colorselectors.events.ColorChangeEvent;
7 |
8 | public class WorkspaceColorEvent extends ColorChangeEvent
9 | {
10 |
11 | public static const COLOR_CHANGED:String = "WorkspaceColorEvent.colorChanged";
12 | public static const COLOR_LOADED:String = "WorkspaceColorEvent.colorLoaded";
13 |
14 | public function WorkspaceColorEvent(type:String, color:uint)
15 | {
16 | super(type, color);
17 | }
18 |
19 | override public function clone():Event
20 | {
21 | return new WorkspaceColorEvent(type, _color);
22 | }
23 |
24 | }
25 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/EmptyDesignGrid.as:
--------------------------------------------------------------------------------
1 | package mosaic.model
2 | {
3 | public class EmptyDesignGrid
4 | {
5 |
6 | protected var _grid:Vector.>
7 |
8 | public function EmptyDesignGrid(rows:uint, columns:uint)
9 | {
10 | _grid = createGrid(rows, columns);
11 | }
12 |
13 | public function get grid():Vector.>
14 | {
15 | return _grid;
16 | }
17 |
18 | protected function createGrid(rows:uint, columns:uint):Vector.>
19 | {
20 | var vectorOfZeros:Vector.> = new Vector.>();
21 |
22 | var iLength:uint = rows;
23 | var jLength:uint = columns;
24 |
25 | for (var i:int = 0; i < iLength; i++)
26 | {
27 | vectorOfZeros[i] = new Vector.;
28 |
29 | for (var j:int = 0; j < jLength; j++)
30 | {
31 | vectorOfZeros[i][j] = 0;
32 | }
33 | }
34 |
35 | return vectorOfZeros;
36 | }
37 |
38 | }
39 |
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/IConfigModel.as:
--------------------------------------------------------------------------------
1 | package mosaic.model
2 | {
3 | import flash.events.IEventDispatcher;
4 |
5 | public interface IConfigModel
6 | {
7 |
8 | function get designNames():Vector.;
9 |
10 | function set designNames(names:Vector.):void;
11 |
12 | function get hasDesign():Boolean;
13 |
14 | function get currentDesign():String;
15 |
16 | function set currentDesign(designName:String):void;
17 |
18 | function get workspaceColor():uint;
19 |
20 | function set workspaceColor(color:uint):void;
21 |
22 | function get eventDispatcher():IEventDispatcher;
23 |
24 | function set eventDispatcher(value:IEventDispatcher):void;
25 | }
26 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/IDesignToColorsTranslator.as:
--------------------------------------------------------------------------------
1 | package mosaic.model
2 | {
3 | public interface IDesignToColorsTranslator
4 | {
5 | function processDesign(designGrid:Vector.>, tileSupplies:Vector., defaultColor:uint):Vector.>;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/IMosaicDesignModel.as:
--------------------------------------------------------------------------------
1 | package mosaic.model
2 | {
3 | import flash.events.IEventDispatcher;
4 |
5 | public interface IMosaicDesignModel
6 | {
7 | function loadDesign(designGrid:Vector.>):void;
8 |
9 | function getDesign():Vector.>;
10 |
11 | function changeTileColorAt(row:uint, column:uint, colorID:uint):uint;
12 |
13 | function switchTileColors(colorIDWas:uint, colorIDNow:uint):void;
14 |
15 | function get eventDispatcher():IEventDispatcher;
16 |
17 | function set eventDispatcher(value:IEventDispatcher):void;
18 | }
19 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/IMosaicSpecModel.as:
--------------------------------------------------------------------------------
1 | package mosaic.model
2 | {
3 | public interface IMosaicSpecModel
4 | {
5 | function get rows():uint;
6 |
7 | function set rows(value:uint):void;
8 |
9 | function get columns():uint;
10 |
11 | function set columns(value:uint):void;
12 |
13 | function get defaultTileColor():uint;
14 |
15 | function set defaultTileColor(value:uint):void;
16 |
17 | function get groutColor():uint;
18 |
19 | function set groutColor(value:uint):void;
20 | }
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/ITileSuppliesModel.as:
--------------------------------------------------------------------------------
1 | package mosaic.model
2 | {
3 | import flash.events.IEventDispatcher;
4 |
5 | public interface ITileSuppliesModel
6 | {
7 | function switchTiles(idWas:uint, idNow:uint):void;
8 |
9 | function addSupply(id:uint, color:uint):void;
10 |
11 | function changeSupplyColor(id:uint, color:uint):void;
12 |
13 | function removeSupply(id:uint):void;
14 |
15 | function combineSupplies(idWas:uint, idNow:uint):void;
16 |
17 | function get supplyList():Vector.;
18 |
19 | function set supplyList(value:Vector.):void;
20 |
21 | function get selectedSupplyID():uint;
22 |
23 | function set selectedSupplyID(value:uint):void;
24 |
25 | function get eventDispatcher():IEventDispatcher;
26 |
27 | function set eventDispatcher(value:IEventDispatcher):void;
28 | }
29 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/NullTileSupplyVO.as:
--------------------------------------------------------------------------------
1 | package mosaic.model
2 | {
3 |
4 | public class NullTileSupplyVO extends TileSupplyVO
5 | {
6 |
7 | public function NullTileSupplyVO()
8 | {
9 | super(0, 0x000000, 0);
10 | }
11 |
12 | }
13 |
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/TileSupplyVO.as:
--------------------------------------------------------------------------------
1 | package mosaic.model
2 | {
3 | import mosaic.model.utils.ID;
4 |
5 | public class TileSupplyVO implements ID
6 | {
7 | protected var _id:uint;
8 | protected var _color:uint;
9 | protected var _count:Number;
10 |
11 | public function TileSupplyVO(id:uint, color:uint, count:Number)
12 | {
13 | _id = id;
14 | _color = color;
15 | _count = count;
16 | }
17 |
18 | public function get id():uint
19 | {
20 | return _id;
21 | }
22 |
23 | public function get color():uint
24 | {
25 | return _color;
26 | }
27 |
28 | public function updateColor(value:uint):Boolean
29 | {
30 | if (value != _color)
31 | {
32 | _color = value;
33 | return true;
34 | }
35 |
36 | return false;
37 | }
38 |
39 | public function get count():Number
40 | {
41 | return _count;
42 | }
43 |
44 | public function set count(value:Number):void
45 | {
46 | _count = value;
47 | }
48 | }
49 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/utils/AutoIncrementor.as:
--------------------------------------------------------------------------------
1 | package mosaic.model.utils
2 | {
3 | public class AutoIncrementor implements IAutoIncrementor
4 | {
5 | protected var _index:uint;
6 |
7 | public function set currentIndex(value:uint):void
8 | {
9 | _index = value;
10 | }
11 |
12 | public function get nextIndex():uint
13 | {
14 | return ++_index;
15 | }
16 |
17 | public function indexUsed(value:uint):void
18 | {
19 | _index = Math.max(_index, value);
20 | }
21 |
22 | public function reset():void
23 | {
24 | _index = 0;
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/utils/FileNameFixer.as:
--------------------------------------------------------------------------------
1 | package mosaic.model.utils
2 | {
3 | public class FileNameFixer extends Object
4 | {
5 | protected var _rawText:String;
6 |
7 | public function FileNameFixer(rawText:String)
8 | {
9 | _rawText = rawText;
10 | }
11 |
12 | public function get fileName():String
13 | {
14 | return _rawText.replace(/[\s]/, "_");
15 | }
16 |
17 | public function get realName():String
18 | {
19 | return _rawText.replace(/[_]/, " ");
20 | }
21 |
22 | }
23 |
24 | }
25 |
26 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/utils/IAutoIncrementor.as:
--------------------------------------------------------------------------------
1 | package mosaic.model.utils
2 | {
3 | public interface IAutoIncrementor
4 | {
5 | function set currentIndex(value:uint):void;
6 |
7 | function get nextIndex():uint;
8 |
9 | function indexUsed(value:uint):void;
10 |
11 | function reset():void;
12 | }
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/utils/ID.as:
--------------------------------------------------------------------------------
1 | package mosaic.model.utils
2 | {
3 | public interface ID
4 | {
5 | function get id():uint;
6 | }
7 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/utils/IDIndexer.as:
--------------------------------------------------------------------------------
1 | package mosaic.model.utils
2 | {
3 | import flash.utils.Dictionary;
4 |
5 | public class IDIndexer
6 | {
7 | public function createIndex(itemList:Vector.):Dictionary
8 | {
9 | var indexByID:Dictionary = new Dictionary();
10 |
11 | var iLength:uint = itemList.length;
12 | for (var i:int = 0; i < iLength; i++)
13 | {
14 | var item:ID = itemList[i];
15 | indexByID[item.id] = item;
16 | }
17 |
18 | return indexByID;
19 | }
20 |
21 | }
22 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/values/ConfigName.as:
--------------------------------------------------------------------------------
1 | package mosaic.model.values
2 | {
3 | public class ConfigName extends StringVO
4 | {
5 | public function ConfigName(configName:String)
6 | {
7 | super(configName);
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/values/DefaultDesignName.as:
--------------------------------------------------------------------------------
1 | package mosaic.model.values
2 | {
3 | public class DefaultDesignName extends StringVO
4 | {
5 | public function DefaultDesignName(designName:String)
6 | {
7 | super(designName);
8 | }
9 | }
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/values/DefaultGridSize.as:
--------------------------------------------------------------------------------
1 | package mosaic.model.values
2 | {
3 | public class DefaultGridSize
4 | {
5 | protected var _rows:uint;
6 | protected var _columns:uint;
7 |
8 | public function DefaultGridSize(rows:uint, columns:uint)
9 | {
10 | _rows = rows;
11 | _columns = columns;
12 | }
13 |
14 | public function get rows():uint
15 | {
16 | return _rows;
17 | }
18 |
19 | public function get columns():uint
20 | {
21 | return _columns;
22 | }
23 | }
24 | }
25 |
26 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/values/DefaultTileColor.as:
--------------------------------------------------------------------------------
1 | package mosaic.model.values
2 | {
3 | public class DefaultTileColor extends uintVO
4 | {
5 | public function DefaultTileColor(color:uint)
6 | {
7 | super(color);
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/values/DefaultWorkspaceColor.as:
--------------------------------------------------------------------------------
1 | package mosaic.model.values
2 | {
3 | public class DefaultWorkspaceColor extends uintVO
4 | {
5 | public function DefaultWorkspaceColor(color:uint)
6 | {
7 | super(color);
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/values/StringVO.as:
--------------------------------------------------------------------------------
1 | package mosaic.model.values
2 | {
3 | public class StringVO
4 | {
5 | protected var _value:String;
6 |
7 | public function StringVO(text:String)
8 | {
9 | _value = text;
10 | }
11 |
12 | public function toString():String
13 | {
14 | return _value;
15 | }
16 | }
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/model/values/uintVO.as:
--------------------------------------------------------------------------------
1 | package mosaic.model.values
2 | {
3 | public class uintVO
4 | {
5 | protected var _value:uint;
6 |
7 | public function uintVO(value:uint)
8 | {
9 | _value = value;
10 | }
11 |
12 | public function get value():uint
13 | {
14 | return _value;
15 | }
16 | }
17 | }
18 |
19 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/services/BaseSolSavingService.as:
--------------------------------------------------------------------------------
1 | package mosaic.services
2 | {
3 | import flash.net.SharedObject;
4 |
5 | import mosaic.model.utils.FileNameFixer;
6 |
7 | import org.robotlegs.mvcs.Actor;
8 |
9 | public class BaseSolSavingService extends Actor
10 | {
11 | protected var _sol:SharedObject;
12 |
13 | protected function save(solName:String):void
14 | {
15 | getSol(solName);
16 | copyData();
17 | closeSol();
18 | dispatchCompleteEvent(solName);
19 | }
20 |
21 | protected function getSol(solName:String):void
22 | {
23 | var solFileName:String = new FileNameFixer(solName).fileName;
24 | _sol = SharedObject.getLocal(solFileName);
25 | }
26 |
27 | protected function copyData():void { }
28 |
29 | protected function closeSol():void
30 | {
31 | _sol.flush();
32 | _sol.close();
33 | }
34 |
35 | protected function dispatchCompleteEvent(solName:String):void { }
36 |
37 | }
38 |
39 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/services/config/IMosaicConfigLoadingService.as:
--------------------------------------------------------------------------------
1 | package mosaic.services.config
2 | {
3 | public interface IMosaicConfigLoadingService
4 | {
5 | function loadConfig(configName:String):void;
6 | }
7 | }
8 |
9 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/services/config/IMosaicConfigSavingService.as:
--------------------------------------------------------------------------------
1 | package mosaic.services.config
2 | {
3 | public interface IMosaicConfigSavingService
4 | {
5 | function saveConfig(configName:String):void;
6 | }
7 | }
8 |
9 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/services/config/MosaicConfigSolSavingService.as:
--------------------------------------------------------------------------------
1 | package mosaic.services.config
2 | {
3 | import mosaic.controller.events.MosaicConfigServiceEvent;
4 | import mosaic.model.IConfigModel;
5 | import mosaic.services.BaseSolSavingService;
6 |
7 | public class MosaicConfigSolSavingService extends BaseSolSavingService implements IMosaicConfigSavingService
8 | {
9 | [Inject]
10 | public var configModel:IConfigModel;
11 |
12 | public function saveConfig(configName:String):void
13 | {
14 | save(configName);
15 | }
16 |
17 | override protected function copyData():void
18 | {
19 | var solData:Object = _sol.data;
20 | solData.workspaceColor = configModel.workspaceColor;
21 | solData.currentDesign = configModel.currentDesign;
22 | solData.designNames = configModel.designNames;
23 | }
24 |
25 | override protected function dispatchCompleteEvent(solName:String):void
26 | {
27 | var evt:MosaicConfigServiceEvent = new MosaicConfigServiceEvent(MosaicConfigServiceEvent.SAVE_COMPLETED);
28 | dispatch(evt);
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/services/design/DesignSolSavingService.as:
--------------------------------------------------------------------------------
1 | package mosaic.services.design
2 | {
3 | import mosaic.controller.events.DesignSaveEvent;
4 | import mosaic.services.BaseSolSavingService;
5 |
6 | public class DesignSolSavingService extends BaseSolSavingService implements IDesignSavingService
7 | {
8 | [Inject]
9 | public var designToDataParser:IDesignToDataParser;
10 |
11 | public function saveDesign(designName:String):void
12 | {
13 | save(designName);
14 | }
15 |
16 | override protected function copyData():void
17 | {
18 | var solData:Object = _sol.data;
19 | solData.date = new Date();
20 | designToDataParser.populateDataFromDesign(solData);
21 | }
22 |
23 | override protected function dispatchCompleteEvent(solName:String):void
24 | {
25 | var evt:DesignSaveEvent = new DesignSaveEvent(DesignSaveEvent.SAVE_COMPLETED, solName);
26 | dispatch(evt);
27 | }
28 | }
29 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/services/design/IDesignFromDataParser.as:
--------------------------------------------------------------------------------
1 | package mosaic.services.design
2 | {
3 | public interface IDesignFromDataParser
4 | {
5 | function populateDesignFromData(data:Object):Boolean;
6 |
7 | }
8 | }
9 |
10 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/services/design/IDesignLoadingService.as:
--------------------------------------------------------------------------------
1 | package mosaic.services.design
2 | {
3 | public interface IDesignLoadingService
4 | {
5 | function loadDesign(designName:String):void;
6 | }
7 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/services/design/IDesignSavingService.as:
--------------------------------------------------------------------------------
1 | package mosaic.services.design
2 | {
3 | public interface IDesignSavingService
4 | {
5 | function saveDesign(designName:String):void;
6 | }
7 | }
8 |
9 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/services/design/IDesignToDataParser.as:
--------------------------------------------------------------------------------
1 | package mosaic.services.design
2 | {
3 | public interface IDesignToDataParser
4 | {
5 | function populateDataFromDesign(data:Object):void;
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/services/design/ITileSupplyFromDataParser.as:
--------------------------------------------------------------------------------
1 | package mosaic.services.design
2 | {
3 | import mosaic.model.TileSupplyVO;
4 |
5 | public interface ITileSupplyFromDataParser
6 | {
7 | function createTileSuppliesFrom(data:Object):Vector.
8 | }
9 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/services/design/ITileSupplyToDataParser.as:
--------------------------------------------------------------------------------
1 | package mosaic.services.design
2 | {
3 | import mosaic.model.TileSupplyVO;
4 |
5 | public interface ITileSupplyToDataParser
6 | {
7 |
8 | function populateDataWithTileSupplies(data:Object, supplyList:Vector.):void;
9 |
10 | }
11 | }
--------------------------------------------------------------------------------
/mosaictool/src/mosaic/services/design/TileSupplyToSolParser.as:
--------------------------------------------------------------------------------
1 | package mosaic.services.design
2 | {
3 | import mosaic.model.TileSupplyVO;
4 |
5 | public class TileSupplyToSolParser implements ITileSupplyToDataParser
6 | {
7 |
8 | public function populateDataWithTileSupplies(data:Object, supplyList:Vector.):void
9 | {
10 | var tileSuppliesData:Vector.