You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Harbs <ga...@gmail.com> on 2013/02/26 20:11:31 UTC

VRule and HRule

While going through the mx components I'm trying to remove, I'm looking into HRule and VRule.

For my purposes it's simple enough to just draw some lines, but I figured I'd look into what's necessary to create Spark versions.

Looking at the HRule and VRule classes, it seems to me that all that's really needed is to copy the mx components and just change the package to spark. It's based on UIComponent which Spark components are also based on.

Am I missing something?

Also, is it really necessary to base HRule and VRule off UIComponent, that's a lot of dependent code there for a very simple component…

Harbs

Re: VRule and HRule

Posted by Jonathan Campos <jo...@gmail.com>.
On Tue, Feb 26, 2013 at 1:19 PM, Om <bi...@gmail.com> wrote:

> I just tried adding a VRule to my code and I was prompted by FB to use
> spark.primitives.Line instead.  Have you taken a look at it yet?
>

Agreed. I think most people just think "oh that is a line" and don't worry
about it. I know that some people are worried about 100% parity, while
other just don't see a point for something like the v/hrule.


-- 
Jonathan Campos

Re: VRule and HRule

Posted by Om <bi...@gmail.com>.
On Tue, Feb 26, 2013 at 11:11 AM, Harbs <ga...@gmail.com> wrote:

> While going through the mx components I'm trying to remove, I'm looking
> into HRule and VRule.
>
> For my purposes it's simple enough to just draw some lines, but I figured
> I'd look into what's necessary to create Spark versions.
>
> Looking at the HRule and VRule classes, it seems to me that all that's
> really needed is to copy the mx components and just change the package to
> spark. It's based on UIComponent which Spark components are also based on.
>
> Am I missing something?
>
> Also, is it really necessary to base HRule and VRule off UIComponent,
> that's a lot of dependent code there for a very simple component…
>
> Harbs



I just tried adding a VRule to my code and I was prompted by FB to use
spark.primitives.Line instead.  Have you taken a look at it yet?

BTW, here is a comprehensive list of missing spark components, if you are
looking for something like this [1]

Thanks,
Om

[1]
https://cwiki.apache.org/confluence/display/FLEX/Missing+Spark+Components

RE: VRule and HRule

Posted by Kessler CTR Mark J <ma...@usmc.mil>.
   I think we should have a comparable one in spark.  A stroke and a shadow.  Padding outside the lines would be great so these could be more easily used as a separator.

-Mark

-----Original Message-----
From: Alex Harui [mailto:aharui@adobe.com] 
Sent: Tuesday, February 26, 2013 3:07 PM
To: dev@flex.apache.org
Subject: Re: VRule and HRule




On 2/26/13 11:11 AM, "Harbs" <ga...@gmail.com> wrote:

> While going through the mx components I'm trying to remove, I'm looking into
> HRule and VRule.
> 
> For my purposes it's simple enough to just draw some lines, but I figured I'd
> look into what's necessary to create Spark versions.
> 
> Looking at the HRule and VRule classes, it seems to me that all that's really
> needed is to copy the mx components and just change the package to spark. It's
> based on UIComponent which Spark components are also based on.
> 
> Am I missing something?
> 
> Also, is it really necessary to base HRule and VRule off UIComponent, that's a
> lot of dependent code there for a very simple componentŠ
> 
Vrule and Hrule either have to be IUIComponents or be based of the graphic
primitives like Line otherwise it may not work like you want in MXML.

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


Re: VRule and HRule

Posted by Cosma Colanicchia <co...@gmail.com>.
Personally, I don't think that providing any possible
aggregations/specializations of existing components would be an improvement
for the framework.

However, the framework provide a BorderContainer component that does a
similar thing (except for the fact that it is also a container): provide
styles to control skin behavior.

As a side note, even if not strictly related, this make me think about a
limitation see with current Spark skinning implementation: the relation
between skins and styles. Sometime it would be useful to "configure" some
skin visual properties directly from MXML using a style, but style must be
declared by the host component (even if inherited by the skin, think about
"borderColor" and "borderAlpha"). This force you to subclass and/or create
a strong dependency between component and skin (leading to "theme
warnings", such as "the style XXX could only be used with theme YYY"). My
current workaround is to use CSS rules to assign styles directly to skin
classes, but its far from perfect..





2013/2/27 Harbs <ga...@gmail.com>

> So you think there should be a separate H/VRule and H/VRuleSkin?
>
> Is it really necessary to have it fully skinnable?
>
> I was just thinking of allowing to specify an alternate stroke (for
> gradients, etc) and allow all the standard filters, etc.
>
> By default it would have a solid stroke, and you'd just specify the weight
> along with the width and height of the component.
>
> Harbs
>
> On Feb 27, 2013, at 7:07 PM, Alex Harui wrote:
>
> > Yep, but the Spark philosophy might lean away from such "intelligence"
> and
> > styles and head towards skinning.
> >
> >
> > On 2/27/13 8:56 AM, "Kessler CTR Mark J" <ma...@usmc.mil>
> wrote:
> >
> >> Here is a link to the HRule and VRule.  While these are the MX
> versions, they
> >> do have a good picture that shows what it can do under the sections
> "Sizing
> >> HRule and VRule controls"
> >>
> >>
> http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d
> >> 96.html
> >>
> >> -Mark
> >>
> >
> > --
> > Alex Harui
> > Flex SDK Team
> > Adobe Systems, Inc.
> > http://blogs.adobe.com/aharui
> >
>
>

RE: VRule and HRule

Posted by Kessler CTR Mark J <ma...@usmc.mil>.
   Well my only requirements in the end is a double line (stroke & shade line 2px high total) and the ability to put padding before / after it so it can be used as a separator as well.    Currently I just have an AS component that is skinless which works well.

   Ultimately I would like to have a complete spark component set even if it's not much different from the MX versions.

-Mark

-----Original Message-----
From: Alex Harui [mailto:aharui@adobe.com] 
Sent: Wednesday, February 27, 2013 2:30 PM
To: dev@flex.apache.org
Subject: Re: VRule and HRule




On 2/27/13 10:52 AM, "Harbs" <ga...@gmail.com> wrote:

> So you think there should be a separate H/VRule and H/VRuleSkin?
Not really, I was just pointing out the Spark-thinking.  That would be so
heavy, it really wouldn't be practical, but it sure would be powerful.
> 
> Is it really necessary to have it fully skinnable?
No, just thinking out loud.  But if it isn't skinnable and goes in
spark.components then it isn't "consistent".
> 
> I was just thinking of allowing to specify an alternate stroke (for gradients,
> etc) and allow all the standard filters, etc.
> 
> By default it would have a solid stroke, and you'd just specify the weight
> along with the width and height of the component.
So if you do that (which is a reasonable thing to do), keep in mind that if
you have a weight property, then it doesn't make sense to have a replaceable
stroke for which the weight property may not apply.

If it were me, I'd probably call it SolidLine instead of Rule and put it in
the graphics package so folks know it isn't skinnable, and not allow
replacing of the stroke.  I think that would hit the 80% case.

RE: VRule and HRule

Posted by Kessler CTR Mark J <ma...@usmc.mil>.
I support the skin idea would be nice to just drop in a component and have the line skinned the way you want it. Something simple like a SkinnableComponent that has a basic SparkSkin would be fine.  

-Mark



-----Original Message-----
From: Harbs [mailto:gavharbs@gmail.com] 
Sent: Wednesday, February 27, 2013 1:53 PM
To: dev@flex.apache.org
Subject: Re: VRule and HRule

So you think there should be a separate H/VRule and H/VRuleSkin?

Is it really necessary to have it fully skinnable?

I was just thinking of allowing to specify an alternate stroke (for gradients, etc) and allow all the standard filters, etc.

By default it would have a solid stroke, and you'd just specify the weight along with the width and height of the component.

Harbs

On Feb 27, 2013, at 7:07 PM, Alex Harui wrote:

> Yep, but the Spark philosophy might lean away from such "intelligence" and
> styles and head towards skinning.
> 
> 
> On 2/27/13 8:56 AM, "Kessler CTR Mark J" <ma...@usmc.mil> wrote:
> 
>> Here is a link to the HRule and VRule.  While these are the MX versions, they
>> do have a good picture that shows what it can do under the sections "Sizing
>> HRule and VRule controls"
>> 
>> http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d
>> 96.html
>> 
>> -Mark
>> 
> 
> -- 
> Alex Harui
> Flex SDK Team
> Adobe Systems, Inc.
> http://blogs.adobe.com/aharui
> 


Re: VRule and HRule

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


On 2/27/13 10:52 AM, "Harbs" <ga...@gmail.com> wrote:

> So you think there should be a separate H/VRule and H/VRuleSkin?
Not really, I was just pointing out the Spark-thinking.  That would be so
heavy, it really wouldn't be practical, but it sure would be powerful.
> 
> Is it really necessary to have it fully skinnable?
No, just thinking out loud.  But if it isn't skinnable and goes in
spark.components then it isn't "consistent".
> 
> I was just thinking of allowing to specify an alternate stroke (for gradients,
> etc) and allow all the standard filters, etc.
> 
> By default it would have a solid stroke, and you'd just specify the weight
> along with the width and height of the component.
So if you do that (which is a reasonable thing to do), keep in mind that if
you have a weight property, then it doesn't make sense to have a replaceable
stroke for which the weight property may not apply.

If it were me, I'd probably call it SolidLine instead of Rule and put it in
the graphics package so folks know it isn't skinnable, and not allow
replacing of the stroke.  I think that would hit the 80% case.

> 
> Harbs
> 
> On Feb 27, 2013, at 7:07 PM, Alex Harui wrote:
> 
>> Yep, but the Spark philosophy might lean away from such "intelligence" and
>> styles and head towards skinning.
>> 
>> 
>> On 2/27/13 8:56 AM, "Kessler CTR Mark J" <ma...@usmc.mil> wrote:
>> 
>>> Here is a link to the HRule and VRule.  While these are the MX versions,
>>> they
>>> do have a good picture that shows what it can do under the sections "Sizing
>>> HRule and VRule controls"
>>> 
>>> http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-
>>> 7d
>>> 96.html
>>> 
>>> -Mark
>>> 
>> 
>> -- 
>> Alex Harui
>> Flex SDK Team
>> Adobe Systems, Inc.
>> http://blogs.adobe.com/aharui
>> 
> 

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


Re: VRule and HRule

Posted by Harbs <ga...@gmail.com>.
So you think there should be a separate H/VRule and H/VRuleSkin?

Is it really necessary to have it fully skinnable?

I was just thinking of allowing to specify an alternate stroke (for gradients, etc) and allow all the standard filters, etc.

By default it would have a solid stroke, and you'd just specify the weight along with the width and height of the component.

Harbs

On Feb 27, 2013, at 7:07 PM, Alex Harui wrote:

> Yep, but the Spark philosophy might lean away from such "intelligence" and
> styles and head towards skinning.
> 
> 
> On 2/27/13 8:56 AM, "Kessler CTR Mark J" <ma...@usmc.mil> wrote:
> 
>> Here is a link to the HRule and VRule.  While these are the MX versions, they
>> do have a good picture that shows what it can do under the sections "Sizing
>> HRule and VRule controls"
>> 
>> http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d
>> 96.html
>> 
>> -Mark
>> 
> 
> -- 
> Alex Harui
> Flex SDK Team
> Adobe Systems, Inc.
> http://blogs.adobe.com/aharui
> 


Re: VRule and HRule

Posted by Alex Harui <ah...@adobe.com>.
Yep, but the Spark philosophy might lean away from such "intelligence" and
styles and head towards skinning.


On 2/27/13 8:56 AM, "Kessler CTR Mark J" <ma...@usmc.mil> wrote:

> Here is a link to the HRule and VRule.  While these are the MX versions, they
> do have a good picture that shows what it can do under the sections "Sizing
> HRule and VRule controls"
> 
> http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d
> 96.html
> 
> -Mark
> 

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


RE: VRule and HRule

Posted by Kessler CTR Mark J <ma...@usmc.mil>.
Here is a link to the HRule and VRule.  While these are the MX versions, they do have a good picture that shows what it can do under the sections "Sizing HRule and VRule controls"

http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7d96.html

-Mark


Re: VRule and HRule

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> My way of thinking is that Flex is about making these things easy so that you don't need to add these custom classes to every project… :-)

Post the code and lets have a look.

Thanks,
Justin

Re: VRule and HRule

Posted by Harbs <ga...@gmail.com>.
Of course. (That's what I already did…)

My way of thinking is that Flex is about making these things easy so that you don't need to add these custom classes to every project… :-)

On Feb 27, 2013, at 6:01 PM, Michael A. Labriola wrote:

>> Graphic primitives are more lightweight. Right?
> 
>> Line is not really a replacement for HRule and VRule, because you need to add stroke every time you add one. That's at least four lines of mxml to one for HRule and VRule.
> 
> There is nothing wrong with making it a line, and then simply wrapping the Line associated stroke in a new class named VRule and HRule... You don't literally need to type those lines every time to base this on the graphics. So, make a class that is a line pre-configured the way you want it.
> 
> Mike


Re: VRule and HRule

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


On 2/27/13 8:01 AM, "Michael A. Labriola" <la...@digitalprimates.net>
wrote:

>> Graphic primitives are more lightweight. Right?
> 
>> Line is not really a replacement for HRule and VRule, because you need to add
>> stroke every time you add one. That's at least four lines of mxml to one for
>> HRule and VRule.
> 
> There is nothing wrong with making it a line, and then simply wrapping the
> Line associated stroke in a new class named VRule and HRule... You don't
> literally need to type those lines every time to base this on the graphics.
> So, make a class that is a line pre-configured the way you want it.
> 
> Mike
I'm ok with that, but just for fun: should a Spark Vrule be skinnable?  Or
at minimum, should it allow for a replaceable stroke and just default to
SolidColorStroke?

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui


RE: VRule and HRule

Posted by "Michael A. Labriola" <la...@digitalprimates.net>.
>Graphic primitives are more lightweight. Right?

>Line is not really a replacement for HRule and VRule, because you need to add stroke every time you add one. That's at least four lines of mxml to one for HRule and VRule.

There is nothing wrong with making it a line, and then simply wrapping the Line associated stroke in a new class named VRule and HRule... You don't literally need to type those lines every time to base this on the graphics. So, make a class that is a line pre-configured the way you want it.

Mike

Re: VRule and HRule

Posted by Harbs <ga...@gmail.com>.
Graphic primitives are more lightweight. Right?

Line is not really a replacement for HRule and VRule, because you need to add stroke every time you add one. That's at least four lines of mxml to one for HRule and VRule.

I think I'll work on this. It should be pretty easy…

On Feb 26, 2013, at 10:06 PM, Alex Harui wrote:

> 
> 
> 
> On 2/26/13 11:11 AM, "Harbs" <ga...@gmail.com> wrote:
> 
>> While going through the mx components I'm trying to remove, I'm looking into
>> HRule and VRule.
>> 
>> For my purposes it's simple enough to just draw some lines, but I figured I'd
>> look into what's necessary to create Spark versions.
>> 
>> Looking at the HRule and VRule classes, it seems to me that all that's really
>> needed is to copy the mx components and just change the package to spark. It's
>> based on UIComponent which Spark components are also based on.
>> 
>> Am I missing something?
>> 
>> Also, is it really necessary to base HRule and VRule off UIComponent, that's a
>> lot of dependent code there for a very simple componentŠ
>> 
> Vrule and Hrule either have to be IUIComponents or be based of the graphic
> primitives like Line otherwise it may not work like you want in MXML.
> 
> -- 
> Alex Harui
> Flex SDK Team
> Adobe Systems, Inc.
> http://blogs.adobe.com/aharui
> 


Re: VRule and HRule

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


On 2/26/13 11:11 AM, "Harbs" <ga...@gmail.com> wrote:

> While going through the mx components I'm trying to remove, I'm looking into
> HRule and VRule.
> 
> For my purposes it's simple enough to just draw some lines, but I figured I'd
> look into what's necessary to create Spark versions.
> 
> Looking at the HRule and VRule classes, it seems to me that all that's really
> needed is to copy the mx components and just change the package to spark. It's
> based on UIComponent which Spark components are also based on.
> 
> Am I missing something?
> 
> Also, is it really necessary to base HRule and VRule off UIComponent, that's a
> lot of dependent code there for a very simple componentŠ
> 
Vrule and Hrule either have to be IUIComponents or be based of the graphic
primitives like Line otherwise it may not work like you want in MXML.

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui