http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/skinning/skins/IconTextButtonSkin.mxml ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/skinning/skins/IconTextButtonSkin.mxml b/tourdeflexmodules/src/spark/skinning/skins/IconTextButtonSkin.mxml new file mode 100644 index 0000000..7d4b5af --- /dev/null +++ b/tourdeflexmodules/src/spark/skinning/skins/IconTextButtonSkin.mxml @@ -0,0 +1,195 @@ +<?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. + +--> +<!-- +@langversion 3.0 +@playerversion Flash 10 +@playerversion AIR 1.5 +@productversion Flex 4 +--> +<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" + minWidth="21" minHeight="21" + alpha.disabled="0.5"> + + <!-- host component --> + <fx:Metadata> + <![CDATA[ + /** + * @copy spark.skins.spark.ApplicationSkin#hostComponent + */ + [HostComponent("spark.components.Button")] + ]]> + </fx:Metadata> + + <fx:Script> + <![CDATA[ + /* Define the skin elements that should not be colorized. + For button, the graphics are colorized but the label is not. */ + static private const exclusions:Array = ["labelDisplay"]; + /** + * @copy spark.skins.SparkSkin#colorizeExclusions + */ + override public function get colorizeExclusions():Array {return exclusions;} + + ]]> + </fx:Script> + + <!-- states --> + <s:states> + <s:State name="up" /> + <s:State name="over" /> + <s:State name="down" /> + <s:State name="disabled" /> + </s:states> + + <!-- layer 1: shadow --> + <s:Rect left="-1" right="-1" top="-1" bottom="-1" radiusX="7" radiusY="7"> + <s:fill> + <s:LinearGradient rotation="90"> + <s:GradientEntry color="0x000000" + color.down="0xFFFFFF" + alpha="0.01" + alpha.down="0" /> + <s:GradientEntry color="0x000000" + color.down="0xFFFFFF" + alpha="0.07" + alpha.down="0.5" /> + </s:LinearGradient> + </s:fill> + </s:Rect> + + + <!-- layer 2: fill --> + <s:Rect left="1" right="1" top="1" bottom="1" radiusX="7" radiusY="7"> + <s:fill> + <s:LinearGradient rotation="90"> + <s:GradientEntry color="0xFFFFFF" + color.over="0xBBBDBD" + color.down="0xAAAAAA" + alpha="0.85" /> + <s:GradientEntry color="0xD8D8D8" + color.over="0x9FA0A1" + color.down="0x929496" + alpha="0.85" /> + </s:LinearGradient> + </s:fill> + </s:Rect> + + + <!-- layer 3: fill lowlight --> + <s:Rect left="1" right="1" bottom="1" height="9" radiusX="7" radiusY="7"> + + <s:fill> + <s:LinearGradient rotation="90"> + <s:GradientEntry color="0x000000" alpha="0.0099" /> + <s:GradientEntry color="0x000000" alpha="0.0627" /> + </s:LinearGradient> + </s:fill> + </s:Rect> + + <!-- layer 4: fill highlight --> + <s:Rect left="1" right="1" top="1" height="9" radiusX="7" radiusY="7"> + <s:fill> + <s:SolidColor color="0xFFFFFF" + alpha="0.33" + alpha.over="0.22" + alpha.down="0.12" /> + </s:fill> + </s:Rect> + + + <!-- layer 5: highlight stroke (all states except down) --> + <s:Rect left="1" right="1" top="1" bottom="1" radiusX="7" radiusY="7" excludeFrom="down"> + <s:stroke> + <s:LinearGradientStroke rotation="90" weight="1"> + <s:GradientEntry color="0xFFFFFF" alpha.over="0.22" /> + <s:GradientEntry color="0xD8D8D8" alpha.over="0.22" /> + </s:LinearGradientStroke> + </s:stroke> + </s:Rect> + + + <!-- layer 6: highlight stroke (down state only) --> + <s:Rect left="1" top="1" bottom="1" width="1" includeIn="down"> + <s:fill> + <s:SolidColor color="0x000000" alpha="0.07" /> + </s:fill> + </s:Rect> + + <s:Rect right="1" top="1" bottom="1" width="1" includeIn="down"> + <s:fill> + <s:SolidColor color="0x000000" alpha="0.07" /> + </s:fill> + </s:Rect> + + <s:Rect left="2" top="1" right="2" height="1" includeIn="down"> + <s:fill> + <s:SolidColor color="0x000000" alpha="0.25" /> + </s:fill> + </s:Rect> + + <s:Rect left="1" top="2" right="1" height="1" includeIn="down"> + <s:fill> + <s:SolidColor color="0x000000" alpha="0.09" /> + </s:fill> + </s:Rect> + + + <!-- layer 7: border - put on top of the fill so it doesn't disappear when scale is less than 1 --> + <s:Rect left="0" right="0" top="0" bottom="0" width="69" height="20" radiusX="7" radiusY="7"> + <s:stroke> + <s:LinearGradientStroke rotation="90" weight="1"> + <s:GradientEntry color="0x000000" + alpha="0.5625" + alpha.down="0.6375" /> + <s:GradientEntry color="0x000000" + alpha="0.75" + alpha.down="0.85" /> + </s:LinearGradientStroke> + </s:stroke> + </s:Rect> + + <!-- icon/symbol layer --> + <s:Group id="symbol" left="7" top="7" right="3" bottom="3"> + <s:filters> + <s:DropShadowFilter alpha="0.5" blurX="0" blurY="0" distance="1" /> + </s:filters> + <s:BitmapImage source="@Embed('../assets/icon_plus.png')"/> + + </s:Group> + + <!-- The divider between symbol and text --> + <s:Line blendMode="overlay" verticalCenter="0" height="90%" left="20"> + <s:stroke> + <s:SolidColorStroke color="#3d3d3d" weight=".25" /> + </s:stroke> + </s:Line> + + <!-- layer 8: text --> + <s:Group id="textGroup" verticalCenter="1" left="25"> + <s:filters> + <s:DropShadowFilter alpha="0.5" blurX="0" blurY="0" distance="1" /> + </s:filters> + <s:Label id="labelDisplay" + textAlign="center" + verticalAlign="middle" + maxDisplayedLines="1"> + </s:Label> + </s:Group> +</s:SparkSkin>
http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/skinning/skins/MyPanelSkin.mxml ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/skinning/skins/MyPanelSkin.mxml b/tourdeflexmodules/src/spark/skinning/skins/MyPanelSkin.mxml new file mode 100644 index 0000000..300af66 --- /dev/null +++ b/tourdeflexmodules/src/spark/skinning/skins/MyPanelSkin.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. + +--> + + +<!--- The default skin class for a Spark Panel container. + +@langversion 3.0 +@playerversion Flash 10 +@playerversion AIR 1.5 +@productversion Flex 4 +--> +<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" alpha.disabled="0.5" blendMode="normal"> + + <fx:Metadata> + <![CDATA[ + /** + * @copy spark.skins.spark.ApplicationSkin#hostComponent + */ + [HostComponent("spark.components.Panel")] + ]]> + </fx:Metadata> + + <fx:Script> + /* Define the skin elements that should not be colorized. + For panel, border and title backround are skinned, but the content area and title text are not. */ + static private const exclusions:Array = ["background", "titleDisplay", "contentGroup", "bgfill"]; + + /** + * @copy spark.skins.SparkSkin#colorizeExclusions + */ + override public function get colorizeExclusions():Array {return exclusions;} + + /* Define the content fill items that should be colored by the "contentBackgroundColor" style. */ + static private const contentFill:Array = []; + + /** + * @inheritDoc + */ + override public function get contentItems():Array {return contentFill}; + </fx:Script> + + <s:states> + <s:State name="normal" /> + <s:State name="disabled" /> + </s:states> + + <!-- background fill --> + <s:Rect left="0" right="0" bottom="0" top="0" > + <s:fill> + <s:LinearGradient rotation="90" > + <s:GradientEntry color="0xFFFFFF" /> + <s:GradientEntry color="0x000000" /> + </s:LinearGradient> + </s:fill> + </s:Rect> + + <!-- title bar fill --> + <s:Rect left="0" right="0" top="0" height="30"> + <s:fill> + <s:LinearGradient rotation="90"> + <s:GradientEntry color="0x000000" /> + <s:GradientEntry color="0xC0C0C0" /> + </s:LinearGradient> + </s:fill> + </s:Rect> + + + <!-- text layer --> + <!--- Defines the appearance of the PanelSkin class's title bar. --> + <s:SimpleText id="titleDisplay" lineBreak="explicit" + right="4" top="2" height="30" + verticalAlign="middle" fontWeight="bold" + color="0xE2E2E2"> + </s:SimpleText> + + <!-- + Note: setting the minimum size to 0 here so that changes to the host component's + size will not be thwarted by this skin part's minimum size. This is a compromise, + more about it here: http://bugs.adobe.com/jira/browse/SDK-21143 + --> + <s:Group id="contentGroup" left="1" right="1" top="32" bottom="1" minWidth="0" minHeight="0"> + </s:Group> + +</s:SparkSkin> http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/states/AnimateShaderTransitionEffect.mxml ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/states/AnimateShaderTransitionEffect.mxml b/tourdeflexmodules/src/spark/states/AnimateShaderTransitionEffect.mxml new file mode 100644 index 0000000..c4e744e --- /dev/null +++ b/tourdeflexmodules/src/spark/states/AnimateShaderTransitionEffect.mxml @@ -0,0 +1,58 @@ +<?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:Module xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:s="library://ns.adobe.com/flex/spark" + xmlns:mx="library://ns.adobe.com/flex/mx" + backgroundColor="0x000000"> + + <s:states> + <s:State name="default"/> + <s:State name="flipped"/> + </s:states> + + <s:transitions> + <s:Transition id="t1"> + <s:AnimateTransitionShader + target="{holder}" + duration="1000" + shaderByteCode="@Embed(source='assets/twist.pbj', mimeType='application/octet-stream')"/> + </s:Transition> + </s:transitions> + + <s:HGroup left="190" top="7"> + <s:Group id="holder"> + <s:BitmapImage + source="@Embed('assets/back.png')" + visible="true" visible.flipped="false"/> + <s:BitmapImage + source="@Embed('assets/c1.png')" + visible="false" visible.flipped="true"/> + </s:Group> + </s:HGroup> + <s:VGroup top="10" right="5" width="30%"> + <s:Label text="AnimateShaderTransition Sample" fontSize="18"/> + <s:Label color="#FFFFFF" width="200" verticalAlign="justify" + text="AnimateShaderTransition animates a shader between two images. Click the button below to see the effect."/> + <s:Button id="playButton" + label="Play Animation" + click="currentState = (currentState == 'flipped') ? 'default' : 'flipped'" /> + </s:VGroup> + +</s:Module> http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/states/assets/back.png ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/states/assets/back.png b/tourdeflexmodules/src/spark/states/assets/back.png new file mode 100644 index 0000000..19367fb Binary files /dev/null and b/tourdeflexmodules/src/spark/states/assets/back.png differ http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/TextLayoutEditorCanvas.mxml ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/TextLayoutEditorCanvas.mxml b/tourdeflexmodules/src/spark/tlf/TextLayoutEditorCanvas.mxml new file mode 100644 index 0000000..bda3699 --- /dev/null +++ b/tourdeflexmodules/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> http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/TextLayoutEditorSample.mxml ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/TextLayoutEditorSample.mxml b/tourdeflexmodules/src/spark/tlf/TextLayoutEditorSample.mxml new file mode 100644 index 0000000..d18ae6b --- /dev/null +++ b/tourdeflexmodules/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:Module xmlns="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:local="*"> + <local:TextLayoutEditorCanvas width="100%" height="100%"/> + <Style source="/flashx/textLayout/ui/VellumGUIStyles.css"/> + <!--<Style source="VellumGUIStyles.css"/>--> +</s:Module> + http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/assets/%scroll_arrow_down_over.png ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/assets/%scroll_arrow_down_over.png b/tourdeflexmodules/src/spark/tlf/assets/%scroll_arrow_down_over.png new file mode 100644 index 0000000..a209b46 Binary files /dev/null and b/tourdeflexmodules/src/spark/tlf/assets/%scroll_arrow_down_over.png differ http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/assets/%scroll_arrow_up_over.png ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/assets/%scroll_arrow_up_over.png b/tourdeflexmodules/src/spark/tlf/assets/%scroll_arrow_up_over.png new file mode 100644 index 0000000..5e37d0f Binary files /dev/null and b/tourdeflexmodules/src/spark/tlf/assets/%scroll_arrow_up_over.png differ http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/assets/combo_drop_down_arrow.png ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/assets/combo_drop_down_arrow.png b/tourdeflexmodules/src/spark/tlf/assets/combo_drop_down_arrow.png new file mode 100644 index 0000000..1b905e8 Binary files /dev/null and b/tourdeflexmodules/src/spark/tlf/assets/combo_drop_down_arrow.png differ http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/assets/header_close_icon.png ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/assets/header_close_icon.png b/tourdeflexmodules/src/spark/tlf/assets/header_close_icon.png new file mode 100644 index 0000000..e55928c Binary files /dev/null and b/tourdeflexmodules/src/spark/tlf/assets/header_close_icon.png differ http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/assets/header_open_icon.png ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/assets/header_open_icon.png b/tourdeflexmodules/src/spark/tlf/assets/header_open_icon.png new file mode 100644 index 0000000..d3a1b42 Binary files /dev/null and b/tourdeflexmodules/src/spark/tlf/assets/header_open_icon.png differ http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/assets/scroll_arrow_down.png ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/assets/scroll_arrow_down.png b/tourdeflexmodules/src/spark/tlf/assets/scroll_arrow_down.png new file mode 100644 index 0000000..f5d8145 Binary files /dev/null and b/tourdeflexmodules/src/spark/tlf/assets/scroll_arrow_down.png differ http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/assets/scroll_arrow_down_over.png ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/assets/scroll_arrow_down_over.png b/tourdeflexmodules/src/spark/tlf/assets/scroll_arrow_down_over.png new file mode 100644 index 0000000..ef66ac6 Binary files /dev/null and b/tourdeflexmodules/src/spark/tlf/assets/scroll_arrow_down_over.png differ http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/assets/scroll_arrow_up.png ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/assets/scroll_arrow_up.png b/tourdeflexmodules/src/spark/tlf/assets/scroll_arrow_up.png new file mode 100644 index 0000000..1d3828d Binary files /dev/null and b/tourdeflexmodules/src/spark/tlf/assets/scroll_arrow_up.png differ http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/assets/scroll_arrow_up_over.png ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/assets/scroll_arrow_up_over.png b/tourdeflexmodules/src/spark/tlf/assets/scroll_arrow_up_over.png new file mode 100644 index 0000000..2147d32 Binary files /dev/null and b/tourdeflexmodules/src/spark/tlf/assets/scroll_arrow_up_over.png differ http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/flashx/textLayout/UiClasses.as ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/flashx/textLayout/UiClasses.as b/tourdeflexmodules/src/spark/tlf/flashx/textLayout/UiClasses.as new file mode 100644 index 0000000..712e83a --- /dev/null +++ b/tourdeflexmodules/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; + } +} http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/MultiPanel.as ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/MultiPanel.as b/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/MultiPanel.as new file mode 100644 index 0000000..774031a --- /dev/null +++ b/tourdeflexmodules/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-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/MultiPanelHeaderSkin.as ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/MultiPanelHeaderSkin.as b/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/MultiPanelHeaderSkin.as new file mode 100644 index 0000000..f5043a3 --- /dev/null +++ b/tourdeflexmodules/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-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/PanelWithEdgeBars.as ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/PanelWithEdgeBars.as b/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/PanelWithEdgeBars.as new file mode 100644 index 0000000..1d55c59 --- /dev/null +++ b/tourdeflexmodules/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-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/VellumGUIStyles.css ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/VellumGUIStyles.css b/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/VellumGUIStyles.css new file mode 100644 index 0000000..8756a92 --- /dev/null +++ b/tourdeflexmodules/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-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_down_over.png ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_down_over.png b/tourdeflexmodules/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/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_down_over.png differ http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_up_over.png ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_up_over.png b/tourdeflexmodules/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/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/%scroll_arrow_up_over.png differ http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/combo_drop_down_arrow.png ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/combo_drop_down_arrow.png b/tourdeflexmodules/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/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/combo_drop_down_arrow.png differ http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/header_close_icon.png ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/header_close_icon.png b/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/header_close_icon.png new file mode 100644 index 0000000..e55928c Binary files /dev/null and b/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/header_close_icon.png differ http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/header_open_icon.png ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/header_open_icon.png b/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/header_open_icon.png new file mode 100644 index 0000000..d3a1b42 Binary files /dev/null and b/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/header_open_icon.png differ http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down.png ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down.png b/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down.png new file mode 100644 index 0000000..f5d8145 Binary files /dev/null and b/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down.png differ http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down_over.png ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down_over.png b/tourdeflexmodules/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/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_down_over.png differ http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up.png ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up.png b/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up.png new file mode 100644 index 0000000..1d3828d Binary files /dev/null and b/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up.png differ http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up_over.png ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up_over.png b/tourdeflexmodules/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/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/assets/scroll_arrow_up_over.png differ http://git-wip-us.apache.org/repos/asf/flex-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/inspectors/AdvancedTextPropertyEditor.as ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/inspectors/AdvancedTextPropertyEditor.as b/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/inspectors/AdvancedTextPropertyEditor.as new file mode 100644 index 0000000..145c721 --- /dev/null +++ b/tourdeflexmodules/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-examples/blob/9343d391/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/inspectors/AntiAliasPropertyEditor.as ---------------------------------------------------------------------- diff --git a/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/inspectors/AntiAliasPropertyEditor.as b/tourdeflexmodules/src/spark/tlf/flashx/textLayout/ui/inspectors/AntiAliasPropertyEditor.as new file mode 100644 index 0000000..af0fc66 --- /dev/null +++ b/tourdeflexmodules/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