You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jm...@apache.org on 2014/08/09 08:31:59 UTC
[1/5] git commit: [flex-utilities] [refs/heads/develop] - Added more
spark examples
Repository: flex-utilities
Updated Branches:
refs/heads/develop f8cd52387 -> 47a676080
Added more spark examples
Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/070907e2
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/070907e2
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/070907e2
Branch: refs/heads/develop
Commit: 070907e282a065f570f2bb6b6f601dfc67b00c89
Parents: f8cd523
Author: Justin Mclean <jm...@apache.org>
Authored: Sat Aug 9 16:30:53 2014 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sat Aug 9 16:30:53 2014 +1000
----------------------------------------------------------------------
TourDeFlex/TourDeFlex3/build.xml | 12 ++++++++++++
TourDeFlex/TourDeFlex3/src/explorer.xml | 13 +++++++++++++
2 files changed, 25 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/070907e2/TourDeFlex/TourDeFlex3/build.xml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/build.xml b/TourDeFlex/TourDeFlex3/build.xml
index 7abfbba..3a4b2a4 100644
--- a/TourDeFlex/TourDeFlex3/build.xml
+++ b/TourDeFlex/TourDeFlex3/build.xml
@@ -200,6 +200,12 @@
<compile-mxml example="/spark/controls/ToolTipExample"/>
<compile-mxml example="/spark/controls/TreeExample"/>
<compile-mxml example="/spark/controls/ViewStackExample"/>
+ <compile-mxml example="/spark/controls/TextAreaExample"/>
+ <compile-mxml example="/spark/controls/TextInputExample"/>
+ <compile-mxml example="/spark/controls/TextLayout1Example"/>
+ <compile-mxml example="/spark/controls/TextLayout2Example"/>
+ <compile-mxml example="/spark/controls/TextLayout3Example"/>
+ <compile-mxml example="/spark/controls/TextLayout4Example"/>
<compile-mxml example="/spark/css/CSSDescendantSelectorExample"/>
<compile-mxml example="/spark/css/CSSTypeClassSelectorExample"/>
@@ -221,8 +227,11 @@
<compile-mxml example="/spark/containers/SampleHGroup"/>
<compile-mxml example="/spark/containers/SampleVGroup"/>
<compile-mxml example="/spark/containers/SampleVerticalHorizontalAlign"/>
+ <compile-mxml example="/spark/containers/SkinableDataContainerExample"/>
+ <compile-mxml example="/spark/containers/TileGroupExample"/>
<compile-mxml example="/spark/effects/Move3DExample"/>
+ <compile-mxml example="/spark/effects/WipeExample"/>
<compile-mxml example="/spark/charts/AreaChartExample"/>
<compile-mxml example="/spark/charts/BarChartExample"/>
@@ -264,6 +273,7 @@
<compile-mxml example="/spark/other/DragAndDrop2Example"/>
<compile-mxml example="/spark/other/FilterExample"/>
<compile-mxml example="/spark/other/RepeaterExample"/>
+ <compile-mxml example="/spark/other/ScrollBarsExample"/>
<compile-mxml example="/spark/events/EventExample1"/>
<compile-mxml example="/spark/events/EventExample2"/>
@@ -275,6 +285,8 @@
<compile-mxml example="/spark/modules/ModuleExample"/>
<compile-mxml example="/spark/modules/Module1"/>
<compile-mxml example="/spark/modules/Module2"/>
+
+ <compile-mxml example="/spark/tlf/TextLayoutEditorSample"/>
<!-- Explorer shell -->
<compile-mxml example="/explorer"/>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/070907e2/TourDeFlex/TourDeFlex3/src/explorer.xml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/explorer.xml b/TourDeFlex/TourDeFlex3/src/explorer.xml
index ebd1a26..f5cb1d2 100755
--- a/TourDeFlex/TourDeFlex3/src/explorer.xml
+++ b/TourDeFlex/TourDeFlex3/src/explorer.xml
@@ -240,10 +240,14 @@
<node label="Repeater">
<node label="Repeater" app="spark/other/RepeaterExample" />
</node>
+ <node label="ScrollBars">
+ <node label="ScrollBars" app="spark/other/ScrollBarsExample" />
+ </node>
</node>
<node label="Effects and Filters">
<node label="Move 3D" app="spark/effects/Move3DExample" />
<node label="Filter" app="spark/other/FilterExample" />
+ <node label="Wipe" app="spark/effects/WipeExample" />
</node>
<node label="Visual Components">
<node label="Containers">
@@ -252,6 +256,8 @@
<node label="Form" app="spark/controls/FormExample" />
<node label="HGroup" app="spark/containers/SampleHGroup" />
<node label="TabNavigator" app="spark/controls/TabNavigatorExample" />
+ <node label="SkinableDataContainer" app="spark/containers/SkinableDataContainerExample" />
+ <node label="TitleGroup" app="spark/containers/TileGroupExample" />
<node label="TitleWindow" app="spark/controls/TitleWindowExample" />
<node label="ViewStack" app="spark/controls/ViewStackExample" />
<node label="VGroup" app="spark/containers/SampleVGroup" />
@@ -290,6 +296,13 @@
</node>
<node label="Text Controls">
<node label="RichEditableText" app="spark/controls/RichEditableTextExample" />
+ <node label="TextArea" app="spark/controls/TextAreaExample" />
+ <node label="TextInput" app="spark/controls/TextInputExample" />
+ <node label="Sample Layout" app="spark/controls/TextLayout1Example" />
+ <node label="News Layout" app="spark/controls/TextLayout2Example" />
+ <node label="Text Controls" app="spark/controls/TextLayout3Example" />
+ <node label="Import Format Types" app="spark/controls/TextLayout4Example" />
+ <node label="Text Layout Editor" app="spark/tlf/TextLayoutEditorSample" />
</node>
<node label="Layouts">
<node label="Animated" app="spark/layouts/CustomLayoutAnimatedExample" />
[3/5] Added more spark examples
Posted by jm...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextInspectorController.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextInspectorController.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextInspectorController.as
new file mode 100644
index 0000000..3bf6f6a
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextInspectorController.as
@@ -0,0 +1,614 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.inspectors
+{
+ import flash.events.EventDispatcher;
+ import flash.events.IEventDispatcher;
+ import flash.text.engine.RenderingMode;
+
+ import flashx.textLayout.compose.TextFlowLine;
+ import flashx.textLayout.container.ContainerController;
+ import flashx.textLayout.edit.ElementRange;
+ import flashx.textLayout.edit.IEditManager;
+ import flashx.textLayout.edit.SelectionState;
+ import flashx.textLayout.elements.FlowElement;
+ import flashx.textLayout.elements.FlowLeafElement;
+ import flashx.textLayout.elements.LinkElement;
+ import flashx.textLayout.elements.ParagraphElement;
+ import flashx.textLayout.elements.SpanElement;
+ import flashx.textLayout.elements.TCYElement;
+ import flashx.textLayout.elements.TextFlow;
+ import flashx.textLayout.events.SelectionEvent;
+ import flashx.textLayout.formats.ITextLayoutFormat;
+ import flashx.textLayout.formats.TextAlign;
+ import flashx.textLayout.formats.TextLayoutFormat;
+ import flashx.textLayout.tlf_internal;
+ import flashx.textLayout.ui.rulers.RulerBar;
+
+ use namespace tlf_internal;
+
+ public class TextInspectorController extends EventDispatcher
+ {
+ public static const CHAR_DOMAIN:String = "char"
+ public static const PAR_DOMAIN:String = "par"
+ public static const CONT_DOMAIN:String = "cont"
+ public static const FLOW_DOMAIN:String = "flow"
+ public static const SCROLL_DOMAIN:String = "sp"
+ public static const TCY_DOMAIN:String = "tcy"
+ public static const LINK_DOMAIN:String = "link"
+
+ public static const FONT_SIZE_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.fontSizeProperty.name;
+ public static const FONT_FAMILY_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.fontFamilyProperty.name;
+ public static const FONT_LOOKUP_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.fontLookupProperty.name;
+ public static const TRACKING_RIGHT_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.trackingRightProperty.name;
+ public static const TRACKING_LEFT_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.trackingLeftProperty.name;
+ public static const KERNING_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.kerningProperty.name;
+ public static const LINE_HEIGHT_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.lineHeightProperty.name;
+ public static const COLOR_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.colorProperty.name;
+ public static const BGCOLOR_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.backgroundColorProperty.name;
+ public static const FONT_WEIGHT_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.fontWeightProperty.name;
+ public static const FONT_STYLE_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.fontStyleProperty.name;
+ public static const TEXT_DECORATION_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.textDecorationProperty.name;
+ public static const LINE_THROUGH_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.lineThroughProperty.name;
+ public static const DIGIT_CASE_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.digitCaseProperty.name;
+ public static const DIGIT_WIDTH_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.digitWidthProperty.name;
+ public static const DOMINANT_BASELINE_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.dominantBaselineProperty.name;
+ public static const ALIGNMENT_BASELINE_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.alignmentBaselineProperty.name;
+ public static const BASELINE_SHIFT_SUPER_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.baselineShiftProperty.name + "#super";
+ public static const BASELINE_SHIFT_SUB_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.baselineShiftProperty.name + "#sub";
+ public static const BASELINE_SHIFT_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.baselineShiftProperty.name;
+ public static const TYPOGRAPHIC_CASE_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.typographicCaseProperty.name;
+ public static const LIGATURE_LEVEL_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.ligatureLevelProperty.name;
+ public static const TEXT_ROTATION_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.textRotationProperty.name;
+ public static const TEXT_ALPHA_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.textAlphaProperty.name;
+ public static const BACKGROUND_ALPHA_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.backgroundAlphaProperty.name;
+ public static const LOCALE_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.localeProperty.name;
+ public static const BREAK_OPPORTUNITY_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.breakOpportunityProperty.name;
+ public static const RENDERING_MODE_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.renderingModeProperty.name;
+ public static const CFF_HINTING_UIPROP:String = CHAR_DOMAIN + "/" + TextLayoutFormat.cffHintingProperty.name;
+
+ public static const PARA_LOCALE_UIPROP:String = PAR_DOMAIN + "/" + TextLayoutFormat.localeProperty.name;
+ public static const TEXT_INDENT_UIPROP:String = PAR_DOMAIN + "/" + TextLayoutFormat.textIndentProperty.name;
+ public static const START_INDENT_UIPROP:String = PAR_DOMAIN + "/" + TextLayoutFormat.paragraphStartIndentProperty.name;
+ public static const END_INDENT_UIPROP:String = PAR_DOMAIN + "/" + TextLayoutFormat.paragraphEndIndentProperty.name;
+ public static const SPACE_BEFORE_UIPROP:String = PAR_DOMAIN + "/" + TextLayoutFormat.paragraphSpaceBeforeProperty.name;
+ public static const SPACE_AFTER_UIPROP:String = PAR_DOMAIN + "/" + TextLayoutFormat.paragraphSpaceAfterProperty.name;
+ public static const TEXT_ALIGN_UIPROP:String = PAR_DOMAIN + "/" + TextLayoutFormat.textAlignProperty.name;
+ public static const TEXT_ALIGN_LAST_UIPROP:String = PAR_DOMAIN + "/" + TextLayoutFormat.textAlignLastProperty.name;
+ public static const JUSTIFICATION_RULE_UIPROP:String = PAR_DOMAIN + "/" + TextLayoutFormat.justificationRuleProperty.name;
+ public static const TEXT_JUSTIFY_UIPROP:String = PAR_DOMAIN + "/" + TextLayoutFormat.textJustifyProperty.name;
+ public static const JUSTIFICATION_STYLE_UIPROP:String = PAR_DOMAIN + "/" + TextLayoutFormat.justificationStyleProperty.name;
+ public static const DIRECTION_UIPROP:String = PAR_DOMAIN + "/" + TextLayoutFormat.directionProperty.name;
+ public static const LEADING_MODEL_UIPROP:String = PAR_DOMAIN + "/" + TextLayoutFormat.leadingModelProperty.name;
+
+ public static const VERTICAL_ALIGN_UIPROP:String = CONT_DOMAIN + "/" + TextLayoutFormat.verticalAlignProperty.name;
+ public static const COLUMN_COUNT_UIPROP:String = CONT_DOMAIN + "/" + TextLayoutFormat.columnCountProperty.name;
+ public static const COLUMN_WIDTH_UIPROP:String = CONT_DOMAIN + "/" + TextLayoutFormat.columnWidthProperty.name;
+ public static const COLUMN_GAP_UIPROP:String = CONT_DOMAIN + "/" + TextLayoutFormat.columnGapProperty.name;
+ public static const PADDING_LEFT_UIPROP:String = CONT_DOMAIN + "/" + TextLayoutFormat.paddingLeftProperty.name;
+ public static const PADDING_TOP_UIPROP:String = CONT_DOMAIN + "/" + TextLayoutFormat.paddingTopProperty.name;
+ public static const PADDING_RIGHT_UIPROP:String = CONT_DOMAIN + "/" + TextLayoutFormat.paddingRightProperty.name;
+ public static const PADDING_BOTTOM_UIPROP:String = CONT_DOMAIN + "/" + TextLayoutFormat.paddingBottomProperty.name;
+ public static const FIRST_BASELINE_UIPROP:String = CONT_DOMAIN + "/" + TextLayoutFormat.firstBaselineOffsetProperty.name;
+
+ public static const BLOCK_PROGRESSION_UIPROP:String = FLOW_DOMAIN + "/" + TextLayoutFormat.blockProgressionProperty.name;
+ public static const FLOW_DIRECTION_UIPROP:String = FLOW_DOMAIN + "/" + TextLayoutFormat.directionProperty.name;
+ public static const LINE_BREAK_UIPROP:String = FLOW_DOMAIN + "/" + TextLayoutFormat.lineBreakProperty.name;
+
+ public static const VERTICAL_SCROLL_UIPROP:String = SCROLL_DOMAIN + "/" + "verticalScrollPolicy";
+ public static const HORIZONTAL_SCROLL_UIPROP:String = SCROLL_DOMAIN + "/" + "horizontalScrollPolicy";
+
+ public static const TCY_UIPROP:String = TCY_DOMAIN + "/" + "tcy";
+
+ public static const LINK_URL_UIPROP:String = LINK_DOMAIN + "/" + "linkURL";
+ public static const LINK_TARGET_UIPROP:String = LINK_DOMAIN + "/" + "linkTarget";
+ public static const LINK_EXTEND_UIPROP:String = LINK_DOMAIN + "/" + "linkExtend";
+ private static var sInstance:TextInspectorController = null;
+
+ private var processingCharacterFormatChange:Boolean = false;
+
+ public function TextInspectorController(target:IEventDispatcher=null)
+ {
+ super(target);
+ if (sInstance != null)
+ throw new Error("Can't create another TextEditingController. Call TextEditingController.Instance.");
+ }
+
+ public static function Instance():TextInspectorController
+ {
+ if (!sInstance)
+ sInstance = new TextInspectorController();
+ return sInstance;
+ }
+
+ public function set activeFlow(inFlow:TextFlow):void
+ {
+ if (inFlow && !inFlow.interactionManager is IEditManager)
+ throw new Error("Can't set the active flow to a flow without an EditManager.");
+ if (mActiveFlow)
+ {
+ mActiveFlow.removeEventListener(SelectionEvent.SELECTION_CHANGE, onTextSelectionChanged);
+ mEditManager = null;
+ }
+ mActiveFlow = inFlow;
+ if (mActiveFlow)
+ {
+ mEditManager = mActiveFlow.interactionManager as IEditManager;
+ mActiveFlow.addEventListener(SelectionEvent.SELECTION_CHANGE, onTextSelectionChanged);
+ }
+ else
+ onTextSelectionChanged(null);
+ for each (var ruler:RulerBar in mRulers)
+ ruler.activeFlow = mActiveFlow;
+ }
+
+ public function get activeFlow():TextFlow
+ {
+ return mActiveFlow;
+ }
+
+ public function set rulerVisible(inVisible:Boolean):void
+ {
+ for each (var ruler:RulerBar in mRulers)
+ {
+ ruler.active = inVisible;
+ if (inVisible)
+ {
+ ruler.RedrawRuler();
+ }
+ }
+ if (mActiveFlow && (mActiveFlow.interactionManager))
+ {
+ mActiveFlow.interactionManager.setFocus();
+ }
+ }
+
+ public function get rulerVisible():Boolean
+ {
+ if (mRulers.length > 0)
+ return mRulers[0].active;
+ return false;
+ }
+
+ public function AddRuler(inRuler:RulerBar):void
+ {
+ mRulers.push(inRuler);
+ }
+
+ private function onTextSelectionChanged(e:SelectionEvent):void
+ {
+ if ((processingCharacterFormatChange) && (mEditManager.absoluteStart == mEditManager.absoluteEnd)) return;
+
+ if (e)
+ {
+ var selState:SelectionState = e.selectionState;
+ var selectedElementRange:ElementRange = selState ? ElementRange.createElementRange(selState.textFlow, selState.absoluteStart, selState.absoluteEnd) : null;
+ if (selectedElementRange)
+ {
+ var format:Object = GetFormatFromRange(selectedElementRange,selState.pointFormat);
+ if (mLastFormat == null || FormatChanged(mLastFormat, format))
+ {
+ dispatchEvent(new SelectionUpdateEvent(format));
+ mLastFormat = format;
+ }
+ }
+ }
+ else
+ {
+ dispatchEvent(new SelectionUpdateEvent(new Object()));
+ mLastFormat = null;
+ }
+ }
+
+ public function forceBroadcastFormats():void
+ {
+ if (mEditManager)
+ {
+ var format:Object = GetFormatFromRange(ElementRange.createElementRange(mActiveFlow, mActiveFlow.interactionManager.anchorPosition, mActiveFlow.interactionManager.activePosition),null);
+ dispatchEvent(new SelectionUpdateEvent(format));
+ mLastFormat = format;
+ }
+ }
+
+ private function FormatChanged(format1:Object, format2:Object):Boolean
+ {
+ if (format1.numProps == format2.numProps)
+ {
+ for(var key:String in format1)
+ {
+ if (format2[key] == null)
+ return true;
+ var prop1:Array = format1[key];
+ var prop2:Array = format2[key];
+ var n:int = prop1.length;
+ if (n != prop2.length)
+ return true;
+ for (var i:int = 0; i < n; ++i)
+ if (prop1[i] != prop2[i])
+ return true;
+ }
+ return false;
+ }
+ return true;
+ }
+
+ private function GetFormatFromRange(inRange:ElementRange,pendingFormat:ITextLayoutFormat):Object
+ {
+ var format:Object = new Object();
+ format.numProps = 0;
+ format.setPropertyIsEnumerable("numProps", false);
+ var leafIter:FlowLeafElement = inRange.firstLeaf;
+ while (leafIter)
+ {
+ var charFormat:ITextLayoutFormat = leafIter.computedFormat;
+ if (pendingFormat)
+ {
+ var scratch:TextLayoutFormat = new TextLayoutFormat(charFormat);
+ scratch.apply(pendingFormat);
+ charFormat = scratch;
+ }
+ AddAttributeToFormat(format, FONT_FAMILY_UIPROP, charFormat.fontFamily);
+ if (!IsMetaFontName(charFormat.fontFamily))
+ AddAttributeToFormat(format, FONT_LOOKUP_UIPROP, charFormat.fontLookup);
+ AddAttributeToFormat(format, FONT_SIZE_UIPROP, charFormat.fontSize);
+ AddAttributeToFormat(format, TRACKING_RIGHT_UIPROP, charFormat.trackingRight);
+ AddAttributeToFormat(format, TRACKING_LEFT_UIPROP, charFormat.trackingLeft);
+ AddAttributeToFormat(format, KERNING_UIPROP, charFormat.kerning);
+ AddAttributeToFormat(format, LINE_HEIGHT_UIPROP, charFormat.lineHeight);
+ AddAttributeToFormat(format, COLOR_UIPROP, charFormat.color);
+ AddAttributeToFormat(format, BGCOLOR_UIPROP, charFormat.backgroundColor);
+ AddAttributeToFormat(format, FONT_WEIGHT_UIPROP, charFormat.fontWeight);
+ AddAttributeToFormat(format, FONT_STYLE_UIPROP, charFormat.fontStyle);
+ AddAttributeToFormat(format, TEXT_DECORATION_UIPROP, charFormat.textDecoration);
+ AddAttributeToFormat(format, LINE_THROUGH_UIPROP, charFormat.lineThrough);
+ // This little kludge allows me to have two controls operate on the same property
+ AddAttributeToFormat(format, BASELINE_SHIFT_SUPER_UIPROP,
+ charFormat.baselineShift == flashx.textLayout.formats.BaselineShift.SUPERSCRIPT ?
+ flashx.textLayout.formats.BaselineShift.SUPERSCRIPT :
+ 0);
+ AddAttributeToFormat(format, BASELINE_SHIFT_SUB_UIPROP,
+ charFormat.baselineShift == flashx.textLayout.formats.BaselineShift.SUBSCRIPT ?
+ flashx.textLayout.formats.BaselineShift.SUBSCRIPT :
+ 0);
+ AddAttributeToFormat(format, DIGIT_CASE_UIPROP, charFormat.digitCase);
+ AddAttributeToFormat(format, DIGIT_WIDTH_UIPROP, charFormat.digitWidth);
+ AddAttributeToFormat(format, DOMINANT_BASELINE_UIPROP, charFormat.dominantBaseline);
+ AddAttributeToFormat(format, ALIGNMENT_BASELINE_UIPROP, charFormat.alignmentBaseline);
+ AddAttributeToFormat(format, BASELINE_SHIFT_UIPROP, charFormat.baselineShift);
+ AddAttributeToFormat(format, TYPOGRAPHIC_CASE_UIPROP, charFormat.typographicCase);
+ AddAttributeToFormat(format, LIGATURE_LEVEL_UIPROP, charFormat.ligatureLevel);
+ AddAttributeToFormat(format, TEXT_ROTATION_UIPROP, charFormat.textRotation);
+ AddAttributeToFormat(format, TEXT_ALPHA_UIPROP, charFormat.textAlpha);
+ AddAttributeToFormat(format, BACKGROUND_ALPHA_UIPROP, charFormat.backgroundAlpha);
+ AddAttributeToFormat(format, LOCALE_UIPROP, charFormat.locale);
+ AddAttributeToFormat(format, BREAK_OPPORTUNITY_UIPROP, charFormat.breakOpportunity);
+ AddAttributeToFormat(format, RENDERING_MODE_UIPROP, charFormat.renderingMode);
+ if (charFormat.renderingMode == flash.text.engine.RenderingMode.CFF)
+ AddAttributeToFormat(format, CFF_HINTING_UIPROP, charFormat.cffHinting);
+
+
+ var paragraph:ParagraphElement = leafIter.getParagraph();
+ var paraFormat:ITextLayoutFormat = paragraph.computedFormat;
+ AddAttributeToFormat(format, PARA_LOCALE_UIPROP, paraFormat.locale);
+ AddAttributeToFormat(format, TEXT_INDENT_UIPROP, paraFormat.textIndent);
+ AddAttributeToFormat(format, START_INDENT_UIPROP, paraFormat.paragraphStartIndent);
+ AddAttributeToFormat(format, END_INDENT_UIPROP, paraFormat.paragraphEndIndent);
+ AddAttributeToFormat(format, SPACE_BEFORE_UIPROP, paraFormat.paragraphSpaceBefore);
+ AddAttributeToFormat(format, SPACE_AFTER_UIPROP, paraFormat.paragraphSpaceAfter);
+ AddAttributeToFormat(format, TEXT_ALIGN_UIPROP, paraFormat.textAlign);
+ if (paraFormat.textAlign == TextAlign.JUSTIFY)
+ AddAttributeToFormat(format, TEXT_ALIGN_LAST_UIPROP, paraFormat.textAlignLast);
+ AddAttributeToFormat(format, JUSTIFICATION_RULE_UIPROP, paraFormat.justificationRule);
+ AddAttributeToFormat(format, TEXT_JUSTIFY_UIPROP, paraFormat.textJustify);
+ AddAttributeToFormat(format, JUSTIFICATION_STYLE_UIPROP, paraFormat.justificationStyle);
+ AddAttributeToFormat(format, DIRECTION_UIPROP, paraFormat.direction);
+ AddAttributeToFormat(format, LEADING_MODEL_UIPROP, paraFormat.leadingModel);
+
+ addLinkSettings(format, leafIter);
+
+ if (leafIter == inRange.lastLeaf)
+ break;
+
+ leafIter = leafIter.getNextLeaf();
+
+ //if this is a single point selection between differing elements, we don't want to pick up the second one
+ //is start == end, break...
+ if(inRange.absoluteStart == inRange.absoluteEnd)
+ break;
+ }
+ var containerFormat:ITextLayoutFormat = null;
+ var selStart:int = Math.min(mActiveFlow.interactionManager.activePosition, mActiveFlow.interactionManager.anchorPosition);
+ var selEnd:int = Math.max(mActiveFlow.interactionManager.activePosition, mActiveFlow.interactionManager.anchorPosition);
+ var line:TextFlowLine = mActiveFlow.flowComposer.findLineAtPosition(selStart);
+
+ // this is some odd logic - probably because ElementRange is not telling about the containercontroller range
+ if (line && line.controller)
+ {
+ var controller:ContainerController = line.controller;
+ line = mActiveFlow.flowComposer.findLineAtPosition(selEnd);
+ var lastController:ContainerController = null;
+ if (line && line.controller)
+ lastController = line.controller;
+ while (controller)
+ {
+ containerFormat = controller.computedFormat;
+ AddAttributeToFormat(format, VERTICAL_ALIGN_UIPROP, containerFormat.verticalAlign);
+ AddAttributeToFormat(format, COLUMN_COUNT_UIPROP, containerFormat.columnCount);
+ AddAttributeToFormat(format, COLUMN_WIDTH_UIPROP, containerFormat.columnWidth);
+ AddAttributeToFormat(format, COLUMN_GAP_UIPROP, containerFormat.columnGap);
+ AddAttributeToFormat(format, PADDING_LEFT_UIPROP, containerFormat.paddingLeft);
+ AddAttributeToFormat(format, PADDING_TOP_UIPROP, containerFormat.paddingTop);
+ AddAttributeToFormat(format, PADDING_RIGHT_UIPROP, containerFormat.paddingRight);
+ AddAttributeToFormat(format, PADDING_BOTTOM_UIPROP, containerFormat.paddingBottom);
+ // Note: These attributes are in the API but don't cause anything to be drawn. It looks like support
+ // for drawing borders on text containers is probably post-1.0. I have left in the XML description of
+ // how to build a UI for these properties, but commented this code out. If the DynamicPropertyEditorBase
+ // is never givena value for these properties, it will not display the UI.
+ // AddAttributeToFormat(format, BORDER_COLOR_UIPROP, containerFormat.borderColor);
+ // AddAttributeToFormat(format, BORDER_STYLE_UIPROP, containerFormat.borderStyle);
+ // AddAttributeToFormat(format, BORDER_THICKNESS_UIPROP, containerFormat.borderThickness);
+ AddAttributeToFormat(format, FIRST_BASELINE_UIPROP, containerFormat.firstBaselineOffset);
+
+ if (controller == lastController)
+ break;
+ var myIdx:int = controller.flowComposer.getControllerIndex(controller);
+ controller = myIdx+1 == controller.flowComposer.numControllers ? null : controller.flowComposer.getControllerAt(myIdx+1);
+ }
+ }
+ containerFormat = inRange.containerFormat;
+ var tf:TextFlow = inRange.firstLeaf.getTextFlow();
+ AddAttributeToFormat(format, BLOCK_PROGRESSION_UIPROP, tf.computedFormat.blockProgression);
+ AddAttributeToFormat(format, FLOW_DIRECTION_UIPROP, tf.computedFormat.direction);
+ AddAttributeToFormat(format, LINE_BREAK_UIPROP, tf.computedFormat.lineBreak);
+
+ // TODO: uses first container only
+ AddAttributeToFormat(format, VERTICAL_SCROLL_UIPROP, mActiveFlow.flowComposer.getControllerAt(0).verticalScrollPolicy);
+ AddAttributeToFormat(format, HORIZONTAL_SCROLL_UIPROP, mActiveFlow.flowComposer.getControllerAt(0).horizontalScrollPolicy);
+
+ if (isTCYEnabled())
+ AddAttributeToFormat(format, TCY_UIPROP, TCY(inRange));
+
+ if (shouldExtendLink(format))
+ AddAttributeToFormat(format, LINK_EXTEND_UIPROP, true);
+
+ return format;
+ }
+
+ private function addLinkSettings(format:Object, leaf:FlowElement):void
+ {
+ var linkElement:LinkElement = leaf.getParentByType(LinkElement) as LinkElement;
+ if (linkElement)
+ {
+ AddAttributeToFormat(format, LINK_URL_UIPROP, linkElement.href);
+ AddAttributeToFormat(format, LINK_TARGET_UIPROP, linkElement.target ? linkElement.target : "");
+ }
+ else
+ {
+ AddAttributeToFormat(format, LINK_URL_UIPROP, "");
+ // Don't show link target or extend link if there's no URL property in the selection
+ }
+
+ }
+
+ private function shouldExtendLink(format:Object):Boolean
+ {
+ // Check box is added if the selection contains mixed link settings (more than one, and at least one a valid link)
+ var extendLink:Boolean = false;
+ var urlArray:Array = format[LINK_URL_UIPROP];
+ if (urlArray && urlArray.length > 1)
+ {
+ for each (var urlString:String in urlArray)
+ if (urlString.length > 1)
+ {
+ extendLink = true;
+ break;
+ }
+ }
+ return extendLink;
+ }
+
+ private function isTCYEnabled():Boolean
+ {
+ var okToTurnOnTCY:Boolean = false;
+ if (mActiveFlow.interactionManager.isRangeSelection())
+ {
+ //have to also check if more than just the end of paragraph markers
+ //are selected
+
+ var selBegIdx:int = mActiveFlow.interactionManager.anchorPosition;
+ var selEndIdx:int = mActiveFlow.interactionManager.activePosition;
+ if (selBegIdx > selEndIdx)
+ {
+ var tempInt:int = selBegIdx;
+ selBegIdx = selEndIdx;
+ selEndIdx = tempInt;
+ }
+
+ var para:ParagraphElement;
+ var startParaPos:int;
+ var endParaPos:int;
+ var beginCheckPos:int;
+ var endCheckPos:int;
+ while ((!okToTurnOnTCY) && (selBegIdx < selEndIdx))
+ {
+ para = mActiveFlow.findAbsoluteParagraph(selBegIdx);
+ startParaPos = para.getAbsoluteStart();
+ endParaPos = startParaPos + para.textLength;
+
+ if (startParaPos > selBegIdx)
+ beginCheckPos = startParaPos;
+ else
+ beginCheckPos = selBegIdx
+
+ if (endParaPos > selEndIdx)
+ endCheckPos = selEndIdx;
+ else
+ endCheckPos = endParaPos;
+
+ var numSelInPar:int = endCheckPos - beginCheckPos;
+ if ((numSelInPar > 1) || ((numSelInPar == 1) && (endCheckPos != endParaPos)))
+ {
+ okToTurnOnTCY = true;
+ } else {
+ selBegIdx = endParaPos;
+ }
+ }
+ }
+ return okToTurnOnTCY;
+ }
+
+ public function TCY(range:ElementRange):Boolean
+ {
+ if(range != null)
+ {
+ var anchorEl:FlowElement = range.firstLeaf;
+ var endEl:FlowElement = range.lastLeaf;
+ if ((endEl is SpanElement) && ((endEl as SpanElement).hasParagraphTerminator) && (endEl.textLength == 1))
+ {
+ endEl = endEl.getTextFlow().findLeaf(endEl.getAbsoluteStart() - 1);
+ }
+
+ var anchorIsTCY:Boolean = false;
+ var endIsTCY:Boolean = false;
+
+ //if this or any of it's parents are TCY, then anchorIsTCY is true
+ while(anchorEl != null && !anchorIsTCY)
+ {
+ if(anchorEl is TCYElement)
+ anchorIsTCY = true;
+
+ anchorEl = anchorEl.parent;
+ }
+
+ //if this or any of it's parents are TCY, then anchorIsTCY is true
+ //NOTE: anchorEl and endEl may differing parent counts.
+ while(endEl != null && !endIsTCY)
+ {
+ if(endEl is TCYElement)
+ endIsTCY = true;
+
+ endEl = endEl.parent;
+ }
+
+ return endIsTCY && anchorIsTCY;
+ }
+ else
+ return false;
+ }
+
+ private function IsMetaFontName(inFont:String):Boolean
+ {
+ return (inFont == "_sans" || inFont == "_serif" || inFont == "_typewriter");
+ }
+
+ private function AddAttributeToFormat(inFormat:Object, key:String, value:Object):void
+ {
+ if (inFormat[key] == null)
+ {
+ inFormat[key] = [];
+ ++inFormat.numProps;
+ }
+ if (inFormat[key].indexOf(value) == -1)
+ inFormat[key].push(value);
+ }
+
+ public function SetTextProperty(inKey:String, inValue:Object):void
+ {
+ var slashIndex:int = inKey.indexOf("/");
+ if (slashIndex == -1)
+ throw new Error("Expected a key with a slash in it.");
+ var domain:String = inKey.slice(0, slashIndex);
+ var key:String = inKey.slice(slashIndex + 1);
+ // This little kludge allows me to have two controls operate on the same property
+ var hashIndex:int = key.indexOf("#");
+ if (hashIndex > -1)
+ key = key.slice(0, hashIndex);
+ if (mEditManager)
+ {
+ // scratch vars
+ var pa:TextLayoutFormat;
+ var cont:TextLayoutFormat;
+ var ca:TextLayoutFormat;
+
+ switch(domain) {
+ case CHAR_DOMAIN:
+ ca = new TextLayoutFormat();
+ if (key == "color")
+ {
+ inValue = uint(inValue);
+ if (mActiveFlow)
+ {
+ mActiveFlow.interactionManager.setFocus();
+ }
+ }
+ if (key == "backgroundColor")
+ {
+ inValue = uint(inValue);
+ }
+ if (key == "lineThrough")
+ inValue = inValue == "true" ? true : false;
+ ca[key] = inValue;
+ if (key == "fontFamily" && IsMetaFontName(inValue as String))
+ ca["fontLookup"] = flash.text.engine.FontLookup.DEVICE;
+ processingCharacterFormatChange = true;
+ mEditManager.applyLeafFormat(ca);
+ processingCharacterFormatChange = false;
+ break;
+ case PAR_DOMAIN:
+ pa = new TextLayoutFormat();
+ pa[key] = inValue;
+ mEditManager.applyParagraphFormat(pa);
+ break;
+ case FLOW_DOMAIN:
+ pa = new TextLayoutFormat();
+ pa[key] = inValue;
+ mEditManager.applyFormatToElement(mActiveFlow,pa);
+ break;
+ case CONT_DOMAIN:
+ cont = new TextLayoutFormat();
+ cont[key] = inValue;
+
+ // always modify the containers
+ mEditManager.applyContainerFormat(cont,null);
+ break;
+ case SCROLL_DOMAIN: // scroll policy props
+ mActiveFlow.flowComposer.getControllerAt(0)[key] = inValue;
+ mActiveFlow.flowComposer.updateAllControllers();
+ break;
+ case TCY_DOMAIN:
+ if (key == "tcy")
+ mEditManager.applyTCY(inValue == "true" ? true : false);
+ break;
+ case LINK_DOMAIN:
+ if (key == "linkURL")
+ mEditManager.applyLink(inValue as String);
+ break;
+ }
+ }
+ mLastFormat = null;
+ }
+
+ private var mActiveFlow:TextFlow = null;
+ private var mEditManager:IEditManager = null;
+ private var mLastFormat:Object = null;
+ private var mRulers:Array = [];
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_center_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_center_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_center_icon.png
new file mode 100644
index 0000000..14e18cd
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_center_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_end_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_end_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_end_icon.png
new file mode 100644
index 0000000..917f0a0
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_end_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_justify_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_justify_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_justify_icon.png
new file mode 100644
index 0000000..01ccc34
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_justify_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_last_center_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_last_center_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_last_center_icon.png
new file mode 100644
index 0000000..e5fb315
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_last_center_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_last_left_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_last_left_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_last_left_icon.png
new file mode 100644
index 0000000..bd67ea2
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_last_left_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_last_right_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_last_right_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_last_right_icon.png
new file mode 100644
index 0000000..d33328c
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_last_right_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_left_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_left_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_left_icon.png
new file mode 100644
index 0000000..4524f7a
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_left_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_right_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_right_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_right_icon.png
new file mode 100644
index 0000000..d84624c
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_right_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_start_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_start_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_start_icon.png
new file mode 100644
index 0000000..80b6b9e
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/align_start_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/bold_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/bold_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/bold_icon.png
new file mode 100644
index 0000000..cef2c4b
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/bold_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/cont_align_bottom_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/cont_align_bottom_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/cont_align_bottom_icon.png
new file mode 100644
index 0000000..a6ec4b1
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/cont_align_bottom_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/cont_align_justify_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/cont_align_justify_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/cont_align_justify_icon.png
new file mode 100644
index 0000000..4c45bc2
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/cont_align_justify_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/cont_align_middle_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/cont_align_middle_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/cont_align_middle_icon.png
new file mode 100644
index 0000000..a1f5ae8
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/cont_align_middle_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/cont_align_top_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/cont_align_top_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/cont_align_top_icon.png
new file mode 100644
index 0000000..9981848
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/cont_align_top_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/italic_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/italic_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/italic_icon.png
new file mode 100644
index 0000000..9bcce71
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/italic_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/strikethrough_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/strikethrough_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/strikethrough_icon.png
new file mode 100644
index 0000000..2d4e528
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/strikethrough_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/subscript_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/subscript_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/subscript_icon.png
new file mode 100644
index 0000000..7ee2a86
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/subscript_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/superscript_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/superscript_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/superscript_icon.png
new file mode 100644
index 0000000..210f933
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/superscript_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/tcy_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/tcy_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/tcy_icon.png
new file mode 100644
index 0000000..86797f1
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/tcy_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/underline_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/underline_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/underline_icon.png
new file mode 100644
index 0000000..355ac65
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/assets/underline_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/ParagraphPropertyMarker.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/ParagraphPropertyMarker.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/ParagraphPropertyMarker.as
new file mode 100644
index 0000000..b5f4327
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/ParagraphPropertyMarker.as
@@ -0,0 +1,98 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.rulers
+{
+ import flashx.textLayout.formats.TextLayoutFormat;
+ import flashx.textLayout.tlf_internal;
+ use namespace tlf_internal;
+
+ public class ParagraphPropertyMarker extends RulerMarker
+ {
+ public function ParagraphPropertyMarker(inRuler:RulerBar, inProperty:String)
+ {
+ super(inRuler, 6, 13, 0, 0, 0);
+ setStyle("propkind", inProperty);
+ setStyle("rightToLeftPar", false);
+ mProperty = inProperty;
+ }
+
+ public function get property():String
+ {
+ return mProperty;
+ }
+
+ override protected function get alignToRight():Boolean
+ {
+ switch(mProperty)
+ {
+ case TextLayoutFormat.textIndentProperty.name:
+ return mRightToLeftPar ? true : false;
+ case TextLayoutFormat.paragraphStartIndentProperty.name:
+ return mRightToLeftPar;
+ case TextLayoutFormat.paragraphEndIndentProperty.name:
+ return !mRightToLeftPar;
+ }
+ return false;
+ }
+
+ override protected function get originPosition():Number
+ {
+ return mRelativeToPosition;
+ }
+
+ public function set relativeToPosition(inRelPos:Number):void
+ {
+ mRelativeToPosition = inRelPos;
+ positionMarker();
+ }
+
+ override public function get hOffset():Number
+ {
+ switch(mProperty)
+ {
+ case TextLayoutFormat.textIndentProperty.name:
+ return mRightToLeftPar ? -6 : 0;
+ case TextLayoutFormat.paragraphStartIndentProperty.name:
+ return mRightToLeftPar ? -6 : 0;
+ case TextLayoutFormat.paragraphEndIndentProperty.name:
+ return mRightToLeftPar ? 0 : -6;
+ }
+ return 0;
+ }
+
+ public function set rightToLeftPar(inRightToLeft:Boolean):void
+ {
+ if (inRightToLeft != mRightToLeftPar)
+ {
+ mRightToLeftPar = inRightToLeft;
+ setStyle("rightToLeftPar", mRightToLeftPar);
+
+ if (mProperty == TextLayoutFormat.paragraphStartIndentProperty.name)
+ mProperty = TextLayoutFormat.paragraphEndIndentProperty.name;
+ else if (mProperty == TextLayoutFormat.paragraphEndIndentProperty.name)
+ mProperty = TextLayoutFormat.paragraphStartIndentProperty.name;
+ }
+ }
+
+ private var mProperty:String;
+ private var mRelativeToPosition:Number = 0;
+ private var mRightToLeftPar:Boolean = false;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/ParagraphPropertyMarkerSkin.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/ParagraphPropertyMarkerSkin.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/ParagraphPropertyMarkerSkin.as
new file mode 100644
index 0000000..930f1c7
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/ParagraphPropertyMarkerSkin.as
@@ -0,0 +1,103 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.rulers
+{
+ import mx.skins.RectangularBorder;
+
+ public class ParagraphPropertyMarkerSkin extends RectangularBorder
+ {
+ public function ParagraphPropertyMarkerSkin()
+ {
+ super();
+ }
+
+ override protected function updateDisplayList(w:Number, h:Number):void
+ {
+ super.updateDisplayList(w, h);
+
+ var propKind:String = getStyle("propkind");
+ var rightToLeftPar:Boolean = getStyle("rightToLeftPar");
+
+ var t:Number = 0;
+ var b:Number = h;
+
+ graphics.clear();
+
+ graphics.beginFill(0x000000);
+ if (rightToLeftPar)
+ {
+ switch(propKind) {
+ case "textIndent":
+ b = (h - 1) / 2;
+ graphics.moveTo(w, 0);
+ graphics.lineTo(w, b);
+ graphics.lineTo(0, b);
+ graphics.lineTo(w, 0);
+ break;
+ case "paragraphStartIndent":
+ graphics.moveTo(0, 0);
+ graphics.lineTo(0, h);
+ graphics.lineTo(w, h / 2);
+ graphics.lineTo(0, 0);
+ break;
+ case "paragraphEndIndent":
+ t = h - (h - 1) / 2;
+ graphics.moveTo(w, h);
+ graphics.lineTo(0, t);
+ graphics.lineTo(w, t);
+ graphics.lineTo(w, h);
+ break;
+ }
+ }
+ else
+ {
+ switch(propKind) {
+ case "textIndent":
+ b = (h - 1) / 2;
+ graphics.moveTo(0, 0);
+ graphics.lineTo(w, b);
+ graphics.lineTo(0, b);
+ graphics.lineTo(0, 0);
+ break;
+ case "paragraphStartIndent":
+ t = h - (h - 1) / 2;
+ graphics.moveTo(0, h);
+ graphics.lineTo(0, t);
+ graphics.lineTo(w, t);
+ graphics.lineTo(0, h);
+ break;
+ case "paragraphEndIndent":
+ graphics.moveTo(w, 0);
+ graphics.lineTo(w, h);
+ graphics.lineTo(0, h / 2);
+ graphics.lineTo(w, 0);
+ break;
+ }
+ }
+ graphics.endFill();
+
+ // this makes the whole rect hittable
+ graphics.lineStyle();
+ graphics.beginFill(0x0000ff, 0);
+ graphics.drawRect(0, t, w, b);
+ graphics.endFill();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/RulerBar.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/RulerBar.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/RulerBar.as
new file mode 100644
index 0000000..73817f2
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/RulerBar.as
@@ -0,0 +1,672 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.rulers
+{
+ import bxf.ui.inspectors.DynamicPropertyEditorBase;
+
+ import flash.display.DisplayObject;
+ import flash.display.GradientType;
+ import flash.events.MouseEvent;
+ import flash.geom.Matrix;
+ import flash.geom.Point;
+ import flash.geom.Rectangle;
+ import flash.text.engine.TabAlignment;
+
+ import flashx.textLayout.container.ContainerController;
+ import flashx.textLayout.edit.EditManager;
+ import flashx.textLayout.edit.ElementRange;
+ import flashx.textLayout.edit.SelectionState;
+ import flashx.textLayout.elements.ContainerFormattedElement;
+ import flashx.textLayout.elements.ParagraphElement;
+ import flashx.textLayout.elements.TextFlow;
+ import flashx.textLayout.compose.TextFlowLine;
+ import flashx.textLayout.events.SelectionEvent;
+ import flashx.textLayout.formats.ITextLayoutFormat;
+ import flashx.textLayout.formats.ITabStopFormat;
+ import flashx.textLayout.formats.TextLayoutFormat;
+ import flashx.textLayout.formats.TabStopFormat;
+ import flashx.textLayout.formats.BlockProgression;
+ import flashx.textLayout.tlf_internal;
+ import flashx.textLayout.ui.inspectors.TabPropertyEditor;
+ import flashx.textLayout.ui.inspectors.TextInspectorController;
+
+ import mx.containers.Canvas;
+ import mx.core.ScrollPolicy;
+ import mx.core.UIComponent;
+ import mx.events.PropertyChangeEvent;
+ import mx.events.ResizeEvent;
+ use namespace tlf_internal;
+
+ public class RulerBar extends Canvas
+ {
+ public static const RULER_HORIZONTAL:String = "horizontal";
+ public static const RULER_VERTICAL:String = "vertical";
+
+ public function RulerBar()
+ {
+ super();
+ horizontalScrollPolicy = ScrollPolicy.OFF;
+ verticalScrollPolicy = ScrollPolicy.OFF;
+ mDefaultTabStop = new TabStopFormat(TabStopFormat.defaultFormat);
+ addEventListener(MouseEvent.MOUSE_DOWN, onRulerMouseDown);
+ selectMarker(null);
+ TextInspectorController.Instance().AddRuler(this);
+ curParagraphFormat = null;
+ }
+
+ override public function initialize():void
+ {
+ super.initialize();
+ adjustForActive();
+ }
+
+ public function creationComplete():void
+ {
+ if (mSyncToPanel)
+ {
+ mSyncToPanel.addEventListener(ResizeEvent.RESIZE, onSyncPanelResize);
+ }
+ SyncRulerToPanel();
+ mIndentMarker = addParagraphPropertyMarker(TextLayoutFormat.textIndentProperty.name);
+ mLeftMarginMarker = addParagraphPropertyMarker(TextLayoutFormat.paragraphStartIndentProperty.name);
+ mRightMarginMarker = addParagraphPropertyMarker(TextLayoutFormat.paragraphEndIndentProperty.name);
+ }
+
+ public function set activeFlow(inFlow:TextFlow):void
+ {
+ if (inFlow && !inFlow.interactionManager is EditManager)
+ throw new Error("Can't set the active flow to a flow without an EditManager.");
+ if (mActiveFlow)
+ {
+ mActiveFlow.removeEventListener(SelectionEvent.SELECTION_CHANGE, onTextSelectionChanged);
+ mEditManager = null;
+ }
+ mActiveFlow = inFlow;
+ mLastSelActiveIdx = -1;
+ mLastSelAnchorIdx = -1;
+ mTabSet = null;
+ RemoveTabMarkers();
+ selectMarker(null);
+
+ if (mActiveFlow)
+ {
+ mEditManager = mActiveFlow.interactionManager as EditManager;
+ mActiveFlow.addEventListener(SelectionEvent.SELECTION_CHANGE, onTextSelectionChanged);
+ }
+ else
+ onTextSelectionChanged(null);
+ }
+
+ public function get activeFlow():TextFlow
+ {
+ return mActiveFlow;
+ }
+
+ public function set active(inActive:Boolean):void
+ {
+ mActive = inActive;
+ selectMarker(null);
+ adjustForActive();
+ }
+
+ public function get active():Boolean
+ {
+ return mActive;
+ }
+
+ private function set rightRuler(inActive:Boolean):void
+ {
+ mRightRuler = inActive;
+ adjustForActive();
+ }
+
+ private function get rightRuler():Boolean
+ {
+ return mRightRuler;
+ }
+
+ private function adjustForActive():void
+ {
+ if (parent)
+ {
+ if (mActive && mRightRuler)
+ {
+ parent.visible = true;
+ if (parent is Canvas)
+ (parent as Canvas).includeInLayout = true;
+ }
+ else
+ {
+ parent.visible = false;
+ if (parent is Canvas)
+ (parent as Canvas).includeInLayout = false;
+ }
+ }
+ }
+
+ public function set orientation(inOrientation:String):void
+ {
+ if (inOrientation != mOrientation && (inOrientation == RULER_HORIZONTAL || inOrientation == RULER_VERTICAL))
+ {
+ mOrientation = inOrientation;
+ }
+ }
+
+ public function set syncToPanel(inPanel:UIComponent):void
+ {
+ mSyncToPanel = inPanel;
+ }
+
+ public function set tabPropertyEditor(inEditor:TabPropertyEditor):void
+ {
+ mPropertyEditor = inEditor;
+ mPropertyEditor.addEventListener(DynamicPropertyEditorBase.MODELCHANGED_EVENT, onFormatValueChanged, false, 0, true);
+ mPropertyEditor.addEventListener(DynamicPropertyEditorBase.MODELEDITED_EVENT, onFormatValueChanged, false, 0, true);
+ selectMarker(mSelectedMarker);
+ }
+
+ private function onSyncPanelResize(evt:ResizeEvent):void
+ {
+ RedrawRuler();
+ }
+
+ public function RedrawRuler():void
+ {
+ SyncRulerToPanel();
+ if (curParagraphFormat != null) {
+ ShowTabs(curParagraphFormat);
+ }
+ }
+
+ private function SyncRulerToPanel():void
+ {
+ if (mActiveFlow && mActiveFlow.flowComposer && rightRuler)
+ {
+ var selStart:int = Math.min(mActiveFlow.interactionManager.activePosition, mActiveFlow.interactionManager.anchorPosition);
+ var line:TextFlowLine = selStart != -1 ? mActiveFlow.flowComposer.findLineAtPosition(selStart) : null;
+ if (line)
+ {
+ var controller:ContainerController;
+ var containerDO:DisplayObject;
+ if (line.controller)
+ {
+ controller = line.controller;
+ containerDO = controller.container as DisplayObject;
+ }
+ else
+ {
+ // get the last container
+ controller = mActiveFlow.flowComposer.getControllerAt(mActiveFlow.flowComposer.numControllers-1);
+ containerDO = controller.container as DisplayObject;
+ }
+ var localOrigin:Point = parent.globalToLocal(containerDO.parent.localToGlobal(new Point(containerDO.x, containerDO.y)));
+ var columnBounds:Rectangle;
+ var columnIndex:int = line.columnIndex;
+ if (columnIndex == -1)
+ columnBounds = controller.columnState.getColumnAt(controller.columnState.columnCount - 1);
+ else
+ {
+ // columnIndex is an index into all the columns in the flow, so to get the actual
+ // column bounds
+ var idx:int = 0;
+ var ch:ContainerController = mActiveFlow.flowComposer.getControllerAt(idx);
+ while (ch && ch != controller)
+ {
+ columnIndex -= ch.columnState.columnCount;
+ idx++;
+ ch = idx == mActiveFlow.flowComposer.numControllers ? null : mActiveFlow.flowComposer.getControllerAt(idx);
+ }
+ // Pin the column number to the actual range of column indices. I have found this
+ // is needed when the insertion point is inside a table (because the line's container
+ // is not in the flow's list of containers) or when the insertion point is in regular
+ // text after a table (the column number doesn't make sense, and I think it's a bug, which
+ // I have written to Robin about.
+ columnIndex = Math.max(0, Math.min(line.columnIndex, controller.columnState.columnCount - 1));
+ columnBounds = controller.columnState.getColumnAt(columnIndex);
+ }
+
+ if (columnBounds)
+ {
+ if (mOrientation == RULER_HORIZONTAL)
+ {
+ x = localOrigin.x + columnBounds.x;
+ y = 0;
+ height = parent.height;
+ width = columnBounds.width;
+ }
+ else
+ {
+ x = parent.width;
+ y = localOrigin.y + columnBounds.y;
+ rotation = 90;
+ height = parent.width;
+ width = columnBounds.height;
+ }
+ }
+ }
+ }
+ }
+
+ private function onTextSelectionChanged(e:SelectionEvent):void
+ {
+ curParagraphFormat = null;
+ if (mEditManager && (mEditManager.activePosition != mLastSelActiveIdx || mEditManager.anchorPosition != mLastSelAnchorIdx))
+ {
+ mLastSelActiveIdx = mActiveFlow.interactionManager.activePosition;
+ mLastSelAnchorIdx = mActiveFlow.interactionManager.anchorPosition;
+ selectMarker(null);
+ }
+ if (e)
+ {
+ var selState:SelectionState = e.selectionState;
+ var selectedElementRange:ElementRange = selState ? ElementRange.createElementRange(selState.textFlow, selState.absoluteStart, selState.absoluteEnd) : null;
+ if (selectedElementRange)
+ {
+ var rootElement:ContainerFormattedElement = selectedElementRange.firstLeaf.getAncestorWithContainer();
+ if ((rootElement.computedFormat.blockProgression == BlockProgression.RL) == (mOrientation == RULER_VERTICAL))
+ {
+ // should be active
+ if (rightRuler != true)
+ {
+ mTabSet = null;
+ }
+ if (!rightRuler)
+ rightRuler = true;
+ }
+ else
+ {
+ // should be inactive
+ if (rightRuler != false)
+ {
+ mTabSet = null;
+ }
+ if (rightRuler)
+ rightRuler = false;
+ }
+
+ curParagraphFormat = new TextLayoutFormat(selectedElementRange.firstParagraph.computedFormat);
+ setRightToLeft(curParagraphFormat.direction == flashx.textLayout.formats.Direction.RTL);
+ ShowTabs(curParagraphFormat);
+ }
+ else
+ ShowTabs(null);
+ }
+ else
+ ShowTabs(null);
+ }
+
+
+ private function RemoveTabMarkers():void
+ {
+ var markers:Array = getChildren();
+ for each (var marker:UIComponent in markers)
+ if (marker is TabMarker)
+ this.removeChild(marker);
+ }
+
+
+ private function ShowTabs(inFormat:ITextLayoutFormat):void
+ {
+ SyncRulerToPanel();
+ var tabs:Array = inFormat ? ((inFormat.tabStops && (inFormat.tabStops.length > 0)) ? inFormat.tabStops as Array : null) : null;
+ if (isNewTabSet(tabs))
+ {
+ mTabSet = tabs;
+ if (mUpdateFromSelection)
+ {
+ RemoveTabMarkers();
+ var oldSel:RulerMarker = mSelectedMarker;
+ selectMarker(null);
+ if (mTabSet)
+ for each(var tab:TabStopFormat in mTabSet)
+ {
+ var tabMarker:TabMarker = addTabMarker(tab);
+ if (oldSel && oldSel.pos == tabMarker.pos)
+ selectMarker(tabMarker);
+ }
+ }
+ }
+ if (inFormat)
+ {
+ if(mIndentMarker)
+ {
+ mIndentMarker.rightToLeftPar = mRightToLeft;
+ mIndentMarker.pos = Number(inFormat.textIndent);
+ mIndentMarker.relativeToPosition = inFormat.paragraphStartIndent;
+ }
+
+ if(mLeftMarginMarker)
+ {
+ mLeftMarginMarker.rightToLeftPar = mRightToLeft;
+ mLeftMarginMarker.pos = rightToLeft ? Number(inFormat.paragraphEndIndent): Number(inFormat.paragraphStartIndent);
+ }
+
+ if(mRightMarginMarker)
+ {
+ mRightMarginMarker.rightToLeftPar = mRightToLeft;
+ mRightMarginMarker.pos = rightToLeft ? Number(inFormat.paragraphStartIndent): Number(inFormat.paragraphEndIndent);
+ }
+ }
+ }
+
+
+ private function addTabMarker(tabAttrs:ITabStopFormat):TabMarker
+ {
+ var tabMarker:TabMarker = new TabMarker(this, tabAttrs);
+ tabMarker.addEventListener(MouseEvent.MOUSE_DOWN, onMarkerMouseDown);
+ addChild(tabMarker);
+ return tabMarker;
+ }
+
+
+ private function addParagraphPropertyMarker(inProperty:String):ParagraphPropertyMarker
+ {
+ var propMarker:ParagraphPropertyMarker = new ParagraphPropertyMarker(this, inProperty);
+ propMarker.addEventListener(MouseEvent.MOUSE_DOWN, onMarkerMouseDown);
+ addChild(propMarker);
+ return propMarker;
+ }
+
+
+ private function isNewTabSet(inTabs:Array):Boolean
+ {
+ if (inTabs == mTabSet)
+ return false;
+ if ((inTabs == null) != (mTabSet == null))
+ return true;
+ if (inTabs)
+ {
+ if (inTabs.length == mTabSet.length)
+ {
+ var n:int = inTabs.length;
+ for (var i:int = 0; i < n; ++i)
+ {
+ if (inTabs[i] != mTabSet[i])
+ return true;
+ }
+ return false;
+ }
+ else
+ return true;
+ }
+ return false;
+ }
+
+
+ override protected function updateDisplayList(w:Number, h:Number):void
+ {
+ super.updateDisplayList(w, h);
+
+ graphics.clear();
+ var m:Matrix = new Matrix();
+ m.createGradientBox(height, height, Math.PI / 2);
+ graphics.beginGradientFill(GradientType.LINEAR, [0xffffff, 0xe0e0e0], [1, 1], [0, 255], m);
+ graphics.drawRect(0, 0, w, h);
+ graphics.endFill();
+
+ graphics.lineStyle(1, 0x404040, 1.0, true);
+ for (var x:int = 0; x < w; x += 10)
+ {
+ var rulerX:Number = rightToLeft ? w - x - 1 : x;
+ if (x % 100 == 0)
+ graphics.moveTo(rulerX, 12);
+ else if (x % 50 == 0)
+ graphics.moveTo(rulerX, 9);
+ else
+ graphics.moveTo(rulerX, 5);
+ graphics.lineTo(rulerX, 0);
+ }
+ }
+
+ private function onMarkerMouseDown(e:MouseEvent):void
+ {
+ if (mEditManager)
+ {
+ var cookie:Object;
+ if (e.target is TabMarker)
+ {
+ var tabMarker:TabMarker = e.target as TabMarker;
+ selectMarker(tabMarker);
+ e.stopPropagation();
+ cookie = new Object();
+ cookie["marker"] = tabMarker;
+ cookie["offset"] = e.localX;
+ cookie["onRuler"] = true;
+ mUpdateFromSelection = false;
+ new RulerDragTracker(this.parentApplication as UIComponent, this, cookie).BeginTracking(e, false);
+ }
+ else if (e.target is ParagraphPropertyMarker)
+ {
+ var propMarker:ParagraphPropertyMarker = e.target as ParagraphPropertyMarker;
+ selectMarker(null);
+ e.stopPropagation();
+ cookie = new Object();
+ cookie["marker"] = propMarker;
+ cookie["offset"] = e.localX;
+ new RulerDragTracker(this.parentApplication as UIComponent, this, cookie).BeginTracking(e, false);
+ }
+ }
+ }
+
+ private function onRulerMouseDown(e:MouseEvent):void
+ {
+ if (e.target is RulerBar && mEditManager)
+ {
+ var tabMarker:TabMarker = addTabMarker(mDefaultTabStop);
+ tabMarker.markerLeft = e.localX + tabMarker.hOffset;
+ selectMarker(tabMarker);
+ mUpdateFromSelection = false;
+ setFormatFromRuler();
+ e.stopPropagation();
+ var cookie:Object = new Object();
+ cookie["marker"] = tabMarker;
+ cookie["offset"] = -tabMarker.hOffset;
+ cookie["onRuler"] = true;
+ new RulerDragTracker(this.parentApplication as UIComponent, this, cookie, 0).BeginTracking(e, false);
+ }
+ }
+
+ public function TrackDrag(inCurPos:Point, inCookie:Object, inCommit:Boolean):void
+ {
+ if (inCookie)
+ {
+ if (inCookie["marker"] is TabMarker)
+ {
+ var tabMarker:TabMarker = inCookie["marker"] as TabMarker;
+ var wasOnRuler:Boolean = inCookie["onRuler"];
+ if (inCookie["onRuler"] && inCurPos.y > height + 16)
+ {
+ inCookie["onRuler"] = false;
+ removeChild(tabMarker);
+ selectMarker(null);
+ }
+ else if (!inCookie["onRuler"] && inCurPos.y <= height + 16)
+ {
+ inCookie["onRuler"] = true;
+ addChild(tabMarker);
+ selectMarker(tabMarker);
+ }
+
+ tabMarker.markerLeft = inCurPos.x - inCookie["offset"];
+ if (wasOnRuler || inCookie["onRuler"])
+ setFormatFromRuler();
+ }
+ else if (inCookie["marker"] is ParagraphPropertyMarker)
+ {
+ var propMarker:ParagraphPropertyMarker = inCookie["marker"] as ParagraphPropertyMarker;
+ propMarker.markerLeft = inCurPos.x - inCookie["offset"];
+ var pa:TextLayoutFormat = new TextLayoutFormat();
+ pa[propMarker.property] = propMarker.pos;
+ mEditManager.applyParagraphFormat(pa);
+ }
+ }
+ if (inCommit)
+ mUpdateFromSelection = true;
+ }
+
+ public function DragCancelled():void
+ {
+ mUpdateFromSelection = true;
+ }
+
+ private function selectMarker(inMarker:RulerMarker):void
+ {
+ if (mSelectedMarker)
+ mSelectedMarker.setStyle("selected", false);
+ mSelectedMarker = inMarker;
+ if (mSelectedMarker)
+ mSelectedMarker.setStyle("selected", true);
+ updatePropertyEditor();
+ }
+
+ private function updatePropertyEditor():void
+ {
+ if (mRightRuler && mPropertyEditor && mTabPanelActive)
+ {
+ mPropertyEditor.reset();
+ mPropertyEditor.properties["rulervisible"] = TextInspectorController.Instance().rulerVisible;
+ if (TextInspectorController.Instance().rulerVisible)
+ {
+ var tab:ITabStopFormat = mSelectedMarker as ITabStopFormat;
+ if (!tab)
+ tab = mDefaultTabStop as ITabStopFormat;
+ if (tab)
+ {
+ mPropertyEditor.properties["alignment"] = tab.alignment;
+ if (tab != mDefaultTabStop)
+ mPropertyEditor.properties["position"] = tab.position;
+ if (tab.alignment == flash.text.engine.TabAlignment.DECIMAL)
+ mPropertyEditor.properties["decimalAlignmentToken"] = tab.decimalAlignmentToken;
+ }
+ }
+ mPropertyEditor.rebuildUI();
+ }
+ }
+
+ private function onFormatValueChanged(e:PropertyChangeEvent):void
+ {
+ if (mRightRuler)
+ {
+ var property:String = e.property as String;
+ if (property == "rulervisible")
+ TextInspectorController.Instance().rulerVisible = (e.newValue == "true" ? true : false);
+ else
+ {
+ if (e.type == DynamicPropertyEditorBase.MODELEDITED_EVENT)
+ mUpdateFromSelection = false;
+ var tab:Object = mSelectedMarker;
+ if (!tab)
+ tab = mDefaultTabStop;
+ var newValue:Object = e.newValue;
+ if (property == "position")
+ newValue = Number(newValue);
+ tab[property] = newValue;
+ if (property == "alignment" && newValue == flash.text.engine.TabAlignment.DECIMAL && tab["decimalAlignmentToken"] == null)
+ tab["decimalAlignmentToken"] = "";
+ if (mSelectedMarker)
+ setFormatFromRuler();
+ if (e.type == DynamicPropertyEditorBase.MODELCHANGED_EVENT)
+ mUpdateFromSelection = true;
+ updatePropertyEditor();
+ }
+ }
+ }
+
+ private function setFormatFromRuler():void
+ {
+ var newTabs:Array = [];
+ if (mSelectedMarker && mSelectedMarker.parent)
+ newTabs.push(new TabStopFormat(mSelectedMarker as ITabStopFormat));
+ var markers:Array = getChildren();
+ for each (var marker:UIComponent in markers)
+ if (marker is TabMarker)
+ {
+ var tab:TabMarker = marker as TabMarker;
+ if (isUniquePosition(newTabs, tab.pos))
+ newTabs.push(new TabStopFormat(tab));
+
+ }
+ newTabs.sortOn("position", Array.NUMERIC);
+ var pa:TextLayoutFormat = new TextLayoutFormat();
+ pa.tabStops = newTabs;
+ mEditManager.applyParagraphFormat(pa);
+ updatePropertyEditor();
+ }
+
+ private static function isUniquePosition(inTabFormat:Array, inNewPosition:Number):Boolean
+ {
+ for each (var tab:TabStopFormat in inTabFormat)
+ if (tab.position == inNewPosition)
+ return false;
+ return true;
+ }
+
+ public function set tabPanelActive(inActive:Boolean):void
+ {
+ if (mTabPanelActive != inActive)
+ {
+ mTabPanelActive = inActive;
+ if (mTabPanelActive)
+ updatePropertyEditor();
+ }
+ }
+
+ public function get tabPanelActive():Boolean
+ {
+ return mTabPanelActive;
+ }
+
+ public function get rightToLeft():Boolean
+ {
+ return mRightToLeft;
+ }
+
+ private function setRightToLeft(inRTL:Boolean):void
+ {
+ if (inRTL != mRightToLeft)
+ {
+ mTabSet = null;
+ mRightToLeft = inRTL;
+ invalidateDisplayList();
+ }
+ }
+
+ private var mActive:Boolean = true;
+ private var mActiveFlow:TextFlow = null;
+ private var mEditManager:EditManager = null;
+ private var mTabSet:Array = null;
+ private var mSelectedMarker:RulerMarker = null;
+ private var mUpdateFromSelection:Boolean = true;
+ private var mDefaultTabStop:TabStopFormat;
+ private var mPropertyEditor:TabPropertyEditor = null;
+ private var mOrientation:String = RULER_HORIZONTAL;
+ private var mSyncToPanel:UIComponent = null;
+ private var mRightRuler:Boolean = true;
+ private var mLastSelAnchorIdx:int = -1;
+ private var mLastSelActiveIdx:int = -1;
+ private var mIndentMarker:ParagraphPropertyMarker = null;
+ private var mLeftMarginMarker:ParagraphPropertyMarker = null;
+ private var mRightMarginMarker:ParagraphPropertyMarker = null;
+ private var mTabPanelActive:Boolean = false;
+ private var mRightToLeft:Boolean = false;
+ private var curParagraphFormat:TextLayoutFormat = null;
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/RulerDragTracker.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/RulerDragTracker.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/RulerDragTracker.as
new file mode 100644
index 0000000..042a92c
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/RulerDragTracker.as
@@ -0,0 +1,88 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.rulers
+{
+ import flash.events.MouseEvent;
+ import flash.geom.Point;
+
+ import mx.core.UIComponent;
+
+ import bxf.ui.toolkit.Tracker;
+
+ public class RulerDragTracker extends Tracker
+ {
+ public function RulerDragTracker(inPeerToTrackTo:UIComponent, inController:RulerBar, inCookie:Object, inDragThreshold:Number = 2)
+ {
+ super(inPeerToTrackTo, 0, 0);
+ mController = inController;
+ mDragCookie = inCookie;
+ mDragThreshold = inDragThreshold;
+ }
+
+ /** Override to get cursor adjust hook and mouse down.
+ * @param inMouseEvent mouse info.
+ * @param inCursorAdjust true if this is a mouse up track.*/
+ override public function BeginTracking(inMouseEvent:MouseEvent, inCursorAdjust:Boolean):void
+ {
+ super.BeginTracking(inMouseEvent, inCursorAdjust);
+ }
+
+ /** Override to get mouse move.
+ * @param inMouseEvent mouse info.*/
+ override public function ContinueTracking(inMouseEvent:MouseEvent):void
+ {
+ super.ContinueTracking(inMouseEvent);
+ if (!mDragThresholdReached)
+ {
+ if (Point.distance(mAnchorPt, mTrackPt) >= mDragThreshold)
+ mDragThresholdReached = true;
+ }
+ if (mDragThresholdReached)
+ mController.TrackDrag(mTrackPt, mDragCookie, false);
+ inMouseEvent.stopPropagation();
+ }
+
+ /** Override to get mouse up.
+ * @param inMouseEvent mouse info.*/
+ override public function EndTracking(inMouseEvent:MouseEvent):void
+ {
+ super.EndTracking(inMouseEvent);
+ if (mDragThresholdReached)
+ mController.TrackDrag(mTrackPt, mDragCookie, true);
+ else
+ mController.DragCancelled();
+ inMouseEvent.stopPropagation();
+ }
+
+ override protected function TrackPoint(inMouseEvent:MouseEvent, inAlsoSetAnchor:Boolean): void
+ {
+ mTrackPt.x = inMouseEvent.stageX;
+ mTrackPt.y = inMouseEvent.stageY;
+ mTrackPt = mController.globalToLocal(mTrackPt);
+ if (inAlsoSetAnchor)
+ mAnchorPt = mTrackPt.clone();
+ }
+
+ private var mController:RulerBar = null;
+ private var mDragCookie:Object = null;
+ private var mDragThreshold:Number;
+ private var mDragThresholdReached:Boolean = false;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/RulerMarker.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/RulerMarker.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/RulerMarker.as
new file mode 100644
index 0000000..7cc2848
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/RulerMarker.as
@@ -0,0 +1,124 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.rulers
+{
+ import mx.containers.Canvas;
+
+ public class RulerMarker extends Canvas
+ {
+ public function RulerMarker(inRuler:RulerBar, inWidth:Number, inHeight:Number, inHOffset:Number, inVOffset:Number, inPos:Number)
+ {
+ super();
+ width = inWidth;
+ height = inHeight;
+ mHOffset = inHOffset;
+ mVOffset = inVOffset;
+ mPos = inPos;
+ mRuler = inRuler;
+ }
+
+ override public function initialize():void
+ {
+ super.initialize();
+ positionMarker();
+ }
+
+ protected function positionMarker():void
+ {
+ if (parent)
+ {
+ if (alignToRight)
+ {
+ x = parent.width - originPosition - pos + hOffset;
+ y = parent.height - height + vOffset;
+ }
+ else
+ {
+ x = originPosition + pos + hOffset;
+ y = parent.height - height + vOffset;
+ }
+ }
+ }
+
+ protected function get alignToRight():Boolean
+ {
+ return ruler.rightToLeft;
+ }
+
+ protected function get originPosition():Number
+ {
+ return 0;
+ }
+
+ public function set pos(inPos:Number):void
+ {
+ mPos = inPos;
+ positionMarker();
+ }
+
+ public function get pos():Number
+ {
+ return mPos;
+ }
+
+ public function set hOffset(inOffset:Number):void
+ {
+ mHOffset = inOffset;
+ positionMarker();
+ }
+
+ public function get hOffset():Number
+ {
+ return mHOffset;
+ }
+
+ public function set vOffset(inOffset:Number):void
+ {
+ mVOffset = inOffset;
+ positionMarker();
+ }
+
+ public function get vOffset():Number
+ {
+ return mVOffset;
+ }
+
+ public function get ruler():RulerBar
+ {
+ return mRuler;
+ }
+
+ public function set markerLeft(inNewLeft:Number):void
+ {
+ if (parent)
+ {
+ if (alignToRight)
+ pos = parent.width - (inNewLeft + hOffset > parent.width ? parent.width : inNewLeft + hOffset) - originPosition;
+ else
+ pos = (inNewLeft < 0 ? 0 : inNewLeft) - originPosition - hOffset;
+ }
+ }
+
+ private var mPos:Number;
+ private var mHOffset:Number;
+ private var mVOffset:Number;
+ private var mRuler:RulerBar = null;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/TabMarker.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/TabMarker.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/TabMarker.as
new file mode 100644
index 0000000..9b6a31e
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/TabMarker.as
@@ -0,0 +1,86 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.rulers
+{
+ import mx.messaging.management.Attribute;
+
+ import flashx.textLayout.formats.ITabStopFormat;
+
+ public class TabMarker extends RulerMarker implements ITabStopFormat
+ {
+ public function TabMarker(inRuler:RulerBar, tabAttrs:ITabStopFormat)
+ {
+ super(inRuler, 9, 10, -4, 0, Number(tabAttrs.position));
+ mTabKind = tabAttrs.alignment;
+ mAlignmentToken = tabAttrs.decimalAlignmentToken;
+ setStyle("tabkind", mTabKind);
+ }
+
+ public function get alignment():*
+ {
+ return mTabKind;
+ }
+
+ public function set alignment(inAlignment:String):void
+ {
+ mTabKind = inAlignment;
+ setStyle("tabkind", mTabKind);
+ }
+
+ public function get decimalAlignmentToken():*
+ {
+ return mAlignmentToken;
+ }
+
+ public function set decimalAlignmenyToken(inToken:String):void
+ {
+ mAlignmentToken = inToken;
+ }
+
+ public function set decimalAlignmentToken(inToken:String):void
+ {
+ mAlignmentToken = inToken;
+ }
+
+ public function get position():*
+ {
+ return pos;
+ }
+
+ public function set position(inPosition:Object):void
+ {
+ pos = inPosition as Number;
+ }
+
+
+ public function isDifferentPosition(element:*, index:int, arr:Array):Boolean
+ {
+ var other:TabMarker = element as TabMarker;
+ if (other)
+ return other.position != position;
+ else
+ return true;
+ }
+
+
+ private var mTabKind:String;
+ private var mAlignmentToken:String = null;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/TabMarkerSkin.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/TabMarkerSkin.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/TabMarkerSkin.as
new file mode 100644
index 0000000..a6c4aaf
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/rulers/TabMarkerSkin.as
@@ -0,0 +1,94 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.rulers
+{
+ import flash.text.engine.TabAlignment;
+
+ import mx.skins.RectangularBorder;
+
+ public class TabMarkerSkin extends RectangularBorder
+ {
+ public function TabMarkerSkin()
+ {
+ super();
+ }
+
+ override protected function updateDisplayList(w:Number, h:Number):void
+ {
+ super.updateDisplayList(w, h);
+
+ var tabKind:String = getStyle("tabkind");
+
+ graphics.clear();
+
+ graphics.lineStyle(3, 0xffffff);
+ drawOrnament(tabKind, w, h);
+ graphics.lineStyle(1, 0x000000);
+ drawOrnament(tabKind, w, h);
+
+ if (tabKind == flash.text.engine.TabAlignment.DECIMAL)
+ {
+ graphics.beginFill(0x000000);
+ graphics.drawCircle(w / 2 + 3, (h - w / 2) / 2, .75);
+ graphics.endFill();
+ }
+
+ graphics.beginFill(0x000000);
+ graphics.moveTo(0, h - w / 2);
+ graphics.lineTo(w / 2, h);
+ graphics.lineTo(w, h - w / 2);
+ graphics.lineTo(0, h - w / 2);
+ graphics.endFill();
+
+ var selected:Boolean = getStyle("selected");
+ graphics.lineStyle();
+ graphics.beginFill(0x0000ff, selected ? .3 : 0);
+ graphics.drawRect(0, 0, w, h);
+ graphics.endFill();
+ }
+
+ private function drawOrnament(inKind:String, w:Number, h:Number):void
+ {
+ switch (inKind)
+ {
+ case flash.text.engine.TabAlignment.START:
+ graphics.moveTo(w / 2, h - w / 2);
+ graphics.lineTo(w / 2, 1);
+ graphics.lineTo(w, 1);
+ break;
+ case flash.text.engine.TabAlignment.CENTER:
+ graphics.moveTo(w / 2, h - w / 2);
+ graphics.lineTo(w / 2, 0);
+ break;
+ case flash.text.engine.TabAlignment.END:
+ graphics.moveTo(w / 2, h - w / 2);
+ graphics.lineTo(w / 2, 1);
+ graphics.lineTo(0, 1);
+ break;
+ case flash.text.engine.TabAlignment.DECIMAL:
+ graphics.moveTo(w / 2, h - w / 2);
+ graphics.lineTo(w / 2, 0);
+ break;
+ }
+ }
+
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/PopupMenuSkin.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/PopupMenuSkin.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/PopupMenuSkin.as
new file mode 100644
index 0000000..78b3ccb
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/PopupMenuSkin.as
@@ -0,0 +1,70 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.styles
+{
+ import flash.filters.DropShadowFilter;
+
+ import mx.skins.RectangularBorder;
+
+ public class PopupMenuSkin extends RectangularBorder
+ {
+ public function PopupMenuSkin()
+ {
+ super();
+ filters = [new DropShadowFilter(2, 90, 0x000000, .45, 2, 2)];
+ }
+
+ override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+ {
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+ if (getStyle("cornerRadius") != undefined)
+ mCornerRadius = getStyle("cornerRadius");
+ if (getStyle("backColor") != undefined)
+ mBackColor = getStyle("backColor");
+ if (getStyle("backAlpha") != undefined)
+ mBackAlpha = getStyle("backAlpha");
+ if (getStyle("lineColor") != undefined)
+ mLineColor = getStyle("lineColor");
+ if (getStyle("lineAlpha") != undefined)
+ mLineAlpha = getStyle("lineAlpha");
+ if (getStyle("lineWidth") != undefined)
+ mLineWidth = getStyle("lineWidth");
+
+ graphics.clear();
+ graphics.lineStyle(mLineWidth, mLineColor, mLineAlpha);
+ graphics.beginFill(mBackColor, mBackAlpha);
+ graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
+ graphics.endFill();
+
+ }
+
+ private var mCornerRadius:Number = 0;
+ private var mLineWidth:Number = 1;
+ private var mBackColor:uint = 0x1a1a1a;
+ private var mBackAlpha:Number = 0.9;
+ private var mLineColor:uint = 0xffffff;
+ private var mLineAlpha:Number = 0.15;
+
+
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarDownArrowUpSkin.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarDownArrowUpSkin.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarDownArrowUpSkin.as
new file mode 100644
index 0000000..f2c4e5e
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarDownArrowUpSkin.as
@@ -0,0 +1,45 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.styles
+{
+ import mx.skins.RectangularBorder;
+
+ public class ScrollbarDownArrowUpSkin extends RectangularBorder
+ {
+ public function ScrollbarDownArrowUpSkin()
+ {
+ super();
+ }
+
+ override public function get measuredWidth():Number
+ {
+ return 13;
+ }
+
+ override public function get measuredHeight():Number
+ {
+ return 14;
+ }
+
+ override protected function updateDisplayList(w:Number, h:Number):void
+ {
+ super.updateDisplayList(w, h);
+ }
+ }
+}
\ No newline at end of file
[4/5] Added more spark examples
Posted by jm...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/MultiPanel.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/MultiPanel.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/MultiPanel.as
new file mode 100644
index 0000000..774031a
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/MultiPanel.as
@@ -0,0 +1,206 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui
+{
+ import flash.events.MouseEvent;
+
+ import mx.controls.Button;
+ import mx.core.EdgeMetrics;
+ import mx.core.LayoutContainer;
+ import mx.core.ScrollPolicy;
+ import mx.effects.Resize;
+ import mx.events.ResizeEvent;
+
+ [Style(name="openDuration", type="Number", format="Time", inherit="no")]
+ [Style(name="closeDuration", type="Number", format="Time", inherit="no")]
+ [Style(name="headerTextAlign", type="String", inherit="no")]
+
+ public class MultiPanel extends LayoutContainer {
+
+ [Embed (source="assets/header_close_icon.png")]
+ private static var ICON_CLOSE:Class;
+
+ [Embed (source="assets/header_open_icon.png")]
+ private static var ICON_OPEN:Class;
+
+ private static var SPACING_TOP:uint = 10;
+ private static var SPACING_BOTTOM:uint = 5;
+ private var _headerButton:Button = null;
+ private var _openedChanged:Boolean = false;
+ private var _opened:Boolean = true;
+ private var _viewMetrics:EdgeMetrics;
+ private var resize:Resize;
+
+ public function MultiPanel() {
+ super();
+
+ this.verticalScrollPolicy = ScrollPolicy.OFF;
+ this.horizontalScrollPolicy = ScrollPolicy.OFF;
+
+ addEventListener("PropertyEditorChanged", onPropertyEditorChange);
+ }
+
+ protected function createOrReplaceHeaderButton():void {
+ if(_headerButton) {
+ _headerButton.removeEventListener(MouseEvent.CLICK, headerButton_clickHandler);
+
+ if(rawChildren.contains(_headerButton))
+ rawChildren.removeChild(_headerButton);
+ }
+
+ _headerButton = new Button();
+ applyHeaderButtonStyles(_headerButton);
+ _headerButton.addEventListener(MouseEvent.CLICK, headerButton_clickHandler);
+ rawChildren.addChild(_headerButton);
+ }
+
+ protected function applyHeaderButtonStyles(button:Button):void {
+ button.setStyle("textAlign", getStyle("headerTextAlign"));
+ button.styleName = "multiPanelHeader";
+ button.height = getStyle("headerHeight");
+ button.label = label;
+
+ if(_opened)
+ button.setStyle('icon', ICON_OPEN);
+ else
+ button.setStyle('icon', ICON_CLOSE);
+ }
+
+ override public function set label(value:String):void {
+ super.label = value;
+ if(_headerButton) _headerButton.label = value;
+ }
+
+ public function get opened():Boolean {
+ return _opened;
+ }
+
+ [Bindable]
+ public function set opened(value:Boolean):void {
+ var old:Boolean = _opened;
+
+ _opened = value;
+ _openedChanged = _openedChanged || old != _opened;
+
+ if(_openedChanged && initialized) {
+ measure();
+ runResizeEffect();
+
+ invalidateProperties();
+ }
+ }
+
+ override public function styleChanged(styleProp:String):void {
+ super.styleChanged(styleProp);
+
+ if(styleProp == "headerTextAlign") {
+ applyHeaderButtonStyles(_headerButton);
+ }
+
+ invalidateDisplayList();
+ }
+
+ override protected function createChildren():void {
+ super.createChildren();
+
+ createOrReplaceHeaderButton();
+ }
+
+ override protected function commitProperties():void {
+ super.commitProperties();
+
+ if(_openedChanged) {
+ if(_opened)
+ _headerButton.setStyle('icon', ICON_OPEN);
+ else
+ _headerButton.setStyle('icon', ICON_CLOSE);
+
+ _openedChanged = false;
+ }
+ }
+
+ override protected function updateDisplayList(w:Number, h:Number):void {
+ super.updateDisplayList(w, h);
+
+ _headerButton.move(0,0);
+ _headerButton.setActualSize(w, _headerButton.getExplicitOrMeasuredHeight());
+ }
+
+ override public function get viewMetrics():EdgeMetrics {
+ if (!_viewMetrics)
+ _viewMetrics = new EdgeMetrics(0, 0, 0, 0);
+
+ var edgeMetrics:EdgeMetrics = _viewMetrics;
+ var parentEdgeMetrics:EdgeMetrics = super.viewMetrics;
+
+ edgeMetrics.left = parentEdgeMetrics.left;
+ edgeMetrics.top = parentEdgeMetrics.top + SPACING_TOP;
+ edgeMetrics.right = parentEdgeMetrics.right;
+ edgeMetrics.bottom = parentEdgeMetrics.bottom + SPACING_BOTTOM;
+
+ var headerHeight:Number = _headerButton.getExplicitOrMeasuredHeight();
+ if (!isNaN(headerHeight)) {
+ edgeMetrics.top += headerHeight;
+ }
+
+ return edgeMetrics;
+ }
+
+ override protected function measure():void {
+ super.measure();
+
+ if(!_opened) {
+ //only the height of the header button
+ measuredHeight = _headerButton.getExplicitOrMeasuredHeight();
+ }
+ }
+
+ protected function runResizeEffect():void {
+ if(resize && resize.isPlaying)
+ resize.end();
+
+ var duration:Number = _opened ? getStyle("openDuration") : getStyle("closeDuration");
+ if(duration == 0) {
+ this.setActualSize(getExplicitOrMeasuredWidth(), measuredHeight);
+
+ invalidateSize();
+ invalidateDisplayList();
+ }
+ else {
+ resize = new Resize(this);
+ resize.heightTo = Math.min(maxHeight, measuredHeight);
+ resize.duration = duration;
+ resize.play();
+ }
+ }
+
+ protected function headerButton_clickHandler(event:MouseEvent):void {
+ opened = !_opened;
+ }
+
+ private function onPropertyEditorChange(event:Event):void {
+ // Make sure that the panel exists and is open before doing anything
+ if(initialized && _opened) {
+ measure();
+ runResizeEffect();
+ invalidateProperties();
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/MultiPanelHeaderSkin.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/MultiPanelHeaderSkin.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/MultiPanelHeaderSkin.as
new file mode 100644
index 0000000..f5043a3
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/MultiPanelHeaderSkin.as
@@ -0,0 +1,58 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui
+{
+ import mx.skins.RectangularBorder;
+ import mx.utils.GraphicsUtil;
+ import flash.display.LineScaleMode;
+ import flash.display.CapsStyle;
+
+ public class MultiPanelHeaderSkin extends RectangularBorder
+ {
+ public function MultiPanelHeaderSkin()
+ {
+ super();
+ }
+
+ override protected function updateDisplayList(w:Number, h:Number):void
+ {
+ super.updateDisplayList(w, h);
+
+ var fillColors:Array = [0x000000, 0x000000];
+ var fillAlphas:Array = [1.0, 1.0];
+ var borderColor:uint = 0x2A2A2A;
+ var borderAlpha:Number = 1.0;
+
+ if (getStyle("fillColors") != undefined)
+ fillColors = getStyle("fillColors");
+ if (getStyle("fillAlphas") != undefined)
+ fillAlphas = getStyle("fillAlphas");
+ if (getStyle("borderColor") != undefined)
+ borderColor = getStyle("borderColor");
+ if (getStyle("borderAlpha") != undefined)
+ borderAlpha = getStyle("borderAlpha");
+
+ graphics.clear();
+ drawRoundRect(0,0,w, h, null, fillColors, fillAlphas, verticalGradientMatrix(0,0,w,h));
+ graphics.lineStyle(1, borderColor, borderAlpha, true, LineScaleMode.NONE, CapsStyle.SQUARE);
+ graphics.drawRect(0, 0, w-1, h);
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/PanelWithEdgeBars.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/PanelWithEdgeBars.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/PanelWithEdgeBars.as
new file mode 100644
index 0000000..1d55c59
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/PanelWithEdgeBars.as
@@ -0,0 +1,266 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui
+{
+ import flash.geom.Rectangle;
+
+ import mx.binding.utils.*;
+ import mx.containers.Canvas;
+ import mx.core.UIComponent;
+ import mx.events.ResizeEvent;
+
+ public class PanelWithEdgeBars extends Canvas
+ {
+ public function PanelWithEdgeBars()
+ {
+ super();
+ addEventListener(ResizeEvent.RESIZE, onResize);
+ }
+
+ public function set mainPanel(inPanel:UIComponent):void
+ {
+ if (mMainPanel == null)
+ {
+ mMainPanel = inPanel;
+ ArrangeContents();
+ }
+ else if (mMainPanel != inPanel)
+ throw new Error("Can't set main panel more than once.");
+ }
+
+ public function get mainPanel():UIComponent
+ {
+ return mMainPanel;
+ }
+
+ public function set topBar(inBar:UIComponent):void
+ {
+ if (mTopBar == null && inBar != null)
+ {
+ mTopBar = inBar;
+ ArrangeContents();
+ var watcherSetter:ChangeWatcher = BindingUtils.bindSetter(includeInLayoutChanged, mTopBar, "includeInLayout");
+ }
+ else if (mTopBar != inBar)
+ throw new Error("Can't set any edge bar more than once.");
+ }
+
+ public function get topBar():UIComponent
+ {
+ return mTopBar;
+ }
+
+ public function set rightBar(inBar:UIComponent):void
+ {
+ if (mRightBar == null && inBar != null)
+ {
+ mRightBar = inBar;
+ ArrangeContents();
+ var watcherSetter:ChangeWatcher = BindingUtils.bindSetter(includeInLayoutChanged, mRightBar, "includeInLayout");
+ }
+ else if (mRightBar != inBar)
+ throw new Error("Can't set any edge bar more than once.");
+ }
+
+ public function get rightBar():UIComponent
+ {
+ return mRightBar;
+ }
+
+ public function set bottomBar(inBar:UIComponent):void
+ {
+ if (mBottomBar == null && inBar != null)
+ {
+ mBottomBar = inBar;
+ ArrangeContents();
+ var watcherSetter:ChangeWatcher = BindingUtils.bindSetter(includeInLayoutChanged, mBottomBar, "includeInLayout");
+ }
+ else if (mBottomBar != inBar)
+ throw new Error("Can't set any edge bar more than once.");
+ }
+
+ public function get bottomBar():UIComponent
+ {
+ return mBottomBar;
+ }
+
+ public function set leftBar(inBar:UIComponent):void
+ {
+ if (mLeftBar == null && inBar != null)
+ {
+ mLeftBar = inBar;
+ ArrangeContents();
+ var watcherSetter:ChangeWatcher = BindingUtils.bindSetter(includeInLayoutChanged, mLeftBar, "includeInLayout");
+ }
+ else if (mLeftBar != inBar)
+ throw new Error("Can't set any edge bar more than once.");
+ }
+
+ public function get leftBar():UIComponent
+ {
+ return mLeftBar;
+ }
+
+ public function set edgeInset(inInset:Number):void
+ {
+ mEdgeInset = inInset;
+ ArrangeContents();
+ }
+
+ public function get edgeInset():Number
+ {
+ return mEdgeInset;
+ }
+
+ public function set gap(inGap:Number):void
+ {
+ mGap = inGap;
+ ArrangeContents();
+ }
+
+ public function get gap():Number
+ {
+ return mGap;
+ }
+
+ public function set leftInset(inInset:Number):void
+ {
+ mLeftInset = inInset;
+ ArrangeContents();
+ }
+
+ public function get leftInset():Number
+ {
+ return mLeftInset;
+ }
+
+ public function set topInset(inInset:Number):void
+ {
+ mTopInset = inInset;
+ ArrangeContents();
+ }
+
+ public function get topInset():Number
+ {
+ return mTopInset;
+ }
+
+ public function set rightInset(inInset:Number):void
+ {
+ mRightInset = inInset;
+ ArrangeContents();
+ }
+
+ public function get rightInset():Number
+ {
+ return mRightInset;
+ }
+
+ public function set bottomInset(inInset:Number):void
+ {
+ mBottomInset = inInset;
+ ArrangeContents();
+ }
+
+ public function get bottomInset():Number
+ {
+ return mBottomInset;
+ }
+
+ private function onResize(evt:ResizeEvent):void
+ {
+ ArrangeContents();
+ }
+
+ private function includeInLayoutChanged(val:Boolean):void {
+ ArrangeContents();
+ }
+
+ private function ArrangeContents():void
+ {
+ var space:Rectangle = new Rectangle(0, 0, width, height);
+ for (var i:int = numChildren - 1; i >= 0; --i)
+ {
+ var child:UIComponent = getChildAt(i) as UIComponent;
+ if (child && child.includeInLayout)
+ {
+ var inset:Number;
+ if (child == mTopBar)
+ {
+ inset = mTopInset ? mTopInset : mEdgeInset;
+ child.x = space.x;
+ child.width = space.width;
+ child.y = space.y;
+ child.height = inset;
+ space.y += inset + mGap;
+ space.height -= inset + mGap;
+ }
+ else if (child == mRightBar)
+ {
+ inset = mRightInset ? mRightInset : mEdgeInset;
+ child.x = space.right - inset;
+ child.width = inset;
+ child.y = space.y;
+ child.height = space.height;
+ space.width -= inset + mGap;
+ }
+ else if (child == mBottomBar)
+ {
+ inset = mBottomInset ? mBottomInset : mEdgeInset;
+ child.x = space.x;
+ child.width = space.width;
+ child.y = space.bottom - inset;
+ child.height = inset;
+ space.height -= inset + mGap;
+ }
+ if (child == mLeftBar)
+ {
+ inset = mLeftInset ? mLeftInset : mEdgeInset;
+ child.x = space.x;
+ child.width = inset;
+ child.y = space.y;
+ child.height = space.height;
+ space.x += inset + mGap;
+ space.width -= inset + mGap;
+ }
+ }
+ }
+ if (mMainPanel)
+ {
+ mMainPanel.x = space.x;
+ mMainPanel.y = space.y;
+ mMainPanel.width = space.width;
+ mMainPanel.height = space.height;
+ }
+ }
+
+ private var mTopBar:UIComponent = null;
+ private var mRightBar:UIComponent = null;
+ private var mBottomBar:UIComponent = null;
+ private var mLeftBar:UIComponent = null;
+ private var mMainPanel:UIComponent = null;
+ private var mEdgeInset:Number = 16;
+ private var mLeftInset:Number = 0;
+ private var mRightInset:Number = 0;
+ private var mTopInset:Number = 0;
+ private var mBottomInset:Number = 0;
+ private var mGap:Number = 1;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/VellumGUIStyles.css
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/VellumGUIStyles.css b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/VellumGUIStyles.css
new file mode 100644
index 0000000..8756a92
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/VellumGUIStyles.css
@@ -0,0 +1,254 @@
+/*
+ * 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.
+ */
+@namespace s "library://ns.adobe.com/flex/spark";
+@namespace "library://ns.adobe.com/flex/mx";
+@namespace bxf "bxf.ui.controls.*";
+@namespace tlfui "flashx.textLayout.ui.rulers.*";
+
+bxf|BxPopupMenu
+{
+ borderSkin: ClassReference("flashx.textLayout.ui.styles.PopupMenuSkin");
+ borderStyle: "solid";
+ backColor: "0xd9d9d9";
+ backAlpha: "1.0";
+ lineColor: "0x000000";
+ lineAlpha: "0.9";
+ lineWidth: "1";
+ rollOverColor: "0x0000b0";
+ rollOverAlpha: "1.0";
+ selectionColor: "0x0000b0";
+ selectionAlpha: "0.8";
+ separatorAlpha: "0.1";
+ separatorColor: "0xffffff";
+ separatorThickness: "1";
+ color: "0x2e2e2e";
+ textSelectedColor: "0xffffff";
+ textRollOverColor: "0xffffff";
+ leftIconGap: "5";
+ rightIconGap: "5";
+ openDuration: "10";
+ closeDuration: "10";
+}
+
+CheckBox
+{
+ textRollOverColor: #000000;
+}
+
+
+TabNavigator {
+ tabHeight: 18;
+ backgroundColor: #d6d6d6;
+ tabStyleName: "myTabs";
+ firstTabStyleName: "myTabs";
+ lastTabStyleName: "myTabs";
+ selectedTabTextStyleName: "mySelectedTabs";
+}
+
+
+tlfui|TabMarker
+{
+ borderSkin: ClassReference("flashx.textLayout.ui.rulers.TabMarkerSkin");
+ borderStyle: "solid";
+}
+
+tlfui|ParagraphPropertyMarker
+{
+ borderSkin: ClassReference("flashx.textLayout.ui.rulers.ParagraphPropertyMarkerSkin");
+ borderStyle: "solid";
+}
+
+.stringPropertyEditor {
+ color: #262626;
+ fontFamily: "Myriad Pro";
+ fontSize: 12;
+}
+
+.myTabs {
+ cornerRadius: 0;
+ fillColors: #b0b0b0, #989898;
+ backgroundColor: #d9d9d9;
+ borderColor: #666666;
+ color: #181818;
+ textRollOverColor: #000000;
+ themeColor: #484848;
+ fontFamily: "Myriad Pro";
+ fontSize: 10;
+ fontWeight: "bold";
+}
+
+.mySelectedTabs {
+ color: #202020;
+ textRollOverColor: #202020;
+ fontFamily: "Myriad Pro";
+ fontSize: 10;
+ fontWeight: "bold";
+}
+
+.comboPropEditorValue
+{
+ fontFamily: "Myriad Pro";
+ fontWeight: "bold";
+}
+
+.unitComboValue
+{
+ fontFamily: "Myriad Pro";
+ fontWeight: "bold";
+}
+
+
+.toggleIconButton {
+ cornerRadius: 2;
+}
+
+.toggleButtonRow {
+ horizontalGap: 2;
+}
+
+.iconButtonGroup {
+ cornerRadius: 2;
+ horizontalGap: 20;
+}
+
+.multiPanel {
+ headerHeight: 17;
+ border-style: solid;
+ border-color: #D6D6D6;
+ headerTextAlign: "left";
+ openDuration: 200;
+ closeDuration: 200;
+ paddingTop: 0;
+
+ fontFamily: "Myriad Pro";
+ font-size: 12px;
+ letter-spacing: 0px;
+ color: #2A2A2A;
+}
+
+.multiPanelHeader {
+ upSkin: ClassReference("flashx.textLayout.ui.MultiPanelHeaderSkin");
+ downSkin: ClassReference("flashx.textLayout.ui.MultiPanelHeaderSkin");
+ overSkin: ClassReference("flashx.textLayout.ui.MultiPanelHeaderSkin");
+ disabledSkin: ClassReference("flashx.textLayout.ui.MultiPanelHeaderSkin");
+ fillAlphas: 1,1;
+ fillColors: #c8c8c8, #b8b8b8;
+ borderAlpha: 1;
+ borderColor: #D6D6D6;
+ cornerRadius: 0;
+
+ padding-left: 3;
+ padding-top: 5px;
+
+ fontFamily: "Myriad Pro";
+ font-size: 11px;
+ letter-spacing: 0px;
+ color: #262626;
+}
+
+.hotTextStyle {
+ fontFamily: "Myriad Pro";
+ fontWeight: "bold";
+ color: #0071BC;
+ backColor: #D9D9D9;
+ text-decoration: none;
+ border-bottom: solid 1px;
+}
+
+.fontComboStyle {
+ fontFamily: "Helvetica";
+ fontWeight: "normal";
+ fontSize: 12;
+ openDuration: 10;
+ closeDuration: 10;
+
+ padding-top: -10;
+
+ upSkin: Embed(source="assets/combo_drop_down_arrow.png");
+ disabledSkin: Embed(source="assets/combo_drop_down_arrow.png");
+ overSkin: Embed(source="assets/combo_drop_down_arrow.png");
+ disabledSkin: Embed(source="assets/combo_drop_down_arrow.png");
+ editableUpSkin: Embed(source="assets/combo_drop_down_arrow.png");
+ editableDisabledSkin: Embed(source="assets/combo_drop_down_arrow.png");
+ editableOverSkin: Embed(source="assets/combo_drop_down_arrow.png");
+ editableDisabledSkin: Embed(source="assets/combo_drop_down_arrow.png");
+ arrowButtonWidth: 18;
+
+ cornerRadius: 2;
+ borderColor: #737373;
+
+ textInputStyleName: "fontComboTextInputStyle";
+}
+
+.fontDropDownStyle {
+ fontFamily: "Helvetica";
+ fontWeight: "normal";
+ fontSize: 12;
+ borderColor: #66ffff;
+ backgroundColor: #D6D6D6;
+ verticalScrollBarStyleName: scrollbarStyle;
+}
+
+.fontComboTextInputStyle {
+ borderStyle: solid;
+ borderColor: #737373;
+}
+
+.scrollbarStyle {
+ thumbUpSkin: ClassReference("flashx.textLayout.ui.styles.ScrollbarThumbUpSkin");
+ thumbOverSkin: ClassReference("flashx.textLayout.ui.styles.ScrollbarThumbOverSkin");
+ thumbDownSkin: ClassReference("flashx.textLayout.ui.styles.ScrollbarThumbUpSkin");
+ trackSkin: ClassReference("flashx.textLayout.ui.styles.ScrollbarTrackSkin");
+ upArrowUpSkin: Embed(source="assets/scroll_arrow_up.png");
+ upArrowDownSkin: Embed(source="assets/scroll_arrow_up.png");
+ upArrowOverSkin: Embed(source="assets/scroll_arrow_up_over.png");
+ upArrowDisabledSkin: Embed(source="assets/scroll_arrow_up.png");
+ downArrowUpSkin: Embed(source="assets/scroll_arrow_down.png");
+ downArrowOverSkin: Embed(source="assets/scroll_arrow_down_over.png");
+ downArrowDownSkin: Embed(source="assets/scroll_arrow_down.png");
+ downArrowDisabledSkin: Embed(source="assets/scroll_arrow_down.png");
+
+
+ trackFill: #CECECE;
+ trackFillAlpha: 1.0;
+ trackStroke: #7B7B7B;
+ trackStrokeAlpha: 1.0;
+
+ thumbFill: #DFDFDF;
+ thumbFillAlpha: 1.0;
+ thumbStroke: #F4F4F4;
+ thumbStrokeAlpha: 1.0;
+
+ thumbOverFill: #E5E5E5;
+ thumbOverFillAlpha: 1.0;
+ thumbOverStroke: #F4F4F4;
+ thumbOverStrokeAlpha: 1.0;
+}
+
+@font-face
+{
+ src: url("assets/Fonts.swf");
+ fontFamily: "Myriad Pro";
+}
+
+@font-face
+{
+ src: url("assets/Fonts.swf");
+ fontFamily: "Myriad Pro";
+ fontWeight: "bold";
+}
+
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_down_over.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_down_over.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_down_over.png
new file mode 100644
index 0000000..a209b46
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_down_over.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_up_over.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_up_over.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_up_over.png
new file mode 100644
index 0000000..5e37d0f
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_up_over.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/combo_drop_down_arrow.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/combo_drop_down_arrow.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/combo_drop_down_arrow.png
new file mode 100644
index 0000000..1b905e8
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/combo_drop_down_arrow.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/header_close_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/header_close_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/header_close_icon.png
new file mode 100644
index 0000000..e55928c
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/header_close_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/header_open_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/header_open_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/header_open_icon.png
new file mode 100644
index 0000000..d3a1b42
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/header_open_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down.png
new file mode 100644
index 0000000..f5d8145
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down_over.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down_over.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down_over.png
new file mode 100644
index 0000000..ef66ac6
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down_over.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up.png
new file mode 100644
index 0000000..1d3828d
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up_over.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up_over.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up_over.png
new file mode 100644
index 0000000..2147d32
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up_over.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/AdvancedTextPropertyEditor.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/AdvancedTextPropertyEditor.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/AdvancedTextPropertyEditor.as
new file mode 100644
index 0000000..145c721
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/AdvancedTextPropertyEditor.as
@@ -0,0 +1,190 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.inspectors
+{
+ import flash.text.engine.*;
+
+ import flashx.textLayout.formats.FormatValue;
+ import flashx.textLayout.formats.TextLayoutFormat;
+ import flashx.textLayout.tlf_internal;
+ use namespace tlf_internal;
+
+ public class AdvancedTextPropertyEditor extends DynamicTextPropertyEditor
+ {
+ public function AdvancedTextPropertyEditor()
+ {
+ var recipe:XML =
+ <recipe>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/DigitCase=Digit Case:">
+ <property name={TextInspectorController.DIGIT_CASE_UIPROP}/>
+ <choice display="Default" value={flash.text.engine.DigitCase.DEFAULT}/>
+ <choice display="Lining" value={flash.text.engine.DigitCase.LINING}/>
+ <choice display="Old Style" value={flash.text.engine.DigitCase.OLD_STYLE}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/DigitWidth=Digit Width:">
+ <property name={TextInspectorController.DIGIT_WIDTH_UIPROP}/>
+ <choice display="Default" value={flash.text.engine.DigitWidth.DEFAULT}/>
+ <choice display="Proportional" value={flash.text.engine.DigitWidth.PROPORTIONAL}/>
+ <choice display="Tabular" value={flash.text.engine.DigitWidth.TABULAR}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/DominantBaseline=Dominant Baseline:">
+ <property name={TextInspectorController.DOMINANT_BASELINE_UIPROP}/>
+ <choice display="Auto" value={FormatValue.AUTO}/>
+ <choice display="Roman" value={flash.text.engine.TextBaseline.ROMAN}/>
+ <choice display="Ascent" value={flash.text.engine.TextBaseline.ASCENT}/>
+ <choice display="Descent" value={flash.text.engine.TextBaseline.DESCENT}/>
+ <choice display="Ideographic Top" value={flash.text.engine.TextBaseline.IDEOGRAPHIC_TOP}/>
+ <choice display="Ideographic Center" value={flash.text.engine.TextBaseline.IDEOGRAPHIC_CENTER}/>
+ <choice display="Ideographic Bottom" value={flash.text.engine.TextBaseline.IDEOGRAPHIC_BOTTOM}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/AlignmentBaseline=Alignment Baseline:">
+ <property name={TextInspectorController.ALIGNMENT_BASELINE_UIPROP}/>
+ <choice display="Roman" value={flash.text.engine.TextBaseline.ROMAN}/>
+ <choice display="Ascent" value={flash.text.engine.TextBaseline.ASCENT}/>
+ <choice display="Descent" value={flash.text.engine.TextBaseline.DESCENT}/>
+ <choice display="Ideographic Top" value={flash.text.engine.TextBaseline.IDEOGRAPHIC_TOP}/>
+ <choice display="Ideographic Center" value={flash.text.engine.TextBaseline.IDEOGRAPHIC_CENTER}/>
+ <choice display="Ideographic Bottom" value={flash.text.engine.TextBaseline.IDEOGRAPHIC_BOTTOM}/>
+ <choice display="Use Dominant" value={flash.text.engine.TextBaseline.USE_DOMINANT_BASELINE}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="hotnumberunit" label="$$$/stage/TextEditing/Label/BaselineShift=Baseline Shift:">
+ <property name={TextInspectorController.BASELINE_SHIFT_UIPROP}/>
+ <defaultunit>pix</defaultunit>
+ <numericunit displayname="%"
+ min={TextLayoutFormat.baselineShiftProperty.minPercentValue}
+ max={TextLayoutFormat.baselineShiftProperty.maxPercentValue}
+ default="0"
+ decimals="1"/>
+ <numericunit displayname="pix"
+ min={TextLayoutFormat.baselineShiftProperty.minNumberValue}
+ max={TextLayoutFormat.baselineShiftProperty.maxNumberValue}
+ default="0"
+ decimals="1"/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/Ligatures=Ligatures:">
+ <property name={TextInspectorController.LIGATURE_LEVEL_UIPROP}/>
+ <choice display="Minimum" value={flash.text.engine.LigatureLevel.MINIMUM}/>
+ <choice display="Common" value={flash.text.engine.LigatureLevel.COMMON}/>
+ <choice display="Uncommon" value={flash.text.engine.LigatureLevel.UNCOMMON}/>
+ <choice display="Exotic" value={flash.text.engine.LigatureLevel.EXOTIC}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/Rotation=Rotation:">
+ <property name={TextInspectorController.TEXT_ROTATION_UIPROP}/>
+ <choice display="0 degrees" value={flash.text.engine.TextRotation.ROTATE_0}/>
+ <choice display="90 degrees" value={flash.text.engine.TextRotation.ROTATE_90}/>
+ <choice display="180 degrees" value={flash.text.engine.TextRotation.ROTATE_180}/>
+ <choice display="270 degrees" value={flash.text.engine.TextRotation.ROTATE_270}/>
+ <choice display="auto" value={flash.text.engine.TextRotation.AUTO}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="hotnumber" label="$$$/stage/TextEditing/Label/Alpha=Alpha:" suffix="%">
+ <property name={TextInspectorController.TEXT_ALPHA_UIPROP}
+ minValue="0"
+ maxValue="100"
+ convertToPercent="yes"/>
+ </editor>
+ </row>
+ <row>
+ <editor type="hotnumber" label="$$$/stage/TextEditing/Label/BackgroundAlpha=Background alpha:" suffix="%">
+ <property name={TextInspectorController.BACKGROUND_ALPHA_UIPROP}
+ minValue="0"
+ maxValue="100"
+ convertToPercent="yes"/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/Break=Break:">
+ <property name={TextInspectorController.BREAK_OPPORTUNITY_UIPROP}/>
+ <choice display="All" value={flash.text.engine.BreakOpportunity.ALL}/>
+ <choice display="Any" value={flash.text.engine.BreakOpportunity.ANY}/>
+ <choice display="Auto" value={flash.text.engine.BreakOpportunity.AUTO}/>
+ <choice display="No Break" value={flash.text.engine.BreakOpportunity.NONE}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/Lacale=Locale:">
+ <property name={TextInspectorController.LOCALE_UIPROP}/>
+ <choice display="Arabic" value="ar"/>,
+ <choice display="Bengali" value="bn"/>,
+ <choice display="Bulgarian" value="bg"/>,
+ <choice display="Catalan" value="ca"/>,
+ <choice display="Chinese, Simplified (China)" value="zh-CN"/>,
+ <choice display="Chinese, Traditional (Taiwan)" value="zh-TW"/>,
+ <choice display="Croatian" value="hr"/>,
+ <choice display="Czech" value="cs"/>,
+ <choice display="Danish" value="da"/>,
+ <choice display="Dutch" value="nl"/>,
+ <choice display="English" value="en"/>,
+ <choice display="Estonian" value="et"/>,
+ <choice display="Finnish" value="fi"/>,
+ <choice display="French" value="fr"/>,
+ <choice display="German" value="de"/>,
+ <choice display="Greek" value="el"/>,
+ <choice display="Gujarati" value="gu"/>,
+ <choice display="Hindi" value="hi"/>,
+ <choice display="Hebrew" value="he"/>,
+ <choice display="Hungarian" value="hu"/>,
+ <choice display="Italian" value="it"/>,
+ <choice display="Japanese" value="ja"/>,
+ <choice display="Korean" value="ko"/>,
+ <choice display="Latvian" value="lv"/>,
+ <choice display="Lithuanian" value="lt"/>,
+ <choice display="Marathi" value="mr"/>,
+ <choice display="Norwegian" value="no"/>,
+ <choice display="Persian" value="fa"/>,
+ <choice display="Polish" value="pl"/>,
+ <choice display="Portuguese" value="pt"/>,
+ <choice display="Punjabi" value="pa"/>,
+ <choice display="Romanian" value="ro"/>,
+ <choice display="Russian" value="ru"/>,
+ <choice display="Slovak" value="sk"/>,
+ <choice display="Slovenian" value="sl"/>,
+ <choice display="Spanish" value="es"/>,
+ <choice display="Swedish" value="sv"/>,
+ <choice display="Tamil" value="ta"/>,
+ <choice display="Telugu" value="te"/>,
+ <choice display="Thai" value="th"/>,
+ <choice display="Turkish" value="tr"/>,
+ <choice display="Ukrainian" value="uk"/>,
+ <choice display="Urdu" value="ur"/>,
+ <choice display="Vietnamese" value="vi"/>
+ </editor>
+ </row>
+ </recipe>;
+
+ super(recipe);
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/AntiAliasPropertyEditor.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/AntiAliasPropertyEditor.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/AntiAliasPropertyEditor.as
new file mode 100644
index 0000000..af0fc66
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/AntiAliasPropertyEditor.as
@@ -0,0 +1,51 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.inspectors
+{
+ import flash.text.AntiAliasType;
+ import flash.text.engine.CFFHinting;
+ import flash.text.engine.RenderingMode;
+
+ public class AntiAliasPropertyEditor extends DynamicTextPropertyEditor
+ {
+ public function AntiAliasPropertyEditor()
+ {
+ var recipe:XML =
+ <recipe>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/Antialias=Antialias:">
+ <property name={TextInspectorController.RENDERING_MODE_UIPROP}/>
+ <choice display="Normal" value={flash.text.engine.RenderingMode.NORMAL}/>
+ <choice display="CFF" value={flash.text.engine.RenderingMode.CFF}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/GridFit=Grid Fit:">
+ <property name={TextInspectorController.CFF_HINTING_UIPROP}/>
+ <choice display="None" value={flash.text.engine.CFFHinting.NONE}/>
+ <choice display="Horizontal stem" value={flash.text.engine.CFFHinting.HORIZONTAL_STEM}/>
+ </editor>
+ </row>
+ </recipe>;
+ super(recipe);
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/CharacterPropertyEditor.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/CharacterPropertyEditor.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/CharacterPropertyEditor.as
new file mode 100644
index 0000000..6581152
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/CharacterPropertyEditor.as
@@ -0,0 +1,179 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.inspectors
+{
+ import flash.text.engine.*;
+
+ import flashx.textLayout.formats.TextLayoutFormat;
+ import flashx.textLayout.tlf_internal;
+ use namespace tlf_internal;
+
+ public class CharacterPropertyEditor extends DynamicTextPropertyEditor
+ {
+ [Embed(source="./assets/bold_icon.png")]
+ private var boldIcon:Class;
+
+ [Embed(source="./assets/italic_icon.png")]
+ private var italicIcon:Class;
+
+ [Embed(source="./assets/underline_icon.png")]
+ private var underlineIcon:Class;
+
+ [Embed(source="./assets/strikethrough_icon.png")]
+ private var strikethroughIcon:Class;
+
+ [Embed(source="./assets/superscript_icon.png")]
+ private var superscriptIcon:Class;
+
+ [Embed(source="./assets/subscript_icon.png")]
+ private var subscriptIcon:Class;
+
+ [Embed(source="./assets/tcy_icon.png")]
+ private var tcyIcon:Class;
+
+ public function CharacterPropertyEditor()
+ {
+ var recipe:XML =
+ <recipe>
+ <row>
+ <editor type="fontPicker" label="$$$/stage/TextEditing/Label/Font=Font:">
+ <property name={TextInspectorController.FONT_FAMILY_UIPROP}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/FontLookup=Lookup:">
+ <property name={TextInspectorController.FONT_LOOKUP_UIPROP}/>
+ <choice display="Device" value={flash.text.engine.FontLookup.DEVICE}/>
+ <choice display="Embedded CFF" value={flash.text.engine.FontLookup.EMBEDDED_CFF}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="hotnumber" label="$$$/stage/TextEditing/Label/Size=Size:" decimals="1" enforcePrecision="no">
+ <property name={TextInspectorController.FONT_SIZE_UIPROP}
+ minValue={TextLayoutFormat.fontSizeProperty.minValue}
+ maxValue={TextLayoutFormat.fontSizeProperty.maxValue}/>
+ </editor>
+ <editor type="hotnumberunit" label="$$$/stage/TextEditing/Label/Leading=Leading:">
+ <property name={TextInspectorController.LINE_HEIGHT_UIPROP}/>
+ <defaultunit>pix</defaultunit>
+ <numericunit displayname="%"
+ min={TextLayoutFormat.lineHeightProperty.minPercentValue}
+ max={TextLayoutFormat.lineHeightProperty.maxPercentValue}
+ default="120"/>
+ <numericunit displayname="pix"
+ min={TextLayoutFormat.lineHeightProperty.minNumberValue}
+ max={TextLayoutFormat.lineHeightProperty.maxNumberValue}
+ default="14"
+ decimals="1"/>
+ </editor>
+ </row>
+ <row style="toggleButtonRow">
+ <editor type="toggleButton" style="toggleIconButton" iconClass="boldIcon" width="17" commit="yes">
+ <property name={TextInspectorController.FONT_WEIGHT_UIPROP} falseValue="normal" trueValue="bold"/>
+ </editor>
+ <editor type="toggleButton" style="toggleIconButton" iconClass="italicIcon" width="17" commit="yes">
+ <property name={TextInspectorController.FONT_STYLE_UIPROP} falseValue="normal" trueValue="italic"/>
+ </editor>
+ <editor type="toggleButton" style="toggleIconButton" iconClass="underlineIcon" width="17" commit="yes">
+ <property name={TextInspectorController.TEXT_DECORATION_UIPROP} falseValue="none" trueValue="underline"/>
+ </editor>
+ <editor type="toggleButton" style="toggleIconButton" iconClass="strikethroughIcon" width="17" commit="yes">
+ <property name={TextInspectorController.LINE_THROUGH_UIPROP}/>
+ </editor>
+ <editor type="toggleButton" style="toggleIconButton" iconClass="superscriptIcon" width="17" commit="yes">
+ <property name={TextInspectorController.BASELINE_SHIFT_SUPER_UIPROP} falseValue="0" trueValue={flashx.textLayout.formats.BaselineShift.SUPERSCRIPT}/>
+ </editor>
+ <editor type="toggleButton" style="toggleIconButton" iconClass="subscriptIcon" width="17" commit="yes">
+ <property name={TextInspectorController.BASELINE_SHIFT_SUB_UIPROP} falseValue="0" trueValue={flashx.textLayout.formats.BaselineShift.SUBSCRIPT}/>
+ </editor>
+ <editor type="toggleButton" style="toggleIconButton" iconClass="tcyIcon" width="17" commit="yes">
+ <property name={TextInspectorController.TCY_UIPROP}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/Kerning=Kerning:">
+ <property name={TextInspectorController.KERNING_UIPROP}/>
+ <choice display="On" value={flash.text.engine.Kerning.ON}/>
+ <choice display="Off" value={flash.text.engine.Kerning.OFF}/>
+ <choice display="Auto" value={flash.text.engine.Kerning.AUTO}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="hotnumberunit" label="$$$/stage/TextEditing/Label/Tracking=Track R:">
+ <property name={TextInspectorController.TRACKING_RIGHT_UIPROP}/>
+ <defaultunit>pix</defaultunit>
+ <numericunit displayname="%"
+ min={TextLayoutFormat.trackingRightProperty.minPercentValue}
+ max={TextLayoutFormat.trackingRightProperty.maxPercentValue}
+ default="0"/>
+ <numericunit displayname="pix"
+ min={TextLayoutFormat.trackingRightProperty.minNumberValue}
+ max={TextLayoutFormat.trackingRightProperty.maxNumberValue}
+ default="0"
+ decimals="1"/>
+ </editor>
+ </row>
+ <row>
+ <editor type="hotnumberunit" label="$$$/stage/TextEditing/Label/Tracking=Track L:">
+ <property name={TextInspectorController.TRACKING_LEFT_UIPROP}/>
+ <defaultunit>pix</defaultunit>
+ <numericunit displayname="%"
+ min={TextLayoutFormat.trackingLeftProperty.minPercentValue}
+ max={TextLayoutFormat.trackingLeftProperty.maxPercentValue}
+ default="0"/>
+ <numericunit displayname="pix"
+ min={TextLayoutFormat.trackingLeftProperty.minNumberValue}
+ max={TextLayoutFormat.trackingLeftProperty.maxNumberValue}
+ default="0"
+ decimals="1"/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/Case=Case:">
+ <property name={TextInspectorController.TYPOGRAPHIC_CASE_UIPROP}/>
+ <choice display="Default" value={flashx.textLayout.formats.TLFTypographicCase.DEFAULT}/>
+ <choice display="Caps to Small Caps" value={flashx.textLayout.formats.TLFTypographicCase.CAPS_TO_SMALL_CAPS}/>
+ <choice display="Upper" value={flashx.textLayout.formats.TLFTypographicCase.UPPERCASE}/>
+ <choice display="Lower" value={flashx.textLayout.formats.TLFTypographicCase.LOWERCASE}/>
+ <choice display="Lowercase to Small Caps" value={flashx.textLayout.formats.TLFTypographicCase.LOWERCASE_TO_SMALL_CAPS}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="color" label="$$$/stage/TextEditing/Label/Color=Color:">
+ <property name={TextInspectorController.COLOR_UIPROP}/>
+ </editor>
+ <editor type="color" label="$$$/stage/TextEditing/Label/BackgroundColor=Background color:">
+ <property name={TextInspectorController.BGCOLOR_UIPROP}/>
+ </editor>
+ </row>
+ </recipe>;
+
+ super(recipe);
+ SetIcon("boldIcon", boldIcon);
+ SetIcon("italicIcon", italicIcon);
+ SetIcon("underlineIcon", underlineIcon);
+ SetIcon("strikethroughIcon", strikethroughIcon);
+ SetIcon("superscriptIcon", superscriptIcon);
+ SetIcon("subscriptIcon", subscriptIcon);
+ SetIcon("tcyIcon", tcyIcon);
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/DynamicTextPropertyEditor.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/DynamicTextPropertyEditor.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/DynamicTextPropertyEditor.as
new file mode 100644
index 0000000..e3a931a
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/DynamicTextPropertyEditor.as
@@ -0,0 +1,74 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.inspectors
+{
+ import bxf.ui.inspectors.DynamicPropertyEditorBase;
+
+ import mx.events.PropertyChangeEvent;
+
+ public class DynamicTextPropertyEditor extends DynamicPropertyEditorBase
+ {
+ public function DynamicTextPropertyEditor(inRecipe:XML)
+ {
+ super(inRecipe);
+ TextInspectorController.Instance().addEventListener(SelectionUpdateEvent.SELECTION_UPDATE, onSelectionUpdate);
+ addEventListener(DynamicPropertyEditorBase.MODELCHANGED_EVENT, onFormatValueChanged, false, 0, true);
+ addEventListener(DynamicPropertyEditorBase.MODELEDITED_EVENT, onFormatValueChanged, false, 0, true);
+ }
+
+ public function set active(inActive:Boolean):void
+ {
+ if (mActive != inActive)
+ {
+ mActive = inActive;
+ if (mActive)
+ TextInspectorController.Instance().forceBroadcastFormats();
+ }
+ }
+
+ public function get active():Boolean
+ {
+ return mActive;
+ }
+
+ private function onSelectionUpdate(e:SelectionUpdateEvent):void
+ {
+ if (mActive)
+ {
+ reset();
+ for (var id:String in e.format)
+ {
+ if (e.format[id].length == 1)
+ properties[id] = e.format[id][0];
+ else
+ properties[id] = e.format[id];
+ }
+ rebuildUI();
+ }
+ }
+
+ private function onFormatValueChanged(e:PropertyChangeEvent):void
+ {
+ TextInspectorController.Instance().SetTextProperty(e.property as String, e.newValue);
+ }
+
+ private var mActive:Boolean = false;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/LinkPropertyEditor.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/LinkPropertyEditor.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/LinkPropertyEditor.as
new file mode 100644
index 0000000..33bb311
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/LinkPropertyEditor.as
@@ -0,0 +1,50 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.inspectors
+{
+ public class LinkPropertyEditor extends DynamicTextPropertyEditor
+ {
+ public function LinkPropertyEditor()
+ {
+ var recipe:XML =
+ <recipe>
+ <row>
+ <editor type="string" label="$$$/stage/TextEditing/Label/linkURL=URL:" width="150">
+ <property name={TextInspectorController.LINK_URL_UIPROP}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/linkTarget=Target:">
+ <property name={TextInspectorController.LINK_TARGET_UIPROP}/>
+ <choice display="_blank" value={"_blank"}/>
+ <choice display="_self" value={"_self"}/>
+ <choice display="_parent" value={"_parent"}/>
+ <choice display="_top" value={"_top"}/>
+ </editor>
+ <editor type="checkbox" label="$$$/stage/TextEditing/Label/linkExtend=Extend:">
+ <property name={TextInspectorController.LINK_EXTEND_UIPROP}/>
+ </editor>
+ </row>
+ </recipe>;
+ super(recipe);
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/ParagraphPropertyEditor.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/ParagraphPropertyEditor.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/ParagraphPropertyEditor.as
new file mode 100644
index 0000000..4b8a8cc
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/ParagraphPropertyEditor.as
@@ -0,0 +1,226 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.inspectors
+{
+ import flash.text.engine.*;
+
+ import flashx.textLayout.formats.Direction;
+ import flashx.textLayout.formats.FormatValue;
+ import flashx.textLayout.formats.TextJustify;
+ import flashx.textLayout.formats.TextLayoutFormat;
+ import flashx.textLayout.tlf_internal;
+ import flashx.textLayout.formats.LeadingModel;
+ use namespace tlf_internal;
+
+ public class ParagraphPropertyEditor extends DynamicTextPropertyEditor
+ {
+ [Embed(source="./assets/align_start_icon.png")]
+ private var alignStartIcon:Class;
+
+ [Embed(source="./assets/align_end_icon.png")]
+ private var alignEndIcon:Class;
+
+ [Embed(source="./assets/align_left_icon.png")]
+ private var alignLeftIcon:Class;
+
+ [Embed(source="./assets/align_center_icon.png")]
+ private var alignCenterIcon:Class;
+
+ [Embed(source="./assets/align_right_icon.png")]
+ private var alignRightIcon:Class;
+
+ [Embed(source="./assets/align_justify_icon.png")]
+ private var alignJustifyIcon:Class;
+
+ [Embed(source="./assets/align_last_left_icon.png")]
+ private var alignLastLeftIcon:Class;
+
+ [Embed(source="./assets/align_last_center_icon.png")]
+ private var alignLastCenterIcon:Class;
+
+ [Embed(source="./assets/align_last_right_icon.png")]
+ private var alignLastRightIcon:Class;
+
+ public function ParagraphPropertyEditor()
+ {
+ var recipe:XML =
+ <recipe>
+ <row>
+ <editor type="multiIconButton" style="iconButtonGroup" label="$$$/stage/TextEditing/Label/Alignment=Alignment:">
+ <property name={TextInspectorController.TEXT_ALIGN_UIPROP}/>
+ <button icon="alignStartIcon" value="start"/>
+ <button icon="alignEndIcon" value="end"/>
+ <button icon="alignLeftIcon" value="left"/>
+ <button icon="alignCenterIcon" value="center"/>
+ <button icon="alignRightIcon" value="right"/>
+ <button icon="alignJustifyIcon" value="justify"/>
+ </editor>
+ </row>
+ <row>
+ <editor type="multiIconButton" style="iconButtonGroup" label="$$$/stage/TextEditing/Label/LastLine=Last Line:">
+ <property name={TextInspectorController.TEXT_ALIGN_LAST_UIPROP}/>
+ <button icon="alignStartIcon" value="start"/>
+ <button icon="alignEndIcon" value="end"/>
+ <button icon="alignLastLeftIcon" value="left"/>
+ <button icon="alignLastCenterIcon" value="center"/>
+ <button icon="alignLastRightIcon" value="right"/>
+ <button icon="alignJustifyIcon" value="justify"/>
+ </editor>
+ </row>
+ <row>
+ <editor type="hotnumber" label="$$$/stage/TextEditing/Label/Indent=Text Indent:" decimals="1" enforcePrecision="no">
+ <property name={TextInspectorController.TEXT_INDENT_UIPROP}
+ minValue={TextLayoutFormat.textIndentProperty.minValue}
+ maxValue={TextLayoutFormat.textIndentProperty.maxValue}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="hotnumber" label="$$$/stage/TextEditing/Label/Left=Start Indent:" decimals="1" enforcePrecision="no">
+ <property name={TextInspectorController.START_INDENT_UIPROP}
+ minValue={TextLayoutFormat.paragraphStartIndentProperty.minValue}
+ maxValue={TextLayoutFormat.paragraphStartIndentProperty.maxValue}/>
+ </editor>
+ <editor type="hotnumber" label="$$$/stage/TextEditing/Label/Right=End:" decimals="1" enforcePrecision="no">
+ <property name={TextInspectorController.END_INDENT_UIPROP}
+ minValue={TextLayoutFormat.paragraphEndIndentProperty.minValue}
+ maxValue={TextLayoutFormat.paragraphEndIndentProperty.maxValue}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="hotnumber" label="$$$/stage/TextEditing/Label/Before=Space Before:" decimals="1" enforcePrecision="no">
+ <property name={TextInspectorController.SPACE_BEFORE_UIPROP}
+ minValue={TextLayoutFormat.paragraphSpaceBeforeProperty.minValue}
+ maxValue={TextLayoutFormat.paragraphSpaceBeforeProperty.maxValue}/>
+ </editor>
+ <editor type="hotnumber" label="$$$/stage/TextEditing/Label/After=After:" decimals="1" enforcePrecision="no">
+ <property name={TextInspectorController.SPACE_AFTER_UIPROP}
+ minValue={TextLayoutFormat.paragraphSpaceAfterProperty.minValue}
+ maxValue={TextLayoutFormat.paragraphSpaceAfterProperty.maxValue}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/justRule=Just. Rule:">
+ <property name={TextInspectorController.JUSTIFICATION_RULE_UIPROP}/>
+ <choice display="Auto" value={FormatValue.AUTO}/>
+ <choice display="Roman" value={flashx.textLayout.formats.JustificationRule.SPACE}/>
+ <choice display="East Asian" value={flashx.textLayout.formats.JustificationRule.EAST_ASIAN}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/textJust=Text Justify:">
+ <property name={TextInspectorController.TEXT_JUSTIFY_UIPROP}/>
+ <choice display="Inter-word" value={flashx.textLayout.formats.TextJustify.INTER_WORD}/>
+ <choice display="Distribute" value={flashx.textLayout.formats.TextJustify.DISTRIBUTE}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/justStyle=Just. Style:">
+ <property name={TextInspectorController.JUSTIFICATION_STYLE_UIPROP}/>
+ <choice display="Auto" value={FormatValue.AUTO}/>
+ <choice display="Prioritize Least Adjustment" value={flash.text.engine.JustificationStyle.PRIORITIZE_LEAST_ADJUSTMENT}/>
+ <choice display="Push in Kinsoku" value={flash.text.engine.JustificationStyle.PUSH_IN_KINSOKU}/>
+ <choice display="Push out Only" value={flash.text.engine.JustificationStyle.PUSH_OUT_ONLY}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/direction=Direction:">
+ <property name={TextInspectorController.DIRECTION_UIPROP}/>
+ <choice display="Left to Right" value={flashx.textLayout.formats.Direction.LTR}/>
+ <choice display="Right to Left" value={flashx.textLayout.formats.Direction.RTL}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/leadingModel=Leading Model:">
+ <property name={TextInspectorController.LEADING_MODEL_UIPROP}/>
+ <choice display="Roman; Up" value={flashx.textLayout.formats.LeadingModel.ROMAN_UP}/>
+ <choice display="Ideographic Top; Up" value={flashx.textLayout.formats.LeadingModel.IDEOGRAPHIC_TOP_UP}/>
+ <choice display="Ideographic Center; Up" value={flashx.textLayout.formats.LeadingModel.IDEOGRAPHIC_CENTER_UP}/>
+ <choice display="Ideographic Top; Down" value={flashx.textLayout.formats.LeadingModel.IDEOGRAPHIC_TOP_DOWN}/>
+ <choice display="Ideographic Center; Down" value={flashx.textLayout.formats.LeadingModel.IDEOGRAPHIC_CENTER_DOWN}/>
+ <choice display="Ascent-Descent; Up" value={flashx.textLayout.formats.LeadingModel.ASCENT_DESCENT_UP}/>
+ <choice display="Approximate TextField" value={flashx.textLayout.formats.LeadingModel.APPROXIMATE_TEXT_FIELD}/>
+ <choice display="Auto" value={flashx.textLayout.formats.LeadingModel.AUTO}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/Lacale=Locale:">
+ <property name={TextInspectorController.PARA_LOCALE_UIPROP}/>
+ <choice display="Arabic" value="ar"/>,
+ <choice display="Bengali" value="bn"/>,
+ <choice display="Bulgarian" value="bg"/>,
+ <choice display="Catalan" value="ca"/>,
+ <choice display="Chinese, Simplified (China)" value="zh-CN"/>,
+ <choice display="Chinese, Traditional (Taiwan)" value="zh-TW"/>,
+ <choice display="Croatian" value="hr"/>,
+ <choice display="Czech" value="cs"/>,
+ <choice display="Danish" value="da"/>,
+ <choice display="Dutch" value="nl"/>,
+ <choice display="English" value="en"/>,
+ <choice display="Estonian" value="et"/>,
+ <choice display="Finnish" value="fi"/>,
+ <choice display="French" value="fr"/>,
+ <choice display="German" value="de"/>,
+ <choice display="Greek" value="el"/>,
+ <choice display="Gujarati" value="gu"/>,
+ <choice display="Hindi" value="hi"/>,
+ <choice display="Hebrew" value="he"/>,
+ <choice display="Hungarian" value="hu"/>,
+ <choice display="Italian" value="it"/>,
+ <choice display="Japanese" value="ja"/>,
+ <choice display="Korean" value="ko"/>,
+ <choice display="Latvian" value="lv"/>,
+ <choice display="Lithuanian" value="lt"/>,
+ <choice display="Marathi" value="mr"/>,
+ <choice display="Norwegian" value="no"/>,
+ <choice display="Persian" value="fa"/>,
+ <choice display="Polish" value="pl"/>,
+ <choice display="Portuguese" value="pt"/>,
+ <choice display="Punjabi" value="pa"/>,
+ <choice display="Romanian" value="ro"/>,
+ <choice display="Russian" value="ru"/>,
+ <choice display="Slovak" value="sk"/>,
+ <choice display="Slovenian" value="sl"/>,
+ <choice display="Spanish" value="es"/>,
+ <choice display="Swedish" value="sv"/>,
+ <choice display="Tamil" value="ta"/>,
+ <choice display="Telugu" value="te"/>,
+ <choice display="Thai" value="th"/>,
+ <choice display="Turkish" value="tr"/>,
+ <choice display="Ukrainian" value="uk"/>,
+ <choice display="Urdu" value="ur"/>,
+ <choice display="Vietnamese" value="vi"/>
+ </editor>
+ </row>
+ </recipe>;
+
+ super(recipe);
+
+ SetIcon("alignStartIcon", alignStartIcon);
+ SetIcon("alignEndIcon", alignEndIcon);
+ SetIcon("alignLeftIcon", alignLeftIcon);
+ SetIcon("alignCenterIcon", alignCenterIcon);
+ SetIcon("alignRightIcon", alignRightIcon);
+ SetIcon("alignJustifyIcon", alignJustifyIcon);
+ SetIcon("alignLastLeftIcon", alignLastLeftIcon);
+ SetIcon("alignLastCenterIcon", alignLastCenterIcon);
+ SetIcon("alignLastRightIcon", alignLastRightIcon);
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/SelectionUpdateEvent.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/SelectionUpdateEvent.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/SelectionUpdateEvent.as
new file mode 100644
index 0000000..f8bde2f
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/SelectionUpdateEvent.as
@@ -0,0 +1,41 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.inspectors
+{
+ import flash.events.Event;
+
+ public class SelectionUpdateEvent extends Event
+ {
+ public static const SELECTION_UPDATE:String = "selectionUpdate";
+
+ public function SelectionUpdateEvent(inFormat:Object)
+ {
+ super(SELECTION_UPDATE);
+ mFormat = inFormat;
+ }
+
+ public function get format():Object
+ {
+ return mFormat;
+ }
+
+ private var mFormat:Object;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TabPropertyEditor.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TabPropertyEditor.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TabPropertyEditor.as
new file mode 100644
index 0000000..4118857
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TabPropertyEditor.as
@@ -0,0 +1,64 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.inspectors
+{
+ import bxf.ui.inspectors.DynamicPropertyEditorBase;
+
+ import flash.text.engine.*;
+
+ import flashx.textLayout.formats.TabStopFormat;
+ import flashx.textLayout.tlf_internal;
+ use namespace tlf_internal;
+
+ public class TabPropertyEditor extends DynamicPropertyEditorBase
+ {
+ public function TabPropertyEditor()
+ {
+ var recipe:XML =
+ <recipe>
+ <row>
+ <editor type="checkbox" label="$$$/stage/TextEditing/Label/showRuler=Show Ruler" labelSide="right">
+ <property name="rulervisible"/>
+ </editor>
+ <editor type="hotnumber" label="$$$/stage/TextEditing/Label/tabPosition=Position:" decimals="1" enforcePrecision="no">
+ <property name={TabStopFormat.positionProperty.name}
+ minValue={TabStopFormat.positionProperty.minValue}
+ maxValue={TabStopFormat.positionProperty.maxValue}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/tabType=Tab Type:">
+ <property name={TabStopFormat.alignmentProperty.name}/>
+ <choice display="Start" value={flash.text.engine.TabAlignment.START}/>
+ <choice display="Center" value={flash.text.engine.TabAlignment.CENTER}/>
+ <choice display="End" value={flash.text.engine.TabAlignment.END}/>
+ <choice display="Align" value={flash.text.engine.TabAlignment.DECIMAL}/>
+ </editor>
+ <editor type="string" label="$$$/stage/TextEditing/Label/tabAlign=Align to:" width="50">
+ <property name={TabStopFormat.decimalAlignmentTokenProperty.name}/>
+ </editor>
+ </row>
+ </recipe>;
+
+ super(recipe);
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextContainerPropertyEditor.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextContainerPropertyEditor.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextContainerPropertyEditor.as
new file mode 100644
index 0000000..36d62f8
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextContainerPropertyEditor.as
@@ -0,0 +1,151 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.inspectors
+{
+ import flash.text.engine.*;
+
+ import flashx.textLayout.formats.FormatValue;
+ import flashx.textLayout.formats.TextLayoutFormat;
+ import flashx.textLayout.tlf_internal;
+ use namespace tlf_internal;
+
+ public class TextContainerPropertyEditor extends DynamicTextPropertyEditor
+ {
+ [Embed(source="./assets/cont_align_top_icon.png")]
+ private var contAlignTopIcon:Class;
+
+ [Embed(source="./assets/cont_align_middle_icon.png")]
+ private var contAlignMiddleIcon:Class;
+
+ [Embed(source="./assets/cont_align_bottom_icon.png")]
+ private var contAlignBottomIcon:Class;
+
+ [Embed(source="./assets/cont_align_justify_icon.png")]
+ private var contAlignJustifyIcon:Class;
+
+ public function TextContainerPropertyEditor()
+ {
+ var recipe:XML =
+ <recipe>
+ <row>
+ <editor type="multiIconButton" style="iconButtonGroup" label="$$$/stage/TextEditing/Label/Container/Alignment=Alignment:">
+ <property name={TextInspectorController.VERTICAL_ALIGN_UIPROP}/>
+ <button icon="contAlignTopIcon" value="top"/>
+ <button icon="contAlignMiddleIcon" value="middle"/>
+ <button icon="contAlignBottomIcon" value="bottom"/>
+ <button icon="contAlignJustifyIcon" value="justify"/>
+ </editor>
+ </row>
+ <row>
+ <editor type="hotnumberunit" label="$$$/stage/TextEditing/Label/NumColumns=Columns:">
+ <property name={TextInspectorController.COLUMN_COUNT_UIPROP}/>
+ <defaultunit>count</defaultunit>
+ <numericunit displayname="count"
+ min={TextLayoutFormat.columnCountProperty.minValue}
+ max={TextLayoutFormat.columnCountProperty.maxValue}
+ default="1"/>
+ <enumval displayname="Auto" value={flashx.textLayout.formats.FormatValue.AUTO}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="hotnumberunit" label="$$$/stage/TextEditing/Label/ColumnWidth=Column Width:">
+ <property name={TextInspectorController.COLUMN_WIDTH_UIPROP}/>
+ <defaultunit>pix</defaultunit>
+ <numericunit displayname="pix"
+ min={TextLayoutFormat.columnWidthProperty.minValue}
+ max={TextLayoutFormat.columnWidthProperty.maxValue}
+ default="200"/>
+ <enumval displayname="Auto" value={flashx.textLayout.formats.FormatValue.AUTO}/>
+ </editor>
+ <editor type="hotnumber" label="$$$/stage/TextEditing/Label/ColumnGap=Gap:" decimals="1" enforcePrecision="no">
+ <property name={TextInspectorController.COLUMN_GAP_UIPROP}
+ minValue={TextLayoutFormat.columnGapProperty.minValue}
+ maxValue={TextLayoutFormat.columnGapProperty.maxValue}/>
+ </editor>
+ </row>
+ <row label="$$$/stage/TextEditing/Label/ContainerGeometry=Geometry:"/>
+ <row>
+ <editor type="hotnumber" label="$$$/stage/TextEditing/Label/PaddingLeft=Left:" decimals="1" enforcePrecision="no">
+ <property name={TextInspectorController.PADDING_LEFT_UIPROP}
+ minValue={TextLayoutFormat.paddingLeftProperty.minValue}
+ maxValue={TextLayoutFormat.paddingLeftProperty.maxValue}/>
+ </editor>
+ <editor type="hotnumber" label="$$$/stage/TextEditing/Label/PaddingTop=Top:" decimals="1" enforcePrecision="no">
+ <property name={TextInspectorController.PADDING_TOP_UIPROP}
+ minValue={TextLayoutFormat.paddingTopProperty.minValue}
+ maxValue={TextLayoutFormat.paddingTopProperty.maxValue}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="hotnumber" label="$$$/stage/TextEditing/Label/PaddingRight=Right:" decimals="1" enforcePrecision="no">
+ <property name={TextInspectorController.PADDING_RIGHT_UIPROP}
+ minValue={TextLayoutFormat.paddingRightProperty.minValue}
+ maxValue={TextLayoutFormat.paddingRightProperty.maxValue}/>
+ </editor>
+ <editor type="hotnumber" label="$$$/stage/TextEditing/Label/PaddingBottom=Bottom:" decimals="1" enforcePrecision="no">
+ <property name={TextInspectorController.PADDING_BOTTOM_UIPROP}
+ minValue={TextLayoutFormat.paddingBottomProperty.minValue}
+ maxValue={TextLayoutFormat.paddingBottomProperty.maxValue}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="hotnumberunit" label="$$$/stage/TextEditing/Label/FirstBaseline=First Line Offset:">
+ <property name={TextInspectorController.FIRST_BASELINE_UIPROP}/>
+ <defaultunit>pix</defaultunit>
+ <numericunit displayname="pix"
+ min={TextLayoutFormat.firstBaselineOffsetProperty.minValue}
+ max={TextLayoutFormat.firstBaselineOffsetProperty.maxValue}
+ default="1"/>
+ <enumval displayname="Auto" value={flashx.textLayout.formats.BaselineOffset.AUTO}/>
+ <enumval displayname="Ascent" value={flashx.textLayout.formats.BaselineOffset.ASCENT}/>
+ <enumval displayname="Line Height" value={flashx.textLayout.formats.BaselineOffset.LINE_HEIGHT}/>
+ </editor>
+ </row>
+ <!-- <row label="$$$/stage/TextEditing/Label/Border=Border:">
+ <editor type="combo" label="$$$/stage/TextEditing/Label/BorderStyle=Style:">
+ <property name={TextInspectorController.BORDER_STYLE_UIPROP}/>
+ <choice display="None" value={text.BorderStyle.NONE}/>
+ <choice display="Solid" value={text.BorderStyle.SOLID}/>
+ <choice display="Innie" value={text.BorderStyle.INSET}/>
+ <choice display="Outie" value={text.BorderStyle.OUTSET}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="hotnumber" label="$$$/stage/TextEditing/Label/BorderThickness=Thickness:" decimals="0" enforcePrecision="yes">
+ <property name={TextInspectorController.BORDER_THICKNESS_UIPROP}
+ minValue={TextLayoutFormat.borderThicknessProperty.minValue}
+ maxValue={TextLayoutFormat.borderThicknessProperty.maxValue}/>
+ </editor>
+ <editor type="color" label="$$$/stage/TextEditing/Label/BorderColor=Color:">
+ <property name={TextInspectorController.BORDER_COLOR_UIPROP}/>
+ </editor>
+ </row> -->
+ </recipe>;
+
+ super(recipe);
+
+ SetIcon("contAlignTopIcon", contAlignTopIcon);
+ SetIcon("contAlignMiddleIcon", contAlignMiddleIcon);
+ SetIcon("contAlignBottomIcon", contAlignBottomIcon);
+ SetIcon("contAlignJustifyIcon", contAlignJustifyIcon);
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextFlowPropertyEditor.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextFlowPropertyEditor.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextFlowPropertyEditor.as
new file mode 100644
index 0000000..9b9530a
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/inspectors/TextFlowPropertyEditor.as
@@ -0,0 +1,71 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.inspectors
+{
+ import flashx.textLayout.formats.BlockProgression;
+ import flashx.textLayout.formats.LineBreak;
+
+ public class TextFlowPropertyEditor extends DynamicTextPropertyEditor
+ {
+ public function TextFlowPropertyEditor()
+ {
+ var recipe:XML =
+ <recipe>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/LineProgression=Orientation:">
+ <property name={TextInspectorController.BLOCK_PROGRESSION_UIPROP}/>
+ <choice display="Horizontal" value={flashx.textLayout.formats.BlockProgression.TB}/>
+ <choice display="Vertical" value={flashx.textLayout.formats.BlockProgression.RL}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/direction=Direction:">
+ <property name={TextInspectorController.FLOW_DIRECTION_UIPROP}/>
+ <choice display="Left to Right" value={flashx.textLayout.formats.Direction.LTR}/>
+ <choice display="Right to Left" value={flashx.textLayout.formats.Direction.RTL}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/Linebreak=Line Breaks:">
+ <property name={TextInspectorController.LINE_BREAK_UIPROP}/>
+ <choice display="Auto Line Wrap" value={flashx.textLayout.formats.LineBreak.TO_FIT}/>
+ <choice display="Hard Breaks Only" value={flashx.textLayout.formats.LineBreak.EXPLICIT}/>
+ </editor>
+ </row>
+ <row>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/vertScroll=V. Scroll:">
+ <property name={TextInspectorController.VERTICAL_SCROLL_UIPROP}/>
+ <choice display="Off" value="off"/>
+ <choice display="On" value="on"/>
+ <choice display="Auto" value="auto"/>
+ </editor>
+ <editor type="combo" label="$$$/stage/TextEditing/Label/horzScroll=H. Scroll:">
+ <property name={TextInspectorController.HORIZONTAL_SCROLL_UIPROP}/>
+ <choice display="Off" value="off"/>
+ <choice display="On" value="on"/>
+ <choice display="Auto" value="auto"/>
+ </editor>
+ </row>
+ </recipe>;
+ super(recipe);
+ }
+
+ }
+}
\ No newline at end of file
[5/5] git commit: [flex-utilities] [refs/heads/develop] - Added more
spark examples
Posted by jm...@apache.org.
Added more spark examples
Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/47a67608
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/47a67608
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/47a67608
Branch: refs/heads/develop
Commit: 47a676080b82cbabbc3b680efb016cf94aa9dab5
Parents: 070907e
Author: Justin Mclean <jm...@apache.org>
Authored: Sat Aug 9 16:31:36 2014 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sat Aug 9 16:31:36 2014 +1000
----------------------------------------------------------------------
.../SkinableDataContainerExample.mxml | 62 ++
.../src/spark/containers/TileGroupExample.mxml | 101 +++
.../spark/containers/assets/arrow_icon_sm.png | Bin 0 -> 527 bytes
.../src/spark/controls/MyTextFlow.xml | 23 +
.../src/spark/controls/TextAreaExample.mxml | 90 +++
.../src/spark/controls/TextInputExample.mxml | 100 +++
.../src/spark/controls/TextLayout1Example.mxml | 164 +++++
.../src/spark/controls/TextLayout2Example.mxml | 135 ++++
.../src/spark/controls/TextLayout3example.mxml | 88 +++
.../src/spark/controls/TextLayout4Example.mxml | 77 +++
.../spark/controls/assets/ApacheFlexLogo.png | Bin 0 -> 71228 bytes
.../src/spark/effects/WipeExample.html | 121 ++++
.../src/spark/other/ScrollBarsExample.mxml | 97 +++
.../src/spark/tlf/TextLayoutEditorCanvas.mxml | 439 ++++++++++++
.../src/spark/tlf/TextLayoutEditorSample.mxml | 29 +
.../tlf/assets/%scroll_arrow_down_over.png | Bin 0 -> 109642 bytes
.../spark/tlf/assets/%scroll_arrow_up_over.png | Bin 0 -> 109644 bytes
.../spark/tlf/assets/combo_drop_down_arrow.png | Bin 0 -> 505 bytes
.../src/spark/tlf/assets/header_close_icon.png | Bin 0 -> 3084 bytes
.../src/spark/tlf/assets/header_open_icon.png | Bin 0 -> 3095 bytes
.../src/spark/tlf/assets/scroll_arrow_down.png | Bin 0 -> 332 bytes
.../spark/tlf/assets/scroll_arrow_down_over.png | Bin 0 -> 47147 bytes
.../src/spark/tlf/assets/scroll_arrow_up.png | Bin 0 -> 311 bytes
.../spark/tlf/assets/scroll_arrow_up_over.png | Bin 0 -> 47155 bytes
.../spark/tlf/flashx/textLayout/UiClasses.as | 54 ++
.../tlf/flashx/textLayout/ui/MultiPanel.as | 206 ++++++
.../textLayout/ui/MultiPanelHeaderSkin.as | 58 ++
.../flashx/textLayout/ui/PanelWithEdgeBars.as | 266 ++++++++
.../flashx/textLayout/ui/VellumGUIStyles.css | 254 +++++++
.../ui/assets/%scroll_arrow_down_over.png | Bin 0 -> 109642 bytes
.../ui/assets/%scroll_arrow_up_over.png | Bin 0 -> 109644 bytes
.../ui/assets/combo_drop_down_arrow.png | Bin 0 -> 505 bytes
.../textLayout/ui/assets/header_close_icon.png | Bin 0 -> 3084 bytes
.../textLayout/ui/assets/header_open_icon.png | Bin 0 -> 3095 bytes
.../textLayout/ui/assets/scroll_arrow_down.png | Bin 0 -> 332 bytes
.../ui/assets/scroll_arrow_down_over.png | Bin 0 -> 47147 bytes
.../textLayout/ui/assets/scroll_arrow_up.png | Bin 0 -> 311 bytes
.../ui/assets/scroll_arrow_up_over.png | Bin 0 -> 47155 bytes
.../ui/inspectors/AdvancedTextPropertyEditor.as | 190 ++++++
.../ui/inspectors/AntiAliasPropertyEditor.as | 51 ++
.../ui/inspectors/CharacterPropertyEditor.as | 179 +++++
.../ui/inspectors/DynamicTextPropertyEditor.as | 74 ++
.../ui/inspectors/LinkPropertyEditor.as | 50 ++
.../ui/inspectors/ParagraphPropertyEditor.as | 226 +++++++
.../ui/inspectors/SelectionUpdateEvent.as | 41 ++
.../ui/inspectors/TabPropertyEditor.as | 64 ++
.../inspectors/TextContainerPropertyEditor.as | 151 +++++
.../ui/inspectors/TextFlowPropertyEditor.as | 71 ++
.../ui/inspectors/TextInspectorController.as | 614 +++++++++++++++++
.../ui/inspectors/assets/align_center_icon.png | Bin 0 -> 2834 bytes
.../ui/inspectors/assets/align_end_icon.png | Bin 0 -> 2866 bytes
.../ui/inspectors/assets/align_justify_icon.png | Bin 0 -> 2812 bytes
.../assets/align_last_center_icon.png | Bin 0 -> 2826 bytes
.../inspectors/assets/align_last_left_icon.png | Bin 0 -> 2812 bytes
.../inspectors/assets/align_last_right_icon.png | Bin 0 -> 2815 bytes
.../ui/inspectors/assets/align_left_icon.png | Bin 0 -> 2827 bytes
.../ui/inspectors/assets/align_right_icon.png | Bin 0 -> 2828 bytes
.../ui/inspectors/assets/align_start_icon.png | Bin 0 -> 2915 bytes
.../ui/inspectors/assets/bold_icon.png | Bin 0 -> 2887 bytes
.../assets/cont_align_bottom_icon.png | Bin 0 -> 287 bytes
.../assets/cont_align_justify_icon.png | Bin 0 -> 299 bytes
.../assets/cont_align_middle_icon.png | Bin 0 -> 313 bytes
.../inspectors/assets/cont_align_top_icon.png | Bin 0 -> 310 bytes
.../ui/inspectors/assets/italic_icon.png | Bin 0 -> 2909 bytes
.../ui/inspectors/assets/strikethrough_icon.png | Bin 0 -> 2899 bytes
.../ui/inspectors/assets/subscript_icon.png | Bin 0 -> 2886 bytes
.../ui/inspectors/assets/superscript_icon.png | Bin 0 -> 2892 bytes
.../ui/inspectors/assets/tcy_icon.png | Bin 0 -> 2973 bytes
.../ui/inspectors/assets/underline_icon.png | Bin 0 -> 2892 bytes
.../ui/rulers/ParagraphPropertyMarker.as | 98 +++
.../ui/rulers/ParagraphPropertyMarkerSkin.as | 103 +++
.../tlf/flashx/textLayout/ui/rulers/RulerBar.as | 672 +++++++++++++++++++
.../textLayout/ui/rulers/RulerDragTracker.as | 88 +++
.../flashx/textLayout/ui/rulers/RulerMarker.as | 124 ++++
.../flashx/textLayout/ui/rulers/TabMarker.as | 86 +++
.../textLayout/ui/rulers/TabMarkerSkin.as | 94 +++
.../textLayout/ui/styles/PopupMenuSkin.as | 70 ++
.../ui/styles/ScrollbarDownArrowUpSkin.as | 45 ++
.../ui/styles/ScrollbarThumbOverSkin.as | 89 +++
.../ui/styles/ScrollbarThumbUpSkin.as | 89 +++
.../textLayout/ui/styles/ScrollbarTrackSkin.as | 68 ++
.../ui/styles/ScrollbarUpArrowUpSkin.as | 45 ++
.../tlf/textEditBar/FeatureSetChangeEvent.as | 42 ++
.../src/spark/tlf/textEditBar/FileEvent.as | 43 ++
.../src/spark/tlf/textEditBar/FileIOHelper.as | 268 ++++++++
.../src/spark/tlf/textEditBar/FileServices.mxml | 96 +++
.../src/spark/tlf/textEditBar/GraphicBar.mxml | 153 +++++
.../spark/tlf/textEditBar/GraphicChangeEvent.as | 61 ++
.../src/spark/tlf/textEditBar/LinkBar.mxml | 158 +++++
.../spark/tlf/textEditBar/LinkChangeEvent.as | 51 ++
.../tlf/textEditBar/SingleContainerView.mxml | 80 +++
.../src/spark/tlf/textEditBar/SpriteWithIME.as | 102 +++
.../src/spark/tlf/textEditBar/StatusPopup.mxml | 39 ++
.../spark/tlf/textEditBar/StyleChangeEvent.as | 46 ++
.../spark/tlf/textEditBar/assets/%icon_tcy.png | Bin 0 -> 110058 bytes
.../textEditBar/assets/BreakOpportunityType.png | Bin 0 -> 26281 bytes
.../tlf/textEditBar/assets/EmbedDeleteIcon.png | Bin 0 -> 47172 bytes
.../assets/EmbedDeleteIconDisabled.png | Bin 0 -> 48199 bytes
.../assets/P_TextAlignBottom_Sm_N.png | Bin 0 -> 287 bytes
.../assets/P_TextAlignJustify_Sm_N.png | Bin 0 -> 299 bytes
.../assets/P_TextAlignMiddle_Sm_N.png | Bin 0 -> 313 bytes
.../textEditBar/assets/P_TextAlignTop_Sm_N.png | Bin 0 -> 310 bytes
.../assets/P_TextBaselineShift_Md_N.png | Bin 0 -> 713 bytes
.../assets/P_TextBottomOffset_Md_N.png | Bin 0 -> 527 bytes
.../assets/P_TextFirstLineIndent_Md_N.png | Bin 0 -> 627 bytes
.../assets/P_TextLeftIndent_Md_N.png | Bin 0 -> 697 bytes
.../assets/P_TextLeftOffset_Md_N.png | Bin 0 -> 519 bytes
.../assets/P_TextRightIndent_Md_N.png | Bin 0 -> 739 bytes
.../assets/P_TextRightOffset_Md_N.png | Bin 0 -> 513 bytes
.../textEditBar/assets/P_TextSmallCaps_Md_N.png | Bin 0 -> 647 bytes
.../assets/P_TextSpaceAfter_Md_N.png | Bin 0 -> 578 bytes
.../assets/P_TextSpaceBefore_Md_N.png | Bin 0 -> 572 bytes
.../textEditBar/assets/P_TextTopOffset_Md_N.png | Bin 0 -> 530 bytes
.../assets/TextAutoLeadingPercent.png | Bin 0 -> 27667 bytes
.../spark/tlf/textEditBar/assets/digitCase.png | Bin 0 -> 2964 bytes
.../spark/tlf/textEditBar/assets/digitWidth.png | Bin 0 -> 3123 bytes
.../tlf/textEditBar/assets/elementBaseline.png | Bin 0 -> 26703 bytes
.../assets/icon_align_all_but_last.png | Bin 0 -> 26692 bytes
.../textEditBar/assets/icon_align_center.png | Bin 0 -> 27220 bytes
.../tlf/textEditBar/assets/icon_align_end.PNG | Bin 0 -> 215 bytes
.../textEditBar/assets/icon_align_justify.png | Bin 0 -> 27095 bytes
.../tlf/textEditBar/assets/icon_align_left.png | Bin 0 -> 27210 bytes
.../tlf/textEditBar/assets/icon_align_right.png | Bin 0 -> 27210 bytes
.../tlf/textEditBar/assets/icon_align_start.PNG | Bin 0 -> 184 bytes
.../tlf/textEditBar/assets/icon_bullet.png | Bin 0 -> 27234 bytes
.../tlf/textEditBar/assets/icon_style_bold.png | Bin 0 -> 27205 bytes
.../textEditBar/assets/icon_style_italic.png | Bin 0 -> 27229 bytes
.../assets/icon_style_strikethrough.png | Bin 0 -> 26697 bytes
.../textEditBar/assets/icon_style_underline.png | Bin 0 -> 27197 bytes
.../spark/tlf/textEditBar/assets/icon_tcy.png | Bin 0 -> 59524 bytes
.../spark/tlf/textEditBar/assets/ligatures.png | Bin 0 -> 3045 bytes
.../tlf/textEditBar/assets/lineBaseline.png | Bin 0 -> 26737 bytes
132 files changed, 6885 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/containers/SkinableDataContainerExample.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/containers/SkinableDataContainerExample.mxml b/TourDeFlex/TourDeFlex3/src/spark/containers/SkinableDataContainerExample.mxml
new file mode 100644
index 0000000..e2c9414
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/containers/SkinableDataContainerExample.mxml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx" viewSourceURL="srcview/index.html">
+
+ <s:Panel width="100%" height="100%" title="SkinnableDataContainer" skinClass="skins.TDFPanelSkin">
+ <s:layout><s:HorizontalLayout paddingLeft="8" paddingTop="8" paddingRight="12"/></s:layout>
+
+ <s:VGroup>
+ <s:Label text="Famous Astronauts" fontWeight="bold" fontSize="14"/>
+ <s:SkinnableDataContainer horizontalCenter="-66" verticalCenter="0" width="301">
+ <s:layout>
+ <s:VerticalLayout/>
+ </s:layout>
+ <s:itemRenderer>
+ <fx:Component>
+ <s:ItemRenderer>
+ <s:VGroup horizontalCenter="0" verticalCenter="0">
+ <s:HGroup verticalAlign="middle">
+ <s:Label text="{data.firstName}"/>
+ <s:Label text="{data.lastName}"/>
+ <s:Label text="{data.phoneNumber}"/>
+ <mx:LinkButton label="{data.college}" color="0x3380DD" click="navigateToURL(new URLRequest(data.url), '_blank')"
+ textDecoration="underline" fontWeight="normal" icon="@Embed('assets/arrow_icon_sm.png')" />
+ </s:HGroup>
+ </s:VGroup>
+ </s:ItemRenderer>
+ </fx:Component>
+ </s:itemRenderer>
+
+ <s:ArrayCollection>
+ <fx:Object firstName="John" lastName="Glenn" phoneNumber="888-555-1111" college="West Point" url="http://www.usma.edu/"/>
+ <fx:Object firstName="Neil" lastName="Armstrong" phoneNumber="888-555-2222" college="Purdue" url="http://www.purdue.edu/"/>
+ <fx:Object firstName="Buzz" lastName="Aldrin" phoneNumber="888-555-3333" college="Muskingum" url="http://www.muskingum.edu/"/>
+ <fx:Object firstName="James" lastName="Lovell" phoneNumber="888-555-4444" college="US Naval Academy" url="http://www.usna.edu/"/>
+ </s:ArrayCollection>
+ </s:SkinnableDataContainer>
+ </s:VGroup>
+ <s:Label color="0x323232" width="200" text="The SkinnableDataContainer is the skinnable version of the DataGroup and
+while it can hold visual elements, they are often used only to hold data items as children. Data items can be simple data items
+such String and Number objects, and more complicated data items such as Object and XMLNode objects."/>
+ </s:Panel>
+
+</s:Application>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/containers/TileGroupExample.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/containers/TileGroupExample.mxml b/TourDeFlex/TourDeFlex3/src/spark/containers/TileGroupExample.mxml
new file mode 100644
index 0000000..9fa4af7
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/containers/TileGroupExample.mxml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" viewSourceURL="srcview/index.html">
+
+ <fx:Declarations>
+ <fx:Array id="orientArray">
+ <fx:String>Rows</fx:String>
+ <fx:String>Columns</fx:String>
+ </fx:Array>
+ </fx:Declarations>
+
+ <fx:Script>
+ <![CDATA[
+ import mx.collections.ArrayList;
+ import skins.TDFPanelSkin;
+
+ private function applyProperties():void
+ {
+ this.mainGroup.orientation = this.orientation.selectedItem;
+ this.mainGroup.horizontalGap = this.hgap.value;
+ this.mainGroup.verticalGap = this.vgap.value;
+ this.mainGroup.requestedColumnCount = this.colCount.value;
+ this.mainGroup.requestedRowCount = this.rowCount.value;
+ }
+ ]]>
+ </fx:Script>
+
+ <s:Panel skinClass="skins.TDFPanelSkin" title="TileGroup Sample" width="100%" height="100%">
+ <s:TileGroup left="300" top="10" id="mainGroup">
+ <s:Rect width="100" height="75">
+ <s:fill>
+ <s:SolidColor color="0xd54f4f"/>
+ </s:fill>
+ </s:Rect>
+ <s:Rect width="100" height="75">
+ <s:fill>
+ <s:SolidColor color="0x2f977d"/>
+ </s:fill>
+ </s:Rect>
+ <s:Rect width="100" height="75">
+ <s:fill>
+ <s:SolidColor color="0xfffca2"/>
+ </s:fill>
+ </s:Rect>
+ </s:TileGroup>
+
+ <s:VGroup top="10" left="10">
+ <s:HGroup verticalAlign="middle">
+ <s:Label text="Orientation:"/>
+ <s:DropDownList id="orientation" dataProvider="{new ArrayList(orientArray)}" prompt="columns"/>
+ </s:HGroup>
+
+ <s:HGroup verticalAlign="middle">
+ <s:Label text="Horizontal Gap:"/>
+ <s:NumericStepper id="hgap" maximum="400"/>
+ </s:HGroup>
+
+ <s:HGroup verticalAlign="middle">
+ <s:Label text="Vertical Gap:"/>
+ <s:NumericStepper id="vgap" maximum="400"/>
+ </s:HGroup>
+
+ <s:HGroup verticalAlign="middle">
+ <s:Label text="Requested Column Count:"/>
+ <s:NumericStepper id="colCount"/>
+ </s:HGroup>
+
+ <s:HGroup verticalAlign="middle">
+ <s:Label text="Requested Row Count:"/>
+ <s:NumericStepper id="rowCount"/>
+ </s:HGroup>
+ <s:Button label="Apply Properties" click="this.applyProperties()"/>
+ <mx:Spacer height="10"/>
+ <s:Label width="85%" horizontalCenter="0" color="#323232"
+ text="The TileGroup container is an instance of the Group container that uses the TileLayout class. You can use the properties of the
+ TileGroup class to modify the characteristics of the TileLayout class."/>
+
+ </s:VGroup>
+
+ </s:Panel>
+
+</s:Application>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/containers/assets/arrow_icon_sm.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/containers/assets/arrow_icon_sm.png b/TourDeFlex/TourDeFlex3/src/spark/containers/assets/arrow_icon_sm.png
new file mode 100644
index 0000000..33debc8
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/containers/assets/arrow_icon_sm.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/controls/MyTextFlow.xml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/controls/MyTextFlow.xml b/TourDeFlex/TourDeFlex3/src/spark/controls/MyTextFlow.xml
new file mode 100644
index 0000000..8b787ea
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/controls/MyTextFlow.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<!-- http://blog.flexexamples.com/2009/08/11/setting-text-in-a-spark-richtext-control-in-flex-4/ -->
+<TextFlow xmlns="http://ns.adobe.com/textLayout/2008" whiteSpaceCollapse="preserve">
+ <p><span>This is an example of external text being included that is using the </span> <span fontWeight="bold">Text Layout Framework </span> <span> markup.</span></p>
+</TextFlow>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/controls/TextAreaExample.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/controls/TextAreaExample.mxml b/TourDeFlex/TourDeFlex3/src/spark/controls/TextAreaExample.mxml
new file mode 100644
index 0000000..87d270e
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/controls/TextAreaExample.mxml
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx" viewSourceURL="srcview/index.html">
+ <fx:Script>
+ <![CDATA[
+ import skins.TDFPanelSkin;
+
+ protected function changeHandler():void
+ {
+ txt.maxChars = this.maxChars.value;
+ txt.restrict = this.restrictStr.text;
+ txt.textDisplay.textFlow.textAlign = alignVal.selectedItem;
+ txt.textDisplay.textFlow.direction = direction.selectedItem;
+ }
+ ]]>
+ </fx:Script>
+
+ <s:Panel title="TextArea Sample"
+ width="100%" height="100%" skinClass="skins.TDFPanelSkin">
+
+ <s:HGroup top="8" width="100%" height="100%" left="80">
+ <s:VGroup>
+ <s:HGroup verticalAlign="middle">
+ <s:Label text="Specify Max Character Input:"/>
+ <s:NumericStepper id="maxChars" maximum="200" value="100" stepSize="2" change="this.changeHandler()"/>
+ </s:HGroup>
+ <s:HGroup verticalAlign="middle">
+ <s:Label text="Specify Text Alignment:"/>
+ <s:DropDownList id="alignVal" prompt="left" change="this.changeHandler()">
+ <s:dataProvider>
+ <mx:ArrayList>
+ <fx:String>left</fx:String>
+ <fx:String>right</fx:String>
+ <fx:String>center</fx:String>
+ <fx:String>justify</fx:String>
+ <fx:String>start</fx:String>
+ <fx:String>end</fx:String>
+ </mx:ArrayList>
+ </s:dataProvider>
+ </s:DropDownList>
+ </s:HGroup>
+ <s:HGroup verticalAlign="middle">
+ <s:Label text="Direction:"/>
+ <s:DropDownList id="direction" prompt="ltr" change="this.changeHandler()">
+ <s:dataProvider>
+ <mx:ArrayList>
+ <fx:String>ltr</fx:String>
+ <fx:String>rtl</fx:String>
+ </mx:ArrayList>
+ </s:dataProvider>
+ </s:DropDownList>
+ </s:HGroup>
+ <s:HGroup verticalAlign="middle">
+ <s:Label text="Specify characters to restrict (use - for range):"/>
+ <s:TextInput id="restrictStr" change="this.changeHandler()" text="a-z 1-9"/>
+ </s:HGroup>
+ <s:VGroup>
+ <s:Label text="Text:"/>
+ <s:TextArea id="txt" width="300" height="70" color="0x323232" horizontalCenter="0" verticalCenter="0" restrict="a-z 1-9"
+ change="this.changeHandler()"/>
+ </s:VGroup>
+ </s:VGroup>
+ <s:Label width="200" color="#323232" top="20" right="80"
+ text="TextArea is a text-entry control that lets users enter and edit multiple lines of richly formatted text.
+It can display horizontal and vertical scrollbars for scrolling through the text and supports vertical scrolling with the mouse wheel. This sample also shows
+how you can restrict character input on the text area. The default when this is run will not allow the number 0 or caps based on the restrict range shown. The
+sample also shows how you can specify a direction on the text."/>
+ </s:HGroup>
+
+ </s:Panel>
+</s:Application>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/controls/TextInputExample.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/controls/TextInputExample.mxml b/TourDeFlex/TourDeFlex3/src/spark/controls/TextInputExample.mxml
new file mode 100644
index 0000000..e548ab1
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/controls/TextInputExample.mxml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ viewSourceURL="srcview/index.html">
+ <fx:Script>
+ <![CDATA[
+ import spark.events.TextOperationEvent;
+
+ private function txtChangeHandler(event:TextOperationEvent):void
+ {
+ var textInput:TextInput = event.target as TextInput;
+ textInput.clearStyle("color");
+ }
+
+
+ protected function changeHandler(event:MouseEvent):void
+ {
+ txt.maxChars = this.maxChars.value;
+ txt.restrict = this.restrictStr.text;
+ txt.textDisplay.textFlow.textAlign = alignVal.selectedItem;
+ txt.textDisplay.textFlow.direction = direction.selectedItem;
+ }
+
+ ]]>
+ </fx:Script>
+
+ <s:Panel skinClass="skins.TDFPanelSkin"
+ width="100%" height="100%"
+ title="TextInput Sample">
+
+ <s:VGroup top="20" width="100%" height="100%" left="200">
+ <s:HGroup verticalAlign="middle">
+ <s:Label text="Specify Max Character Input:"/>
+ <s:NumericStepper id="maxChars" value="30" stepSize="2" change="this.changeHandler(null)"/>
+ </s:HGroup>
+ <s:HGroup verticalAlign="middle">
+ <s:Label text="Specify Text Alignment:"/>
+ <s:DropDownList id="alignVal" prompt="left" change="this.changeHandler(null)">
+ <s:dataProvider>
+ <mx:ArrayList>
+ <fx:String>left</fx:String>
+ <fx:String>right</fx:String>
+ <fx:String>center</fx:String>
+ <fx:String>justify</fx:String>
+ <fx:String>start</fx:String>
+ <fx:String>end</fx:String>
+ </mx:ArrayList>
+ </s:dataProvider>
+ </s:DropDownList>
+ </s:HGroup>
+ <s:HGroup verticalAlign="middle">
+ <s:Label text="Direction:"/>
+ <s:DropDownList id="direction" prompt="ltr" change="this.changeHandler(null)">
+ <s:dataProvider>
+ <mx:ArrayList>
+ <fx:String>rtl</fx:String>
+ <fx:String>ltr</fx:String>
+ </mx:ArrayList>
+ </s:dataProvider>
+ </s:DropDownList>
+ </s:HGroup>
+ <s:HGroup verticalAlign="middle">
+ <s:Label text="Specify characters to restrict (use - for range):"/>
+ <s:TextInput id="restrictStr" change="this.changeHandler(null)"/>
+ </s:HGroup>
+ <s:HGroup verticalAlign="middle">
+ <s:Label text="Text Input:"/>
+ <s:TextInput id="txt" maxChars="{maxChars.value}" maxWidth="150"
+ change="txtChangeHandler(event)" textAlign="{alignVal.selectedItem}"/>
+ </s:HGroup>
+ <mx:Spacer height="10"/>
+ <s:Label width="85%" horizontalCenter="0" color="#323232"
+ text="TextInput is a text-entry control that lets users enter and edit a single line of uniformly-formatted text.
+This Spark version of TextInput makes use of the Text Layout Framework (TLF). Numerous properties are available to be set using the
+textFlow object from the TLF framework. Uses of some are shown above."/>
+ </s:VGroup>
+
+ </s:Panel>
+
+
+</s:Application>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/controls/TextLayout1Example.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/controls/TextLayout1Example.mxml b/TourDeFlex/TourDeFlex3/src/spark/controls/TextLayout1Example.mxml
new file mode 100644
index 0000000..456f390
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/controls/TextLayout1Example.mxml
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
+ xmlns:local="*" creationComplete="init()" viewSourceURL="srcview/index.html">
+
+ <!-- Based on original code from here and updated and enhanced for Flex 4:
+ http://www.adobe.com/devnet/flex/articles/text_layout_framework_04.html
+ -->
+
+ <fx:Script>
+ <![CDATA[
+ import flashx.textLayout.container.ContainerController;
+ import flashx.textLayout.conversion.ITextImporter;
+ import flashx.textLayout.conversion.TextConverter;
+ import flashx.textLayout.edit.EditManager;
+ import flashx.textLayout.edit.ISelectionManager;
+ import flashx.textLayout.edit.SelectionState;
+ import flashx.textLayout.elements.InlineGraphicElement;
+ import flashx.textLayout.elements.ParagraphElement;
+ import flashx.textLayout.elements.TextFlow;
+ import flashx.textLayout.events.SelectionEvent;
+ import flashx.textLayout.events.StatusChangeEvent;
+ import flashx.textLayout.formats.Direction;
+ import flashx.textLayout.formats.TextLayoutFormat;
+ import flashx.undo.UndoManager;
+
+ import mx.collections.ArrayCollection;
+ import mx.controls.CheckBox;
+ import mx.events.FlexEvent;
+ import mx.events.SliderEvent;
+
+ import skins.TDFPanelSkin;
+
+ import spark.components.Group;
+ import spark.core.SpriteVisualElement;
+
+ public var directions:ArrayCollection = new ArrayCollection(
+ [
+ {label:"Left-to-Right", data:Direction.LTR},
+ {label:"Right-to-Left", data:Direction.RTL}
+ ]
+ );
+
+ [Embed(source="assets/ApacheFlexLogo.png")]
+ [Bindable]
+ static public var imgClass:Class;
+
+ private var _textContainer:SpriteVisualElement = null;
+
+ private static const textInput:XML = <TextFlow xmlns="http://ns.adobe.com/textLayout/2008">
+ <div>
+ <p><span>The Text Layout Framework is an extensible library, built on the new text engine in Adobe Flash Player 10, which delivers advanced, easy-to-integrate typographic and text layout features for rich, sophisticated and innovative typography on the web.
+ Some benefits provided by this framework include: 1) rich typographical controls, including kerning, ligatures, typographic case, digit case, digit width and discretionary hyphens
+ 2) cut, copy, paste, undo and standard keyboard and mouse gestures for editing 3) selection, editing and flowing text across multiple columns and linked containers
+ 4) bidirectional text, vertical text and over 30 writing scripts including Arabic, Hebrew, Chinese, Japanese, Korean, Thai, Lao, Vietnamese, and others
+ 5) vertical text, Tate-Chu-Yoko (horizontal within vertical text) and justifier for East Asian typography. Try editing this text and playing with the options below! Notice an inline image is also included.</span></p>
+ </div>
+ </TextFlow>;
+
+ private var _textFlow:TextFlow;
+
+ private function init():void {
+
+ _textContainer = new SpriteVisualElement();
+
+ canvas.addElement(_textContainer);
+ var importer:ITextImporter = TextConverter.getImporter(TextConverter.TEXT_LAYOUT_FORMAT);
+ importer.throwOnError = true; // will throw exception if parsing error occurs on import
+
+ _textFlow = importer.importToFlow(textInput);
+ _textFlow.flowComposer.addController(new ContainerController(_textContainer, canvas.width-40, canvas.height));
+
+ // add the graphic
+ var p:ParagraphElement = new ParagraphElement();
+ var inlineGraphicElement:InlineGraphicElement = new InlineGraphicElement();
+ inlineGraphicElement.source = imgClass;
+ inlineGraphicElement.width=32;
+ inlineGraphicElement.height=32;
+ p.addChild(inlineGraphicElement);
+ _textFlow.addChild(p);
+
+ //adding Select/Edit/Copy/Paste/Undo features
+ _textFlow.interactionManager = new EditManager(new UndoManager());
+
+ // initialize with a selection before the first character
+ _textFlow.interactionManager.selectRange(0,0);
+ _textFlow.flowComposer.updateAllControllers();
+ }
+
+ private function changeFontSize(event:Event):void {
+ _textFlow.fontSize = fontSize.value;
+ _textFlow.direction = direction.selectedItem.data;
+ _textFlow.flowComposer.updateAllControllers();
+ }
+
+ private function changeNoColumns(event:Event):void {
+ var tlf:TextLayoutFormat = new TextLayoutFormat();
+ tlf.columnCount = cols.value;
+ tlf.columnGap = 15;
+ tlf.direction = direction.selectedItem.data;
+ _textFlow.format = tlf;
+ _textFlow.flowComposer.updateAllControllers();
+ }
+
+ private function changeTextDirection(event:Event):void {
+ _textFlow.direction = (event.target as DropDownList).selectedItem.data;
+ _textFlow.flowComposer.updateAllControllers();
+ }
+
+ protected function undo_clickHandler(event:MouseEvent):void
+ {
+ var em:EditManager = _textFlow.interactionManager as EditManager;
+ trace("Can undo " + em.undoManager.canUndo() + " can redo " + em.undoManager.canRedo());
+ em.undoManager.undo();
+ }
+ protected function redo_clickHandler(event:MouseEvent):void
+ {
+ var em:EditManager = _textFlow.interactionManager as EditManager;
+ em.undoManager.redo();
+ }
+
+ ]]>
+ </fx:Script>
+ <s:Panel skinClass="skins.TDFPanelSkin" title="Text Layout Framework Sample" width="100%" height="100%">
+ <s:layout>
+ <s:VerticalLayout paddingTop="8" paddingLeft="8"/>
+ </s:layout>
+
+ <s:VGroup>
+ <s:Group id="canvas" width="600" height="200" />
+ <s:HGroup width="100%" verticalAlign="middle">
+ <s:Label text="Font Size:"/>
+ <s:NumericStepper id="fontSize" minimum="6" maximum="22" snapInterval="1" change="changeFontSize(event)" value="12" />
+ <s:Label text="# Columns:"/>
+ <s:NumericStepper id="cols" minimum="1" maximum="20" snapInterval="1" change="changeNoColumns(event)" />
+ <s:Label text="Text Direction:"/>
+ <s:DropDownList id="direction" change="changeTextDirection(event)" dataProvider="{directions}"
+ selectedItem="{directions[0]}"/>
+ <s:Button label="Undo" click="undo_clickHandler(event)"/>
+ <s:Button label="Redo" click="redo_clickHandler(event)"/>
+ </s:HGroup>
+ </s:VGroup>
+ </s:Panel>
+
+</s:Application>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/controls/TextLayout2Example.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/controls/TextLayout2Example.mxml b/TourDeFlex/TourDeFlex3/src/spark/controls/TextLayout2Example.mxml
new file mode 100644
index 0000000..b21ddae
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/controls/TextLayout2Example.mxml
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx" maxWidth="690" maxHeight="300"
+ creationComplete="init()">
+
+<!-- This sample is based on this page: http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3_Flex/WS0d70b2a8565d75766ba6608d121cc29f375-8000.html -->
+
+ <fx:Script>
+ <![CDATA[
+ import flash.display.StageAlign;
+ import flash.display.StageScaleMode;
+ import flash.events.Event;
+ import flash.geom.Rectangle;
+
+ import flashx.textLayout.compose.StandardFlowComposer;
+ import flashx.textLayout.container.ContainerController;
+ import flashx.textLayout.container.ScrollPolicy;
+ import flashx.textLayout.conversion.TextConverter;
+ import flashx.textLayout.elements.TextFlow;
+ import flashx.textLayout.formats.TextLayoutFormat;
+
+ import spark.core.SpriteVisualElement;
+
+ private var hTextFlow:TextFlow;
+ private var headContainer:SpriteVisualElement;
+ private var headlineController:ContainerController;
+ private var hContainerFormat:TextLayoutFormat;
+
+ private var bTextFlow:TextFlow;
+ private var bodyTextContainer:SpriteVisualElement;
+ private var bodyController:ContainerController;
+ private var bodyTextContainerFormat:TextLayoutFormat;
+
+ private const headlineMarkup:String = "<flow:TextFlow xmlns:flow='http://ns.adobe.com/textLayout/2008'><flow:p textAlign='center'><flow:span fontFamily='Helvetica' fontSize='18'>TLF News Layout Example</flow:span><flow:br/><flow:span fontFamily='Helvetica' fontSize='14'>This example formats text like a newspaper page with a headline, a subtitle, and multiple columns</flow:span></flow:p></flow:TextFlow>";
+
+ private const bodyMarkup:String = "<flow:TextFlow xmlns:flow='http://ns.adobe.com/textLayout/2008' fontSize='12' textIndent='10' marginBottom='15' paddingTop='4' paddingLeft='4'><flow:p marginBottom='inherit'><flow:span>There are many </flow:span><flow:span fontStyle='italic'>such</flow:span><flow:span> lime-kilns in that tract of country, for the purpose of burning the white marble which composes a large part of the substance of the hills. Some of them, built years ago, and long deserted, with weeds growing in the vacant round of the interior, which is open to the sky, and grass and wild-flowers rooting themselves into the chinks of the stones, look already like relics of antiquity, and may yet be overspread with the lichens of centuries to come. Others, where the lime-burner still feeds his daily and nightlong fire, afford points of interest to the wanderer among the hills, who seats himself on a log of wood or a fragment of marble, to hold a chat with the solitary man. It is a
lonesome, and, when the character is inclined to thought, may be an intensely thoughtful occupation; as it proved in the case of Ethan Brand, who had mused to such strange purpose, in days gone by, while the fire in this very kiln was burning.</flow:span></flow:p><flow:p marginBottom='inherit'><flow:span>The man who now watched the fire was of a different order, and troubled himself with no thoughts save the very few that were requisite to his business. At frequent intervals, he flung back the clashing weight of the iron door, and, turning his face from the insufferable glare, thrust in huge logs of oak, or stirred the immense brands with a long pole.</flow:span></flow:p></flow:TextFlow>";
+
+ public function init()
+ {
+ // Headline text flow and flow composer
+ hTextFlow = TextConverter.importToFlow(headlineMarkup, TextConverter.TEXT_LAYOUT_FORMAT);
+ hTextFlow.flowComposer = new StandardFlowComposer();
+
+ // initialize the headline container and controller objects
+ headContainer = new SpriteVisualElement();
+ headlineController = new ContainerController(headContainer);
+ headlineController.verticalScrollPolicy = ScrollPolicy.OFF;
+ hContainerFormat = new TextLayoutFormat();
+ hContainerFormat.paddingTop = 4;
+ hContainerFormat.paddingRight = 4;
+ hContainerFormat.paddingBottom = 4;
+ hContainerFormat.paddingLeft = 4;
+
+ headlineController.format = hContainerFormat;
+ hTextFlow.flowComposer.addController(headlineController);
+ addElement(headContainer);
+ this.addEventListener(flash.events.Event.RESIZE, resizeHandler);
+
+ // Body text TextFlow and flow composer
+ bTextFlow = TextConverter.importToFlow(bodyMarkup, TextConverter.TEXT_LAYOUT_FORMAT);
+ bTextFlow.flowComposer = new StandardFlowComposer();
+
+ // The body text container is below, and has three columns
+ bodyTextContainer = new SpriteVisualElement();
+ bodyController = new ContainerController(bodyTextContainer);
+ bodyTextContainerFormat = new TextLayoutFormat();
+ bodyTextContainerFormat.columnCount = 4;
+ bodyTextContainerFormat.columnGap = 30;
+
+ bodyController.format = bodyTextContainerFormat;
+ bTextFlow.flowComposer.addController(bodyController);
+ addElement(bodyTextContainer);
+ resizeHandler(null);
+ }
+
+ private function resizeHandler(event:Event):void
+ {
+ trace("Resizing!");
+ const verticalGap:Number = 25;
+ const stagePadding:Number = 16;
+ var stageWidth:Number = this.width - stagePadding;
+ var stageHeight:Number = this.height - stagePadding;
+ var headlineWidth:Number = stageWidth;
+ var headlineContainerHeight:Number = stageHeight;
+
+ // Initial compose to get height of headline after resize
+ headlineController.setCompositionSize(headlineWidth, headlineContainerHeight);
+ hTextFlow.flowComposer.compose();
+ var rect:Rectangle = headlineController.getContentBounds();
+ headlineContainerHeight = rect.height;
+
+ // Initial compose to get height of headline after resize
+ headlineController.setCompositionSize(headlineWidth, headlineContainerHeight);
+ hTextFlow.flowComposer.compose();
+ var rect:Rectangle = headlineController.getContentBounds();
+ headlineContainerHeight = rect.height;
+
+ // Resize and place headline text container
+ // Call setCompositionSize() again with updated headline height
+ headlineController.setCompositionSize(headlineWidth, headlineContainerHeight );
+ headlineController.container.x = stagePadding / 2;
+ headlineController.container.y = stagePadding / 2;
+ hTextFlow.flowComposer.updateAllControllers();
+
+ // Resize and place body text container
+ var bodyContainerHeight:Number = (stageHeight - verticalGap - headlineContainerHeight);
+ bodyController.format = bodyTextContainerFormat;
+ bodyController.setCompositionSize(stageWidth, bodyContainerHeight );
+ bodyController.container.x = (stagePadding/2);
+ bodyController.container.y = (stagePadding/2) + headlineContainerHeight + verticalGap;
+ bTextFlow.flowComposer.updateAllControllers();
+ }
+ ]]>
+ </fx:Script>
+
+</s:Application>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/controls/TextLayout3example.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/controls/TextLayout3example.mxml b/TourDeFlex/TourDeFlex3/src/spark/controls/TextLayout3example.mxml
new file mode 100644
index 0000000..f776e46
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/controls/TextLayout3example.mxml
@@ -0,0 +1,88 @@
+<?xml version="1.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.
+
+-->
+<s:Application
+ xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ creationComplete="init()">
+
+ <fx:Declarations>
+ <fx:XML id="textFlowAsXML" source="MyTextFlow.xml" />
+ </fx:Declarations>
+
+ <fx:Style>
+ @namespace "library://ns.adobe.com/flex/spark";
+ Label {
+ baseColor: #000000;
+ fontFamily: "Verdana";
+ fontSize: "12";
+ advancedAntiAliasing: true;
+ }
+
+ </fx:Style>
+ <fx:Script><![CDATA[
+ import flashx.textLayout.conversion.TextConverter;
+ import flashx.textLayout.elements.TextFlow;
+
+ import spark.utils.TextFlowUtil;
+ XML.ignoreWhitespace = false;
+ private function init():void {
+ // Creates a TextFlow by importing a String containing the markup language used by the Text Layout Framework.
+ // If you specify it, don't forget the namespace -> xmlns="http://ns.adobe.com/textLayout/2008"
+ var markup:String = "<TextFlow xmlns='http://ns.adobe.com/textLayout/2008'><p fontFamily='Arial'>This is TLF markup with paragraphs.</p><p color='0x663399'>The root TextFlow tag is inlcuded.</p></TextFlow>";
+ rt1.textFlow = TextFlowUtil.importFromString(markup);
+
+ // This next string shows that if the root TextFlow tag is omitted, it will be added for you.
+ markup = "<p color='0xCE267D'>This is TLF markup with paragraphs.</p><p fontSize='10' fontWeight='bold' fontFamily='Arial'>The root TextFlow tag is omitted and therefore created automatically.</p>";
+ rt2.textFlow = TextFlowUtil.importFromString(markup);
+
+ // This line shows how you would import plain text with no paragraph spacing
+ var autoMarkup:String = "This is just a plain old string that has no markup within it.";
+ rt3.textDisplay.textFlow = TextFlowUtil.importFromString(autoMarkup);
+
+ // This example shows how you can use the TextConverter class from TLF to import HTML formatted text
+ // See the docs for the subset of HTML that is supported:
+ // http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flashx/textLayout/conversion/TextConverter.html#TEXT_FIELD_HTML_FORMAT
+ var myHTML:String = "<p>This is <i>HTML</i> markup.<br><b>Hello Tour de Flex Users!</b></p>";
+ rt4.textFlow = TextConverter.importToFlow(myHTML,TextConverter.TEXT_FIELD_HTML_FORMAT);
+ }
+ ]]></fx:Script>
+
+ <s:Panel skinClass="skins.TDFPanelSkin" title="Importing Text using TLF and Flex 4" width="100%" height="100%">
+ <s:layout>
+ <s:HorizontalLayout paddingTop="8" paddingLeft="8" paddingRight="12"/>
+ </s:layout>
+
+ <s:VGroup>
+ <s:RichText id="rt1" width="200"/>
+ <s:TextArea id="rt2" width="300" height="50"/>
+ <s:TextInput id="rt3" width="260"/>
+ <s:RichEditableText id="rt4" width="200"/>
+
+ <s:RichText id="rt5" width="280"
+ textFlow="{TextFlowUtil.importFromXML(textFlowAsXML)}"
+ horizontalCenter="0" verticalCenter="0" />
+ </s:VGroup>
+ <s:Label width="200" color="0x323232" verticalAlign="justify" text="This sample shows how you can use different types of text markup within
+the Flex 4 components that are based on TLF through an import. This can be especially useful for dynamically loading text
+that is returned from an HTTPService call at runtime for instance."/>
+
+ </s:Panel>
+</s:Application>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/controls/TextLayout4Example.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/controls/TextLayout4Example.mxml b/TourDeFlex/TourDeFlex3/src/spark/controls/TextLayout4Example.mxml
new file mode 100644
index 0000000..50af0d4
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/controls/TextLayout4Example.mxml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<!-- Sample derived from: http://help.adobe.com/en_US/Flex/4.0/UsingSDK/WS02f7d8d4857b1677-165a04e1126951a2d98-7ff8.html -->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx">
+
+ <fx:Script>
+ <![CDATA[
+ import flashx.textLayout.conversion.TextConverter;
+
+ XML.ignoreWhitespace = false;
+ ]]>
+ </fx:Script>
+ <fx:Style>
+ @namespace "library://ns.adobe.com/flex/spark";
+ Label {
+ baseColor: #000000;
+ fontFamily: "Verdana";
+ fontSize: "12";
+ advancedAntiAliasing: true;
+ }
+ </fx:Style>
+ <fx:Declarations>
+ <!-- Define a String to use with HTML and plain text format. -->
+ <fx:String id="htmlTextAsHTML"><![CDATA[<p>Text containing <b>HTML</b> markup</p>]]></fx:String>
+
+ <!-- Define an XML object to use with TLF format. -->
+ <fx:XML id="tfTextAsTextFlow">
+ <TextFlow xmlns="http://ns.adobe.com/textLayout/2008">
+ <p>Text Using <span fontWeight="bold">Text Layout Framework</span> Markup</p>
+ </TextFlow>
+ </fx:XML>
+ </fx:Declarations>
+
+ <s:Panel skinClass="skins.TDFPanelSkin" title="Text Import Format Types Sample" width="100%" height="100%">
+ <s:layout>
+ <s:HorizontalLayout paddingTop="8" paddingLeft="8" paddingRight="12"/>
+ </s:layout>
+
+ <s:Label verticalAlign="justify" width="200" text="This example shows how you can use different format types for importing text
+and what the result will be in the Flex 4 component shown."/>
+ <s:VGroup>
+ <s:TextArea id="txt1" width="200" height="50"
+ textFlow="{TextConverter.importToFlow(htmlTextAsHTML, TextConverter.TEXT_FIELD_HTML_FORMAT)}"
+ horizontalCenter="0" verticalCenter="0" />
+
+ <s:Label text="Same marked up text with plain format specified:"/>
+ <s:TextArea id="txt2" height="50" width="200"
+ textFlow="{TextConverter.importToFlow(htmlTextAsHTML, TextConverter.PLAIN_TEXT_FORMAT)}"
+ horizontalCenter="0" verticalCenter="0" />
+
+ <s:TextArea id="txt3" width="200" height="50"
+ textFlow="{TextConverter.importToFlow(tfTextAsTextFlow, TextConverter.TEXT_LAYOUT_FORMAT)}"
+ horizontalCenter="0" verticalCenter="0" />
+ </s:VGroup>
+
+ </s:Panel>
+
+</s:Application>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/controls/assets/ApacheFlexLogo.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/controls/assets/ApacheFlexLogo.png b/TourDeFlex/TourDeFlex3/src/spark/controls/assets/ApacheFlexLogo.png
new file mode 100644
index 0000000..4ff037f
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/controls/assets/ApacheFlexLogo.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/effects/WipeExample.html
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/effects/WipeExample.html b/TourDeFlex/TourDeFlex3/src/spark/effects/WipeExample.html
new file mode 100644
index 0000000..37d9446
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/effects/WipeExample.html
@@ -0,0 +1,121 @@
+<!--
+ 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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- saved from url=(0014)about:internet -->
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+ <!--
+ Smart developers always View Source.
+
+ This application was built using Adobe Flex, an open source framework
+ for building rich Internet applications that get delivered via the
+ Flash Player or to desktops via Adobe AIR.
+
+ Learn more about Flex at http://flex.org
+ // -->
+ <head>
+ <title></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <!-- Include CSS to eliminate any default margins/padding and set the height of the html element and
+ the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as
+ the percentage of the height of its parent container, which has to be set explicitly. Initially,
+ don't display flashContent div so it won't show if JavaScript disabled.
+ -->
+ <style type="text/css" media="screen">
+ html, body { height:100%; }
+ body { margin:0; padding:0; overflow:auto; text-align:center;
+ background-color: #ffffff; }
+ #flashContent { display:none; }
+ </style>
+
+ <!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
+ <!-- BEGIN Browser History required section -->
+ <link rel="stylesheet" type="text/css" href="history/history.css" />
+ <script type="text/javascript" src="history/history.js"></script>
+ <!-- END Browser History required section -->
+
+ <script type="text/javascript" src="swfobject.js"></script>
+ <script type="text/javascript">
+ <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. -->
+ var swfVersionStr = "10.0.0";
+ <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
+ var xiSwfUrlStr = "playerProductInstall.swf";
+ var flashvars = {};
+ var params = {};
+ params.quality = "high";
+ params.bgcolor = "#ffffff";
+ params.allowscriptaccess = "sameDomain";
+ params.allowfullscreen = "true";
+ var attributes = {};
+ attributes.id = "sample";
+ attributes.name = "sample";
+ attributes.align = "middle";
+ swfobject.embedSWF(
+ "sample.swf", "flashContent",
+ "100%", "100%",
+ swfVersionStr, xiSwfUrlStr,
+ flashvars, params, attributes);
+ <!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
+ swfobject.createCSS("#flashContent", "display:block;text-align:left;");
+ </script>
+ </head>
+ <body>
+ <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough
+ JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
+ when JavaScript is disabled.
+ -->
+ <div id="flashContent">
+ <p>
+ To view this page ensure that Adobe Flash Player version
+ 10.0.0 or greater is installed.
+ </p>
+ <script type="text/javascript">
+ var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://");
+ document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='"
+ + pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" );
+ </script>
+ </div>
+
+ <noscript>
+ <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" id="sample">
+ <param name="movie" value="sample.swf" />
+ <param name="quality" value="high" />
+ <param name="bgcolor" value="#ffffff" />
+ <param name="allowScriptAccess" value="sameDomain" />
+ <param name="allowFullScreen" value="true" />
+ <!--[if !IE]>-->
+ <object type="application/x-shockwave-flash" data="sample.swf" width="100%" height="100%">
+ <param name="quality" value="high" />
+ <param name="bgcolor" value="#ffffff" />
+ <param name="allowScriptAccess" value="sameDomain" />
+ <param name="allowFullScreen" value="true" />
+ <!--<![endif]-->
+ <!--[if gte IE 6]>-->
+ <p>
+ Either scripts and active content are not permitted to run or Adobe Flash Player version
+ 10.0.0 or greater is not installed.
+ </p>
+ <!--<![endif]-->
+ <a href="http://www.adobe.com/go/getflashplayer">
+ <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
+ </a>
+ <!--[if !IE]>-->
+ </object>
+ <!--<![endif]-->
+ </object>
+ </noscript>
+ </body>
+</html>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/other/ScrollBarsExample.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/other/ScrollBarsExample.mxml b/TourDeFlex/TourDeFlex3/src/spark/other/ScrollBarsExample.mxml
new file mode 100644
index 0000000..664e1ee
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/other/ScrollBarsExample.mxml
@@ -0,0 +1,97 @@
+<?xml version="1.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.
+
+-->
+<!-- controls\bar\SBarSimple.mxml -->
+<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:s="library://ns.adobe.com/flex/spark"
+ xmlns:mx="library://ns.adobe.com/flex/mx" viewSourceURL="srcview/index.html">
+
+ <fx:Script>
+ <![CDATA[
+ import mx.events.ScrollEvent;
+
+ import skins.TDFPanelSkin;
+
+ private function vbarScroll():void {
+ log.text = "VScrollBar properties summary:" + '\n' +
+ "------------------------------------" + '\n' +
+ "Current scroll position: " +
+ bar.value + '\n' +
+ "The maximum scroll position: " +
+ bar.maximum + '\n' +
+ "The minimum scroll position: " +
+ bar.minimum;
+
+ rect.height = bar.value;
+ }
+ private function hbarScroll():void {
+ log.text = "HScrollBar properties summary:" + '\n' +
+ "------------------------------------" + '\n' +
+ "Current scroll position: " +
+ hbar.value + '\n' +
+ "The maximum scroll position: " +
+ hbar.maximum + '\n' +
+ "The minimum scroll position: " +
+ hbar.minimum;
+
+ rect.width = hbar.value;
+ }
+ ]]>
+ </fx:Script>
+ <s:Panel width="100%" height="100%" title="VScrollBar and HScrollBar Sample" skinClass="skins.TDFPanelSkin">
+ <s:layout>
+ <s:HorizontalLayout paddingLeft="5" paddingRight="5" paddingTop="5"/>
+ </s:layout>
+ <s:VGroup>
+ <s:Label
+ width="100%"
+ text="Drag the ScrollBar controls to change the size of the Rectangle graphic."/>
+
+ <s:HGroup>
+ <s:VScrollBar id="bar"
+ height="180"
+ minimum="0"
+ maximum="{bar.height}"
+ stepSize="10"
+ pageSize="10"
+ value="{rect.height}"
+ change="vbarScroll()"/>
+ <s:Rect id="rect" width="50" height="20">
+ <s:fill>
+ <s:LinearGradient rotation="90">
+ <s:GradientEntry color="#6191c3"/>
+ <s:GradientEntry color="#6191c3"/>
+ <s:GradientEntry color="#323232" alpha=".3"/>
+ </s:LinearGradient>
+ </s:fill>
+ </s:Rect>
+ </s:HGroup>
+ <s:HScrollBar id="hbar" width="180" value="{rect.width}"
+ minimum="0" maximum="{hbar.width}" stepSize="10" pageSize="10" change="hbarScroll()"/>
+ </s:VGroup>
+ <s:VGroup width="200">
+ <s:TextArea id="log" editable="false" height="88"/>
+
+ <s:Label color="0x323232" width="188" text="The ScrollBar controls (HScrollBar and VScrollBar) can be used stand-alone, but typically you would combine it as part of
+another group of components to provide scrolling functionality. "/>
+ </s:VGroup>
+
+ </s:Panel>
+
+</s:Application>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/TextLayoutEditorCanvas.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/TextLayoutEditorCanvas.mxml b/TourDeFlex/TourDeFlex3/src/spark/tlf/TextLayoutEditorCanvas.mxml
new file mode 100644
index 0000000..019fe00
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/TextLayoutEditorCanvas.mxml
@@ -0,0 +1,439 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+
+
+
+
+<mx:Canvas
+ xmlns="http://ns.adobe.com/mxml/2009"
+ xmlns:mx="library://ns.adobe.com/flex/mx"
+ xmlns:flow="library://ns.adobe.com/flashx/textLayout"
+ xmlns:textEditBar="textEditBar.*"
+ xmlns:txui="flashx.textLayout.ui.*"
+ xmlns:txrulers="flashx.textLayout.ui.rulers.*"
+ xmlns:txinsp="flashx.textLayout.ui.inspectors.*"
+ explicitMinWidth="300"
+ explicitMinHeight="200"
+ creationComplete="handleCreationComplete()"
+ resize="handleResize()">
+
+
+ <Script><![CDATA[
+ import flashx.textLayout.container.ContainerController;
+ import flashx.textLayout.debug.assert;
+ import flashx.textLayout.edit.EditManager;
+ import flashx.textLayout.edit.EditingMode;
+ import flashx.textLayout.edit.ElementRange;
+ import flashx.textLayout.edit.ISelectionManager;
+ import flashx.textLayout.edit.SelectionFormat;
+ import flashx.textLayout.edit.SelectionManager;
+ import flashx.textLayout.edit.SelectionState;
+ import flashx.textLayout.elements.Configuration;
+ import flashx.textLayout.elements.InlineGraphicElementStatus;
+ import flashx.textLayout.elements.ParagraphElement;
+ import flashx.textLayout.elements.SpanElement;
+ import flashx.textLayout.elements.TextFlow;
+ import flashx.textLayout.events.SelectionEvent;
+ import flashx.textLayout.events.StatusChangeEvent;
+ import flashx.textLayout.formats.TextLayoutFormat;
+ import flashx.undo.IUndoManager;
+ import flashx.undo.UndoManager;
+
+ import textEditBar.FileIOHelper;
+ import flashx.textLayout.ui.inspectors.TextInspectorController;
+
+ import mx.events.IndexChangedEvent;
+
+ private var resizeOK:Boolean;
+ public var activeFlow:TextFlow;
+
+ // undo/redo manager
+ private var undoManager:IUndoManager;
+
+ private var bottomPanels:Array = [];
+
+
+ public function handleCreationComplete(): void
+ {
+ initializeConfiguration();
+ FileIOHelper.parentWindow = this;
+ FileIOHelper.changeContent = changeContent;
+
+ resizeOK = true;
+ handleResize();
+
+ undoManager = new UndoManager();
+
+ hruler.creationComplete();
+ vruler.creationComplete();
+
+ var numPanels:int = bottomTabs.numChildren;
+ for (var i:int = 0; i < numPanels; ++i)
+ {
+ var panel:Canvas = bottomTabs.getChildAt(i) as Canvas;
+ bottomPanels.push(panel.getChildAt(0));
+ if (i > 0)
+ panel.removeAllChildren();
+ }
+ bottomTabs.addEventListener(IndexChangedEvent.CHANGE, onBottomTabChanged);
+
+ this.addEventListener(Event.ACTIVATE, onFocus);
+
+ changeContent(createEmptyFlow());
+ callLater(doFocus);
+ }
+
+ private function doFocus():void
+ {
+ if (activeFlow)
+ {
+ var selMgr:ISelectionManager = activeFlow.interactionManager;
+ if (selMgr && textPanel.visible)
+ selMgr.setFocus();
+ }
+ }
+ private function createEmptyFlow():TextFlow
+ {
+ var newFlow:TextFlow = new TextFlow();
+ var para:ParagraphElement = new ParagraphElement();
+ para.addChild(new SpanElement());
+ newFlow.addChild(para);
+ return newFlow;
+ }
+
+ private function initializeConfiguration():void
+ {
+ var config:Configuration = TextFlow.defaultConfiguration;
+ config.unfocusedSelectionFormat = new SelectionFormat(0xffffff, 1.0, BlendMode.DIFFERENCE, 0xffffff, 1.0, BlendMode.DIFFERENCE, 0);
+ config.inactiveSelectionFormat = new SelectionFormat(0xffffff, 1.0, BlendMode.DIFFERENCE, 0xffffff, 1.0, BlendMode.DIFFERENCE, 0);
+ config.manageTabKey = true;
+ var initialFormat:TextLayoutFormat = new TextLayoutFormat();
+ initialFormat.fontFamily = "Arial";
+ initialFormat.fontSize = 16;
+ initialFormat.paddingLeft = 2;
+ initialFormat.paddingTop = 2;
+ initialFormat.paddingRight = 2;
+ initialFormat.paddingBottom = 2;
+ config.textFlowInitialFormat = initialFormat;
+ }
+
+ private function onFocus(event:Event):void
+ {
+ if (activeFlow)
+ {
+ var selMgr:ISelectionManager = activeFlow.interactionManager;
+ if(selMgr)
+ selMgr.setFocus();
+ }
+
+ }
+ private function onBottomTabChanged(evt:IndexChangedEvent):void
+ {
+ var panel:Canvas = bottomTabs.getChildAt(evt.oldIndex) as Canvas;
+ panel.removeAllChildren();
+ panel = bottomTabs.getChildAt(evt.newIndex) as Canvas;
+ panel.addChild(bottomPanels[evt.newIndex]);
+ }
+
+ private var editingMode:String = EditingMode.READ_WRITE;
+
+ private function keyListener(event:KeyboardEvent):void
+ {
+ if (event.keyCode == Keyboard.ESCAPE)
+ activeFlow.interactionManager.selectRange(-1,-1);
+ }
+
+ private function updateEscapeKeyListener():void
+ {
+ for (var i:int = 0; i < activeFlow.flowComposer.numControllers; i++)
+ {
+ var controller:ContainerController = activeFlow.flowComposer.getControllerAt(i);
+ var container:DisplayObject = controller.container as DisplayObject;
+ if (activeFlow.interactionManager)
+ container.addEventListener(KeyboardEvent.KEY_DOWN, keyListener,false,0,true);
+ else
+ container.removeEventListener(KeyboardEvent.KEY_DOWN, keyListener);
+ }
+ }
+
+ public function setActiveFlow(newActiveFlow:TextFlow):void
+ {
+ TextInspectorController.Instance().activeFlow = newActiveFlow;
+ for (var i:int = bottomPanels.length - 1; i >= 0; --i)
+ bottomPanels[i].activeFlow = newActiveFlow;
+ }
+
+ public function setInteractionManager(selectType:String):void
+ {
+ editingMode = selectType;
+ var uiActiveFlow:TextFlow = null;
+
+ if (activeFlow)
+ {
+ switch (selectType)
+ {
+ case EditingMode.READ_ONLY:
+ if (activeFlow.interactionManager)
+ activeFlow.interactionManager = null;
+ break;
+ case EditingMode.READ_WRITE:
+ // either direction should work.
+ new EditManager(undoManager).textFlow = activeFlow;
+ activeFlow.interactionManager = new EditManager(undoManager);
+
+ activeFlow.addEventListener(SelectionEvent.SELECTION_CHANGE,mySelectionChangeListener,false,0,true);
+ uiActiveFlow = activeFlow;
+ activeFlow.interactionManager.selectRange(0, 0);
+ break;
+ case EditingMode.READ_SELECT:
+ activeFlow.interactionManager = new SelectionManager();
+ activeFlow.addEventListener(SelectionEvent.SELECTION_CHANGE,mySelectionChangeListener,false,0,true);
+ break;
+ }
+ setActiveFlow(uiActiveFlow);
+ updateEscapeKeyListener();
+ updateForSelectedElementRange(new SelectionState( activeFlow, 0, 0));
+ }
+ }
+
+
+ private function mySelectionChangeListener(e:SelectionEvent):void
+ {
+ updateForSelectedElementRange(e ? e.selectionState : null);
+ }
+
+ /**
+ * Update the GUI for a particular selection range.
+ * @private
+ * @param range may be null
+ */
+ private function updateForSelectedElementRange(selectionState:SelectionState):void
+ {
+ var range:ElementRange = selectionState ? ElementRange.createElementRange(selectionState.textFlow, selectionState.absoluteStart, selectionState.absoluteEnd) : null;
+ var selMgr:ISelectionManager = activeFlow.interactionManager;
+
+ for (var i:int = bottomPanels.length - 1; i >= 0; --i)
+ bottomPanels[i].update(range);
+
+ if (selMgr && textPanel.visible)
+ selMgr.setFocus();
+ }
+
+ /** handleResize - resize the child containers
+ * @param alwaysResize - do the recalucation no matter if the size didn't change
+ */
+ public function handleResize():void
+ {
+ if (resizeOK && activeFlow)
+ {
+ vruler.RedrawRuler();
+ hruler.RedrawRuler();
+ }
+ }
+
+ public function detachActiveFlow(deleteTheComposer:Boolean):void
+ {
+ if (activeFlow && activeFlow.flowComposer != null)
+ {
+ // Detach the containers from the display list
+ for (var idx:int = 0; idx < activeFlow.flowComposer.numControllers; idx++)
+ {
+ var controller:ContainerController = activeFlow.flowComposer.getControllerAt(idx);
+ var oldContainer:DisplayObject = controller.container;
+ if (oldContainer && oldContainer.parent)
+ {
+ Canvas(oldContainer.parent).rawChildren.removeChild(oldContainer);
+ }
+ }
+ activeFlow.flowComposer.removeAllControllers();
+
+ // also shuts down inline graphics - need another API if we want to do this another way
+ if (deleteTheComposer)
+ activeFlow.flowComposer = null;
+ }
+ }
+
+ private function recomposeOnLoadComplete(e:StatusChangeEvent):void
+ {
+ if (e.status == InlineGraphicElementStatus.ERROR)
+ trace("IOERROR loading inlinegraphicelement",e.errorEvent.toString());
+ if (e.element.getTextFlow() == activeFlow && e.status == InlineGraphicElementStatus.SIZE_PENDING)
+ activeFlow.flowComposer.updateAllControllers();
+ }
+
+ public function changeContent(newFlow:TextFlow):void
+ {
+ // Remove old containers from the display list
+ if (undoManager != null)
+ undoManager.clearAll();
+ if (activeFlow)
+ {
+ detachActiveFlow(true);
+ activeFlow.removeEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE,recomposeOnLoadComplete);
+ }
+
+ // set activeFlow (note: this variable is used in the mxml code below.)
+ activeFlow = newFlow;
+ if (!activeFlow)
+ return;
+
+ activeFlow.addEventListener(StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE,recomposeOnLoadComplete,false,0,true);
+
+ textPanel.changeContainerSetup(activeFlow);
+
+ activeFlow.interactionManager = new EditManager(undoManager);
+ activeFlow.addEventListener(SelectionEvent.SELECTION_CHANGE,mySelectionChangeListener,false,0,true);
+ setActiveFlow(activeFlow);
+ activeFlow.interactionManager.selectRange(0, 0);
+ updateEscapeKeyListener();
+ activeFlow.flowComposer.updateAllControllers();
+
+ vruler.RedrawRuler();
+ hruler.RedrawRuler();
+ }
+
+ /** visiblePanels is an array of the labels of the right-side property panels that are opened.
+ * if you set it, the panels specified will be opened and all others will be closed.
+ */
+ public function set visiblePanels(inPanelNames:Array):void
+ {
+ var panels:Array = inspectorBox.getChildren();
+ for each(var panel:DisplayObject in panels)
+ {
+ if (panel is MultiPanel)
+ {
+ var mp:MultiPanel = panel as MultiPanel;
+ mp.opened = (inPanelNames.indexOf(mp.label) != -1);
+ }
+ }
+ }
+
+ public function get visiblePanels():Array
+ {
+ var result:Array = [];
+ var panels:Array = inspectorBox.getChildren();
+ for each(var panel:DisplayObject in panels)
+ {
+ if (panel is MultiPanel)
+ {
+ var mp:MultiPanel = panel as MultiPanel;
+ if (mp.opened)
+ result.push(mp.label);
+ }
+ }
+ return result;
+ }
+
+ ]]>
+ </Script>
+
+ <mx:VBox
+ width="100%"
+ height="100%"
+ verticalGap="2"
+ backgroundColor="0x607D8A"
+ fontFamily="Myriad Pro"
+ fontWeight="bold">
+ <mx:HBox
+ width="100%"
+ height="100%"
+ horizontalGap="4">
+ <txui:PanelWithEdgeBars
+ id="panelWithScrollBars"
+ width="100%"
+ height="100%"
+ edgeInset="18"
+ gap="1"
+ mainPanel="{textPanel}"
+ topBar="{horizontalRulerBar}"
+ rightBar="{verticalRulerBar}">
+
+ <textEditBar:SingleContainerView id="textPanel"/>
+
+ <mx:Canvas
+ id="verticalRulerBar"
+ verticalScrollPolicy="off"
+ horizontalScrollPolicy="off">
+ <txrulers:RulerBar
+ id="vruler"
+ orientation="vertical"
+ syncToPanel="{textPanel}"
+ tabPropertyEditor="{tabPropEditor}"
+ tabPanelActive="{tabPanel.opened}">
+ </txrulers:RulerBar>
+ </mx:Canvas>
+ <mx:Canvas
+ id="horizontalRulerBar"
+ verticalScrollPolicy="off"
+ horizontalScrollPolicy="off">
+ <txrulers:RulerBar
+ id="hruler"
+ syncToPanel="{textPanel}"
+ tabPropertyEditor="{tabPropEditor}"
+ tabPanelActive="{tabPanel.opened}">
+ </txrulers:RulerBar>
+ </mx:Canvas>
+ </txui:PanelWithEdgeBars>
+ <mx:Canvas
+ width="270"
+ height="100%"
+ horizontalScrollPolicy="off"
+ backgroundColor="#D9D9D9"
+ verticalScrollBarStyleName="scrollbarStyle">
+ <mx:VBox id="inspectorBox" verticalGap="1" width="100%" backgroundColor="#D9D9D9">
+ <txui:MultiPanel id="charPanel" styleName="multiPanel" label="CHARACTER" width="100%">
+ <txinsp:CharacterPropertyEditor active="{charPanel.opened}"/>
+ </txui:MultiPanel>
+ <txui:MultiPanel id="parPanel" styleName="multiPanel" label="PARAGRAPH" width="100%">
+ <txinsp:ParagraphPropertyEditor active="{parPanel.opened}"/>
+ </txui:MultiPanel>
+ <txui:MultiPanel id="tabPanel" styleName="multiPanel" label="TAB" width="100%" opened="false">
+ <txinsp:TabPropertyEditor id="tabPropEditor"/>
+ </txui:MultiPanel>
+ <txui:MultiPanel id="advancedPanel" styleName="multiPanel" label="ADVANCED CHARACTER" width="100%" opened="false">
+ <txinsp:AdvancedTextPropertyEditor active="{advancedPanel.opened}"/>
+ </txui:MultiPanel>
+ <txui:MultiPanel id="antialiasPanel" styleName="multiPanel" label="ANTIALIAS" width="100%" opened="false">
+ <txinsp:AntiAliasPropertyEditor active="{antialiasPanel.opened}"/>
+ </txui:MultiPanel>
+ <txui:MultiPanel id="containerPanel" styleName="multiPanel" label="CONTAINER" width="100%" opened="false">
+ <txinsp:TextContainerPropertyEditor active="{containerPanel.opened}"/>
+ </txui:MultiPanel>
+ <txui:MultiPanel id="flowPanel" styleName="multiPanel" label="FLOW" width="100%" opened="false">
+ <txinsp:TextFlowPropertyEditor active="{flowPanel.opened}"/>
+ </txui:MultiPanel>
+ </mx:VBox>
+ </mx:Canvas>
+ </mx:HBox>
+ <mx:TabNavigator id="bottomTabs" width="100%" creationPolicy="all" paddingLeft="8" backgroundColor="#D9D9D9" color="#202020">
+ <mx:Canvas label="SOURCE" width="100%" height="28">
+ <textEditBar:FileServices id="fileWidget" fileChoose="FileIOHelper.fileChoose(event.fileName)" textLayoutExport="FileIOHelper.textLayoutExport(activeFlow)" htmlExport="FileIOHelper.htmlExport(activeFlow)" includeInLayout="false" width="100%"/>
+ </mx:Canvas>
+ <mx:Canvas label="LINKS" width="100%" height="100%">
+ <textEditBar:LinkBar id="linkElementProps" creationPolicy="all" includeInLayout="false"/>
+ </mx:Canvas>
+ <mx:Canvas label="GRAPHICS" width="100%" height="100%">
+ <textEditBar:GraphicBar id="foreignElementProps" creationPolicy="all" includeInLayout="false"/>
+ </mx:Canvas>
+
+ </mx:TabNavigator>
+ </mx:VBox>
+
+</mx:Canvas>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/TextLayoutEditorSample.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/TextLayoutEditorSample.mxml b/TourDeFlex/TourDeFlex3/src/spark/tlf/TextLayoutEditorSample.mxml
new file mode 100644
index 0000000..efe13ca
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/TextLayoutEditorSample.mxml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+
+
+
+
+<s:Application xmlns="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:local="*" viewSourceURL="srcview/index.html">
+ <local:TextLayoutEditorCanvas width="100%" height="100%"/>
+ <Style source="/flashx/textLayout/ui/VellumGUIStyles.css"/>
+ <!--<Style source="VellumGUIStyles.css"/>-->
+</s:Application>
+
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/%scroll_arrow_down_over.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/%scroll_arrow_down_over.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/%scroll_arrow_down_over.png
new file mode 100644
index 0000000..a209b46
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/%scroll_arrow_down_over.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/%scroll_arrow_up_over.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/%scroll_arrow_up_over.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/%scroll_arrow_up_over.png
new file mode 100644
index 0000000..5e37d0f
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/%scroll_arrow_up_over.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/combo_drop_down_arrow.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/combo_drop_down_arrow.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/combo_drop_down_arrow.png
new file mode 100644
index 0000000..1b905e8
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/combo_drop_down_arrow.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/header_close_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/header_close_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/header_close_icon.png
new file mode 100644
index 0000000..e55928c
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/header_close_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/header_open_icon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/header_open_icon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/header_open_icon.png
new file mode 100644
index 0000000..d3a1b42
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/header_open_icon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/scroll_arrow_down.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/scroll_arrow_down.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/scroll_arrow_down.png
new file mode 100644
index 0000000..f5d8145
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/scroll_arrow_down.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/scroll_arrow_down_over.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/scroll_arrow_down_over.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/scroll_arrow_down_over.png
new file mode 100644
index 0000000..ef66ac6
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/scroll_arrow_down_over.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/scroll_arrow_up.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/scroll_arrow_up.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/scroll_arrow_up.png
new file mode 100644
index 0000000..1d3828d
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/scroll_arrow_up.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/scroll_arrow_up_over.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/scroll_arrow_up_over.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/scroll_arrow_up_over.png
new file mode 100644
index 0000000..2147d32
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/assets/scroll_arrow_up_over.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/UiClasses.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/UiClasses.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/UiClasses.as
new file mode 100644
index 0000000..712e83a
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/UiClasses.as
@@ -0,0 +1,54 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout
+{
+ internal class UiClasses
+ {
+ import flashx.textLayout.ui.inspectors.DynamicTextPropertyEditor; DynamicTextPropertyEditor;
+ import flashx.textLayout.ui.inspectors.SelectionUpdateEvent; SelectionUpdateEvent;
+ import flashx.textLayout.ui.inspectors.TextInspectorController; TextInspectorController;
+ import flashx.textLayout.ui.inspectors.CharacterPropertyEditor; CharacterPropertyEditor;
+ import flashx.textLayout.ui.inspectors.LinkPropertyEditor; LinkPropertyEditor;
+ import flashx.textLayout.ui.inspectors.TabPropertyEditor; TabPropertyEditor;
+ import flashx.textLayout.ui.inspectors.AdvancedTextPropertyEditor; AdvancedTextPropertyEditor;
+ import flashx.textLayout.ui.inspectors.AntiAliasPropertyEditor; AntiAliasPropertyEditor;
+ import flashx.textLayout.ui.inspectors.TextContainerPropertyEditor; TextContainerPropertyEditor;
+ import flashx.textLayout.ui.inspectors.TextFlowPropertyEditor; TextFlowPropertyEditor;
+ import flashx.textLayout.ui.inspectors.ParagraphPropertyEditor; ParagraphPropertyEditor;
+
+ import flashx.textLayout.ui.styles.ScrollbarThumbOverSkin; ScrollbarThumbOverSkin;
+ import flashx.textLayout.ui.styles.ScrollbarTrackSkin; ScrollbarTrackSkin;
+ import flashx.textLayout.ui.styles.ScrollbarThumbUpSkin; ScrollbarThumbUpSkin;
+ import flashx.textLayout.ui.styles.ScrollbarDownArrowUpSkin; ScrollbarDownArrowUpSkin;
+ import flashx.textLayout.ui.styles.ScrollbarUpArrowUpSkin; ScrollbarUpArrowUpSkin;
+ import flashx.textLayout.ui.styles.PopupMenuSkin; PopupMenuSkin;
+
+ import flashx.textLayout.ui.rulers.RulerBar; RulerBar;
+ import flashx.textLayout.ui.rulers.RulerDragTracker; RulerDragTracker;
+ import flashx.textLayout.ui.rulers.RulerMarker; RulerMarker;
+ import flashx.textLayout.ui.rulers.TabMarker; TabMarker;
+ import flashx.textLayout.ui.rulers.TabMarkerSkin; TabMarkerSkin;
+ import flashx.textLayout.ui.rulers.ParagraphPropertyMarker; ParagraphPropertyMarker;
+ import flashx.textLayout.ui.rulers.ParagraphPropertyMarkerSkin; ParagraphPropertyMarkerSkin;
+
+ import flashx.textLayout.ui.MultiPanel; MultiPanel;
+ import flashx.textLayout.ui.MultiPanelHeaderSkin; MultiPanelHeaderSkin;
+ import flashx.textLayout.ui.PanelWithEdgeBars; PanelWithEdgeBars;
+ }
+}
[2/5] Added more spark examples
Posted by jm...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarThumbOverSkin.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarThumbOverSkin.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarThumbOverSkin.as
new file mode 100644
index 0000000..48aa83a
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarThumbOverSkin.as
@@ -0,0 +1,89 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.styles
+{
+ import mx.skins.RectangularBorder;
+ import mx.utils.GraphicsUtil;
+ import flash.display.LineScaleMode;
+ import flash.display.CapsStyle;
+
+ public class ScrollbarThumbOverSkin extends RectangularBorder
+ {
+ public function ScrollbarThumbOverSkin()
+ {
+ super();
+ }
+
+ override public function get measuredWidth():Number
+ {
+ return 11;
+ }
+
+ override public function get measuredHeight():Number
+ {
+ return 10;
+ }
+
+ override protected function updateDisplayList(w:Number, h:Number):void
+ {
+ super.updateDisplayList(w, h);
+
+ var thumbFill:uint = 0x222222;
+ var thumbFillAlpha:Number = 1.0;
+ var thumbStroke:uint = 0x2A2A2A;
+ var thumbStrokeAlpha:Number = 1.0;
+
+ var trackStroke:uint = 0x2A2A2A;
+ var trackStrokeAlpha:Number = 1.0;
+
+ if (getStyle("thumbOverFill") != undefined)
+ thumbFill = getStyle("thumbOverFill");
+ if (getStyle("thumbOverFillAlpha") != undefined)
+ thumbFillAlpha = getStyle("thumbOverFillAlpha");
+ if (getStyle("thumbOverStroke") != undefined)
+ thumbStroke = getStyle("thumbOverStroke");
+ if (getStyle("thumbOverStrokeAlpha") != undefined)
+ thumbStrokeAlpha = getStyle("thumbOverStrokeAlpha");
+ if (getStyle("trackStroke") != undefined)
+ trackStroke = getStyle("trackStroke");
+ if (getStyle("trackStrokeAlpha") != undefined)
+ trackStrokeAlpha = getStyle("trackStrokeAlpha");
+
+ graphics.clear();
+ // draw the top line of the thumb to match the track
+ graphics.lineStyle(1, trackStroke, trackStrokeAlpha);
+ graphics.moveTo(0, 0);
+ graphics.lineTo(w-1, 0);
+
+ // fill in the thumb
+ graphics.beginFill(thumbFill, thumbFillAlpha);
+ graphics.drawRect(0, 0, w-1, h-2);
+ graphics.endFill();
+
+ // draw the border of the thumb
+ graphics.lineStyle(1, thumbStroke, thumbStrokeAlpha);
+ graphics.drawRect(0, 1, w-1, h-3);
+
+ // draw the bottom line of the thumb to match the track
+ graphics.lineStyle(1, trackStroke, trackStrokeAlpha);
+ graphics.moveTo(0, h-1);
+ graphics.lineTo(w, h-1);
+
+ }
+ }}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarThumbUpSkin.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarThumbUpSkin.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarThumbUpSkin.as
new file mode 100644
index 0000000..450fd3a
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarThumbUpSkin.as
@@ -0,0 +1,89 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.styles
+{
+ import mx.skins.RectangularBorder;
+ import mx.utils.GraphicsUtil;
+ import flash.display.LineScaleMode;
+ import flash.display.CapsStyle;
+
+ public class ScrollbarThumbUpSkin extends RectangularBorder
+ {
+ public function ScrollbarThumbUpSkin()
+ {
+ super();
+ }
+
+ override public function get measuredWidth():Number
+ {
+ return 11;
+ }
+
+ override public function get measuredHeight():Number
+ {
+ return 10;
+ }
+
+ override protected function updateDisplayList(w:Number, h:Number):void
+ {
+ super.updateDisplayList(w, h);
+
+ var thumbFill:uint = 0x222222;
+ var thumbFillAlpha:Number = 1.0;
+ var thumbStroke:uint = 0x2A2A2A;
+ var thumbStrokeAlpha:Number = 1.0;
+
+ var trackStroke:uint = 0x2A2A2A;
+ var trackStrokeAlpha:Number = 1.0;
+
+ if (getStyle("thumbFill") != undefined)
+ thumbFill = getStyle("thumbFill");
+ if (getStyle("thumbFillAlpha") != undefined)
+ thumbFillAlpha = getStyle("thumbFillAlpha");
+ if (getStyle("thumbStroke") != undefined)
+ thumbStroke = getStyle("thumbStroke");
+ if (getStyle("thumbStrokeAlpha") != undefined)
+ thumbStrokeAlpha = getStyle("thumbStrokeAlpha");
+ if (getStyle("trackStroke") != undefined)
+ trackStroke = getStyle("trackStroke");
+ if (getStyle("trackStrokeAlpha") != undefined)
+ trackStrokeAlpha = getStyle("trackStrokeAlpha");
+
+ graphics.clear();
+ // draw the top line of the thumb to match the track
+ graphics.lineStyle(1, trackStroke, trackStrokeAlpha);
+ graphics.moveTo(0, 0);
+ graphics.lineTo(w-1, 0);
+
+ // fill in the thumb
+ graphics.beginFill(thumbFill, thumbFillAlpha);
+ graphics.drawRect(0, 0, w-1, h-2);
+ graphics.endFill();
+
+ // draw the border of the thumb
+ graphics.lineStyle(1, thumbStroke, thumbStrokeAlpha);
+ graphics.drawRect(0, 1, w-1, h-3);
+
+ // draw the bottom line of the thumb to match the track
+ graphics.lineStyle(1, trackStroke, trackStrokeAlpha);
+ graphics.moveTo(0, h-1);
+ graphics.lineTo(w, h-1);
+
+ }
+ }}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarTrackSkin.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarTrackSkin.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarTrackSkin.as
new file mode 100644
index 0000000..d822b91
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarTrackSkin.as
@@ -0,0 +1,68 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.styles
+{
+ import flash.display.CapsStyle;
+ import flash.display.LineScaleMode;
+
+ import mx.skins.RectangularBorder;
+
+ public class ScrollbarTrackSkin extends RectangularBorder
+ {
+ public function ScrollbarTrackSkin()
+ {
+ super();
+ }
+
+ override public function get measuredWidth():Number
+ {
+ return 13;
+ }
+
+ override public function get measuredHeight():Number
+ {
+ return 10;
+ }
+
+ override protected function updateDisplayList(w:Number, h:Number):void
+ {
+ super.updateDisplayList(w, h);
+
+ var trackFill:uint = 0x000000;
+ var trackFillAlpha:Number = 1.0;
+ var trackStroke:uint = 0x2A2A2A;
+ var trackStrokeAlpha:Number = 1.0;
+
+ if (getStyle("trackFill") != undefined)
+ trackFill = getStyle("trackFill");
+ if (getStyle("trackFillAlpha") != undefined)
+ trackFillAlpha = getStyle("trackFillAlpha");
+ if (getStyle("trackStroke") != undefined)
+ trackStroke = getStyle("trackStroke");
+ if (getStyle("trackStrokeInnerAlpha") != undefined)
+ trackStrokeAlpha = getStyle("trackStrokeAlpha");
+
+ graphics.clear();
+ graphics.beginFill(trackFill, trackFillAlpha);
+ graphics.drawRect(0, 0, w-1, h);
+ graphics.endFill();
+ graphics.lineStyle(1, trackStroke, trackStrokeAlpha, true, LineScaleMode.NONE, CapsStyle.SQUARE);
+ graphics.drawRect(0, 0, w-1, h);
+ }
+ }}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarUpArrowUpSkin.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarUpArrowUpSkin.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarUpArrowUpSkin.as
new file mode 100644
index 0000000..f9b66bc
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/flashx/textLayout/ui/styles/ScrollbarUpArrowUpSkin.as
@@ -0,0 +1,45 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 flashx.textLayout.ui.styles
+{
+ import mx.skins.RectangularBorder;
+
+ public class ScrollbarUpArrowUpSkin extends RectangularBorder
+ {
+ public function ScrollbarUpArrowUpSkin()
+ {
+ super();
+ }
+
+ override public function get measuredWidth():Number
+ {
+ return 13;
+ }
+
+ override public function get measuredHeight():Number
+ {
+ return 14;
+ }
+
+ override protected function updateDisplayList(w:Number, h:Number):void
+ {
+ super.updateDisplayList(w, h);
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/FeatureSetChangeEvent.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/FeatureSetChangeEvent.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/FeatureSetChangeEvent.as
new file mode 100644
index 0000000..811dd37
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/FeatureSetChangeEvent.as
@@ -0,0 +1,42 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 textEditBar
+{
+import flash.events.Event;
+import flashx.textLayout.elements.TextFlow;
+
+public class FeatureSetChangeEvent extends Event
+{
+ public const FEATURE_SET:String = "featureSet";
+
+ public var featureSet:String;
+
+ public function FeatureSetChangeEvent(newFeatureSet:String, type:String = FEATURE_SET,
+ bubbles:Boolean = false,
+ cancelable:Boolean = false)
+ {
+ super(type, bubbles, cancelable);
+ featureSet = newFeatureSet;
+ }
+ override public function clone():Event
+ {
+ return new FeatureSetChangeEvent(featureSet, type, bubbles, cancelable);
+ }
+} // end class
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/FileEvent.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/FileEvent.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/FileEvent.as
new file mode 100644
index 0000000..4832d1f
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/FileEvent.as
@@ -0,0 +1,43 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 textEditBar
+{
+import flash.events.Event;
+import flash.net.FileReference;
+
+public class FileEvent extends Event
+{
+ public var fileName:FileReference;
+
+ public const FILE_CHOOSE:String = "fileChoose";
+
+ public function FileEvent(newFileName:FileReference, type:String = FILE_CHOOSE,
+ bubbles:Boolean = false,
+ cancelable:Boolean = false)
+ {
+ super(type, bubbles, cancelable);
+ fileName = newFileName;
+ }
+
+ override public function clone():Event
+ {
+ return new FileEvent(fileName, type, bubbles, cancelable);
+ }
+} // end class
+} // end package
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/FileIOHelper.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/FileIOHelper.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/FileIOHelper.as
new file mode 100644
index 0000000..1d239bc
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/FileIOHelper.as
@@ -0,0 +1,268 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 textEditBar
+{
+ import flash.display.DisplayObject;
+ import flash.events.Event;
+ import flash.events.IOErrorEvent;
+ import flash.net.FileReference;
+
+ import flashx.textLayout.conversion.ConversionType;
+ import flashx.textLayout.conversion.ITextExporter;
+ import flashx.textLayout.conversion.ITextImporter;
+ import flashx.textLayout.conversion.TextConverter;
+ import flashx.textLayout.debug.assert;
+ import flashx.textLayout.elements.TextFlow;
+
+ import mx.managers.CursorManager;
+ import mx.managers.PopUpManager;
+ import mx.rpc.events.ResultEvent;
+ import mx.rpc.http.mxml.HTTPService;
+
+ import textEditBar.StatusPopup;
+
+ public class FileIOHelper
+ {
+ static public var parentWindow:DisplayObject;
+ static public var changeContent:Function;
+
+ static private var _openedFile:String;
+
+ // called when the app has a specific file it wants to read (at startup)
+ static public function fileOpen(fileName:String):void
+ {
+ var localHTTP:HTTPService = new HTTPService();
+ localHTTP.url = fileName;
+ _openedFile = fileName;
+ localHTTP.method = "GET";
+ localHTTP.resultFormat="text"
+ localHTTP.showBusyCursor=true;
+ localHTTP.addEventListener(ResultEvent.RESULT,parseIntoFlowFromHTTP,false,0,true);
+ localHTTP.addEventListener(IOErrorEvent.IO_ERROR,errorOnReadFromHTTP,false,0,true);
+ localHTTP.send();
+ }
+
+ // called when user picks a file
+ static public function fileChoose(fileName:FileReference) : void
+ {
+ fileName.addEventListener(Event.COMPLETE,onFileReferenceLoadComplete,false,0,true);
+ fileName.addEventListener(IOErrorEvent.IO_ERROR,errorOnReadFromFileReference,false,0,true);
+ fileName.load();
+ }
+
+ static private function onFileReferenceLoadComplete(event:Event):void
+ {
+ var fileReference:FileReference = FileReference(event.target);
+ _extension= getExtension(fileReference.name).toLowerCase();
+ _fileData = String(fileReference.data);
+ parseCurrentDataWithExtension();
+ }
+
+ static private function errorOnReadFromFileReference(event:IOErrorEvent):void
+ {
+ var curFileReference:FileReference = FileReference(event.target);
+ // Text content will be an error string
+ var errorString:String = "Error reading file " + curFileReference.name;
+ errorString += "\n";
+ errorString += event.toString();
+ _extension = "txt";
+ _fileData = errorString;
+ parseCurrentDataWithExtension();
+ //CursorManager.removeBusyCursor(); //get rid of hourglass cursor.
+ }
+
+ static private function parseIntoFlowFromHTTP(event:ResultEvent):void
+ {
+ _fileData = String(event.result);
+ _extension = getExtension(_openedFile).toLowerCase();
+ parseCurrentDataWithExtension();
+ _openedFile = null;
+ }
+
+ static private function errorOnReadFromHTTP(event:Object):void
+ {
+ // Text content will be an error string
+ var errorString:String = "Error reading file " + _openedFile;
+ errorString += "\n";
+ errorString += event.fault;
+ _extension = "txt";
+ _fileData = errorString;
+ parseCurrentDataWithExtension();
+ CursorManager.removeBusyCursor(); //get rid of hourglass cursor.
+ _openedFile = null;
+ }
+
+ static private function getExtension(fileName:String):String
+ {
+ var dotPos:int = fileName.lastIndexOf(".");
+ if (dotPos >= 0)
+ return fileName.substring(dotPos + 1);
+ return fileName;
+ }
+
+ // hold onto these two in case we need to recreate textFlow
+ static private var _extension:String;
+ static private var _fileData:String;
+
+ static public function parseCurrentDataWithExtension():void
+ {
+ switch (_extension)
+ {
+ case "xml": // use Vellum markup
+ parseStringIntoFlow(_fileData, TextConverter.TEXT_LAYOUT_FORMAT);
+ break;
+ case "txt":
+ parseStringIntoFlow(_fileData, TextConverter.PLAIN_TEXT_FORMAT);
+ break;
+ case "html":
+ parseStringIntoFlow(_fileData, TextConverter.TEXT_FIELD_HTML_FORMAT);
+ break;
+
+ }
+ }
+
+ static private function parseStringIntoFlow(source:String, format:String):void
+ {
+ var textImporter:ITextImporter = TextConverter.getImporter(format);
+ var newFlow:TextFlow = textImporter.importToFlow(source);
+ reportImportErrors(textImporter.errors);
+ // no TextFlow found - Flow will display an empty TextFlow by design
+ // - alternative is to do some kind of error string
+ changeContent(newFlow ? newFlow : new TextFlow());
+ }
+
+ static private function reportImportErrors(errors:Vector.<String>):void
+ {
+ if (errors)
+ {
+ var errorText:String = "ERRORS REPORTED ON IMPORT";
+ for each(var e:String in errors)
+ errorText += "\n" + e;
+
+ var dlg:StatusPopup = new StatusPopup();
+ dlg.closeFunction = closeStatusPopup;
+
+ PopUpManager.addPopUp(dlg, parentWindow, true);
+ PopUpManager.centerPopUp(dlg);
+ // stick it in the upper left
+ dlg.x = 0;
+ dlg.y = 0;
+
+ dlg.textArea.text = errorText;
+ }
+ }
+ static private function closeStatusPopup(dlg:StatusPopup):void
+ {
+ PopUpManager.removePopUp(dlg);
+ }
+
+ static private function importStatusPopupContent(dlg:StatusPopup):void
+ {
+ switch(dlg.textFormat)
+ {
+ case TextConverter.TEXT_LAYOUT_FORMAT:
+ _extension = "xml";
+ break;
+ case TextConverter.TEXT_FIELD_HTML_FORMAT:
+ _extension = "html";
+ break;
+ }
+ _fileData = dlg.textArea.text;
+ parseCurrentDataWithExtension();
+ PopUpManager.removePopUp(dlg);
+ }
+
+ static private function saveStatusPopupContent(dlg:StatusPopup):void
+ {
+ var extension:String;
+ switch(dlg.textFormat)
+ {
+ case TextConverter.TEXT_LAYOUT_FORMAT:
+ extension = "xml";
+ break;
+ case TextConverter.TEXT_FIELD_HTML_FORMAT:
+ extension = "html";
+ break;
+ }
+
+ var fileReference:FileReference = new FileReference();
+ fileReference.save(dlg.textArea.text,extension == null ? null : "NewFile."+extension);
+ }
+
+
+
+ // Export related code
+ static public function textLayoutExport(activeFlow:TextFlow) : void
+ {
+ export(activeFlow, TextConverter.TEXT_LAYOUT_FORMAT);
+ }
+
+
+ static public function htmlExport(activeFlow:TextFlow) : void
+ {
+ export(activeFlow, TextConverter.TEXT_FIELD_HTML_FORMAT);
+ }
+
+ static private const xmlBoilerPlate:String = '<?xml version="1.0" encoding="utf-8"?>\n';
+
+ static public function export(activeFlow:TextFlow, format:String) : void
+ {
+ //CONFIG::debug
+ {
+ var originalSettings:Object = XML.settings();
+ try
+ {
+ XML.ignoreProcessingInstructions = false;
+ XML.ignoreWhitespace = false;
+ XML.prettyPrinting = false;
+
+
+ var exporter:ITextExporter = TextConverter.getExporter(format);
+ var xmlExport:XML = exporter.export(activeFlow, ConversionType.XML_TYPE) as XML;
+ var result:String = xmlBoilerPlate + xmlExport;
+ XML.setSettings(originalSettings);
+ }
+
+ catch(e:Error)
+ {
+ XML.setSettings(originalSettings);
+ throw(e);
+ }
+ }
+
+ // show it in the pop-up dialog
+ var dlg:StatusPopup = new StatusPopup();
+ dlg.closeFunction = closeStatusPopup;
+ dlg.importFunction = importStatusPopupContent;
+ dlg.saveFunction = saveStatusPopupContent;
+ dlg.textFormat = format;
+
+ PopUpManager.addPopUp(dlg, parentWindow, true);
+ PopUpManager.centerPopUp(dlg);
+ // stick it in the upper left
+ dlg.x = 0;
+ dlg.y = 0;
+
+ dlg.textArea.text = result.replace(/\u000D\u000A/g, "\r"); // workaround for TextArea bug SDK-14797
+ }
+
+
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/FileServices.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/FileServices.mxml b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/FileServices.mxml
new file mode 100644
index 0000000..343cc94
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/FileServices.mxml
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+
+<!--This widget allows the user to enter a file name and when the "ReadFile" button is pressed, it
+reads the file, and passes through the file contents as a ContentEvent. It expects an XML file in
+TextLayout format.-->
+
+<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" creationComplete="handleCreationComplete()" >
+ <mx:Metadata>
+ [Event(name="fileChoose", type="textEditBar.FileEvent")]
+ [Event(name="textLayoutExport", type="flash.events.Event")]
+ [Event(name="htmlExport", type="flash.events.Event")]
+ </mx:Metadata>
+
+ <mx:Script>
+ <![CDATA[
+ import flash.events.Event;
+ import flash.system.Capabilities;
+ import flashx.textLayout.elements.TextFlow;
+ import mx.events.MenuEvent;
+ import mx.controls.Alert;
+ import flashx.textLayout.edit.EditingMode;
+ import flashx.textLayout.edit.ElementRange;
+ import flashx.textLayout.edit.ISelectionManager;
+ import flashx.textLayout.edit.IEditManager;
+ import flashx.textLayout.BuildInfo;
+
+ public var activeFlow:TextFlow;
+
+ [Bindable]
+ public var buildString:String = "Build: " + BuildInfo.kBuildNumber + "(" + Capabilities.version + ")";
+
+ internal function handleCreationComplete():void
+ {
+ buildLabel.left = (this.x + this.width - 20) - buildLabel.width;
+ }
+ // Update UI panel in response to change in selection
+ public function update(range:ElementRange):void
+ {
+ if (!activeFlow)
+ return;
+
+ }
+
+ private var fileReference:FileReference;
+
+ public function currentFileName():String
+ {
+ return fileReference != null ? fileReference.name : null;
+ }
+
+ public function openDialog():void
+ {
+ var markupFilter:FileFilter = new FileFilter("Documents","*.xml;*.fxg;*.html");
+ fileReference = new FileReference();
+ fileReference.browse([markupFilter]);
+ fileReference.addEventListener(Event.SELECT,onFileSelect);
+ }
+
+ private function onFileSelect(event:Event):void
+ {
+ try {
+ dispatchEvent(new FileEvent(fileReference));
+ //fileReference.load();
+ } catch (err:Event) {
+ Alert.show(err.toString());
+ }
+ }
+
+ ]]>
+ </mx:Script>
+
+ <mx:Button label="Open..." click="openDialog()"/>
+
+ <mx:Button id="textLayoutExportButton" label="Markup..." click="dispatchEvent(new Event('textLayoutExport'));"/>
+ <mx:Button id="htmlExportButton" label="HTML Markup..." click="dispatchEvent(new Event('htmlExport'));"/>
+
+ <mx:Label id="buildLabel" text="{buildString}" fontWeight="bold" paddingTop="3" paddingBottom="1"/>
+</mx:HBox>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/GraphicBar.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/GraphicBar.mxml b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/GraphicBar.mxml
new file mode 100644
index 0000000..1aa5d14
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/GraphicBar.mxml
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+
+<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:textEditBar="textEditBar.*"
+ addedToStage="onAddedToStage()" removedFromStage="onRemovedFromStage()" horizontalScrollPolicy="off" verticalScrollPolicy="off">
+
+ <mx:Script>
+ <![CDATA[
+ import flashx.textLayout.edit.ElementRange;
+ import flashx.textLayout.edit.IEditManager;
+ import flashx.textLayout.elements.InlineGraphicElement;
+ import flashx.textLayout.elements.TextFlow;
+ import flashx.textLayout.formats.FormatValue;
+ import flashx.textLayout.tlf_internal;
+
+ use namespace tlf_internal;
+
+ public var activeFlow:TextFlow;
+
+ protected function applyChange():void
+ {
+ changeForeignElement(imageURL.text, imageWidth.text, imageHeight.text, "none", doChangeImage);
+ }
+
+ protected function changeForeignElement(foreignElementUrl:String, width:String, height:String, float:String, changeCurrent:Boolean):void
+ {
+ if (activeFlow && activeFlow.interactionManager is IEditManager)
+ {
+ if (changeCurrent)
+ IEditManager(activeFlow.interactionManager).modifyInlineGraphic(foreignElementUrl, width, height, float);
+ else
+ IEditManager(activeFlow.interactionManager).insertInlineGraphic(foreignElementUrl, width, height, float);
+ activeFlow.interactionManager.setFocus();
+ }
+ }
+
+ protected var doChangeImage:Boolean = false;
+
+ public function update(range:ElementRange):void
+ {
+ if (onStage)
+ {
+ if (range == null)
+ visible = false;
+ else
+ {
+ if (!visible)
+ visible = true;
+
+ var makeItTheChangeButton:Boolean = false;
+
+ // this logic is a complicated by the fact that we extend the end of the selection because the FE is at the end of the paragraph
+ if (range && range.firstLeaf is InlineGraphicElement && range.absoluteStart == range.firstLeaf.getAbsoluteStart())
+ {
+ // two cases just the FE and just the FE plus the paragraph terminator
+ if (range.absoluteEnd == range.absoluteStart+1 || (range.firstParagraph == range.lastParagraph && range.absoluteEnd == range.absoluteStart+2 && range.absoluteEnd == range.lastParagraph.getAbsoluteStart() + range.lastParagraph.textLength))
+ makeItTheChangeButton = true;
+ }
+
+ // block selection of just the FE
+ if (makeItTheChangeButton)
+ updateForChange(InlineGraphicElement(range.firstLeaf));
+ else
+ updateForInsert(range)
+ }
+ }
+ lastRange = range;
+ }
+
+ protected function updateForChange(inlineElement:InlineGraphicElement):void
+ {
+ var sourceString:String = inlineElement.source.toString()
+ var widthString:String = inlineElement.width === undefined ? FormatValue.AUTO : inlineElement.width.toString();
+ var heightString:String = inlineElement.height === undefined ? FormatValue.AUTO : inlineElement.height.toString();
+ doUpdate(sourceString, widthString, heightString, true, true);
+ }
+
+ protected function updateForInsert(range:ElementRange):void
+ {
+ doUpdate("",
+ InlineGraphicElement.tlf_internal::widthPropertyDefinition.defaultValue.toString(),
+ InlineGraphicElement.tlf_internal::heightPropertyDefinition.defaultValue.toString(),
+ false, range && range.firstLeaf);
+ }
+
+ private function doUpdate(url:String, width:String, height:String, modify:Boolean, enableImage:Boolean):void
+ {
+ imageURL.text = url;
+ imageWidth.text = width;
+ imageHeight.text = height;
+ imageButton.label = modify ? "Change" : "Insert";
+ doChangeImage = modify;
+ imageButton.enabled = enableImage;
+ }
+
+ private var onStage:Boolean = false;
+ private var addedFrameEventListener:Boolean = false;
+ protected var lastRange:ElementRange = null;
+ private function onAddedToStage():void
+ {
+ // the dataProviders aren't set up yet - delay to the frame
+ onStage = true;
+ if (!addedFrameEventListener)
+ {
+ addedFrameEventListener = true;
+ addEventListener("enterFrame",onEnterFrame);
+ }
+ }
+
+ private function onEnterFrame(p:Event):void
+ {
+ this.removeEventListener("enterFrame",onEnterFrame);
+ addedFrameEventListener = false;
+
+ var temp:ElementRange = lastRange;
+ lastRange = null;
+ update(temp);
+
+ }
+
+ private function onRemovedFromStage():void
+ {
+ onStage = false;
+ }
+ ]]>
+ </mx:Script>
+
+ <mx:Label text="Image URL:" fontWeight="bold"/>
+ <mx:TextInput id="imageURL" width="140"/>
+ <mx:Label text="Width:" fontWeight="bold"/>
+ <mx:TextInput id="imageWidth" width="60"/>
+ <mx:Label text="Height:" fontWeight="bold"/>
+ <mx:TextInput id="imageHeight" width="60"/>
+ <mx:Button id="imageButton" label="Insert Image"
+ click="applyChange();" />
+</mx:HBox>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/GraphicChangeEvent.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/GraphicChangeEvent.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/GraphicChangeEvent.as
new file mode 100644
index 0000000..0128881
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/GraphicChangeEvent.as
@@ -0,0 +1,61 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 textEditBar
+{
+ import flash.events.Event;
+
+ public class GraphicChangeEvent extends Event
+ {
+ private var _imageLink:String;
+ private var _imageWidth:Object;
+ private var _imageHeight:Object;
+ private var _float:String;
+ private var _replaceCurrent:Boolean;
+
+ public function GraphicChangeEvent(type:String, imageLink:String, imageWidth:Object, imageHeight:Object, float:String, replaceCurrent:Boolean = false, bubbles:Boolean=false, cancelable:Boolean=false)
+ {
+ _imageLink = imageLink;
+ _imageWidth = imageWidth;
+ _imageHeight = imageHeight;
+ _replaceCurrent = replaceCurrent;
+ _float = float;
+ super(type, bubbles, cancelable);
+ }
+
+ override public function clone():Event
+ {
+ return new GraphicChangeEvent(type, _imageLink, _imageWidth, _imageHeight, _float, _replaceCurrent, bubbles, cancelable);
+ }
+
+ public function get imageLink():String
+ { return _imageLink; }
+
+ public function get imageWidth():Object
+ { return _imageWidth; }
+
+ public function get imageHeight():Object
+ { return _imageHeight; }
+
+ public function get float():String
+ { return _float; }
+
+ public function get replaceCurrent():Boolean
+ { return _replaceCurrent; }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/LinkBar.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/LinkBar.mxml b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/LinkBar.mxml
new file mode 100644
index 0000000..61b8b6f
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/LinkBar.mxml
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+
+<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:textEditBar="textEditBar.*"
+ addedToStage="onAddedToStage()" removedFromStage="onRemovedFromStage()">
+
+ <mx:Array id="targetArray">
+ <mx:String>_blank</mx:String>
+ <mx:String>_self</mx:String>
+ <mx:String>_parent</mx:String>
+ <mx:String>_top</mx:String>
+ </mx:Array>
+
+ <mx:Script>
+ <![CDATA[
+ import mx.controls.Alert;
+ import flashx.textLayout.edit.ElementRange;
+ import flashx.textLayout.edit.IEditManager;
+ import flashx.textLayout.elements.LinkElement;
+ import flashx.textLayout.elements.FlowElement;
+ import flashx.textLayout.elements.ParagraphElement;
+ import flashx.textLayout.events.FlowElementMouseEvent;
+ import flashx.textLayout.elements.TextFlow;
+
+ public var activeFlow:TextFlow;
+
+ private function changeLink(urlText:String, targetText:String, extendToOverlappingLinks:Boolean):void
+ {
+ if (activeFlow && activeFlow.interactionManager is IEditManager)
+ {
+ IEditManager(activeFlow.interactionManager).applyLink(urlText, targetText, extendToOverlappingLinks);
+ activeFlow.interactionManager.setFocus();
+ }
+ }
+
+ private var onStage:Boolean = false;
+ private var addedFrameEventListener:Boolean = false;
+ private var lastRange:ElementRange;
+
+ private function onAddedToStage():void
+ {
+ // the dataProviders aren't set up yet - delay to the frame
+ onStage = true;
+ if (!addedFrameEventListener)
+ {
+ addedFrameEventListener = true;
+ addEventListener("enterFrame",onEnterFrame);
+ }
+ }
+
+ private function onEnterFrame(p:Event):void
+ {
+ this.removeEventListener("enterFrame",onEnterFrame);
+ addedFrameEventListener = false;
+
+ update(lastRange);
+ }
+
+ private function onRemovedFromStage():void
+ {
+ onStage = false;
+ }
+
+ protected function setTargetCombo(val:String):void
+ {
+ var length:uint = linkTargetCombo.dataProvider.length;
+
+ for (var i:uint = 0; i < length; i++)
+ {
+ if (linkTargetCombo.dataProvider.getItemAt(i).toLowerCase() == val.toLowerCase())
+ {
+ linkTargetCombo.selectedIndex = i;
+ return;
+ }
+ }
+ linkTargetCombo.selectedIndex = -1;
+ linkTargetCombo.validateNow();
+ linkTargetCombo.text = val;
+ }
+
+ public function update(range:ElementRange):void
+ {
+ if (!range)
+ {
+ if (onStage)
+ visible = false;
+ lastRange = null;
+ return;
+ }
+
+ var linkString:String = "";
+ var linkTarget:String = "";
+ var linkEl:LinkElement = range.firstLeaf.getParentByType(LinkElement) as LinkElement;
+ if (linkEl != null)
+ {
+ var linkElStart:int = linkEl.getAbsoluteStart();
+ var linkElEnd:int = linkElStart + linkEl.textLength;
+ if (linkElEnd < linkElStart)
+ {
+ var temp:int = linkElStart;
+ linkElStart = linkElEnd;
+ linkElEnd = temp;
+ }
+
+ var beginRange:int = range.absoluteStart;
+ var endRange:int = range.absoluteEnd;
+
+ var beginPara:ParagraphElement = range.firstParagraph;
+ if (endRange == (beginPara.getAbsoluteStart() + beginPara.textLength))
+ {
+ endRange--;
+ }
+
+ if ((beginRange == endRange) || (endRange <= linkElEnd))
+ {
+ linkString = LinkElement(linkEl).href;
+ linkTarget = LinkElement(linkEl).target;
+ }
+ }
+
+ if (onStage)
+ {
+ if (!visible)
+ visible = true;
+ linkTextInput.text = linkString ? linkString : "";
+ setTargetCombo(linkTarget ? linkTarget : "");
+ }
+ lastRange = range;
+ }
+ ]]>
+ </mx:Script>
+
+ <mx:Label text="Link Url:" fontWeight="bold"/>
+ <mx:TextInput id="linkTextInput" width="140"/>
+ <mx:Label text="Link Target:" fontWeight="bold"/>
+ <mx:ComboBox id="linkTargetCombo" editable="true"
+ selectedIndex="0" dataProvider = "{targetArray}"/>
+ <mx:CheckBox id = "linkExtendCheckBox" label="Extend"/>
+ <mx:Button label="Apply Link"
+ click="changeLink(linkTextInput.text, linkTargetCombo.text, linkExtendCheckBox.selected);" />
+</mx:HBox>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/LinkChangeEvent.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/LinkChangeEvent.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/LinkChangeEvent.as
new file mode 100644
index 0000000..2c500dc
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/LinkChangeEvent.as
@@ -0,0 +1,51 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 textEditBar
+{
+ import flash.events.Event;
+
+ public class LinkChangeEvent extends Event
+ {
+ private var _linkText:String;
+ private var _targetText:String;
+ private var _extendToOverlappingLinks:Boolean;
+
+ public function LinkChangeEvent(type:String, linkText:String, targetText:String, extendToOverlappingLinks:Boolean=false, bubbles:Boolean=false, cancelable:Boolean=false)
+ {
+ _linkText = linkText;
+ _targetText = targetText;
+ _extendToOverlappingLinks = extendToOverlappingLinks;
+ super(type, bubbles, cancelable);
+ }
+
+ override public function clone():Event
+ {
+ return new LinkChangeEvent(type, _linkText, _targetText, _extendToOverlappingLinks, bubbles, cancelable);
+ }
+
+ public function get linkText():String
+ { return _linkText; }
+
+ public function get linkTarget():String
+ { return _targetText; }
+
+ public function get extendToOverlappingLinks():Boolean
+ { return _extendToOverlappingLinks; }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/SingleContainerView.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/SingleContainerView.mxml b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/SingleContainerView.mxml
new file mode 100644
index 0000000..85797c2
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/SingleContainerView.mxml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+
+<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="0xffffff" resize="handleResize()">
+
+ <mx:Script>
+ <![CDATA[
+ import flashx.textLayout.elements.TextFlow;
+ import flashx.textLayout.compose.StandardFlowComposer;
+ import flashx.textLayout.container.ContainerController;
+ import textEditBar.SpriteWithIME;
+
+
+ private var _activeFlow:TextFlow;
+
+ public function changeContainerSetup(newActiveFlow:TextFlow):void
+ {
+ _activeFlow = newActiveFlow;
+ if (_activeFlow)
+ {
+ if (!_activeFlow.flowComposer)
+ _activeFlow.flowComposer = new StandardFlowComposer();
+ if (_activeFlow.flowComposer.numControllers < 1)
+ _activeFlow.flowComposer.addController(new ContainerController(new SpriteWithIME()));
+ rawChildren.addChild(_activeFlow.flowComposer.getControllerAt(0).container);
+ handleResize();
+ }
+ }
+
+ public function handleResize():void
+ {
+ if (!_activeFlow)
+ return;
+
+ var newFrameWidth:Number = width;
+ var newFrameHeight:Number = height;
+
+ var cont:ContainerController = _activeFlow.flowComposer.getControllerAt(0);
+ if (cont.container)
+ updateFrameDimensions(cont,0,0,newFrameWidth,newFrameHeight);
+
+ _activeFlow.flowComposer.updateAllControllers();
+
+ if (_activeFlow.interactionManager && _activeFlow.interactionManager.hasSelection())
+ _activeFlow.flowComposer.getControllerAt(0).scrollToRange(_activeFlow.interactionManager.activePosition,_activeFlow.interactionManager.anchorPosition);
+
+ }
+
+ /** helper function to update a frame's dimensions */
+ private function updateFrameDimensions(controller:ContainerController,x:Number,y:Number,w:Number,h:Number):void
+ {
+ var tc:DisplayObject = controller.container;
+
+ if (tc.x != x)
+ tc.x = x;
+ if (tc.y != y)
+ tc.y = y;
+ controller.setCompositionSize(w,h);
+ }
+
+ ]]>
+ </mx:Script>
+</mx:Canvas>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/SpriteWithIME.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/SpriteWithIME.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/SpriteWithIME.as
new file mode 100644
index 0000000..8abf701
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/SpriteWithIME.as
@@ -0,0 +1,102 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 textEditBar
+{
+ import flash.display.Sprite;
+
+ import mx.core.IIMESupport;
+ import mx.managers.IFocusManagerComponent;
+
+ public class SpriteWithIME extends Sprite implements IIMESupport, IFocusManagerComponent
+ {
+ private var _imeMode:String;
+
+ public function SpriteWithIME()
+ {
+ super();
+ }
+
+ public function get enableIME():Boolean
+ {
+ return true;
+ }
+
+ public function get imeMode():String
+ {
+ return _imeMode;
+ }
+
+ public function set imeMode(value:String):void
+ {
+ _imeMode = value;
+ }
+
+ public function get focusEnabled():Boolean
+ {
+ return true;
+ }
+
+ public function set focusEnabled(value:Boolean):void
+ {
+ }
+
+ // For now! Should be dependent on Configuration.manageTabKey
+ public function get tabFocusEnabled():Boolean
+ {
+ return true;
+ }
+
+ public function set tabFocusEnabled(value:Boolean):void
+ {
+ }
+
+ public function get hasFocusableChildren():Boolean
+ {
+ return false;
+ }
+
+ public function set hasFocusableChildren(value:Boolean):void
+ {
+ }
+
+ public function get mouseFocusEnabled():Boolean
+ {
+ return false;
+ }
+
+ /*public function get tabEnabled():Boolean
+ {
+ return false;
+ }
+
+ public function get tabIndex():int
+ {
+ return 0;
+ }*/
+
+ public function setFocus():void
+ {
+ }
+
+ public function drawFocus(isFocused:Boolean):void
+ {
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/StatusPopup.mxml
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/StatusPopup.mxml b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/StatusPopup.mxml
new file mode 100644
index 0000000..850df4c
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/StatusPopup.mxml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="500" height="390" verticalScrollPolicy="off"
+ horizontalScrollPolicy="off">
+ <mx:Script>
+ <![CDATA[
+ public var closeFunction:Function;
+ public var textFormat:String;
+ [Bindable]
+ public var importFunction:Function;
+ [Bindable]
+ public var saveFunction:Function;
+ ]]>
+ </mx:Script>
+ <mx:TextArea id="textArea" x="0" y="0" width="100%" height="100%" fontFamily="_sans">
+ </mx:TextArea>
+ <mx:ControlBar horizontalAlign="center">
+ <mx:Button label="Import" id="cmdImport" visible="{importFunction != null}" click="{if (importFunction != null) importFunction(this)}"/>
+ <mx:Button label="Save" id="cmdSave" visible="{saveFunction != null}" click="{if (saveFunction != null) saveFunction(this)}"/>
+ <mx:Button label="Close" id="cmdClose" click="closeFunction(this)"/>
+ </mx:ControlBar>
+</mx:Panel>
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/StyleChangeEvent.as
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/StyleChangeEvent.as b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/StyleChangeEvent.as
new file mode 100644
index 0000000..eb3273c
--- /dev/null
+++ b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/StyleChangeEvent.as
@@ -0,0 +1,46 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 textEditBar
+{
+ import flash.events.Event;
+
+ import flashx.textLayout.formats.ITextLayoutFormat;
+
+ public class StyleChangeEvent extends Event
+ {
+ private var _attrs:Object;
+
+ public function StyleChangeEvent(type:String, styleAttrs:Object, bubbles:Boolean=false, cancelable:Boolean=false)
+ {
+ _attrs = styleAttrs;
+ super(type, bubbles, cancelable);
+ }
+
+ override public function clone():Event
+ {
+ return new StyleChangeEvent(type, _attrs, bubbles, cancelable);
+ }
+
+ public function get format():ITextLayoutFormat
+ { return _attrs as ITextLayoutFormat; }
+
+ public function get attrs():Object
+ { return _attrs; }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/%icon_tcy.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/%icon_tcy.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/%icon_tcy.png
new file mode 100644
index 0000000..47c3637
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/%icon_tcy.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/BreakOpportunityType.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/BreakOpportunityType.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/BreakOpportunityType.png
new file mode 100644
index 0000000..565003d
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/BreakOpportunityType.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/EmbedDeleteIcon.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/EmbedDeleteIcon.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/EmbedDeleteIcon.png
new file mode 100644
index 0000000..7894025
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/EmbedDeleteIcon.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/EmbedDeleteIconDisabled.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/EmbedDeleteIconDisabled.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/EmbedDeleteIconDisabled.png
new file mode 100644
index 0000000..22975eb
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/EmbedDeleteIconDisabled.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextAlignBottom_Sm_N.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextAlignBottom_Sm_N.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextAlignBottom_Sm_N.png
new file mode 100644
index 0000000..a6ec4b1
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextAlignBottom_Sm_N.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextAlignJustify_Sm_N.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextAlignJustify_Sm_N.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextAlignJustify_Sm_N.png
new file mode 100644
index 0000000..4c45bc2
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextAlignJustify_Sm_N.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextAlignMiddle_Sm_N.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextAlignMiddle_Sm_N.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextAlignMiddle_Sm_N.png
new file mode 100644
index 0000000..a1f5ae8
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextAlignMiddle_Sm_N.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextAlignTop_Sm_N.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextAlignTop_Sm_N.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextAlignTop_Sm_N.png
new file mode 100644
index 0000000..9981848
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextAlignTop_Sm_N.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextBaselineShift_Md_N.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextBaselineShift_Md_N.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextBaselineShift_Md_N.png
new file mode 100644
index 0000000..e348d7c
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextBaselineShift_Md_N.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextBottomOffset_Md_N.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextBottomOffset_Md_N.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextBottomOffset_Md_N.png
new file mode 100644
index 0000000..89b948e
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextBottomOffset_Md_N.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextFirstLineIndent_Md_N.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextFirstLineIndent_Md_N.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextFirstLineIndent_Md_N.png
new file mode 100644
index 0000000..eebadec
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextFirstLineIndent_Md_N.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextLeftIndent_Md_N.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextLeftIndent_Md_N.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextLeftIndent_Md_N.png
new file mode 100644
index 0000000..b587cc6
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextLeftIndent_Md_N.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextLeftOffset_Md_N.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextLeftOffset_Md_N.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextLeftOffset_Md_N.png
new file mode 100644
index 0000000..33c35a8
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextLeftOffset_Md_N.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextRightIndent_Md_N.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextRightIndent_Md_N.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextRightIndent_Md_N.png
new file mode 100644
index 0000000..2c0f651
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextRightIndent_Md_N.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextRightOffset_Md_N.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextRightOffset_Md_N.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextRightOffset_Md_N.png
new file mode 100644
index 0000000..1efc8e7
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextRightOffset_Md_N.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextSmallCaps_Md_N.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextSmallCaps_Md_N.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextSmallCaps_Md_N.png
new file mode 100644
index 0000000..72c3860
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextSmallCaps_Md_N.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextSpaceAfter_Md_N.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextSpaceAfter_Md_N.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextSpaceAfter_Md_N.png
new file mode 100644
index 0000000..3d31df2
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextSpaceAfter_Md_N.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextSpaceBefore_Md_N.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextSpaceBefore_Md_N.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextSpaceBefore_Md_N.png
new file mode 100644
index 0000000..34a5bf6
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextSpaceBefore_Md_N.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextTopOffset_Md_N.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextTopOffset_Md_N.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextTopOffset_Md_N.png
new file mode 100644
index 0000000..b5b98b0
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/P_TextTopOffset_Md_N.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/TextAutoLeadingPercent.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/TextAutoLeadingPercent.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/TextAutoLeadingPercent.png
new file mode 100644
index 0000000..f8726a1
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/TextAutoLeadingPercent.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/digitCase.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/digitCase.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/digitCase.png
new file mode 100644
index 0000000..b3da25b
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/digitCase.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/digitWidth.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/digitWidth.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/digitWidth.png
new file mode 100644
index 0000000..7e156f0
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/digitWidth.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/elementBaseline.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/elementBaseline.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/elementBaseline.png
new file mode 100644
index 0000000..056cf8f
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/elementBaseline.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_all_but_last.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_all_but_last.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_all_but_last.png
new file mode 100644
index 0000000..7475419
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_all_but_last.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_center.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_center.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_center.png
new file mode 100644
index 0000000..3fac48d
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_center.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_end.PNG
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_end.PNG b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_end.PNG
new file mode 100644
index 0000000..15d6ddf
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_end.PNG differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_justify.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_justify.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_justify.png
new file mode 100644
index 0000000..bf4a6d6
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_justify.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_left.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_left.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_left.png
new file mode 100644
index 0000000..c9f45f6
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_left.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_right.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_right.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_right.png
new file mode 100644
index 0000000..1bdcda3
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_right.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_start.PNG
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_start.PNG b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_start.PNG
new file mode 100644
index 0000000..039711b
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_align_start.PNG differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_bullet.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_bullet.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_bullet.png
new file mode 100644
index 0000000..a99e9a2
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_bullet.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_style_bold.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_style_bold.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_style_bold.png
new file mode 100644
index 0000000..a0a71d1
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_style_bold.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_style_italic.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_style_italic.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_style_italic.png
new file mode 100644
index 0000000..2d0221d
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_style_italic.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_style_strikethrough.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_style_strikethrough.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_style_strikethrough.png
new file mode 100644
index 0000000..3195a1b
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_style_strikethrough.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_style_underline.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_style_underline.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_style_underline.png
new file mode 100644
index 0000000..316b2f1
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_style_underline.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_tcy.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_tcy.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_tcy.png
new file mode 100644
index 0000000..04e02e9
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/icon_tcy.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/ligatures.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/ligatures.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/ligatures.png
new file mode 100644
index 0000000..7f72cb0
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/ligatures.png differ
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/47a67608/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/lineBaseline.png
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/lineBaseline.png b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/lineBaseline.png
new file mode 100644
index 0000000..b19b3c8
Binary files /dev/null and b/TourDeFlex/TourDeFlex3/src/spark/tlf/textEditBar/assets/lineBaseline.png differ