You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by OK <OK...@edscha.com> on 2016/05/13 07:16:03 UTC

[FlexJS] How to use the Graphics framework?

Hi,
I've just found the "org.apache.flex.core.graphics" classes and try to draw
a circle... without success.
The only thing I've got is an empty screen.

I used the follwing snippet as "initialView":

<js:ViewBase xmlns:fx="http://ns.adobe.com/mxml/2009"
				xmlns:js="library://ns.apache.org/flexjs/basic" >
		<js:Circle x="100" y="100" radius="50">
			<js:SolidColor color="#26C9FF" />
		</js:Circle>
</js:ViewBase>

Maybe there's a surrounding container needed to make it work?
Does somebody know how it works?

Thanks,
Olaf



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-How-to-use-the-Graphics-framework-tp12681.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: [FlexJS] How to use the Graphics framework?

Posted by Alex Harui <ah...@adobe.com>.

On 5/13/16, 8:23 AM, "Peter Ent" <pe...@adobe.com> wrote:

>IMHO, the default property should be the most obvious or property with the
>highest priority. IOW, I don't see why fill should be more important than
>stroke, so the graphics shouldn't have a default property.

Maybe it is just me, but I fill just about every circle.  Another option
is to create a SolidColorFilledCircle component.  It wouldn't have any
child tags at all.  That's a good illustration of aggregation into
higher-level components.

BTW, regarding checking for valid input, it is surprising that something
didn't throw an error, but also, IMO, the components should not do input
validation because when you get to production, you should have done some
tests and found issues like these such that input validation is a waste of
time in production.  Instead, it would be great to find a volunteer to
explore the notion of debug beads.  These would be beads that plug into
views or components and do input validation based on some configuration
option.

Thoughts?
-Alex


Re: [FlexJS] How to use the Graphics framework?

Posted by Peter Ent <pe...@adobe.com>.
IMHO, the default property should be the most obvious or property with the
highest priority. IOW, I don't see why fill should be more important than
stroke, so the graphics shouldn't have a default property.

‹peter

On 5/13/16, 10:57 AM, "Alex Harui" <ah...@adobe.com> wrote:

>
>
>On 5/13/16, 7:07 AM, "Peter Ent" <pe...@adobe.com> wrote:
>
>>I just tried my example without the <js:fill> either and did not get an
>>error. I'm thinking this is a bug as Circle and the other graphics
>>classes
>>do not have default properties that I'm aware of.
>
>Any reason we shouldn't add fill as the default property?
>
>-Alex
>


Re: [FlexJS] How to use the Graphics framework?

Posted by Alex Harui <ah...@adobe.com>.

On 5/13/16, 7:07 AM, "Peter Ent" <pe...@adobe.com> wrote:

>I just tried my example without the <js:fill> either and did not get an
>error. I'm thinking this is a bug as Circle and the other graphics classes
>do not have default properties that I'm aware of.

Any reason we shouldn't add fill as the default property?

-Alex


Re: [FlexJS] How to use the Graphics framework?

Posted by Peter Ent <pe...@adobe.com>.
I just tried my example without the <js:fill> either and did not get an
error. I'm thinking this is a bug as Circle and the other graphics classes
do not have default properties that I'm aware of.

Regards,
Peter

On 5/13/16, 9:30 AM, "OK" <OK...@edscha.com> wrote:

>>It looks like you are just missing the <js:fill> property of the circle:
>Ahhhhrghhh.... that's it!
>
>
>>I'm surprised you didn't get an error with the SolidColor tag just
>>floating
>within the Circle element.
>I didn't notice any error (using the nightly build 0.7.0).
>
>Thanks!
>Olaf
>
>
>
>
>
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/FlexJS-How-to-use-the-Graph
>ics-framework-tp12681p12690.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.


Re: [FlexJS] How to use the Graphics framework?

Posted by OK <OK...@edscha.com>.
>It looks like you are just missing the <js:fill> property of the circle:
Ahhhhrghhh.... that's it!


>I'm surprised you didn't get an error with the SolidColor tag just floating
within the Circle element.
I didn't notice any error (using the nightly build 0.7.0).

Thanks!
Olaf





--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/FlexJS-How-to-use-the-Graphics-framework-tp12681p12690.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: [FlexJS] How to use the Graphics framework?

Posted by Peter Ent <pe...@adobe.com>.
It looks like you are just missing the <js:fill> property of the circle:

<js:Circle x="100" y="100" radius="50">
	<js:fill>
		<js:SolidColor color="#26C9FF" />
	</js:fill>
</js:Circle>

I'm surprised you didn't get an error with the SolidColor tag just
floating within the Circle element.

Peter Ent
Adobe Systems/Apache Flex Project

On 5/13/16, 3:16 AM, "OK" <OK...@edscha.com> wrote:

>Hi,
>I've just found the "org.apache.flex.core.graphics" classes and try to
>draw
>a circle... without success.
>The only thing I've got is an empty screen.
>
>I used the follwing snippet as "initialView":
>
><js:ViewBase xmlns:fx="http://ns.adobe.com/mxml/2009"
>				xmlns:js="library://ns.apache.org/flexjs/basic" >
>		<js:Circle x="100" y="100" radius="50">
>			<js:SolidColor color="#26C9FF" />
>		</js:Circle>
></js:ViewBase>
>
>Maybe there's a surrounding container needed to make it work?
>Does somebody know how it works?
>
>Thanks,
>Olaf
>
>
>
>--
>View this message in context:
>http://apache-flex-users.2333346.n4.nabble.com/FlexJS-How-to-use-the-Graph
>ics-framework-tp12681.html
>Sent from the Apache Flex Users mailing list archive at Nabble.com.