Initial rename of graphics classes
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/7d529524 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/7d529524 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/7d529524 Branch: refs/heads/svg-rename Commit: 7d529524d7a9e5c9d75cf31d89a83a3d0de3e39b Parents: cb5e88e Author: Harbs <[email protected]> Authored: Thu Jul 21 22:58:12 2016 +0300 Committer: Harbs <[email protected]> Committed: Thu Jul 21 22:58:12 2016 +0300 ---------------------------------------------------------------------- .../apache/flex/charts/beads/AxisBaseBead.as | 10 +- .../flex/charts/beads/layouts/PieChartLayout.as | 4 +- .../org/apache/flex/charts/core/IAxisBead.as | 2 +- .../org/apache/flex/charts/core/IAxisGroup.as | 4 +- .../flex/charts/optimized/SVGBoxItemRenderer.as | 10 +- .../flex/charts/optimized/SVGChartAxisGroup.as | 6 +- .../flex/charts/optimized/SVGChartDataGroup.as | 2 +- .../optimized/SVGLineSegmentItemRenderer.as | 8 +- .../charts/optimized/SVGWedgeItemRenderer.as | 8 +- .../charts/supportClasses/BoxItemRenderer.as | 10 +- .../charts/supportClasses/ChartAxisGroup.as | 6 +- .../supportClasses/ILineSegmentItemRenderer.as | 2 +- .../charts/supportClasses/IWedgeItemRenderer.as | 4 +- .../supportClasses/LineSegmentItemRenderer.as | 4 +- .../charts/supportClasses/WedgeItemRenderer.as | 10 +- .../flex/org/apache/flex/createjs/CheckBox.as | 4 +- .../main/flex/org/apache/flex/createjs/Label.as | 4 +- .../flex/org/apache/flex/createjs/TextButton.as | 4 +- .../apache/flex/createjs/core/CreateJSBase.as | 6 +- .../org/apache/flex/createjs/graphics/Circle.as | 10 +- .../flex/createjs/graphics/GraphicShape.as | 8 +- .../org/apache/flex/createjs/graphics/Rect.as | 10 +- .../Graphics/src/main/flex/GraphicsClasses.as | 20 +- .../org/apache/flex/core/graphics/Circle.as | 102 -- .../org/apache/flex/core/graphics/Ellipse.as | 94 - .../apache/flex/core/graphics/GradientBase.as | 229 --- .../apache/flex/core/graphics/GradientEntry.as | 133 -- .../apache/flex/core/graphics/GraphicShape.as | 213 --- .../flex/core/graphics/GraphicsContainer.as | 302 --- .../flex/org/apache/flex/core/graphics/IFill.as | 32 - .../org/apache/flex/core/graphics/IStroke.as | 29 - .../apache/flex/core/graphics/LinearGradient.as | 123 -- .../flex/org/apache/flex/core/graphics/Path.as | 100 - .../flex/org/apache/flex/core/graphics/Rect.as | 90 - .../org/apache/flex/core/graphics/SolidColor.as | 136 -- .../flex/core/graphics/SolidColorStroke.as | 130 -- .../flex/org/apache/flex/core/graphics/Text.as | 147 -- .../graphics/utils/AdvancedLayoutFeatures.as | 1140 ------------ .../core/graphics/utils/CompoundTransform.as | 777 -------- .../core/graphics/utils/IAssetLayoutFeatures.as | 371 ---- .../flex/core/graphics/utils/MatrixUtil.as | 1605 ---------------- .../flex/core/graphics/utils/PathHelper.as | 1712 ------------------ .../core/graphics/utils/TransformOffsets.as | 367 ---- .../org/apache/flex/graphics/GradientBase.as | 229 +++ .../org/apache/flex/graphics/GradientEntry.as | 133 ++ .../main/flex/org/apache/flex/graphics/IFill.as | 32 + .../flex/org/apache/flex/graphics/IStroke.as | 29 + .../flex/org/apache/flex/graphics/SolidColor.as | 136 ++ .../apache/flex/graphics/SolidColorStroke.as | 130 ++ .../graphics/utils/AdvancedLayoutFeatures.as | 1140 ++++++++++++ .../flex/graphics/utils/CompoundTransform.as | 777 ++++++++ .../flex/graphics/utils/IAssetLayoutFeatures.as | 371 ++++ .../apache/flex/graphics/utils/MatrixUtil.as | 1605 ++++++++++++++++ .../apache/flex/graphics/utils/PathHelper.as | 1712 ++++++++++++++++++ .../flex/graphics/utils/TransformOffsets.as | 367 ++++ .../src/main/flex/org/apache/flex/svg/Circle.as | 102 ++ .../main/flex/org/apache/flex/svg/Ellipse.as | 94 + .../flex/org/apache/flex/svg/GraphicShape.as | 213 +++ .../org/apache/flex/svg/GraphicsContainer.as | 302 +++ .../flex/org/apache/flex/svg/LinearGradient.as | 123 ++ .../src/main/flex/org/apache/flex/svg/Path.as | 100 + .../src/main/flex/org/apache/flex/svg/Rect.as | 90 + .../src/main/flex/org/apache/flex/svg/Text.as | 147 ++ .../src/main/resources/basic-manifest.xml | 18 +- .../apache/flex/html/beads/DataGridLinesBead.as | 8 +- .../flex/html/beads/DecrementButtonView.as | 8 +- .../flex/html/beads/IncrementButtonView.as | 8 +- .../apache/flex/html/beads/RangeStepperView.as | 4 +- .../html/supportClasses/GraphicsItemRenderer.as | 2 +- .../flex/mobile/beads/ToggleSwitchView.as | 6 +- .../FlexJSTest_SVG/src/GraphicsView.mxml | 18 +- manualtests/FlexJSTest_SVG/src/SkinsView.mxml | 4 +- 72 files changed, 7948 insertions(+), 7948 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/AxisBaseBead.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/AxisBaseBead.as b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/AxisBaseBead.as index 5db25fe..b141c84 100644 --- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/AxisBaseBead.as +++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/AxisBaseBead.as @@ -22,11 +22,11 @@ package org.apache.flex.charts.beads import org.apache.flex.charts.core.IAxisGroup; import org.apache.flex.core.IStrand; import org.apache.flex.core.UIBase; - import org.apache.flex.core.graphics.GraphicsContainer; - import org.apache.flex.core.graphics.IFill; - import org.apache.flex.core.graphics.IStroke; - import org.apache.flex.core.graphics.SolidColor; - import org.apache.flex.core.graphics.SolidColorStroke; + import org.apache.flex.svg.GraphicsContainer; + import org.apache.flex.graphics.IFill; + import org.apache.flex.graphics.IStroke; + import org.apache.flex.graphics.SolidColor; + import org.apache.flex.graphics.SolidColorStroke; /** * The AxisBaseBead is the base class for the chart axis beads. http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/PieChartLayout.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/PieChartLayout.as b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/PieChartLayout.as index 7fb2188..ed4d75e 100644 --- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/PieChartLayout.as +++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/beads/layouts/PieChartLayout.as @@ -26,8 +26,8 @@ package org.apache.flex.charts.beads.layouts import org.apache.flex.core.ISelectionModel; import org.apache.flex.core.ILayoutHost; import org.apache.flex.core.IParentIUIBase; - import org.apache.flex.core.graphics.IFill; - import org.apache.flex.core.graphics.SolidColor; + import org.apache.flex.graphics.IFill; + import org.apache.flex.graphics.SolidColor; import org.apache.flex.events.Event; import org.apache.flex.events.IEventDispatcher; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/IAxisBead.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/IAxisBead.as b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/IAxisBead.as index 8332e31..a2a513b 100644 --- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/IAxisBead.as +++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/IAxisBead.as @@ -19,7 +19,7 @@ package org.apache.flex.charts.core { import org.apache.flex.core.IBead; - import org.apache.flex.core.graphics.IStroke; + import org.apache.flex.graphics.IStroke; public interface IAxisBead extends IBead { http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/IAxisGroup.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/IAxisGroup.as b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/IAxisGroup.as index 2a5a2a4..23e711f 100644 --- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/IAxisGroup.as +++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/core/IAxisGroup.as @@ -18,8 +18,8 @@ //////////////////////////////////////////////////////////////////////////////// package org.apache.flex.charts.core { - import org.apache.flex.core.graphics.IFill; - import org.apache.flex.core.graphics.IStroke; + import org.apache.flex.graphics.IFill; + import org.apache.flex.graphics.IStroke; /** * The IAxisGroup defines the interface for classes that provide drawing http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGBoxItemRenderer.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGBoxItemRenderer.as b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGBoxItemRenderer.as index d390eca..20f4c46 100644 --- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGBoxItemRenderer.as +++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGBoxItemRenderer.as @@ -20,11 +20,11 @@ package org.apache.flex.charts.optimized { import org.apache.flex.charts.core.IChartItemRenderer; import org.apache.flex.charts.core.IChartSeries; - import org.apache.flex.core.graphics.GraphicsContainer; - import org.apache.flex.core.graphics.IFill; - import org.apache.flex.core.graphics.IStroke; - import org.apache.flex.core.graphics.SolidColor; - import org.apache.flex.core.graphics.SolidColorStroke; + import org.apache.flex.svg.GraphicsContainer; + import org.apache.flex.graphics.IFill; + import org.apache.flex.graphics.IStroke; + import org.apache.flex.graphics.SolidColor; + import org.apache.flex.graphics.SolidColorStroke; import org.apache.flex.html.supportClasses.DataItemRenderer; import org.apache.flex.html.supportClasses.GraphicsItemRenderer; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGChartAxisGroup.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGChartAxisGroup.as b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGChartAxisGroup.as index 7853919..e9e434b 100644 --- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGChartAxisGroup.as +++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGChartAxisGroup.as @@ -19,9 +19,9 @@ package org.apache.flex.charts.optimized { import org.apache.flex.charts.core.IAxisGroup; - import org.apache.flex.core.graphics.GraphicsContainer; - import org.apache.flex.core.graphics.IFill; - import org.apache.flex.core.graphics.IStroke; + import org.apache.flex.svg.GraphicsContainer; + import org.apache.flex.graphics.IFill; + import org.apache.flex.graphics.IStroke; /** * The SVGChartAxisGroup provides a GraphicsContainer whose drawing functions http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGChartDataGroup.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGChartDataGroup.as b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGChartDataGroup.as index 385a55b..0f3a28d 100644 --- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGChartDataGroup.as +++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGChartDataGroup.as @@ -26,7 +26,7 @@ package org.apache.flex.charts.optimized import org.apache.flex.core.IItemRendererParent; import org.apache.flex.core.IStrand; import org.apache.flex.core.UIBase; - import org.apache.flex.core.graphics.GraphicsContainer; + import org.apache.flex.svg.GraphicsContainer; import org.apache.flex.events.Event; import org.apache.flex.geom.Point; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGLineSegmentItemRenderer.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGLineSegmentItemRenderer.as b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGLineSegmentItemRenderer.as index 343efc1..3300a76 100644 --- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGLineSegmentItemRenderer.as +++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGLineSegmentItemRenderer.as @@ -19,10 +19,10 @@ package org.apache.flex.charts.optimized { import org.apache.flex.charts.core.IChartSeries; - import org.apache.flex.core.graphics.GraphicsContainer; - import org.apache.flex.core.graphics.IStroke; - import org.apache.flex.core.graphics.Path; - import org.apache.flex.core.graphics.SolidColorStroke; + import org.apache.flex.svg.GraphicsContainer; + import org.apache.flex.graphics.IStroke; + import org.apache.flex.svg.Path; + import org.apache.flex.graphics.SolidColorStroke; import org.apache.flex.html.supportClasses.DataItemRenderer; import org.apache.flex.charts.supportClasses.ILineSegmentItemRenderer; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGWedgeItemRenderer.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGWedgeItemRenderer.as b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGWedgeItemRenderer.as index e60595f..0c08401 100644 --- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGWedgeItemRenderer.as +++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/optimized/SVGWedgeItemRenderer.as @@ -19,10 +19,10 @@ package org.apache.flex.charts.optimized { import org.apache.flex.charts.core.IChartSeries; - import org.apache.flex.core.graphics.GraphicsContainer; - import org.apache.flex.core.graphics.IFill; - import org.apache.flex.core.graphics.IStroke; - import org.apache.flex.core.graphics.Path; + import org.apache.flex.svg.GraphicsContainer; + import org.apache.flex.graphics.IFill; + import org.apache.flex.graphics.IStroke; + import org.apache.flex.svg.Path; import org.apache.flex.html.supportClasses.DataItemRenderer; import org.apache.flex.charts.supportClasses.IWedgeItemRenderer; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/BoxItemRenderer.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/BoxItemRenderer.as b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/BoxItemRenderer.as index 2fabdba..573a192 100644 --- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/BoxItemRenderer.as +++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/BoxItemRenderer.as @@ -21,11 +21,11 @@ package org.apache.flex.charts.supportClasses import org.apache.flex.charts.core.IChartItemRenderer; import org.apache.flex.charts.core.IChartSeries; import org.apache.flex.core.IBead; - import org.apache.flex.core.graphics.IFill; - import org.apache.flex.core.graphics.IStroke; - import org.apache.flex.core.graphics.Rect; - import org.apache.flex.core.graphics.SolidColor; - import org.apache.flex.core.graphics.LinearGradient; + import org.apache.flex.graphics.IFill; + import org.apache.flex.graphics.IStroke; + import org.apache.flex.svg.Rect; + import org.apache.flex.graphics.SolidColor; + import org.apache.flex.svg.LinearGradient; import org.apache.flex.html.supportClasses.DataItemRenderer; /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ChartAxisGroup.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ChartAxisGroup.as b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ChartAxisGroup.as index d41b32b..2a85372 100644 --- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ChartAxisGroup.as +++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ChartAxisGroup.as @@ -21,9 +21,9 @@ package org.apache.flex.charts.supportClasses import org.apache.flex.charts.core.IAxisGroup; import org.apache.flex.core.IChrome; import org.apache.flex.core.UIBase; - import org.apache.flex.core.graphics.IFill; - import org.apache.flex.core.graphics.IStroke; - import org.apache.flex.core.graphics.Path; + import org.apache.flex.graphics.IFill; + import org.apache.flex.graphics.IStroke; + import org.apache.flex.svg.Path; import org.apache.flex.html.Label; /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ILineSegmentItemRenderer.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ILineSegmentItemRenderer.as b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ILineSegmentItemRenderer.as index a6f3c22..0ec078e 100644 --- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ILineSegmentItemRenderer.as +++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/ILineSegmentItemRenderer.as @@ -19,7 +19,7 @@ package org.apache.flex.charts.supportClasses { import org.apache.flex.charts.core.IChartItemRenderer; - import org.apache.flex.core.graphics.IStroke; + import org.apache.flex.graphics.IStroke; /** * The ILineSegmentItemRenderer interface must be implemented by any class that http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/IWedgeItemRenderer.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/IWedgeItemRenderer.as b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/IWedgeItemRenderer.as index bf66140..dd53df4 100644 --- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/IWedgeItemRenderer.as +++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/IWedgeItemRenderer.as @@ -19,8 +19,8 @@ package org.apache.flex.charts.supportClasses { import org.apache.flex.charts.core.IChartItemRenderer; - import org.apache.flex.core.graphics.IFill; - import org.apache.flex.core.graphics.IStroke; + import org.apache.flex.graphics.IFill; + import org.apache.flex.graphics.IStroke; /** * The IWedgeItemRenderer interface must be implemented by any class that http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/LineSegmentItemRenderer.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/LineSegmentItemRenderer.as b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/LineSegmentItemRenderer.as index 1f3b22b..5cc943e 100644 --- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/LineSegmentItemRenderer.as +++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/LineSegmentItemRenderer.as @@ -19,8 +19,8 @@ package org.apache.flex.charts.supportClasses { import org.apache.flex.charts.core.IChartSeries; - import org.apache.flex.core.graphics.IStroke; - import org.apache.flex.core.graphics.Path; + import org.apache.flex.graphics.IStroke; + import org.apache.flex.svg.Path; import org.apache.flex.html.supportClasses.DataItemRenderer; /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/WedgeItemRenderer.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/WedgeItemRenderer.as b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/WedgeItemRenderer.as index a5b43fb..c4aee25 100644 --- a/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/WedgeItemRenderer.as +++ b/frameworks/projects/Charts/src/main/flex/org/apache/flex/charts/supportClasses/WedgeItemRenderer.as @@ -20,11 +20,11 @@ package org.apache.flex.charts.supportClasses { import org.apache.flex.charts.core.IChartSeries; import org.apache.flex.core.IBead; - import org.apache.flex.core.graphics.IFill; - import org.apache.flex.core.graphics.IStroke; - import org.apache.flex.core.graphics.Path; - import org.apache.flex.core.graphics.SolidColor; - import org.apache.flex.core.graphics.LinearGradient; + import org.apache.flex.graphics.IFill; + import org.apache.flex.graphics.IStroke; + import org.apache.flex.svg.Path; + import org.apache.flex.graphics.SolidColor; + import org.apache.flex.svg.LinearGradient; import org.apache.flex.html.supportClasses.DataItemRenderer; /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/CheckBox.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/CheckBox.as b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/CheckBox.as index 9f83bb1..2faca3f 100644 --- a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/CheckBox.as +++ b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/CheckBox.as @@ -36,8 +36,8 @@ package org.apache.flex.createjs } import org.apache.flex.core.IToggleButtonModel; - import org.apache.flex.core.graphics.IFill; - import org.apache.flex.core.graphics.SolidColor; + import org.apache.flex.graphics.IFill; + import org.apache.flex.graphics.SolidColor; COMPILE::SWF public class CheckBox extends org.apache.flex.html.CheckBox http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/Label.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/Label.as b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/Label.as index fefac73..577e6da 100644 --- a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/Label.as +++ b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/Label.as @@ -33,8 +33,8 @@ package org.apache.flex.createjs } import org.apache.flex.core.ITextModel; - import org.apache.flex.core.graphics.IFill; - import org.apache.flex.core.graphics.SolidColor; + import org.apache.flex.graphics.IFill; + import org.apache.flex.graphics.SolidColor; /** * The Label class provides a static text string which may be colored. http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/TextButton.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/TextButton.as b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/TextButton.as index 068ad10..c0c1a83 100644 --- a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/TextButton.as +++ b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/TextButton.as @@ -34,8 +34,8 @@ package org.apache.flex.createjs } import org.apache.flex.core.ITextModel; - import org.apache.flex.core.graphics.IFill; - import org.apache.flex.core.graphics.SolidColor; + import org.apache.flex.graphics.IFill; + import org.apache.flex.graphics.SolidColor; /** * The TextButton class provides a clickable button. http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/core/CreateJSBase.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/core/CreateJSBase.as b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/core/CreateJSBase.as index 1b74e82..f0ffb08 100644 --- a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/core/CreateJSBase.as +++ b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/core/CreateJSBase.as @@ -28,9 +28,9 @@ package org.apache.flex.createjs.core import org.apache.flex.createjs.core.UIBase; import org.apache.flex.core.WrappedHTMLElement; - import org.apache.flex.core.graphics.IFill; - import org.apache.flex.core.graphics.IStroke; - import org.apache.flex.core.graphics.SolidColor; + import org.apache.flex.graphics.IFill; + import org.apache.flex.graphics.IStroke; + import org.apache.flex.graphics.SolidColor; } COMPILE::SWF http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/Circle.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/Circle.as b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/Circle.as index e6a31c4..a461425 100644 --- a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/Circle.as +++ b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/Circle.as @@ -20,7 +20,7 @@ package org.apache.flex.createjs.graphics { COMPILE::SWF { - import org.apache.flex.core.graphics.Circle + import org.apache.flex.svg.Circle } COMPILE::JS @@ -32,9 +32,9 @@ package org.apache.flex.createjs.graphics import org.apache.flex.core.WrappedHTMLElement; } - import org.apache.flex.core.graphics.IFill; - import org.apache.flex.core.graphics.SolidColor; - import org.apache.flex.core.graphics.SolidColorStroke; + import org.apache.flex.graphics.IFill; + import org.apache.flex.graphics.SolidColor; + import org.apache.flex.graphics.SolidColorStroke; /** * Creates a circle. @@ -46,7 +46,7 @@ package org.apache.flex.createjs.graphics */ COMPILE::SWF - public class Circle extends org.apache.flex.core.graphics.Circle + public class Circle extends org.apache.flex.svg.Circle { // nothing special for SWF version. } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/GraphicShape.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/GraphicShape.as b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/GraphicShape.as index abe02d3..6b09fc5 100644 --- a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/GraphicShape.as +++ b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/GraphicShape.as @@ -20,7 +20,7 @@ package org.apache.flex.createjs.graphics { COMPILE::SWF { - import org.apache.flex.core.graphics.GraphicShape + import org.apache.flex.svg.GraphicShape } COMPILE::JS @@ -32,8 +32,8 @@ package org.apache.flex.createjs.graphics import org.apache.flex.core.WrappedHTMLElement; } - import org.apache.flex.core.graphics.IFill; - import org.apache.flex.core.graphics.IStroke; + import org.apache.flex.graphics.IFill; + import org.apache.flex.graphics.IStroke; /** * This is the base class for CreateJS graphic shape components such as @@ -46,7 +46,7 @@ package org.apache.flex.createjs.graphics */ COMPILE::SWF - public class GraphicShape extends org.apache.flex.core.graphics.GraphicShape + public class GraphicShape extends org.apache.flex.svg.GraphicShape { // nothing special for SWF version. } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/Rect.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/Rect.as b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/Rect.as index 2e735bb..5059835 100644 --- a/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/Rect.as +++ b/frameworks/projects/CreateJS/src/main/flex/org/apache/flex/createjs/graphics/Rect.as @@ -20,7 +20,7 @@ package org.apache.flex.createjs.graphics { COMPILE::SWF { - import org.apache.flex.core.graphics.Rect + import org.apache.flex.svg.Rect } COMPILE::JS @@ -33,9 +33,9 @@ package org.apache.flex.createjs.graphics import org.apache.flex.core.WrappedHTMLElement; } - import org.apache.flex.core.graphics.IFill; - import org.apache.flex.core.graphics.SolidColor; - import org.apache.flex.core.graphics.SolidColorStroke; + import org.apache.flex.graphics.IFill; + import org.apache.flex.graphics.SolidColor; + import org.apache.flex.graphics.SolidColorStroke; /** * Creates a rectangle. @@ -47,7 +47,7 @@ package org.apache.flex.createjs.graphics */ COMPILE::SWF - public class Rect extends org.apache.flex.core.graphics.Rect + public class Rect extends org.apache.flex.svg.Rect { // nothing special for SWF version. } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as b/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as index c463f04..11d729c 100644 --- a/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as +++ b/frameworks/projects/Graphics/src/main/flex/GraphicsClasses.as @@ -28,16 +28,16 @@ package internal class GraphicsClasses { - import org.apache.flex.core.graphics.GraphicShape; GraphicShape; - import org.apache.flex.core.graphics.Rect; Rect; - import org.apache.flex.core.graphics.Ellipse; Ellipse; - import org.apache.flex.core.graphics.Circle; Circle; - import org.apache.flex.core.graphics.Path; Path; - import org.apache.flex.core.graphics.SolidColor; SolidColor; - import org.apache.flex.core.graphics.SolidColorStroke; SolidColorStroke; - import org.apache.flex.core.graphics.Text; Text; - import org.apache.flex.core.graphics.GraphicsContainer; GraphicsContainer; - import org.apache.flex.core.graphics.LinearGradient; LinearGradient; + import org.apache.flex.svg.GraphicShape; GraphicShape; + import org.apache.flex.svg.Rect; Rect; + import org.apache.flex.svg.Ellipse; Ellipse; + import org.apache.flex.svg.Circle; Circle; + import org.apache.flex.svg.Path; Path; + import org.apache.flex.graphics.SolidColor; SolidColor; + import org.apache.flex.graphics.SolidColorStroke; SolidColorStroke; + import org.apache.flex.svg.Text; Text; + import org.apache.flex.svg.GraphicsContainer; GraphicsContainer; + import org.apache.flex.svg.LinearGradient; LinearGradient; } } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Circle.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Circle.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Circle.as deleted file mode 100644 index c983e74..0000000 --- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Circle.as +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.flex.core.graphics -{ - COMPILE::SWF - { - import flash.geom.Point; - import flash.geom.Rectangle; - } - COMPILE::JS - { - import org.apache.flex.core.WrappedHTMLElement; - } - - public class Circle extends GraphicShape - { - private var _radius:Number; - - public function get radius():Number - { - return _radius; - } - - public function set radius(value:Number):void - { - _radius = value; - } - - COMPILE::JS - private var _circle:WrappedHTMLElement; - - /** - * Draw the circle. - * @param cx The x location of the center of the circle - * @param cy The y location of the center of the circle. - * @param radius The radius of the circle. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - * @flexjsignorecoercion SVGCircleElement - */ - public function drawCircle(cx:Number, cy:Number, radius:Number):void - { - COMPILE::SWF - { - graphics.clear(); - applyStroke(); - beginFill(new Rectangle(cx,cy,radius*2, radius*2),new Point(cx-radius,cy-radius)); - graphics.drawCircle(cx,cy,radius); - endFill(); - } - COMPILE::JS - { - var style:String = getStyleStr(); - - if (_circle == null) { - _circle = document.createElementNS('http://www.w3.org/2000/svg', 'ellipse') as WrappedHTMLElement; - _circle.flexjs_wrapper = this; - element.appendChild(_circle); - } - _circle.setAttribute('style', style); - if (stroke) - { - _circle.setAttribute('cx', String(radius + stroke.weight)); - _circle.setAttribute('cy', String(radius + stroke.weight)); - } - else - { - _circle.setAttribute('cx', String(radius)); - _circle.setAttribute('cy', String(radius)); - } - - _circle.setAttribute('rx', String(radius)); - _circle.setAttribute('ry', String(radius)); - - resize(x-radius, y-radius, (_circle as SVGCircleElement).getBBox()); - - } - } - - override protected function draw():void - { - drawCircle(0, 0, radius); - } - - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Ellipse.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Ellipse.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Ellipse.as deleted file mode 100644 index 732d2c0..0000000 --- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Ellipse.as +++ /dev/null @@ -1,94 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//////////////////////////////////////////////////////////////////////////////// -package org.apache.flex.core.graphics -{ - COMPILE::SWF - { - import flash.geom.Point; - import flash.geom.Rectangle; - } - COMPILE::JS - { - import org.apache.flex.core.WrappedHTMLElement; - } - - public class Ellipse extends GraphicShape - { - - COMPILE::JS - private var _ellipse:WrappedHTMLElement; - - /** - * Draw the ellipse. - * @param xp The x position of the top-left corner of the bounding box of the ellipse. - * @param yp The y position of the top-left corner of the bounding box of the ellipse. - * @param width The width of the ellipse. - * @param height The height of the ellipse. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - * @flexjsignorecoercion SVGEllipseElement - */ - public function drawEllipse(xp:Number, yp:Number, width:Number, height:Number):void - { - COMPILE::SWF - { - graphics.clear(); - applyStroke(); - beginFill(new Rectangle(xp, yp, width, height), new Point(xp,yp)); - graphics.drawEllipse(xp,yp,width,height); - endFill(); - } - COMPILE::JS - { - var style:String = getStyleStr(); - if (_ellipse == null) { - _ellipse = document.createElementNS('http://www.w3.org/2000/svg', 'ellipse') as WrappedHTMLElement; - _ellipse.flexjs_wrapper = this; - element.appendChild(_ellipse); - } - _ellipse.setAttribute('style', style); - if (stroke) - { - _ellipse.setAttribute('cx', String(width / 2 + stroke.weight)); - _ellipse.setAttribute('cy', String(height / 2 + stroke.weight)); - } - else - { - _ellipse.setAttribute('cx', String(width / 2)); - _ellipse.setAttribute('cy', String(height / 2)); - } - _ellipse.setAttribute('rx', String(width / 2)); - _ellipse.setAttribute('ry', String(height / 2)); - - resize(x, y, (_ellipse as SVGEllipseElement).getBBox()); - - } - } - - override protected function draw():void - { - drawEllipse(0, 0, width, height); - } - - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/GradientBase.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/GradientBase.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/GradientBase.as deleted file mode 100644 index 0fb521c..0000000 --- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/GradientBase.as +++ /dev/null @@ -1,229 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.flex.core.graphics -{ - import org.apache.flex.core.graphics.utils.CompoundTransform; - - public class GradientBase - { - - protected var colors:Array /* of uint */ = []; - - protected var ratios:Array /* of Number */ = []; - - protected var alphas:Array /* of Number */ = []; - - /** - * Holds the matrix and the convenience transform properties (<code>x</code>, <code>y</code>, and <code>rotation</code>). - * The compoundTransform is only created when the <code>matrix</code> property is set. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - */ - COMPILE::SWF - protected var compoundTransform:CompoundTransform; - - /** - * Value of the width and height of the untransformed gradient - * - * @langversion 3.0 - * @playerversion Flash 10 - * @playerversion AIR 1.5 - */ - public static const GRADIENT_DIMENSION:Number = 1638.4; - - /** - * generate uid - */ - public function get newId():String - { - return 'gradient' + String(Math.floor((Math.random() * 100000) + 1)); - } - - /** - * Storage for the entries property. - */ - private var _entries:Array = []; - - /** - * @private - * Storage for the rotation property. - */ - private var _rotation:Number = 0.0; - - /** - * An Array of GradientEntry objects - * defining the fill patterns for the gradient fill. - * - */ - public function get entries():Array - { - return _entries; - } - - /** - * @private - */ - public function set entries(value:Array):void - { - _entries = value; - COMPILE::SWF - { - processEntries(); - } - } - - /** - * By default, the LinearGradientStroke defines a transition - * from left to right across the control. - * Use the <code>rotation</code> property to control the transition direction. - * For example, a value of 180.0 causes the transition - * to occur from right to left, rather than from left to right. - * - * @default 0.0 - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function get rotation():Number - { - return _rotation; - } - - /** - * @private - */ - public function set rotation(value:Number):void - { - _rotation = value; - } - - - private var _x:Number = 0; - - /** - * The distance by which to translate each point along the x axis. - */ - public function get x():Number - { - return _x; - } - - /** - * @private - */ - public function set x(value:Number):void - { - _x = value; - } - - private var _y:Number = 0; - - /** - * The distance by which to translate each point along the y axis. - */ - public function get y():Number - { - return _y; - } - - /** - * @private - */ - public function set y(value:Number):void - { - _y = value; - } - - COMPILE::SWF - protected function toRad(a:Number):Number { - return a*Math.PI/180; - } - - COMPILE::SWF - protected function get rotationInRadians():Number - { - return rotation / 180 * Math.PI; - } - - /** - * @private - * Extract the gradient information in the public <code>entries</code> - * Array into the internal <code>colors</code>, <code>ratios</code>, - * and <code>alphas</code> arrays. - */ - COMPILE::SWF - private function processEntries():void - { - colors = []; - ratios = []; - alphas = []; - - if (!_entries || _entries.length == 0) - return; - - var ratioConvert:Number = 255; - - var i:int; - - var n:int = _entries.length; - for (i = 0; i < n; i++) - { - var e:GradientEntry = _entries[i]; - colors.push(e.color); - alphas.push(e.alpha); - ratios.push(e.ratio * ratioConvert); - } - - if (isNaN(ratios[0])) - ratios[0] = 0; - - if (isNaN(ratios[n - 1])) - ratios[n - 1] = 255; - - i = 1; - - while (true) - { - while (i < n && !isNaN(ratios[i])) - { - i++; - } - - if (i == n) - break; - - var start:int = i - 1; - - while (i < n && isNaN(ratios[i])) - { - i++; - } - - var br:Number = ratios[start]; - var tr:Number = ratios[i]; - - for (var j:int = 1; j < i - start; j++) - { - ratios[j] = br + j * (tr - br) / (i - start); - } - } - } - - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/GradientEntry.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/GradientEntry.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/GradientEntry.as deleted file mode 100644 index 68ce012..0000000 --- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/GradientEntry.as +++ /dev/null @@ -1,133 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.flex.core.graphics -{ - public class GradientEntry - { - - //---------------------------------- - // alpha - //---------------------------------- - - private var _alpha:Number = 1.0; - //---------------------------------- - // color - //---------------------------------- - - private var _color:uint = 0x000000; - //---------------------------------- - // ratio - //---------------------------------- - - private var _ratio:Number = 0x000000; - - - public function GradientEntry(alpha:Number = 1.0, color:uint = 0x000000, ratio:Number = 1.0) - { - _alpha = alpha; - _color = color; - _ratio = ratio; - } - - /** - * The transparency of a color. - * Possible values are 0.0 (invisible) through 1.0 (opaque). - * - * @default 1.0 - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.3 - */ - public function get alpha():Number - { - return _alpha; - } - - public function set alpha(value:Number):void - { - var oldValue:Number = _alpha; - if (value != oldValue) - { - _alpha = value; - } - } - - /** - * A color value. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion FlexJS 0.3 - */ - public function get color():uint - { - return _color; - } - - public function set color(value:uint):void - { - var oldValue:uint = _color; - if (value != oldValue) - { - _color = value; - } - } - - /** - * Where in the graphical element, as a percentage from 0.0 to 1.0, - * Flex samples the associated color at 100%. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion FlexJS 0.3 - */ - public function get ratio():Number - { - return _ratio; - } - - public function set ratio(value:Number):void - { - _ratio = value; - } - - /** - * Begin drawing the fill on the given shape's graphic object - */ - public function begin(s:GraphicShape):void - { - COMPILE::SWF - { - s.graphics.beginFill(color,alpha); - } - } - - /** - * End the fill - */ - public function end(s:GraphicShape):void - { - COMPILE::SWF - { - s.graphics.endFill(); - } - } - - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/GraphicShape.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/GraphicShape.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/GraphicShape.as deleted file mode 100644 index 6bbe486..0000000 --- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/GraphicShape.as +++ /dev/null @@ -1,213 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.flex.core.graphics -{ - COMPILE::SWF - { - import flash.geom.Point; - import flash.geom.Rectangle; - } - COMPILE::JS - { - import org.apache.flex.core.WrappedHTMLElement; - } - - import org.apache.flex.core.UIBase; - - public class GraphicShape extends UIBase - { - private var _fill:IFill; - private var _stroke:IStroke; - - public function get stroke():IStroke - { - return _stroke; - } - - /** - * A solid color fill. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion FlexJS 0.0 - */ - public function set stroke(value:IStroke):void - { - _stroke = value; - } - - public function get fill():IFill - { - return _fill; - } - /** - * A solid color fill. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion FlexJS 0.0 - */ - public function set fill(value:IFill):void - { - _fill = value; - } - - /** - * Constructor - * - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - */ - public function GraphicShape() - { - COMPILE::JS - { - element = document.createElementNS('http://www.w3.org/2000/svg', 'svg') as WrappedHTMLElement; - element.flexjs_wrapper = this; - element.style.left = 0; - element.style.top = 0; - //element.offsetParent = null; - positioner = element; - positioner.style.position = 'relative'; - } - } - - COMPILE::SWF - protected function applyStroke():void - { - if(stroke) - { - stroke.apply(this); - } - } - - COMPILE::SWF - protected function beginFill(targetBounds:Rectangle,targetOrigin:Point):void - { - if(fill) - { - fill.begin(this, targetBounds,targetOrigin); - } - } - - COMPILE::SWF - protected function endFill():void - { - if(fill) - { - fill.end(this); - } - } - - /** - * This is where the drawing methods get called from - */ - protected function draw():void - { - //Overwrite in subclass - } - - override public function addedToParent():void - { - COMPILE::SWF - { - super.addedToParent(); - } - draw(); - COMPILE::JS - { - element.style.overflow = 'visible'; - } - } - - /** - * @return {string} The style attribute. - */ - COMPILE::JS - public function getStyleStr():String - { - var fillStr:String; - if (fill) - { - fillStr = fill.addFillAttrib(this); - } - else - { - fillStr = 'fill:none'; - } - - var strokeStr:String; - if (stroke) - { - strokeStr = stroke.addStrokeAttrib(this); - } - else - { - strokeStr = 'stroke:none'; - } - - - return fillStr + ';' + strokeStr; - } - - - /** - * @param x X position. - * @param y Y position. - * @param bbox The bounding box of the svg element. - */ - COMPILE::JS - public function resize(x:Number, y:Number, bbox:SVGRect):void - { - var useWidth:Number = Math.max(this.width, bbox.width); - var useHeight:Number = Math.max(this.height, bbox.height); - - element.style.position = 'absolute'; - if (!isNaN(x)) element.style.top = String(x) + 'px'; - if (!isNaN(y)) element.style.left = String(y) + 'px'; - element.style.width = String(useWidth) + 'px'; - element.style.height = String(useHeight) + 'px'; - element.style.left = x; - element.style.top = y; - } - - COMPILE::JS - private var _x:Number; - COMPILE::JS - private var _y:Number; - COMPILE::JS - private var _xOffset:Number; - COMPILE::JS - private var _yOffset:Number; - - /** - * @param x X position. - * @param y Y position. - * @param xOffset offset from x position. - * @param yOffset offset from y position. - */ - COMPILE::JS - public function setPosition(x:Number, y:Number, xOffset:Number, yOffset:Number):void - { - _x = x; - _y = y; - _xOffset = xOffset; - _yOffset = yOffset; - element.style.left = xOffset; - element.style.top = yOffset; - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/GraphicsContainer.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/GraphicsContainer.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/GraphicsContainer.as deleted file mode 100644 index af10df8..0000000 --- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/GraphicsContainer.as +++ /dev/null @@ -1,302 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.flex.core.graphics -{ - COMPILE::SWF - { - import flash.display.GraphicsPath; - import flash.display.Shape; - import flash.display.Sprite; - import flash.geom.Point; - import flash.geom.Rectangle; - import flash.text.TextFieldType; - - import org.apache.flex.core.CSSTextField; - import org.apache.flex.core.graphics.utils.PathHelper; - } - COMPILE::JS - { - import org.apache.flex.core.WrappedHTMLElement; - } - - /** - * GraphicsContainer is a surface on which you can - * draw various graphic elements such as Rect, Circle, - * Ellipse, Path etc. - * Use this class if you want to draw multiple graphic - * shapes on a single container. - * - */ - public class GraphicsContainer extends GraphicShape - { - /** - * Removes all of the drawn elements of the container. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0.3 - */ - public function removeAllElements():void - { - COMPILE::SWF - { - graphics.clear(); - } - COMPILE::JS - { - var svg:HTMLElement = element; - while (svg.lastChild) { - svg.removeChild(svg.lastChild); - } - } - } - - /** - * Draw the rectangle. - * @param x The x position of the top-left corner of the rectangle. - * @param y The y position of the top-left corner. - * @param width The width of the rectangle. - * @param height The height of the rectangle. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0.3 - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - */ - public function drawRect(x:Number, y:Number, width:Number, height:Number):void - { - COMPILE::SWF - { - applyStroke(); - beginFill(new Rectangle(x, y, width, height), new Point(x,y) ); - graphics.drawRect(x, y, width, height); - endFill(); - } - COMPILE::JS - { - var style:String = getStyleStr(); - var rect:WrappedHTMLElement = document.createElementNS('http://www.w3.org/2000/svg', 'rect') as WrappedHTMLElement; - rect.flexjs_wrapper = this; - rect.style.left = x; - rect.style.top = y; - rect.setAttribute('style', style); - rect.setAttribute('x', String(x) + 'px'); - rect.setAttribute('y', String(y) + 'px'); - rect.setAttribute('width', String(width) + 'px'); - rect.setAttribute('height', String(height) + 'px'); - element.appendChild(rect); - } - } - - COMPILE::SWF - public function createRect(x:Number, y:Number, width:Number, height:Number):void - { - var color:uint = (fill as SolidColor).color; - var alpha:uint = (fill as SolidColor).alpha; - - var shape:Sprite = new Sprite(); - shape.graphics.beginFill(color,alpha); - shape.graphics.drawRect(0, 0, width, height); - shape.graphics.endFill(); - shape.x = x; - shape.y = y; - addChild(shape); - } - - /** - * Draw the ellipse. - * @param x The x position of the top-left corner of the bounding box of the ellipse. - * @param y The y position of the top-left corner of the bounding box of the ellipse. - * @param width The width of the ellipse. - * @param height The height of the ellipse. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0.3 - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - */ - public function drawEllipse(x:Number, y:Number, width:Number, height:Number):void - { - COMPILE::SWF - { - applyStroke(); - beginFill(new Rectangle(x,y,width,height), new Point(x,y)); - graphics.drawEllipse(x,y,width,height); - endFill(); - } - COMPILE::JS - { - var style:String = getStyleStr(); - var ellipse:WrappedHTMLElement = document.createElementNS('http://www.w3.org/2000/svg', 'ellipse') as WrappedHTMLElement; - ellipse.flexjs_wrapper = this; - ellipse.style.left = x; - ellipse.style.top = y; - ellipse.setAttribute('style', style); - ellipse.setAttribute('cx', String(x + width / 2)); - ellipse.setAttribute('cy', String(y + height / 2)); - ellipse.setAttribute('rx', String(width / 2)); - ellipse.setAttribute('ry', String(height / 2)); - element.appendChild(ellipse); - } - } - - /** - * Draw the circle. - * @param x The x location of the center of the circle - * @param y The y location of the center of the circle. - * @param radius The radius of the circle. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - */ - public function drawCircle(x:Number, y:Number, radius:Number):void - { - COMPILE::SWF - { - applyStroke(); - beginFill(new Rectangle(x,y,radius*2, radius*2),new Point(x-radius,y-radius)); - graphics.drawCircle(x,y,radius); - endFill(); - } - COMPILE::JS - { - var style:String = getStyleStr(); - var circle:WrappedHTMLElement = document.createElementNS('http://www.w3.org/2000/svg', 'ellipse') as WrappedHTMLElement; - circle.flexjs_wrapper = this; - circle.style.left = x; - circle.style.top = y; - circle.setAttribute('style', style); - circle.setAttribute('cx', String(x)); - circle.setAttribute('cy', String(y)); - circle.setAttribute('rx', String(radius)); - circle.setAttribute('ry', String(radius)); - element.appendChild(circle); - - } - } - - /** - * Draw the path. - * @param data A string containing a compact represention of the path segments. - * The value is a space-delimited string describing each path segment. Each - * segment entry has a single character which denotes the segment type and - * two or more segment parameters. - * - * If the segment command is upper-case, the parameters are absolute values. - * If the segment command is lower-case, the parameters are relative values. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - */ - public function drawPath(data:String):void - { - COMPILE::SWF - { - applyStroke(); - var bounds:Rectangle = PathHelper.getBounds(data); - beginFill(bounds,bounds.topLeft); - var graphicsPath:GraphicsPath = PathHelper.getSegments(data); - graphics.drawPath(graphicsPath.commands, graphicsPath.data); - endFill(); - } - COMPILE::JS - { - var style:String = getStyleStr(); - var path:WrappedHTMLElement = document.createElementNS('http://www.w3.org/2000/svg', 'path') as WrappedHTMLElement; - path.flexjs_wrapper = this; - path.style.left = 0; - path.style.top = 0; - path.setAttribute('style', style); - path.setAttribute('d', data); - element.appendChild(path); - } - } - - public function drawLine():void - { - - } - - public function drawPolygon():void - { - - } - - /** - * Draw a string of characters. - * @param value The string to draw. - * @param x The x location of the center of the circle - * @param y The y location of the center of the circle. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - * @flexjsignorecoercion Text - * @flexjsignorecoercion Node - */ - public function drawText(value:String, x:Number, y:Number):Object - { - COMPILE::SWF - { - var textField:CSSTextField = new CSSTextField(); - addChild(textField); - - textField.selectable = false; - textField.type = TextFieldType.DYNAMIC; - textField.mouseEnabled = false; - textField.autoSize = "left"; - textField.text = value; - - var lineColor:SolidColorStroke = stroke as SolidColorStroke; - if (lineColor) { - textField.textColor = lineColor.color; - textField.alpha = lineColor.alpha; - } - - textField.x = x; - textField.y = y + textField.textHeight/4; - - return textField; - - } - COMPILE::JS - { - var style:String = getStyleStr(); - var text:WrappedHTMLElement = document.createElementNS('http://www.w3.org/2000/svg', 'text') as WrappedHTMLElement; - text.flexjs_wrapper = this; - text.style.left = x; - text.style.top = y; - text.setAttribute('style', style); - text.setAttribute('x', String(x) + 'px'); - text.setAttribute('y', String(y + 15) + 'px'); - var textNode:Text = document.createTextNode(value) as Text; - text.appendChild(textNode as Node); - element.appendChild(text); - return text; - } - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/IFill.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/IFill.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/IFill.as deleted file mode 100644 index 4dd69a0..0000000 --- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/IFill.as +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.flex.core.graphics -{ - COMPILE::SWF - { - import flash.geom.Point; - import flash.geom.Rectangle; - } - - public interface IFill - { - COMPILE::SWF - function begin(s:GraphicShape,targetBounds:Rectangle, targetOrigin:Point):void; - COMPILE::SWF - function end(s:GraphicShape):void; - COMPILE::JS - function addFillAttrib(s:GraphicShape):String; - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/IStroke.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/IStroke.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/IStroke.as deleted file mode 100644 index 7dcfd6c..0000000 --- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/IStroke.as +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.flex.core.graphics -{ - public interface IStroke - { - COMPILE::SWF - function apply(s:GraphicShape):void; - - COMPILE::JS - function get weight():Number; - - COMPILE::JS - function addStrokeAttrib(s:GraphicShape):String; - - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/LinearGradient.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/LinearGradient.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/LinearGradient.as deleted file mode 100644 index c4cf5db..0000000 --- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/LinearGradient.as +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.flex.core.graphics -{ - COMPILE::SWF - { - import flash.display.GradientType; - import flash.display.InterpolationMethod; - import flash.display.SpreadMethod; - import flash.geom.Matrix; - import flash.geom.Point; - import flash.geom.Rectangle; - } - - public class LinearGradient extends GradientBase implements IFill - { - COMPILE::SWF - private static var commonMatrix:Matrix = new Matrix(); - - private var _scaleX:Number; - - /** - * The horizontal scale of the gradient transform, which defines the width of the (unrotated) gradient - */ - public function get scaleX():Number - { - return _scaleX; - } - - public function set scaleX(value:Number):void - { - _scaleX = value; - } - - COMPILE::SWF - public function begin(s:GraphicShape,targetBounds:Rectangle, targetOrigin:Point):void - { - commonMatrix.identity(); - commonMatrix.createGradientBox(targetBounds.width,targetBounds.height,toRad(this.rotation),targetOrigin.x, targetOrigin.y); - - s.graphics.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, - commonMatrix, SpreadMethod.PAD, InterpolationMethod.RGB); - - } - - COMPILE::SWF - public function end(s:GraphicShape):void - { - s.graphics.endFill(); - } - - /** - * addFillAttrib() - * - * @param value The GraphicShape object on which the fill must be added. - * @return {string} - * @flexjsignorecoercion Node - */ - COMPILE::JS - public function addFillAttrib(value:GraphicShape):String - { - //Create and add a linear gradient def - var svgNS:String = value.element.namespaceURI; - var grad:HTMLElement = document.createElementNS(svgNS, 'linearGradient') as HTMLElement; - var gradientId:String = this.newId; - grad.setAttribute('id', gradientId); - - //Set x1, y1, x2, y2 of gradient - grad.setAttribute('x1', '0%'); - grad.setAttribute('y1', '0%'); - grad.setAttribute('x2', '100%'); - grad.setAttribute('y2', '0%'); - - //Apply rotation to the gradient if rotation is a number - if (rotation) - { - grad.setAttribute('gradientTransform', 'rotate(' + rotation + ' 0.5 0.5)'); - } - - //Process gradient entries and create a stop for each entry - var entries:Array = this.entries; - for (var i:int = 0; i < entries.length; i++) - { - var gradientEntry:GradientEntry = entries[i]; - var stop:HTMLElement = document.createElementNS(svgNS, 'stop') as HTMLElement; - //Set Offset - stop.setAttribute('offset', String(gradientEntry.ratio * 100) + '%'); - //Set Color - var color:String = Number(gradientEntry.color).toString(16); - if (color.length == 1) color = '00' + color; - if (color.length == 2) color = '00' + color; - if (color.length == 4) color = '00' + color; - stop.setAttribute('stop-color', '#' + String(color)); - //Set Alpha - stop.setAttribute('stop-opacity', String(gradientEntry.alpha)); - - grad.appendChild(stop); - } - - //Add defs element if not available already - //Add newly created gradient to defs element - var defs:Node = value.element.querySelector('defs') || - value.element.insertBefore(document.createElementNS(svgNS, 'defs'), value.element.firstChild); - defs.appendChild(grad); - - //Return the fill attribute - return 'fill:url(#' + gradientId + ')'; - } - - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Path.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Path.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Path.as deleted file mode 100644 index 15e6f0f..0000000 --- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Path.as +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.flex.core.graphics -{ - COMPILE::SWF - { - import flash.display.GraphicsPath; - import flash.geom.Point; - import flash.geom.Rectangle; - } - COMPILE::JS - { - import org.apache.flex.core.WrappedHTMLElement; - } - - import org.apache.flex.core.graphics.utils.PathHelper; - - public class Path extends GraphicShape - { - - private var _data:String; - - public function get data():String - { - return _data; - } - - public function set data(value:String):void - { - _data = value; - } - - COMPILE::JS - private var _path:WrappedHTMLElement; - - /** - * Draw the path. - * @param data A string containing a compact represention of the path segments. - * The value is a space-delimited string describing each path segment. Each - * segment entry has a single character which denotes the segment type and - * two or more segment parameters. - * - * If the segment command is upper-case, the parameters are absolute values. - * If the segment command is lower-case, the parameters are relative values. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - */ - public function drawPath(xp:Number,yp:Number,data:String):void - { - COMPILE::SWF - { - graphics.clear(); - applyStroke(); - var bounds:Rectangle = PathHelper.getBounds(data); - this.width = bounds.width; - this.height = bounds.height; - beginFill(bounds,new Point(bounds.left + xp, bounds.top + yp) ); - var graphicsPath:GraphicsPath = PathHelper.getSegments(data,xp,yp); - graphics.drawPath(graphicsPath.commands, graphicsPath.data); - endFill(); - } - COMPILE::JS - { - if (data == null || data.length === 0) return; - var style:String = getStyleStr(); - if (_path == null) { - _path = document.createElementNS('http://www.w3.org/2000/svg', 'path') as WrappedHTMLElement; - _path.flexjs_wrapper = this; - element.appendChild(_path); - } - _path.setAttribute('style', style); - _path.setAttribute('d', data); - - resize(x, y, _path['getBBox']()); - - } - } - - override protected function draw():void - { - drawPath(0, 0, data); - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Rect.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Rect.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Rect.as deleted file mode 100644 index 0355c27..0000000 --- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/Rect.as +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.flex.core.graphics -{ - COMPILE::SWF - { - import flash.display.CapsStyle; - import flash.display.JointStyle; - import flash.geom.Point; - import flash.geom.Rectangle; - } - COMPILE::JS - { - import org.apache.flex.core.WrappedHTMLElement; - } - - public class Rect extends GraphicShape - { - COMPILE::JS - private var _rect:WrappedHTMLElement; - - /** - * Draw the rectangle. - * @param xp The x position of the top-left corner of the rectangle. - * @param yp The y position of the top-left corner. - * @param width The width of the rectangle. - * @param height The height of the rectangle. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - */ - public function drawRect(xp:Number, yp:Number, width:Number, height:Number):void - { - COMPILE::SWF - { - graphics.clear(); - applyStroke(); - beginFill(new Rectangle(xp, yp, width, height), new Point(xp,yp)); - graphics.drawRect(xp, yp, width, height); - endFill(); - } - COMPILE::JS - { - var style:String = this.getStyleStr(); - - if (_rect == null) { - _rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect') as WrappedHTMLElement; - _rect.flexjs_wrapper = this; - element.appendChild(_rect); - } - _rect.setAttribute('style', style); - if (stroke) - { - _rect.setAttribute('x', String(stroke.weight / 2) + 'px'); - _rect.setAttribute('y', String(stroke.weight / 2) + 'px'); - } - else - { - _rect.setAttribute('x', '0' + 'px'); - _rect.setAttribute('y', '0' + 'px'); - } - _rect.setAttribute('width', String(width) + 'px'); - _rect.setAttribute('height', String(height) + 'px'); - - resize(x, y, _rect['getBBox']()); - } - } - - override protected function draw():void - { - drawRect(0,0,width,height); - } - - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/7d529524/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/SolidColor.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/SolidColor.as b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/SolidColor.as deleted file mode 100644 index 1129ff8..0000000 --- a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/core/graphics/SolidColor.as +++ /dev/null @@ -1,136 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.flex.core.graphics -{ - COMPILE::SWF - { - import flash.geom.Point; - import flash.geom.Rectangle; - } - - public class SolidColor implements IFill - { - - /** - * Constructor. - * - * @param color Specifies the color. - * The default value is 0x000000 (black). - * - * @param alpha Specifies the level of transparency. - * Valid values range from 0.0 (completely transparent) - * to 1.0 (completely opaque). - * The default value is 1.0. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion Flex 3 - */ - public function SolidColor(color:uint = 0x000000, alpha:Number = 1.0) - { - super(); - - this.color = color; - this.alpha = alpha; - } - - //---------------------------------- - // alpha - //---------------------------------- - - private var _alpha:Number = 1.0; - //---------------------------------- - // color - //---------------------------------- - - private var _color:uint = 0x000000; - - /** - * The transparency of a color. - * Possible values are 0.0 (invisible) through 1.0 (opaque). - * - * @default 1.0 - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.3 - */ - public function get alpha():Number - { - return _alpha; - } - - public function set alpha(value:Number):void - { - var oldValue:Number = _alpha; - if (value != oldValue) - { - _alpha = value; - } - } - - /** - * A color value. - * - * @langversion 3.0 - * @playerversion Flash 9 - * @playerversion AIR 1.1 - * @productversion FlexJS 0.3 - */ - public function get color():uint - { - return _color; - } - - public function set color(value:uint):void - { - var oldValue:uint = _color; - if (value != oldValue) - { - _color = value; - } - } - - COMPILE::SWF - public function begin(s:GraphicShape,targetBounds:Rectangle,targetOrigin:Point):void - { - s.graphics.beginFill(color,alpha); - } - - COMPILE::SWF - public function end(s:GraphicShape):void - { - s.graphics.endFill(); - } - - /** - * addFillAttrib() - * - * @param value The GraphicShape object on which the fill must be added. - * @return {string} - */ - COMPILE::JS - public function addFillAttrib(value:GraphicShape):String - { - var color:String = Number(this.color).toString(16); - if (color.length == 1) color = '00' + color; - if (color.length == 2) color = '00' + color; - if (color.length == 4) color = '00' + color; - return 'fill:#' + String(color) + ';fill-opacity:' + String(alpha); - } - } -}
