extjs-rails 4.1.0.alpha5 → 4.1.0.alpha6
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/extjs-rails.js +95613 -11000
- data/lib/extjs-rails/version.rb +1 -1
- metadata +2 -509
- data/app/assets/javascripts/src/AbstractComponent.js +0 -3290
- data/app/assets/javascripts/src/AbstractManager.js +0 -144
- data/app/assets/javascripts/src/AbstractPlugin.js +0 -72
- data/app/assets/javascripts/src/Action.js +0 -276
- data/app/assets/javascripts/src/Ajax.js +0 -99
- data/app/assets/javascripts/src/Component.js +0 -1344
- data/app/assets/javascripts/src/ComponentLoader.js +0 -202
- data/app/assets/javascripts/src/ComponentManager.js +0 -47
- data/app/assets/javascripts/src/ComponentQuery.js +0 -521
- data/app/assets/javascripts/src/Editor.js +0 -494
- data/app/assets/javascripts/src/ElementLoader.js +0 -404
- data/app/assets/javascripts/src/FocusManager.js +0 -712
- data/app/assets/javascripts/src/Img.js +0 -111
- data/app/assets/javascripts/src/Layer.js +0 -543
- data/app/assets/javascripts/src/LoadMask.js +0 -432
- data/app/assets/javascripts/src/ModelManager.js +0 -186
- data/app/assets/javascripts/src/PluginManager.js +0 -110
- data/app/assets/javascripts/src/ProgressBar.js +0 -336
- data/app/assets/javascripts/src/Shadow.js +0 -233
- data/app/assets/javascripts/src/ShadowPool.js +0 -43
- data/app/assets/javascripts/src/Template.js +0 -331
- data/app/assets/javascripts/src/XTemplate.js +0 -365
- data/app/assets/javascripts/src/XTemplateCompiler.js +0 -450
- data/app/assets/javascripts/src/XTemplateParser.js +0 -249
- data/app/assets/javascripts/src/ZIndexManager.js +0 -519
- data/app/assets/javascripts/src/app/Application.js +0 -271
- data/app/assets/javascripts/src/app/Controller.js +0 -458
- data/app/assets/javascripts/src/app/EventBus.js +0 -112
- data/app/assets/javascripts/src/button/Button.js +0 -1483
- data/app/assets/javascripts/src/button/Cycle.js +0 -215
- data/app/assets/javascripts/src/button/Split.js +0 -99
- data/app/assets/javascripts/src/chart/Callout.js +0 -140
- data/app/assets/javascripts/src/chart/Chart.js +0 -966
- data/app/assets/javascripts/src/chart/Highlight.js +0 -172
- data/app/assets/javascripts/src/chart/Label.js +0 -241
- data/app/assets/javascripts/src/chart/Legend.js +0 -474
- data/app/assets/javascripts/src/chart/LegendItem.js +0 -217
- data/app/assets/javascripts/src/chart/Mask.js +0 -230
- data/app/assets/javascripts/src/chart/MaskLayer.js +0 -48
- data/app/assets/javascripts/src/chart/Navigation.js +0 -79
- data/app/assets/javascripts/src/chart/Shape.js +0 -106
- data/app/assets/javascripts/src/chart/Tip.js +0 -98
- data/app/assets/javascripts/src/chart/TipSurface.js +0 -42
- data/app/assets/javascripts/src/chart/axis/Abstract.js +0 -73
- data/app/assets/javascripts/src/chart/axis/Axis.js +0 -961
- data/app/assets/javascripts/src/chart/axis/Category.js +0 -130
- data/app/assets/javascripts/src/chart/axis/Gauge.js +0 -203
- data/app/assets/javascripts/src/chart/axis/Numeric.js +0 -235
- data/app/assets/javascripts/src/chart/axis/Radial.js +0 -204
- data/app/assets/javascripts/src/chart/axis/Time.js +0 -135
- data/app/assets/javascripts/src/chart/series/Area.js +0 -803
- data/app/assets/javascripts/src/chart/series/Bar.js +0 -853
- data/app/assets/javascripts/src/chart/series/Cartesian.js +0 -328
- data/app/assets/javascripts/src/chart/series/Column.js +0 -104
- data/app/assets/javascripts/src/chart/series/Gauge.js +0 -490
- data/app/assets/javascripts/src/chart/series/Line.js +0 -1104
- data/app/assets/javascripts/src/chart/series/Pie.js +0 -1072
- data/app/assets/javascripts/src/chart/series/Radar.js +0 -440
- data/app/assets/javascripts/src/chart/series/Scatter.js +0 -668
- data/app/assets/javascripts/src/chart/series/Series.js +0 -443
- data/app/assets/javascripts/src/chart/theme/Base.js +0 -175
- data/app/assets/javascripts/src/chart/theme/Theme.js +0 -253
- data/app/assets/javascripts/src/container/AbstractContainer.js +0 -1062
- data/app/assets/javascripts/src/container/ButtonGroup.js +0 -143
- data/app/assets/javascripts/src/container/Container.js +0 -212
- data/app/assets/javascripts/src/container/DockingContainer.js +0 -265
- data/app/assets/javascripts/src/container/Viewport.js +0 -184
- data/app/assets/javascripts/src/core/dom/Element.form.js +0 -50
- data/app/assets/javascripts/src/core/dom/Element.static-more.js +0 -159
- data/app/assets/javascripts/src/core/examples/index.html +0 -321
- data/app/assets/javascripts/src/core/examples/index.js +0 -6
- data/app/assets/javascripts/src/core/examples/src/Sample/CTO.js +0 -25
- data/app/assets/javascripts/src/core/examples/src/Sample/CoolGuy.js +0 -20
- data/app/assets/javascripts/src/core/examples/src/Sample/Developer.js +0 -43
- data/app/assets/javascripts/src/core/examples/src/Sample/Gun.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/HumanResource.js +0 -23
- data/app/assets/javascripts/src/core/examples/src/Sample/Musician.js +0 -20
- data/app/assets/javascripts/src/core/examples/src/Sample/Person.js +0 -50
- data/app/assets/javascripts/src/core/examples/src/Sample/ability/CanComposeSongs.js +0 -9
- data/app/assets/javascripts/src/core/examples/src/Sample/ability/CanPlayGuitar.js +0 -9
- data/app/assets/javascripts/src/core/examples/src/Sample/ability/CanSing.js +0 -18
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/A.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/B.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/C.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/D.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/E.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/notdeadlock/A.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/notdeadlock/B.js +0 -4
- data/app/assets/javascripts/src/core/examples/src/Sample/notdeadlock/C.js +0 -3
- data/app/assets/javascripts/src/core/src/EventManager.js +0 -1167
- data/app/assets/javascripts/src/core/src/EventObject.js +0 -883
- data/app/assets/javascripts/src/core/src/Ext-more.js +0 -1283
- data/app/assets/javascripts/src/core/src/Ext.js +0 -736
- data/app/assets/javascripts/src/core/src/Support.js +0 -662
- data/app/assets/javascripts/src/core/src/class/Base.js +0 -1085
- data/app/assets/javascripts/src/core/src/class/Class.js +0 -676
- data/app/assets/javascripts/src/core/src/class/ClassManager.js +0 -1591
- data/app/assets/javascripts/src/core/src/class/Loader.js +0 -1423
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.alignment.js +0 -173
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.insertion.js +0 -193
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.js +0 -681
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.position.js +0 -356
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.static.js +0 -474
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.style.js +0 -851
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.traversal.js +0 -180
- data/app/assets/javascripts/src/core/src/dom/AbstractHelper.js +0 -291
- data/app/assets/javascripts/src/core/src/dom/AbstractQuery.js +0 -72
- data/app/assets/javascripts/src/core/src/dom/CompositeElement.js +0 -75
- data/app/assets/javascripts/src/core/src/dom/CompositeElementLite.js +0 -436
- data/app/assets/javascripts/src/core/src/dom/DomQuery-aria.js +0 -1049
- data/app/assets/javascripts/src/core/src/env/Browser.js +0 -186
- data/app/assets/javascripts/src/core/src/env/FeatureDetector.js +0 -274
- data/app/assets/javascripts/src/core/src/env/OS.js +0 -141
- data/app/assets/javascripts/src/core/src/lang/Array.js +0 -1205
- data/app/assets/javascripts/src/core/src/lang/Date.js +0 -1463
- data/app/assets/javascripts/src/core/src/lang/Error.js +0 -326
- data/app/assets/javascripts/src/core/src/lang/Function.js +0 -485
- data/app/assets/javascripts/src/core/src/lang/Number.js +0 -175
- data/app/assets/javascripts/src/core/src/lang/Object.js +0 -606
- data/app/assets/javascripts/src/core/src/lang/String.js +0 -333
- data/app/assets/javascripts/src/core/src/misc/JSON.js +0 -236
- data/app/assets/javascripts/src/core/src/perf/Accumulator.js +0 -244
- data/app/assets/javascripts/src/core/src/perf/Monitor.js +0 -197
- data/app/assets/javascripts/src/core/src/util/DelayedTask.js +0 -71
- data/app/assets/javascripts/src/core/src/util/Event.js +0 -215
- data/app/assets/javascripts/src/core/src/util/Format.js +0 -551
- data/app/assets/javascripts/src/core/src/util/TaskManager.js +0 -417
- data/app/assets/javascripts/src/core/src/version/Version.js +0 -364
- data/app/assets/javascripts/src/core/test/unit/README.MD +0 -91
- data/app/assets/javascripts/src/core/test/unit/bootstrap.js +0 -39
- data/app/assets/javascripts/src/core/test/unit/build/build-data.js +0 -34
- data/app/assets/javascripts/src/core/test/unit/build/build.sh +0 -2
- data/app/assets/javascripts/src/core/test/unit/data.js +0 -27
- data/app/assets/javascripts/src/core/test/unit/index.html +0 -15
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom.html +0 -40
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/extjs-api.js +0 -12
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/platform-api.js +0 -134
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/sanity.js +0 -4
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/touch-api-out.js +0 -128
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/touch-api.js +0 -89
- data/app/assets/javascripts/src/core/test/unit/other_specs/env/Environment.js +0 -357
- data/app/assets/javascripts/src/core/test/unit/resources/APITest.js +0 -37
- data/app/assets/javascripts/src/core/test/unit/resources/jsb3.js +0 -14
- data/app/assets/javascripts/src/core/test/unit/resources/test-setup.js +0 -137
- data/app/assets/javascripts/src/core/test/unit/spec/EventManager.js +0 -629
- data/app/assets/javascripts/src/core/test/unit/spec/Ext-mess.backup +0 -198
- data/app/assets/javascripts/src/core/test/unit/spec/Ext-more.js +0 -520
- data/app/assets/javascripts/src/core/test/unit/spec/Ext.js +0 -1550
- data/app/assets/javascripts/src/core/test/unit/spec/Support.js +0 -250
- data/app/assets/javascripts/src/core/test/unit/spec/class/Base.js +0 -47
- data/app/assets/javascripts/src/core/test/unit/spec/class/Class.js +0 -561
- data/app/assets/javascripts/src/core/test/unit/spec/class/ClassManager.js +0 -555
- data/app/assets/javascripts/src/core/test/unit/spec/dom/CompositeElementLite.js +0 -409
- data/app/assets/javascripts/src/core/test/unit/spec/dom/DomHelper.js +0 -444
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.insertion.js +0 -342
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.js +0 -731
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.static.js +0 -201
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.style.js +0 -118
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.traversal.js +0 -336
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Array.js +0 -1229
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Date.js +0 -697
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Error.js +0 -277
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Function.js +0 -536
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Number.js +0 -323
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Object.js +0 -591
- data/app/assets/javascripts/src/core/test/unit/spec/lang/String.js +0 -451
- data/app/assets/javascripts/src/core/test/unit/spec/misc/JSON.js +0 -252
- data/app/assets/javascripts/src/core/test/unit/spec/util/Format.js +0 -521
- data/app/assets/javascripts/src/core/test/unit/spec/version/Version.js +0 -148
- data/app/assets/javascripts/src/core/test/unit/specs.html +0 -19
- data/app/assets/javascripts/src/data/AbstractStore.js +0 -887
- data/app/assets/javascripts/src/data/ArrayStore.js +0 -74
- data/app/assets/javascripts/src/data/Batch.js +0 -236
- data/app/assets/javascripts/src/data/BufferStore.js +0 -13
- data/app/assets/javascripts/src/data/Connection.js +0 -969
- data/app/assets/javascripts/src/data/DirectStore.js +0 -50
- data/app/assets/javascripts/src/data/Errors.js +0 -52
- data/app/assets/javascripts/src/data/Field.js +0 -341
- data/app/assets/javascripts/src/data/IdGenerator.js +0 -198
- data/app/assets/javascripts/src/data/JsonP.js +0 -253
- data/app/assets/javascripts/src/data/JsonPStore.js +0 -51
- data/app/assets/javascripts/src/data/JsonStore.js +0 -60
- data/app/assets/javascripts/src/data/Model.js +0 -1673
- data/app/assets/javascripts/src/data/NodeInterface.js +0 -1294
- data/app/assets/javascripts/src/data/NodeStore.js +0 -254
- data/app/assets/javascripts/src/data/Operation.js +0 -331
- data/app/assets/javascripts/src/data/Request.js +0 -40
- data/app/assets/javascripts/src/data/ResultSet.js +0 -56
- data/app/assets/javascripts/src/data/SequentialIdGenerator.js +0 -61
- data/app/assets/javascripts/src/data/SortTypes.js +0 -125
- data/app/assets/javascripts/src/data/Store.js +0 -2609
- data/app/assets/javascripts/src/data/StoreManager.js +0 -156
- data/app/assets/javascripts/src/data/Tree.js +0 -290
- data/app/assets/javascripts/src/data/TreeStore.js +0 -655
- data/app/assets/javascripts/src/data/Types.js +0 -190
- data/app/assets/javascripts/src/data/UuidGenerator.js +0 -215
- data/app/assets/javascripts/src/data/XmlStore.js +0 -76
- data/app/assets/javascripts/src/data/association/Association.js +0 -243
- data/app/assets/javascripts/src/data/association/BelongsTo.js +0 -291
- data/app/assets/javascripts/src/data/association/HasMany.js +0 -289
- data/app/assets/javascripts/src/data/association/HasOne.js +0 -304
- data/app/assets/javascripts/src/data/proxy/Ajax.js +0 -282
- data/app/assets/javascripts/src/data/proxy/Client.js +0 -21
- data/app/assets/javascripts/src/data/proxy/Direct.js +0 -181
- data/app/assets/javascripts/src/data/proxy/JsonP.js +0 -313
- data/app/assets/javascripts/src/data/proxy/LocalStorage.js +0 -69
- data/app/assets/javascripts/src/data/proxy/Memory.js +0 -156
- data/app/assets/javascripts/src/data/proxy/Proxy.js +0 -433
- data/app/assets/javascripts/src/data/proxy/Rest.js +0 -173
- data/app/assets/javascripts/src/data/proxy/Server.js +0 -460
- data/app/assets/javascripts/src/data/proxy/SessionStorage.js +0 -39
- data/app/assets/javascripts/src/data/proxy/WebStorage.js +0 -546
- data/app/assets/javascripts/src/data/reader/Array.js +0 -68
- data/app/assets/javascripts/src/data/reader/Json.js +0 -383
- data/app/assets/javascripts/src/data/reader/Reader.js +0 -735
- data/app/assets/javascripts/src/data/reader/Xml.js +0 -292
- data/app/assets/javascripts/src/data/validations.js +0 -149
- data/app/assets/javascripts/src/data/writer/Json.js +0 -81
- data/app/assets/javascripts/src/data/writer/Writer.js +0 -147
- data/app/assets/javascripts/src/data/writer/Xml.js +0 -88
- data/app/assets/javascripts/src/dd/DD.js +0 -300
- data/app/assets/javascripts/src/dd/DDProxy.js +0 -204
- data/app/assets/javascripts/src/dd/DDTarget.js +0 -171
- data/app/assets/javascripts/src/dd/DragDrop.js +0 -1101
- data/app/assets/javascripts/src/dd/DragDropManager.js +0 -1264
- data/app/assets/javascripts/src/dd/DragSource.js +0 -392
- data/app/assets/javascripts/src/dd/DragTracker.js +0 -562
- data/app/assets/javascripts/src/dd/DragZone.js +0 -137
- data/app/assets/javascripts/src/dd/DropTarget.js +0 -118
- data/app/assets/javascripts/src/dd/DropZone.js +0 -254
- data/app/assets/javascripts/src/dd/Registry.js +0 -117
- data/app/assets/javascripts/src/dd/ScrollManager.js +0 -218
- data/app/assets/javascripts/src/dd/StatusProxy.js +0 -179
- data/app/assets/javascripts/src/diag/layout/Context.js +0 -523
- data/app/assets/javascripts/src/diag/layout/ContextItem.js +0 -179
- data/app/assets/javascripts/src/direct/Event.js +0 -35
- data/app/assets/javascripts/src/direct/ExceptionEvent.js +0 -16
- data/app/assets/javascripts/src/direct/JsonProvider.js +0 -82
- data/app/assets/javascripts/src/direct/Manager.js +0 -263
- data/app/assets/javascripts/src/direct/PollingProvider.js +0 -156
- data/app/assets/javascripts/src/direct/Provider.js +0 -96
- data/app/assets/javascripts/src/direct/RemotingEvent.js +0 -24
- data/app/assets/javascripts/src/direct/RemotingMethod.js +0 -100
- data/app/assets/javascripts/src/direct/RemotingProvider.js +0 -510
- data/app/assets/javascripts/src/direct/Transaction.js +0 -41
- data/app/assets/javascripts/src/dom/Element.alignment.js +0 -378
- data/app/assets/javascripts/src/dom/Element.anim.js +0 -962
- data/app/assets/javascripts/src/dom/Element.dd.js +0 -40
- data/app/assets/javascripts/src/dom/Element.fx.js +0 -194
- data/app/assets/javascripts/src/dom/Element.js +0 -1407
- data/app/assets/javascripts/src/dom/Element.position.js +0 -501
- data/app/assets/javascripts/src/dom/Element.scroll.js +0 -214
- data/app/assets/javascripts/src/dom/Element.style.js +0 -792
- data/app/assets/javascripts/src/dom/Element.traversal.js +0 -8
- data/app/assets/javascripts/src/dom/Helper.js +0 -466
- data/app/assets/javascripts/src/dom/Query.js +0 -1067
- data/app/assets/javascripts/src/draw/Color.js +0 -303
- data/app/assets/javascripts/src/draw/Component.js +0 -245
- data/app/assets/javascripts/src/draw/CompositeSprite.js +0 -299
- data/app/assets/javascripts/src/draw/Draw.js +0 -1217
- data/app/assets/javascripts/src/draw/Matrix.js +0 -183
- data/app/assets/javascripts/src/draw/Sprite.js +0 -554
- data/app/assets/javascripts/src/draw/SpriteDD.js +0 -87
- data/app/assets/javascripts/src/draw/Surface.js +0 -1001
- data/app/assets/javascripts/src/draw/Text.js +0 -175
- data/app/assets/javascripts/src/draw/engine/ImageExporter.js +0 -106
- data/app/assets/javascripts/src/draw/engine/Svg.js +0 -734
- data/app/assets/javascripts/src/draw/engine/SvgExporter.js +0 -280
- data/app/assets/javascripts/src/draw/engine/Vml.js +0 -916
- data/app/assets/javascripts/src/flash/Component.js +0 -248
- data/app/assets/javascripts/src/form/Basic.js +0 -1018
- data/app/assets/javascripts/src/form/CheckboxGroup.js +0 -441
- data/app/assets/javascripts/src/form/CheckboxManager.js +0 -26
- data/app/assets/javascripts/src/form/FieldAncestor.js +0 -210
- data/app/assets/javascripts/src/form/FieldContainer.js +0 -290
- data/app/assets/javascripts/src/form/FieldSet.js +0 -506
- data/app/assets/javascripts/src/form/Label.js +0 -110
- data/app/assets/javascripts/src/form/Labelable.js +0 -764
- data/app/assets/javascripts/src/form/Panel.js +0 -335
- data/app/assets/javascripts/src/form/RadioGroup.js +0 -124
- data/app/assets/javascripts/src/form/RadioManager.js +0 -26
- data/app/assets/javascripts/src/form/action/Action.js +0 -307
- data/app/assets/javascripts/src/form/action/DirectLoad.js +0 -107
- data/app/assets/javascripts/src/form/action/DirectSubmit.js +0 -119
- data/app/assets/javascripts/src/form/action/Load.js +0 -120
- data/app/assets/javascripts/src/form/action/StandardSubmit.js +0 -34
- data/app/assets/javascripts/src/form/action/Submit.js +0 -257
- data/app/assets/javascripts/src/form/field/Base.js +0 -813
- data/app/assets/javascripts/src/form/field/Checkbox.js +0 -505
- data/app/assets/javascripts/src/form/field/ComboBox.js +0 -1427
- data/app/assets/javascripts/src/form/field/Date.js +0 -578
- data/app/assets/javascripts/src/form/field/Display.js +0 -155
- data/app/assets/javascripts/src/form/field/Field.js +0 -430
- data/app/assets/javascripts/src/form/field/File.js +0 -265
- data/app/assets/javascripts/src/form/field/Hidden.js +0 -75
- data/app/assets/javascripts/src/form/field/HtmlEditor.js +0 -1439
- data/app/assets/javascripts/src/form/field/Number.js +0 -380
- data/app/assets/javascripts/src/form/field/Picker.js +0 -321
- data/app/assets/javascripts/src/form/field/Radio.js +0 -279
- data/app/assets/javascripts/src/form/field/Spinner.js +0 -321
- data/app/assets/javascripts/src/form/field/Text.js +0 -727
- data/app/assets/javascripts/src/form/field/TextArea.js +0 -228
- data/app/assets/javascripts/src/form/field/Time.js +0 -459
- data/app/assets/javascripts/src/form/field/Trigger.js +0 -469
- data/app/assets/javascripts/src/form/field/VTypes.js +0 -172
- data/app/assets/javascripts/src/fx/Anim.js +0 -472
- data/app/assets/javascripts/src/fx/Animator.js +0 -410
- data/app/assets/javascripts/src/fx/CubicBezier.js +0 -77
- data/app/assets/javascripts/src/fx/Easing.js +0 -136
- data/app/assets/javascripts/src/fx/Manager.js +0 -353
- data/app/assets/javascripts/src/fx/PropertyHandler.js +0 -381
- data/app/assets/javascripts/src/fx/Queue.js +0 -123
- data/app/assets/javascripts/src/fx/target/Component.js +0 -118
- data/app/assets/javascripts/src/fx/target/CompositeElement.js +0 -46
- data/app/assets/javascripts/src/fx/target/CompositeElementCSS.js +0 -22
- data/app/assets/javascripts/src/fx/target/CompositeSprite.js +0 -34
- data/app/assets/javascripts/src/fx/target/Element.js +0 -83
- data/app/assets/javascripts/src/fx/target/ElementCSS.js +0 -77
- data/app/assets/javascripts/src/fx/target/Sprite.js +0 -128
- data/app/assets/javascripts/src/fx/target/Target.js +0 -36
- data/app/assets/javascripts/src/grid/CellEditor.js +0 -172
- data/app/assets/javascripts/src/grid/ColumnComponentLayout.js +0 -34
- data/app/assets/javascripts/src/grid/ColumnLayout.js +0 -201
- data/app/assets/javascripts/src/grid/Lockable.js +0 -863
- data/app/assets/javascripts/src/grid/LockingView.js +0 -169
- data/app/assets/javascripts/src/grid/PagingScroller.js +0 -539
- data/app/assets/javascripts/src/grid/Panel.js +0 -393
- data/app/assets/javascripts/src/grid/RowEditor.js +0 -731
- data/app/assets/javascripts/src/grid/RowNumberer.js +0 -76
- data/app/assets/javascripts/src/grid/Scroller.js +0 -5
- data/app/assets/javascripts/src/grid/View.js +0 -44
- data/app/assets/javascripts/src/grid/ViewDropZone.js +0 -41
- data/app/assets/javascripts/src/grid/column/Action.js +0 -318
- data/app/assets/javascripts/src/grid/column/Boolean.js +0 -82
- data/app/assets/javascripts/src/grid/column/Column.js +0 -835
- data/app/assets/javascripts/src/grid/column/Date.js +0 -63
- data/app/assets/javascripts/src/grid/column/Number.js +0 -52
- data/app/assets/javascripts/src/grid/column/Template.js +0 -58
- data/app/assets/javascripts/src/grid/feature/AbstractSummary.js +0 -154
- data/app/assets/javascripts/src/grid/feature/Chunking.js +0 -77
- data/app/assets/javascripts/src/grid/feature/Feature.js +0 -158
- data/app/assets/javascripts/src/grid/feature/Grouping.js +0 -822
- data/app/assets/javascripts/src/grid/feature/GroupingSummary.js +0 -243
- data/app/assets/javascripts/src/grid/feature/RowBody.js +0 -116
- data/app/assets/javascripts/src/grid/feature/RowWrap.js +0 -120
- data/app/assets/javascripts/src/grid/feature/Summary.js +0 -167
- data/app/assets/javascripts/src/grid/header/Container.js +0 -965
- data/app/assets/javascripts/src/grid/header/DragZone.js +0 -69
- data/app/assets/javascripts/src/grid/header/DropZone.js +0 -265
- data/app/assets/javascripts/src/grid/plugin/CellEditing.js +0 -453
- data/app/assets/javascripts/src/grid/plugin/DragDrop.js +0 -254
- data/app/assets/javascripts/src/grid/plugin/Editing.js +0 -561
- data/app/assets/javascripts/src/grid/plugin/HeaderReorderer.js +0 -49
- data/app/assets/javascripts/src/grid/plugin/HeaderResizer.js +0 -292
- data/app/assets/javascripts/src/grid/plugin/RowEditing.js +0 -339
- data/app/assets/javascripts/src/grid/property/Grid.js +0 -351
- data/app/assets/javascripts/src/grid/property/HeaderContainer.js +0 -109
- data/app/assets/javascripts/src/grid/property/Property.js +0 -36
- data/app/assets/javascripts/src/grid/property/Store.js +0 -141
- data/app/assets/javascripts/src/layout/ClassList.js +0 -90
- data/app/assets/javascripts/src/layout/Context.js +0 -1232
- data/app/assets/javascripts/src/layout/ContextItem.js +0 -1470
- data/app/assets/javascripts/src/layout/Layout.js +0 -761
- data/app/assets/javascripts/src/layout/component/Auto.js +0 -220
- data/app/assets/javascripts/src/layout/component/Body.js +0 -80
- data/app/assets/javascripts/src/layout/component/BoundList.js +0 -95
- data/app/assets/javascripts/src/layout/component/Button.js +0 -261
- data/app/assets/javascripts/src/layout/component/Component.js +0 -427
- data/app/assets/javascripts/src/layout/component/Dock.js +0 -1132
- data/app/assets/javascripts/src/layout/component/Draw.js +0 -79
- data/app/assets/javascripts/src/layout/component/FieldSet.js +0 -62
- data/app/assets/javascripts/src/layout/component/ProgressBar.js +0 -54
- data/app/assets/javascripts/src/layout/component/Tab.js +0 -23
- data/app/assets/javascripts/src/layout/component/field/ComboBox.js +0 -52
- data/app/assets/javascripts/src/layout/component/field/Field.js +0 -372
- data/app/assets/javascripts/src/layout/component/field/FieldContainer.js +0 -48
- data/app/assets/javascripts/src/layout/component/field/HtmlEditor.js +0 -54
- data/app/assets/javascripts/src/layout/component/field/Slider.js +0 -58
- data/app/assets/javascripts/src/layout/component/field/Text.js +0 -75
- data/app/assets/javascripts/src/layout/component/field/TextArea.js +0 -51
- data/app/assets/javascripts/src/layout/component/field/Trigger.js +0 -132
- data/app/assets/javascripts/src/layout/container/Absolute.js +0 -121
- data/app/assets/javascripts/src/layout/container/Accordion.js +0 -308
- data/app/assets/javascripts/src/layout/container/Anchor.js +0 -403
- data/app/assets/javascripts/src/layout/container/Auto.js +0 -70
- data/app/assets/javascripts/src/layout/container/Border-old-js +0 -1079
- data/app/assets/javascripts/src/layout/container/Border.js +0 -816
- data/app/assets/javascripts/src/layout/container/Box.js +0 -929
- data/app/assets/javascripts/src/layout/container/Card.js +0 -361
- data/app/assets/javascripts/src/layout/container/CheckboxGroup.js +0 -376
- data/app/assets/javascripts/src/layout/container/Column.js +0 -234
- data/app/assets/javascripts/src/layout/container/Container.js +0 -961
- data/app/assets/javascripts/src/layout/container/Editor.js +0 -74
- data/app/assets/javascripts/src/layout/container/Fit.js +0 -287
- data/app/assets/javascripts/src/layout/container/Form.js +0 -157
- data/app/assets/javascripts/src/layout/container/HBox.js +0 -134
- data/app/assets/javascripts/src/layout/container/Table.js +0 -412
- data/app/assets/javascripts/src/layout/container/VBox.js +0 -139
- data/app/assets/javascripts/src/layout/container/boxOverflow/Menu.js +0 -365
- data/app/assets/javascripts/src/layout/container/boxOverflow/None.js +0 -83
- data/app/assets/javascripts/src/layout/container/boxOverflow/Scroller.js +0 -475
- data/app/assets/javascripts/src/menu/CheckItem.js +0 -169
- data/app/assets/javascripts/src/menu/ColorPicker.js +0 -110
- data/app/assets/javascripts/src/menu/DatePicker.js +0 -100
- data/app/assets/javascripts/src/menu/Item.js +0 -553
- data/app/assets/javascripts/src/menu/KeyNav.js +0 -134
- data/app/assets/javascripts/src/menu/Manager.js +0 -219
- data/app/assets/javascripts/src/menu/Menu.js +0 -579
- data/app/assets/javascripts/src/menu/Separator.js +0 -126
- data/app/assets/javascripts/src/panel/AbstractPanel.js +0 -323
- data/app/assets/javascripts/src/panel/DD.js +0 -99
- data/app/assets/javascripts/src/panel/Header.js +0 -518
- data/app/assets/javascripts/src/panel/Panel.js +0 -2150
- data/app/assets/javascripts/src/panel/Proxy.js +0 -131
- data/app/assets/javascripts/src/panel/Table.js +0 -1018
- data/app/assets/javascripts/src/panel/Tool.js +0 -304
- data/app/assets/javascripts/src/picker/Color.js +0 -219
- data/app/assets/javascripts/src/picker/Date.js +0 -1140
- data/app/assets/javascripts/src/picker/Month.js +0 -490
- data/app/assets/javascripts/src/picker/Time.js +0 -165
- data/app/assets/javascripts/src/resizer/BorderSplitter.js +0 -22
- data/app/assets/javascripts/src/resizer/BorderSplitterTracker.js +0 -210
- data/app/assets/javascripts/src/resizer/Handle.js +0 -29
- data/app/assets/javascripts/src/resizer/ResizeTracker.js +0 -346
- data/app/assets/javascripts/src/resizer/Resizer.js +0 -477
- data/app/assets/javascripts/src/resizer/Splitter.js +0 -242
- data/app/assets/javascripts/src/resizer/SplitterTracker.js +0 -230
- data/app/assets/javascripts/src/selection/CellModel.js +0 -395
- data/app/assets/javascripts/src/selection/CheckboxModel.js +0 -234
- data/app/assets/javascripts/src/selection/DataViewModel.js +0 -160
- data/app/assets/javascripts/src/selection/Model.js +0 -646
- data/app/assets/javascripts/src/selection/RowModel.js +0 -499
- data/app/assets/javascripts/src/selection/TreeModel.js +0 -78
- data/app/assets/javascripts/src/slider/Multi.js +0 -835
- data/app/assets/javascripts/src/slider/Single.js +0 -56
- data/app/assets/javascripts/src/slider/Thumb.js +0 -259
- data/app/assets/javascripts/src/slider/Tip.js +0 -130
- data/app/assets/javascripts/src/state/CookieProvider.js +0 -120
- data/app/assets/javascripts/src/state/LocalStorageProvider.js +0 -72
- data/app/assets/javascripts/src/state/Manager.js +0 -70
- data/app/assets/javascripts/src/state/Provider.js +0 -182
- data/app/assets/javascripts/src/state/Stateful.js +0 -364
- data/app/assets/javascripts/src/tab/Bar.js +0 -258
- data/app/assets/javascripts/src/tab/Panel.js +0 -654
- data/app/assets/javascripts/src/tab/Tab.js +0 -358
- data/app/assets/javascripts/src/tail.js +0 -10
- data/app/assets/javascripts/src/tip/QuickTip.js +0 -335
- data/app/assets/javascripts/src/tip/QuickTipManager.js +0 -239
- data/app/assets/javascripts/src/tip/Tip.js +0 -160
- data/app/assets/javascripts/src/tip/ToolTip.js +0 -691
- data/app/assets/javascripts/src/toolbar/Fill.js +0 -28
- data/app/assets/javascripts/src/toolbar/Item.js +0 -16
- data/app/assets/javascripts/src/toolbar/Paging.js +0 -600
- data/app/assets/javascripts/src/toolbar/Separator.js +0 -23
- data/app/assets/javascripts/src/toolbar/Spacer.js +0 -33
- data/app/assets/javascripts/src/toolbar/TextItem.js +0 -57
- data/app/assets/javascripts/src/toolbar/Toolbar-legacy.js +0 -123
- data/app/assets/javascripts/src/toolbar/Toolbar.js +0 -447
- data/app/assets/javascripts/src/tree/Column.js +0 -90
- data/app/assets/javascripts/src/tree/Panel.js +0 -505
- data/app/assets/javascripts/src/tree/View.js +0 -658
- data/app/assets/javascripts/src/tree/ViewDragZone.js +0 -49
- data/app/assets/javascripts/src/tree/ViewDropZone.js +0 -287
- data/app/assets/javascripts/src/tree/plugin/TreeViewDragDrop.js +0 -244
- data/app/assets/javascripts/src/util/AbstractMixedCollection.js +0 -772
- data/app/assets/javascripts/src/util/Animate.js +0 -426
- data/app/assets/javascripts/src/util/Bindable.js +0 -102
- data/app/assets/javascripts/src/util/CSS.js +0 -185
- data/app/assets/javascripts/src/util/ClickRepeater.js +0 -238
- data/app/assets/javascripts/src/util/ComponentDragger.js +0 -126
- data/app/assets/javascripts/src/util/Cookies.js +0 -91
- data/app/assets/javascripts/src/util/ElementContainer.js +0 -293
- data/app/assets/javascripts/src/util/Filter.js +0 -159
- data/app/assets/javascripts/src/util/Floating.js +0 -321
- data/app/assets/javascripts/src/util/Grouper.js +0 -26
- data/app/assets/javascripts/src/util/HashMap.js +0 -356
- data/app/assets/javascripts/src/util/History.js +0 -285
- data/app/assets/javascripts/src/util/Inflector.js +0 -297
- data/app/assets/javascripts/src/util/KeyMap.js +0 -427
- data/app/assets/javascripts/src/util/KeyNav.js +0 -239
- data/app/assets/javascripts/src/util/LruCache.js +0 -257
- data/app/assets/javascripts/src/util/Memento.js +0 -131
- data/app/assets/javascripts/src/util/MixedCollection.js +0 -239
- data/app/assets/javascripts/src/util/Observable.js +0 -1003
- data/app/assets/javascripts/src/util/Offset.js +0 -60
- data/app/assets/javascripts/src/util/Point.js +0 -93
- data/app/assets/javascripts/src/util/ProtoElement.js +0 -205
- data/app/assets/javascripts/src/util/Queue.js +0 -76
- data/app/assets/javascripts/src/util/Region.js +0 -388
- data/app/assets/javascripts/src/util/Renderable.js +0 -1079
- data/app/assets/javascripts/src/util/Sortable.js +0 -248
- data/app/assets/javascripts/src/util/Sorter.js +0 -179
- data/app/assets/javascripts/src/util/TextMetrics.js +0 -148
- data/app/assets/javascripts/src/view/AbstractView.js +0 -1103
- data/app/assets/javascripts/src/view/BoundList.js +0 -207
- data/app/assets/javascripts/src/view/BoundListKeyNav.js +0 -92
- data/app/assets/javascripts/src/view/DragZone.js +0 -106
- data/app/assets/javascripts/src/view/DropZone.js +0 -240
- data/app/assets/javascripts/src/view/Table.js +0 -1229
- data/app/assets/javascripts/src/view/TableChunker.js +0 -139
- data/app/assets/javascripts/src/view/View.js +0 -636
- data/app/assets/javascripts/src/window/MessageBox.js +0 -880
- data/app/assets/javascripts/src/window/Window-legacy.js +0 -56
- data/app/assets/javascripts/src/window/Window.js +0 -793
@@ -1,87 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* DD implementation for Panels.
|
3
|
-
* @private
|
4
|
-
*/
|
5
|
-
Ext.define('Ext.draw.SpriteDD', {
|
6
|
-
extend: 'Ext.dd.DragSource',
|
7
|
-
|
8
|
-
constructor : function(sprite, cfg){
|
9
|
-
var me = this,
|
10
|
-
el = sprite.el;
|
11
|
-
me.sprite = sprite;
|
12
|
-
me.el = el;
|
13
|
-
me.dragData = {el: el, sprite: sprite};
|
14
|
-
me.callParent([el, cfg]);
|
15
|
-
me.sprite.setStyle('cursor', 'move');
|
16
|
-
},
|
17
|
-
|
18
|
-
showFrame: Ext.emptyFn,
|
19
|
-
createFrame : Ext.emptyFn,
|
20
|
-
|
21
|
-
getDragEl : function(e){
|
22
|
-
return this.el;
|
23
|
-
},
|
24
|
-
|
25
|
-
getRegion: function() {
|
26
|
-
var me = this,
|
27
|
-
el = me.el,
|
28
|
-
pos, x1, x2, y1, y2, t, r, b, l, bbox, sprite;
|
29
|
-
|
30
|
-
sprite = me.sprite;
|
31
|
-
bbox = sprite.getBBox();
|
32
|
-
|
33
|
-
try {
|
34
|
-
pos = Ext.Element.getXY(el);
|
35
|
-
} catch (e) { }
|
36
|
-
|
37
|
-
if (!pos) {
|
38
|
-
return null;
|
39
|
-
}
|
40
|
-
|
41
|
-
x1 = pos[0];
|
42
|
-
x2 = x1 + bbox.width;
|
43
|
-
y1 = pos[1];
|
44
|
-
y2 = y1 + bbox.height;
|
45
|
-
|
46
|
-
return new Ext.util.Region(y1, x2, y2, x1);
|
47
|
-
},
|
48
|
-
|
49
|
-
/*
|
50
|
-
TODO(nico): Cumulative translations in VML are handled
|
51
|
-
differently than in SVG. While in SVG we specify the translation
|
52
|
-
relative to the original x, y position attributes, in VML the translation
|
53
|
-
is a delta between the last position of the object (modified by the last
|
54
|
-
translation) and the new one.
|
55
|
-
|
56
|
-
In VML the translation alters the position
|
57
|
-
of the object, we should change that or alter the SVG impl.
|
58
|
-
*/
|
59
|
-
|
60
|
-
startDrag: function(x, y) {
|
61
|
-
var me = this,
|
62
|
-
attr = me.sprite.attr;
|
63
|
-
me.prev = me.sprite.surface.transformToViewBox(x, y);
|
64
|
-
},
|
65
|
-
|
66
|
-
onDrag: function(e) {
|
67
|
-
var xy = e.getXY(),
|
68
|
-
me = this,
|
69
|
-
sprite = me.sprite,
|
70
|
-
attr = sprite.attr, dx, dy;
|
71
|
-
xy = me.sprite.surface.transformToViewBox(xy[0], xy[1]);
|
72
|
-
dx = xy[0] - me.prev[0];
|
73
|
-
dy = xy[1] - me.prev[1];
|
74
|
-
sprite.setAttributes({
|
75
|
-
translate: {
|
76
|
-
x: attr.translation.x + dx,
|
77
|
-
y: attr.translation.y + dy
|
78
|
-
}
|
79
|
-
}, true);
|
80
|
-
me.prev = xy;
|
81
|
-
},
|
82
|
-
|
83
|
-
setDragElPos: function () {
|
84
|
-
// Disable automatic DOM move in DD that spoils layout of VML engine.
|
85
|
-
return false;
|
86
|
-
}
|
87
|
-
});
|
@@ -1,1001 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* A Surface is an interface to render methods inside a draw {@link Ext.draw.Component}.
|
3
|
-
* A Surface contains methods to render sprites, get bounding boxes of sprites, add
|
4
|
-
* sprites to the canvas, initialize other graphic components, etc. One of the most used
|
5
|
-
* methods for this class is the `add` method, to add Sprites to the surface.
|
6
|
-
*
|
7
|
-
* Most of the Surface methods are abstract and they have a concrete implementation
|
8
|
-
* in VML or SVG engines.
|
9
|
-
*
|
10
|
-
* A Surface instance can be accessed as a property of a draw component. For example:
|
11
|
-
*
|
12
|
-
* drawComponent.surface.add({
|
13
|
-
* type: 'circle',
|
14
|
-
* fill: '#ffc',
|
15
|
-
* radius: 100,
|
16
|
-
* x: 100,
|
17
|
-
* y: 100
|
18
|
-
* });
|
19
|
-
*
|
20
|
-
* The configuration object passed in the `add` method is the same as described in the {@link Ext.draw.Sprite}
|
21
|
-
* class documentation.
|
22
|
-
*
|
23
|
-
* # Listeners
|
24
|
-
*
|
25
|
-
* You can also add event listeners to the surface using the `Observable` listener syntax. Supported events are:
|
26
|
-
*
|
27
|
-
* - mousedown
|
28
|
-
* - mouseup
|
29
|
-
* - mouseover
|
30
|
-
* - mouseout
|
31
|
-
* - mousemove
|
32
|
-
* - mouseenter
|
33
|
-
* - mouseleave
|
34
|
-
* - click
|
35
|
-
* - dblclick
|
36
|
-
*
|
37
|
-
* For example:
|
38
|
-
*
|
39
|
-
* drawComponent.surface.on({
|
40
|
-
* 'mousemove': function() {
|
41
|
-
* console.log('moving the mouse over the surface');
|
42
|
-
* }
|
43
|
-
* });
|
44
|
-
*
|
45
|
-
* # Example
|
46
|
-
*
|
47
|
-
* var drawComponent = Ext.create('Ext.draw.Component', {
|
48
|
-
* width: 800,
|
49
|
-
* height: 600,
|
50
|
-
* renderTo: document.body
|
51
|
-
* }), surface = drawComponent.surface;
|
52
|
-
*
|
53
|
-
* surface.add([{
|
54
|
-
* type: 'circle',
|
55
|
-
* radius: 10,
|
56
|
-
* fill: '#f00',
|
57
|
-
* x: 10,
|
58
|
-
* y: 10,
|
59
|
-
* group: 'circles'
|
60
|
-
* }, {
|
61
|
-
* type: 'circle',
|
62
|
-
* radius: 10,
|
63
|
-
* fill: '#0f0',
|
64
|
-
* x: 50,
|
65
|
-
* y: 50,
|
66
|
-
* group: 'circles'
|
67
|
-
* }, {
|
68
|
-
* type: 'circle',
|
69
|
-
* radius: 10,
|
70
|
-
* fill: '#00f',
|
71
|
-
* x: 100,
|
72
|
-
* y: 100,
|
73
|
-
* group: 'circles'
|
74
|
-
* }, {
|
75
|
-
* type: 'rect',
|
76
|
-
* width: 20,
|
77
|
-
* height: 20,
|
78
|
-
* fill: '#f00',
|
79
|
-
* x: 10,
|
80
|
-
* y: 10,
|
81
|
-
* group: 'rectangles'
|
82
|
-
* }, {
|
83
|
-
* type: 'rect',
|
84
|
-
* width: 20,
|
85
|
-
* height: 20,
|
86
|
-
* fill: '#0f0',
|
87
|
-
* x: 50,
|
88
|
-
* y: 50,
|
89
|
-
* group: 'rectangles'
|
90
|
-
* }, {
|
91
|
-
* type: 'rect',
|
92
|
-
* width: 20,
|
93
|
-
* height: 20,
|
94
|
-
* fill: '#00f',
|
95
|
-
* x: 100,
|
96
|
-
* y: 100,
|
97
|
-
* group: 'rectangles'
|
98
|
-
* }]);
|
99
|
-
*
|
100
|
-
* // Get references to my groups
|
101
|
-
* circles = surface.getGroup('circles');
|
102
|
-
* rectangles = surface.getGroup('rectangles');
|
103
|
-
*
|
104
|
-
* // Animate the circles down
|
105
|
-
* circles.animate({
|
106
|
-
* duration: 1000,
|
107
|
-
* to: {
|
108
|
-
* translate: {
|
109
|
-
* y: 200
|
110
|
-
* }
|
111
|
-
* }
|
112
|
-
* });
|
113
|
-
*
|
114
|
-
* // Animate the rectangles across
|
115
|
-
* rectangles.animate({
|
116
|
-
* duration: 1000,
|
117
|
-
* to: {
|
118
|
-
* translate: {
|
119
|
-
* x: 200
|
120
|
-
* }
|
121
|
-
* }
|
122
|
-
* });
|
123
|
-
*/
|
124
|
-
Ext.define('Ext.draw.Surface', {
|
125
|
-
|
126
|
-
/* Begin Definitions */
|
127
|
-
|
128
|
-
mixins: {
|
129
|
-
observable: 'Ext.util.Observable'
|
130
|
-
},
|
131
|
-
|
132
|
-
requires: ['Ext.draw.CompositeSprite'],
|
133
|
-
uses: ['Ext.draw.engine.Svg', 'Ext.draw.engine.Vml', 'Ext.draw.engine.SvgExporter', 'Ext.draw.engine.ImageExporter'],
|
134
|
-
|
135
|
-
separatorRe: /[, ]+/,
|
136
|
-
|
137
|
-
statics: {
|
138
|
-
/**
|
139
|
-
* Creates and returns a new concrete Surface instance appropriate for the current environment.
|
140
|
-
* @param {Object} config Initial configuration for the Surface instance
|
141
|
-
* @param {String[]} enginePriority (Optional) order of implementations to use; the first one that is
|
142
|
-
* available in the current environment will be used. Defaults to `['Svg', 'Vml']`.
|
143
|
-
* @return {Object} The created Surface or false.
|
144
|
-
* @static
|
145
|
-
*/
|
146
|
-
create: function(config, enginePriority) {
|
147
|
-
enginePriority = enginePriority || ['Svg', 'Vml'];
|
148
|
-
|
149
|
-
var i = 0,
|
150
|
-
len = enginePriority.length,
|
151
|
-
surfaceClass;
|
152
|
-
|
153
|
-
for (; i < len; i++) {
|
154
|
-
if (Ext.supports[enginePriority[i]] !== false) {
|
155
|
-
return Ext.create('Ext.draw.engine.' + enginePriority[i], config);
|
156
|
-
}
|
157
|
-
}
|
158
|
-
return false;
|
159
|
-
},
|
160
|
-
|
161
|
-
save: function(config, surface){
|
162
|
-
var exportTypes = {
|
163
|
-
/*
|
164
|
-
example adds
|
165
|
-
'image/png': 'Image',
|
166
|
-
'image/jpeg': 'Image',
|
167
|
-
*/
|
168
|
-
'image/png': 'Image',
|
169
|
-
'image/jpeg': 'Image',
|
170
|
-
'image/svg+xml': 'Svg'
|
171
|
-
},
|
172
|
-
prefix = exportTypes[config.type] || 'Svg';
|
173
|
-
|
174
|
-
return (Ext.draw.engine[prefix + 'Exporter']).self.generate(config, surface);
|
175
|
-
|
176
|
-
}
|
177
|
-
},
|
178
|
-
|
179
|
-
/* End Definitions */
|
180
|
-
|
181
|
-
// @private
|
182
|
-
availableAttrs: {
|
183
|
-
blur: 0,
|
184
|
-
"clip-rect": "0 0 1e9 1e9",
|
185
|
-
cursor: "default",
|
186
|
-
cx: 0,
|
187
|
-
cy: 0,
|
188
|
-
'dominant-baseline': 'auto',
|
189
|
-
fill: "none",
|
190
|
-
"fill-opacity": 1,
|
191
|
-
font: '10px "Arial"',
|
192
|
-
"font-family": '"Arial"',
|
193
|
-
"font-size": "10",
|
194
|
-
"font-style": "normal",
|
195
|
-
"font-weight": 400,
|
196
|
-
gradient: "",
|
197
|
-
height: 0,
|
198
|
-
hidden: false,
|
199
|
-
href: "http://sencha.com/",
|
200
|
-
opacity: 1,
|
201
|
-
path: "M0,0",
|
202
|
-
radius: 0,
|
203
|
-
rx: 0,
|
204
|
-
ry: 0,
|
205
|
-
scale: "1 1",
|
206
|
-
src: "",
|
207
|
-
stroke: "none",
|
208
|
-
"stroke-dasharray": "",
|
209
|
-
"stroke-linecap": "butt",
|
210
|
-
"stroke-linejoin": "butt",
|
211
|
-
"stroke-miterlimit": 0,
|
212
|
-
"stroke-opacity": 1,
|
213
|
-
"stroke-width": 1,
|
214
|
-
target: "_blank",
|
215
|
-
text: "",
|
216
|
-
"text-anchor": "middle",
|
217
|
-
title: "Ext Draw",
|
218
|
-
width: 0,
|
219
|
-
x: 0,
|
220
|
-
y: 0,
|
221
|
-
zIndex: 0
|
222
|
-
},
|
223
|
-
|
224
|
-
/**
|
225
|
-
* @cfg {Number} height
|
226
|
-
* The height of this component in pixels (defaults to auto).
|
227
|
-
*/
|
228
|
-
/**
|
229
|
-
* @cfg {Number} width
|
230
|
-
* The width of this component in pixels (defaults to auto).
|
231
|
-
*/
|
232
|
-
|
233
|
-
container: undefined,
|
234
|
-
height: 352,
|
235
|
-
width: 512,
|
236
|
-
x: 0,
|
237
|
-
y: 0,
|
238
|
-
|
239
|
-
/**
|
240
|
-
* @private Flag indicating that the surface implementation requires sprites to be maintained
|
241
|
-
* in order of their zIndex. Impls that don't require this can set it to false.
|
242
|
-
*/
|
243
|
-
orderSpritesByZIndex: true,
|
244
|
-
|
245
|
-
|
246
|
-
/**
|
247
|
-
* Creates new Surface.
|
248
|
-
* @param {Object} config (optional) Config object.
|
249
|
-
*/
|
250
|
-
constructor: function(config) {
|
251
|
-
var me = this;
|
252
|
-
config = config || {};
|
253
|
-
Ext.apply(me, config);
|
254
|
-
|
255
|
-
me.domRef = Ext.getDoc().dom;
|
256
|
-
|
257
|
-
me.customAttributes = {};
|
258
|
-
|
259
|
-
me.addEvents(
|
260
|
-
'mousedown',
|
261
|
-
'mouseup',
|
262
|
-
'mouseover',
|
263
|
-
'mouseout',
|
264
|
-
'mousemove',
|
265
|
-
'mouseenter',
|
266
|
-
'mouseleave',
|
267
|
-
'click',
|
268
|
-
'dblclick'
|
269
|
-
);
|
270
|
-
|
271
|
-
me.mixins.observable.constructor.call(me);
|
272
|
-
|
273
|
-
me.getId();
|
274
|
-
me.initGradients();
|
275
|
-
me.initItems();
|
276
|
-
if (me.renderTo) {
|
277
|
-
me.render(me.renderTo);
|
278
|
-
delete me.renderTo;
|
279
|
-
}
|
280
|
-
me.initBackground(config.background);
|
281
|
-
},
|
282
|
-
|
283
|
-
// @private called to initialize components in the surface
|
284
|
-
// this is dependent on the underlying implementation.
|
285
|
-
initSurface: Ext.emptyFn,
|
286
|
-
|
287
|
-
// @private called to setup the surface to render an item
|
288
|
-
//this is dependent on the underlying implementation.
|
289
|
-
renderItem: Ext.emptyFn,
|
290
|
-
|
291
|
-
// @private
|
292
|
-
renderItems: Ext.emptyFn,
|
293
|
-
|
294
|
-
// @private
|
295
|
-
setViewBox: function (x, y, width, height) {
|
296
|
-
if (isFinite(x) && isFinite(y) && isFinite(width) && isFinite(height)) {
|
297
|
-
this.viewBox = {x: x, y: y, width: width, height: height};
|
298
|
-
this.applyViewBox();
|
299
|
-
}
|
300
|
-
},
|
301
|
-
|
302
|
-
/**
|
303
|
-
* Adds one or more CSS classes to the element. Duplicate classes are automatically filtered out.
|
304
|
-
*
|
305
|
-
* For example:
|
306
|
-
*
|
307
|
-
* drawComponent.surface.addCls(sprite, 'x-visible');
|
308
|
-
*
|
309
|
-
* @param {Object} sprite The sprite to add the class to.
|
310
|
-
* @param {String/String[]} className The CSS class to add, or an array of classes
|
311
|
-
* @method
|
312
|
-
*/
|
313
|
-
addCls: Ext.emptyFn,
|
314
|
-
|
315
|
-
/**
|
316
|
-
* Removes one or more CSS classes from the element.
|
317
|
-
*
|
318
|
-
* For example:
|
319
|
-
*
|
320
|
-
* drawComponent.surface.removeCls(sprite, 'x-visible');
|
321
|
-
*
|
322
|
-
* @param {Object} sprite The sprite to remove the class from.
|
323
|
-
* @param {String/String[]} className The CSS class to remove, or an array of classes
|
324
|
-
* @method
|
325
|
-
*/
|
326
|
-
removeCls: Ext.emptyFn,
|
327
|
-
|
328
|
-
/**
|
329
|
-
* Sets CSS style attributes to an element.
|
330
|
-
*
|
331
|
-
* For example:
|
332
|
-
*
|
333
|
-
* drawComponent.surface.setStyle(sprite, {
|
334
|
-
* 'cursor': 'pointer'
|
335
|
-
* });
|
336
|
-
*
|
337
|
-
* @param {Object} sprite The sprite to add, or an array of classes to
|
338
|
-
* @param {Object} styles An Object with CSS styles.
|
339
|
-
* @method
|
340
|
-
*/
|
341
|
-
setStyle: Ext.emptyFn,
|
342
|
-
|
343
|
-
// @private
|
344
|
-
initGradients: function() {
|
345
|
-
if (this.hasOwnProperty('gradients')) {
|
346
|
-
var gradients = this.gradients,
|
347
|
-
gLen = gradients.length,
|
348
|
-
fn = this.addGradient,
|
349
|
-
g;
|
350
|
-
|
351
|
-
if (gradients) {
|
352
|
-
for (g = 0; g < gLen; g++) {
|
353
|
-
if (fn.call(this, gradients[g], g, gLen) === false) {
|
354
|
-
break;
|
355
|
-
}
|
356
|
-
}
|
357
|
-
}
|
358
|
-
}
|
359
|
-
},
|
360
|
-
|
361
|
-
// @private
|
362
|
-
initItems: function() {
|
363
|
-
var items = this.items;
|
364
|
-
this.items = new Ext.draw.CompositeSprite();
|
365
|
-
this.items.autoDestroy = true;
|
366
|
-
this.groups = new Ext.draw.CompositeSprite();
|
367
|
-
if (items) {
|
368
|
-
this.add(items);
|
369
|
-
}
|
370
|
-
},
|
371
|
-
|
372
|
-
// @private
|
373
|
-
initBackground: function(config) {
|
374
|
-
var me = this,
|
375
|
-
width = me.width,
|
376
|
-
height = me.height,
|
377
|
-
gradientId, gradient, backgroundSprite;
|
378
|
-
if (Ext.isString(config)) {
|
379
|
-
config = {
|
380
|
-
fill : config
|
381
|
-
};
|
382
|
-
}
|
383
|
-
if (config) {
|
384
|
-
if (config.gradient) {
|
385
|
-
gradient = config.gradient;
|
386
|
-
gradientId = gradient.id;
|
387
|
-
me.addGradient(gradient);
|
388
|
-
me.background = me.add({
|
389
|
-
type: 'rect',
|
390
|
-
x: 0,
|
391
|
-
y: 0,
|
392
|
-
width: width,
|
393
|
-
height: height,
|
394
|
-
fill: 'url(#' + gradientId + ')',
|
395
|
-
zIndex: -1
|
396
|
-
});
|
397
|
-
} else if (config.fill) {
|
398
|
-
me.background = me.add({
|
399
|
-
type: 'rect',
|
400
|
-
x: 0,
|
401
|
-
y: 0,
|
402
|
-
width: width,
|
403
|
-
height: height,
|
404
|
-
fill: config.fill,
|
405
|
-
zIndex: -1
|
406
|
-
});
|
407
|
-
} else if (config.image) {
|
408
|
-
me.background = me.add({
|
409
|
-
type: 'image',
|
410
|
-
x: 0,
|
411
|
-
y: 0,
|
412
|
-
width: width,
|
413
|
-
height: height,
|
414
|
-
src: config.image,
|
415
|
-
zIndex: -1
|
416
|
-
});
|
417
|
-
}
|
418
|
-
// prevent me.background to jeopardize me.items.getBBox
|
419
|
-
me.background.bboxExcluded = true;
|
420
|
-
}
|
421
|
-
},
|
422
|
-
|
423
|
-
/**
|
424
|
-
* Sets the size of the surface. Accomodates the background (if any) to fit the new size too.
|
425
|
-
*
|
426
|
-
* For example:
|
427
|
-
*
|
428
|
-
* drawComponent.surface.setSize(500, 500);
|
429
|
-
*
|
430
|
-
* This method is generally called when also setting the size of the draw Component.
|
431
|
-
*
|
432
|
-
* @param {Number} w The new width of the canvas.
|
433
|
-
* @param {Number} h The new height of the canvas.
|
434
|
-
*/
|
435
|
-
setSize: function(w, h) {
|
436
|
-
this.applyViewBox();
|
437
|
-
},
|
438
|
-
|
439
|
-
// @private
|
440
|
-
scrubAttrs: function(sprite) {
|
441
|
-
var i,
|
442
|
-
attrs = {},
|
443
|
-
exclude = {},
|
444
|
-
sattr = sprite.attr;
|
445
|
-
for (i in sattr) {
|
446
|
-
// Narrow down attributes to the main set
|
447
|
-
if (this.translateAttrs.hasOwnProperty(i)) {
|
448
|
-
// Translated attr
|
449
|
-
attrs[this.translateAttrs[i]] = sattr[i];
|
450
|
-
exclude[this.translateAttrs[i]] = true;
|
451
|
-
}
|
452
|
-
else if (this.availableAttrs.hasOwnProperty(i) && !exclude[i]) {
|
453
|
-
// Passtrhough attr
|
454
|
-
attrs[i] = sattr[i];
|
455
|
-
}
|
456
|
-
}
|
457
|
-
return attrs;
|
458
|
-
},
|
459
|
-
|
460
|
-
// @private
|
461
|
-
onClick: function(e) {
|
462
|
-
this.processEvent('click', e);
|
463
|
-
},
|
464
|
-
|
465
|
-
// @private
|
466
|
-
onDblClick: function(e) {
|
467
|
-
this.processEvent('dblclick', e);
|
468
|
-
},
|
469
|
-
|
470
|
-
// @private
|
471
|
-
onMouseUp: function(e) {
|
472
|
-
this.processEvent('mouseup', e);
|
473
|
-
},
|
474
|
-
|
475
|
-
// @private
|
476
|
-
onMouseDown: function(e) {
|
477
|
-
this.processEvent('mousedown', e);
|
478
|
-
},
|
479
|
-
|
480
|
-
// @private
|
481
|
-
onMouseOver: function(e) {
|
482
|
-
this.processEvent('mouseover', e);
|
483
|
-
},
|
484
|
-
|
485
|
-
// @private
|
486
|
-
onMouseOut: function(e) {
|
487
|
-
this.processEvent('mouseout', e);
|
488
|
-
},
|
489
|
-
|
490
|
-
// @private
|
491
|
-
onMouseMove: function(e) {
|
492
|
-
this.fireEvent('mousemove', e);
|
493
|
-
},
|
494
|
-
|
495
|
-
// @private
|
496
|
-
onMouseEnter: Ext.emptyFn,
|
497
|
-
|
498
|
-
// @private
|
499
|
-
onMouseLeave: Ext.emptyFn,
|
500
|
-
|
501
|
-
/**
|
502
|
-
* Adds a gradient definition to the Surface. Note that in some surface engines, adding
|
503
|
-
* a gradient via this method will not take effect if the surface has already been rendered.
|
504
|
-
* Therefore, it is preferred to pass the gradients as an item to the surface config, rather
|
505
|
-
* than calling this method, especially if the surface is rendered immediately (e.g. due to
|
506
|
-
* 'renderTo' in its config). For more information on how to create gradients in the Chart
|
507
|
-
* configuration object please refer to {@link Ext.chart.Chart}.
|
508
|
-
*
|
509
|
-
* The gradient object to be passed into this method is composed by:
|
510
|
-
*
|
511
|
-
* - **id** - string - The unique name of the gradient.
|
512
|
-
* - **angle** - number, optional - The angle of the gradient in degrees.
|
513
|
-
* - **stops** - object - An object with numbers as keys (from 0 to 100) and style objects as values.
|
514
|
-
*
|
515
|
-
* For example:
|
516
|
-
*
|
517
|
-
* drawComponent.surface.addGradient({
|
518
|
-
* id: 'gradientId',
|
519
|
-
* angle: 45,
|
520
|
-
* stops: {
|
521
|
-
* 0: {
|
522
|
-
* color: '#555'
|
523
|
-
* },
|
524
|
-
* 100: {
|
525
|
-
* color: '#ddd'
|
526
|
-
* }
|
527
|
-
* }
|
528
|
-
* });
|
529
|
-
*
|
530
|
-
* @param {Object} gradient A gradient config.
|
531
|
-
* @method
|
532
|
-
*/
|
533
|
-
addGradient: Ext.emptyFn,
|
534
|
-
|
535
|
-
/**
|
536
|
-
* Adds a Sprite to the surface. See {@link Ext.draw.Sprite} for the configuration object to be
|
537
|
-
* passed into this method.
|
538
|
-
*
|
539
|
-
* For example:
|
540
|
-
*
|
541
|
-
* drawComponent.surface.add({
|
542
|
-
* type: 'circle',
|
543
|
-
* fill: '#ffc',
|
544
|
-
* radius: 100,
|
545
|
-
* x: 100,
|
546
|
-
* y: 100
|
547
|
-
* });
|
548
|
-
*
|
549
|
-
* @param {Ext.draw.Sprite[]/Ext.draw.Sprite...} args One or more Sprite objects of configs.
|
550
|
-
* @return {Ext.draw.Sprite[]/Ext.draw.Sprite} The sprites added.
|
551
|
-
*/
|
552
|
-
add: function() {
|
553
|
-
var args = Array.prototype.slice.call(arguments),
|
554
|
-
sprite,
|
555
|
-
index,
|
556
|
-
hasMultipleArgs = args.length > 1,
|
557
|
-
items,
|
558
|
-
results,
|
559
|
-
i,
|
560
|
-
ln,
|
561
|
-
item;
|
562
|
-
|
563
|
-
if (hasMultipleArgs || Ext.isArray(args[0])) {
|
564
|
-
items = hasMultipleArgs ? args : args[0];
|
565
|
-
results = [];
|
566
|
-
|
567
|
-
for (i = 0, ln = items.length; i < ln; i++) {
|
568
|
-
item = items[i];
|
569
|
-
item = this.add(item);
|
570
|
-
results.push(item);
|
571
|
-
}
|
572
|
-
|
573
|
-
return results;
|
574
|
-
}
|
575
|
-
sprite = this.prepareItems(args[0], true)[0];
|
576
|
-
this.insertByZIndex(sprite);
|
577
|
-
this.onAdd(sprite);
|
578
|
-
return sprite;
|
579
|
-
},
|
580
|
-
|
581
|
-
/**
|
582
|
-
* @private
|
583
|
-
* Inserts a given sprite into the correct position in the items collection, according to
|
584
|
-
* its zIndex. It will be inserted at the end of an existing series of sprites with the same or
|
585
|
-
* lower zIndex. By ensuring sprites are always ordered, this allows surface subclasses to render
|
586
|
-
* the sprites in the correct order for proper z-index stacking.
|
587
|
-
* @param {Ext.draw.Sprite} sprite
|
588
|
-
* @return {Number} the sprite's new index in the list
|
589
|
-
*/
|
590
|
-
insertByZIndex: function(sprite) {
|
591
|
-
var me = this,
|
592
|
-
sprites = me.items.items,
|
593
|
-
len = sprites.length,
|
594
|
-
ceil = Math.ceil,
|
595
|
-
zIndex = sprite.attr.zIndex,
|
596
|
-
idx = len,
|
597
|
-
high = idx - 1,
|
598
|
-
low = 0,
|
599
|
-
otherZIndex;
|
600
|
-
|
601
|
-
if (me.orderSpritesByZIndex && len && zIndex < sprites[high].attr.zIndex) {
|
602
|
-
// Find the target index via a binary search for speed
|
603
|
-
while (low <= high) {
|
604
|
-
idx = ceil((low + high) / 2);
|
605
|
-
otherZIndex = sprites[idx].attr.zIndex;
|
606
|
-
if (otherZIndex > zIndex) {
|
607
|
-
high = idx - 1;
|
608
|
-
}
|
609
|
-
else if (otherZIndex < zIndex) {
|
610
|
-
low = idx + 1;
|
611
|
-
}
|
612
|
-
else {
|
613
|
-
break;
|
614
|
-
}
|
615
|
-
}
|
616
|
-
// Step forward to the end of a sequence of the same or lower z-index
|
617
|
-
while (idx < len && sprites[idx].attr.zIndex <= zIndex) {
|
618
|
-
idx++;
|
619
|
-
}
|
620
|
-
}
|
621
|
-
|
622
|
-
me.items.insert(idx, sprite);
|
623
|
-
return idx;
|
624
|
-
},
|
625
|
-
|
626
|
-
onAdd: function(sprite) {
|
627
|
-
var group = sprite.group,
|
628
|
-
draggable = sprite.draggable,
|
629
|
-
groups, ln, i;
|
630
|
-
if (group) {
|
631
|
-
groups = [].concat(group);
|
632
|
-
ln = groups.length;
|
633
|
-
for (i = 0; i < ln; i++) {
|
634
|
-
group = groups[i];
|
635
|
-
this.getGroup(group).add(sprite);
|
636
|
-
}
|
637
|
-
delete sprite.group;
|
638
|
-
}
|
639
|
-
if (draggable) {
|
640
|
-
sprite.initDraggable();
|
641
|
-
}
|
642
|
-
},
|
643
|
-
|
644
|
-
/**
|
645
|
-
* Removes a given sprite from the surface, optionally destroying the sprite in the process.
|
646
|
-
* You can also call the sprite own `remove` method.
|
647
|
-
*
|
648
|
-
* For example:
|
649
|
-
*
|
650
|
-
* drawComponent.surface.remove(sprite);
|
651
|
-
* //or...
|
652
|
-
* sprite.remove();
|
653
|
-
*
|
654
|
-
* @param {Ext.draw.Sprite} sprite
|
655
|
-
* @param {Boolean} destroySprite
|
656
|
-
*/
|
657
|
-
remove: function(sprite, destroySprite) {
|
658
|
-
if (sprite) {
|
659
|
-
this.items.remove(sprite);
|
660
|
-
|
661
|
-
var groups = [].concat(this.groups.items),
|
662
|
-
gLen = groups.length,
|
663
|
-
g;
|
664
|
-
|
665
|
-
for (g = 0; g < gLen; g++) {
|
666
|
-
groups[g].remove(sprite);
|
667
|
-
}
|
668
|
-
|
669
|
-
sprite.onRemove();
|
670
|
-
if (destroySprite === true) {
|
671
|
-
sprite.destroy();
|
672
|
-
}
|
673
|
-
}
|
674
|
-
},
|
675
|
-
|
676
|
-
/**
|
677
|
-
* Removes all sprites from the surface, optionally destroying the sprites in the process.
|
678
|
-
*
|
679
|
-
* For example:
|
680
|
-
*
|
681
|
-
* drawComponent.surface.removeAll();
|
682
|
-
*
|
683
|
-
* @param {Boolean} destroySprites Whether to destroy all sprites when removing them.
|
684
|
-
*/
|
685
|
-
removeAll: function(destroySprites) {
|
686
|
-
var items = this.items.items,
|
687
|
-
ln = items.length,
|
688
|
-
i;
|
689
|
-
for (i = ln - 1; i > -1; i--) {
|
690
|
-
this.remove(items[i], destroySprites);
|
691
|
-
}
|
692
|
-
},
|
693
|
-
|
694
|
-
onRemove: Ext.emptyFn,
|
695
|
-
|
696
|
-
onDestroy: Ext.emptyFn,
|
697
|
-
|
698
|
-
/**
|
699
|
-
* @private Using the current viewBox property and the surface's width and height, calculate the
|
700
|
-
* appropriate viewBoxShift that will be applied as a persistent transform to all sprites.
|
701
|
-
*/
|
702
|
-
applyViewBox: function() {
|
703
|
-
var me = this,
|
704
|
-
viewBox = me.viewBox,
|
705
|
-
width = me.width || 1, // Avoid problems in division
|
706
|
-
height = me.height || 1,
|
707
|
-
viewBoxX, viewBoxY, viewBoxWidth, viewBoxHeight,
|
708
|
-
relativeHeight, relativeWidth, size;
|
709
|
-
|
710
|
-
if (viewBox && (width || height)) {
|
711
|
-
viewBoxX = viewBox.x;
|
712
|
-
viewBoxY = viewBox.y;
|
713
|
-
viewBoxWidth = viewBox.width;
|
714
|
-
viewBoxHeight = viewBox.height;
|
715
|
-
relativeHeight = height / viewBoxHeight;
|
716
|
-
relativeWidth = width / viewBoxWidth;
|
717
|
-
size = Math.min(relativeWidth, relativeHeight);
|
718
|
-
|
719
|
-
if (viewBoxWidth * size < width) {
|
720
|
-
viewBoxX -= (width - viewBoxWidth * size) / 2 / size;
|
721
|
-
}
|
722
|
-
if (viewBoxHeight * size < height) {
|
723
|
-
viewBoxY -= (height - viewBoxHeight * size) / 2 / size;
|
724
|
-
}
|
725
|
-
|
726
|
-
me.viewBoxShift = {
|
727
|
-
dx: -viewBoxX,
|
728
|
-
dy: -viewBoxY,
|
729
|
-
scale: size
|
730
|
-
};
|
731
|
-
|
732
|
-
if (me.background) {
|
733
|
-
me.background.setAttributes(Ext.apply({}, {
|
734
|
-
x: viewBoxX,
|
735
|
-
y: viewBoxY,
|
736
|
-
width: width / size,
|
737
|
-
height: height / size
|
738
|
-
}, { hidden: false }), true);
|
739
|
-
}
|
740
|
-
} else {
|
741
|
-
if (me.background && width && height) {
|
742
|
-
me.background.setAttributes(Ext.apply({x: 0, y: 0, width: width, height: height}, { hidden: false }), true);
|
743
|
-
}
|
744
|
-
}
|
745
|
-
},
|
746
|
-
|
747
|
-
|
748
|
-
getBBox: function (sprite, isWithoutTransform) {
|
749
|
-
var realPath = this["getPath" + sprite.type](sprite);
|
750
|
-
if (isWithoutTransform) {
|
751
|
-
sprite.bbox.plain = sprite.bbox.plain || Ext.draw.Draw.pathDimensions(realPath);
|
752
|
-
return sprite.bbox.plain;
|
753
|
-
}
|
754
|
-
if (sprite.dirtyTransform) {
|
755
|
-
this.applyTransformations(sprite, true);
|
756
|
-
}
|
757
|
-
sprite.bbox.transform = sprite.bbox.transform || Ext.draw.Draw.pathDimensions(Ext.draw.Draw.mapPath(realPath, sprite.matrix));
|
758
|
-
return sprite.bbox.transform;
|
759
|
-
},
|
760
|
-
|
761
|
-
transformToViewBox: function (x, y) {
|
762
|
-
if (this.viewBoxShift) {
|
763
|
-
var me = this, shift = me.viewBoxShift;
|
764
|
-
return [x / shift.scale - shift.dx, y / shift.scale - shift.dy];
|
765
|
-
} else {
|
766
|
-
return [x, y];
|
767
|
-
}
|
768
|
-
},
|
769
|
-
|
770
|
-
// @private
|
771
|
-
applyTransformations: function(sprite, onlyMatrix) {
|
772
|
-
if (sprite.type == 'text') {
|
773
|
-
// TODO: getTextBBox function always take matrix into account no matter whether `isWithoutTransform` is true. Fix that.
|
774
|
-
sprite.bbox.transform = 0;
|
775
|
-
this.transform(sprite, false);
|
776
|
-
}
|
777
|
-
|
778
|
-
|
779
|
-
sprite.dirtyTransform = false;
|
780
|
-
|
781
|
-
var me = this,
|
782
|
-
attr = sprite.attr;
|
783
|
-
|
784
|
-
if (attr.translation.x != null || attr.translation.y != null) {
|
785
|
-
me.translate(sprite);
|
786
|
-
}
|
787
|
-
if (attr.scaling.x != null || attr.scaling.y != null) {
|
788
|
-
me.scale(sprite);
|
789
|
-
}
|
790
|
-
if (attr.rotation.degrees != null) {
|
791
|
-
me.rotate(sprite);
|
792
|
-
}
|
793
|
-
|
794
|
-
sprite.bbox.transform = 0;
|
795
|
-
this.transform(sprite, onlyMatrix);
|
796
|
-
sprite.transformations = [];
|
797
|
-
},
|
798
|
-
|
799
|
-
// @private
|
800
|
-
rotate: function (sprite) {
|
801
|
-
var bbox,
|
802
|
-
deg = sprite.attr.rotation.degrees,
|
803
|
-
centerX = sprite.attr.rotation.x,
|
804
|
-
centerY = sprite.attr.rotation.y;
|
805
|
-
if (!Ext.isNumber(centerX) || !Ext.isNumber(centerY)) {
|
806
|
-
bbox = this.getBBox(sprite, true);
|
807
|
-
centerX = !Ext.isNumber(centerX) ? bbox.x + bbox.width / 2 : centerX;
|
808
|
-
centerY = !Ext.isNumber(centerY) ? bbox.y + bbox.height / 2 : centerY;
|
809
|
-
}
|
810
|
-
sprite.transformations.push({
|
811
|
-
type: "rotate",
|
812
|
-
degrees: deg,
|
813
|
-
x: centerX,
|
814
|
-
y: centerY
|
815
|
-
});
|
816
|
-
},
|
817
|
-
|
818
|
-
// @private
|
819
|
-
translate: function(sprite) {
|
820
|
-
var x = sprite.attr.translation.x || 0,
|
821
|
-
y = sprite.attr.translation.y || 0;
|
822
|
-
sprite.transformations.push({
|
823
|
-
type: "translate",
|
824
|
-
x: x,
|
825
|
-
y: y
|
826
|
-
});
|
827
|
-
},
|
828
|
-
|
829
|
-
// @private
|
830
|
-
scale: function(sprite) {
|
831
|
-
var bbox,
|
832
|
-
x = sprite.attr.scaling.x || 1,
|
833
|
-
y = sprite.attr.scaling.y || 1,
|
834
|
-
centerX = sprite.attr.scaling.centerX,
|
835
|
-
centerY = sprite.attr.scaling.centerY;
|
836
|
-
|
837
|
-
if (!Ext.isNumber(centerX) || !Ext.isNumber(centerY)) {
|
838
|
-
bbox = this.getBBox(sprite, true);
|
839
|
-
centerX = !Ext.isNumber(centerX) ? bbox.x + bbox.width / 2 : centerX;
|
840
|
-
centerY = !Ext.isNumber(centerY) ? bbox.y + bbox.height / 2 : centerY;
|
841
|
-
}
|
842
|
-
sprite.transformations.push({
|
843
|
-
type: "scale",
|
844
|
-
x: x,
|
845
|
-
y: y,
|
846
|
-
centerX: centerX,
|
847
|
-
centerY: centerY
|
848
|
-
});
|
849
|
-
},
|
850
|
-
|
851
|
-
// @private
|
852
|
-
rectPath: function (x, y, w, h, r) {
|
853
|
-
if (r) {
|
854
|
-
return [["M", x + r, y], ["l", w - r * 2, 0], ["a", r, r, 0, 0, 1, r, r], ["l", 0, h - r * 2], ["a", r, r, 0, 0, 1, -r, r], ["l", r * 2 - w, 0], ["a", r, r, 0, 0, 1, -r, -r], ["l", 0, r * 2 - h], ["a", r, r, 0, 0, 1, r, -r], ["z"]];
|
855
|
-
}
|
856
|
-
return [["M", x, y], ["l", w, 0], ["l", 0, h], ["l", -w, 0], ["z"]];
|
857
|
-
},
|
858
|
-
|
859
|
-
// @private
|
860
|
-
ellipsePath: function (x, y, rx, ry) {
|
861
|
-
if (ry == null) {
|
862
|
-
ry = rx;
|
863
|
-
}
|
864
|
-
return [["M", x, y], ["m", 0, -ry], ["a", rx, ry, 0, 1, 1, 0, 2 * ry], ["a", rx, ry, 0, 1, 1, 0, -2 * ry], ["z"]];
|
865
|
-
},
|
866
|
-
|
867
|
-
// @private
|
868
|
-
getPathpath: function (el) {
|
869
|
-
return el.attr.path;
|
870
|
-
},
|
871
|
-
|
872
|
-
// @private
|
873
|
-
getPathcircle: function (el) {
|
874
|
-
var a = el.attr;
|
875
|
-
return this.ellipsePath(a.x, a.y, a.radius, a.radius);
|
876
|
-
},
|
877
|
-
|
878
|
-
// @private
|
879
|
-
getPathellipse: function (el) {
|
880
|
-
var a = el.attr;
|
881
|
-
return this.ellipsePath(a.x, a.y,
|
882
|
-
a.radiusX || (a.width / 2) || 0,
|
883
|
-
a.radiusY || (a.height / 2) || 0);
|
884
|
-
},
|
885
|
-
|
886
|
-
// @private
|
887
|
-
getPathrect: function (el) {
|
888
|
-
var a = el.attr;
|
889
|
-
return this.rectPath(a.x || 0, a.y || 0, a.width || 0, a.height || 0, a.r || 0);
|
890
|
-
},
|
891
|
-
|
892
|
-
// @private
|
893
|
-
getPathimage: function (el) {
|
894
|
-
var a = el.attr;
|
895
|
-
return this.rectPath(a.x || 0, a.y || 0, a.width, a.height);
|
896
|
-
},
|
897
|
-
|
898
|
-
// @private
|
899
|
-
getPathtext: function (el) {
|
900
|
-
var bbox = this.getBBoxText(el);
|
901
|
-
return this.rectPath(bbox.x, bbox.y, bbox.width, bbox.height);
|
902
|
-
},
|
903
|
-
|
904
|
-
createGroup: function(id) {
|
905
|
-
var group = this.groups.get(id);
|
906
|
-
if (!group) {
|
907
|
-
group = new Ext.draw.CompositeSprite({
|
908
|
-
surface: this
|
909
|
-
});
|
910
|
-
group.id = id || Ext.id(null, 'ext-surface-group-');
|
911
|
-
this.groups.add(group);
|
912
|
-
}
|
913
|
-
return group;
|
914
|
-
},
|
915
|
-
|
916
|
-
/**
|
917
|
-
* Returns a new group or an existent group associated with the current surface.
|
918
|
-
* The group returned is a {@link Ext.draw.CompositeSprite} group.
|
919
|
-
*
|
920
|
-
* For example:
|
921
|
-
*
|
922
|
-
* var spriteGroup = drawComponent.surface.getGroup('someGroupId');
|
923
|
-
*
|
924
|
-
* @param {String} id The unique identifier of the group.
|
925
|
-
* @return {Object} The {@link Ext.draw.CompositeSprite}.
|
926
|
-
*/
|
927
|
-
getGroup: function(id) {
|
928
|
-
var group;
|
929
|
-
if (typeof id == "string") {
|
930
|
-
group = this.groups.get(id);
|
931
|
-
if (!group) {
|
932
|
-
group = this.createGroup(id);
|
933
|
-
}
|
934
|
-
} else {
|
935
|
-
group = id;
|
936
|
-
}
|
937
|
-
return group;
|
938
|
-
},
|
939
|
-
|
940
|
-
// @private
|
941
|
-
prepareItems: function(items, applyDefaults) {
|
942
|
-
items = [].concat(items);
|
943
|
-
// Make sure defaults are applied and item is initialized
|
944
|
-
var item, i, ln;
|
945
|
-
for (i = 0, ln = items.length; i < ln; i++) {
|
946
|
-
item = items[i];
|
947
|
-
if (!(item instanceof Ext.draw.Sprite)) {
|
948
|
-
// Temporary, just take in configs...
|
949
|
-
item.surface = this;
|
950
|
-
items[i] = this.createItem(item);
|
951
|
-
} else {
|
952
|
-
item.surface = this;
|
953
|
-
}
|
954
|
-
}
|
955
|
-
return items;
|
956
|
-
},
|
957
|
-
|
958
|
-
/**
|
959
|
-
* Changes the text in the sprite element. The sprite must be a `text` sprite.
|
960
|
-
* This method can also be called from {@link Ext.draw.Sprite}.
|
961
|
-
*
|
962
|
-
* For example:
|
963
|
-
*
|
964
|
-
* var spriteGroup = drawComponent.surface.setText(sprite, 'my new text');
|
965
|
-
*
|
966
|
-
* @param {Object} sprite The Sprite to change the text.
|
967
|
-
* @param {String} text The new text to be set.
|
968
|
-
* @method
|
969
|
-
*/
|
970
|
-
setText: Ext.emptyFn,
|
971
|
-
|
972
|
-
// @private Creates an item and appends it to the surface. Called
|
973
|
-
// as an internal method when calling `add`.
|
974
|
-
createItem: Ext.emptyFn,
|
975
|
-
|
976
|
-
/**
|
977
|
-
* Retrieves the id of this component.
|
978
|
-
* Will autogenerate an id if one has not already been set.
|
979
|
-
*/
|
980
|
-
getId: function() {
|
981
|
-
return this.id || (this.id = Ext.id(null, 'ext-surface-'));
|
982
|
-
},
|
983
|
-
|
984
|
-
/**
|
985
|
-
* Destroys the surface. This is done by removing all components from it and
|
986
|
-
* also removing its reference to a DOM element.
|
987
|
-
*
|
988
|
-
* For example:
|
989
|
-
*
|
990
|
-
* drawComponent.surface.destroy();
|
991
|
-
*/
|
992
|
-
destroy: function() {
|
993
|
-
var me = this;
|
994
|
-
delete me.domRef;
|
995
|
-
if (me.background) {
|
996
|
-
me.background.destroy();
|
997
|
-
}
|
998
|
-
me.removeAll(true);
|
999
|
-
Ext.destroy(me.groups.items);
|
1000
|
-
}
|
1001
|
-
});
|