I understand much better now, thank you. The class names are a little
confusing. :]

I think this would be a great design and look forward to seeing your
UI in action. Let me know if you want a user to try this out. :]

SS

On 6/13/07, Paul Austin <[EMAIL PROTECTED]> wrote:
> SS,
>
> FilterStyle extends Style and all it does is loop through the list of
> StyleFilters invoking the isMatched method on each one until one of
> those is matched and uses the Style associated with that StyleFilter.
> See coee at the end of the email. I need to come up with better names as
> the current ones can get confusing.
>
> The user interface would allow you to add/remove/re-order StyleFilter
> instances on the FilterStylePanel, specifying the label, StyleFilter
> instance and the BasicStyle properties for each filter. You could then
> add additional types of StyleFilters as plug-ins and each one would have
> it's own panel to configure the filter.
>
> I'll be implementing a FeatureValuesStyleFilter that you can select a
> number of attributes and their values so you can style a 2 lane, paved
> road different from a 1 lane, loose road.
>
> I'll put together a UI to demonstrate what this will look like.
>
>  public void paint(Feature f, Graphics2D g, Viewport viewport)
>    throws Exception {
>    getStyle(f).paint(f, g, viewport);
>  }
>
>  private Style getStyle(Feature feature) {
>    FeatureSchema schema = feature.getSchema();
>    boolean foundStyle = false;
>    for (Iterator styleIter = styleFilters.iterator(); !foundStyle
>      && styleIter.hasNext();) {
>      StyleFilter styleFilter = (StyleFilter)styleIter.next();
>      if (styleFilter.isMatched(feature)) {
>        Style style = styleFilter.getStyle();
>        if (style != null) {
>          return style;
>        } else {
>          System.out.println(styleFilter.getLabel());
>        }
>      }
>    }
>    return defaultStyle;
>  }
>
>
>
>
>
> Sunburned Surveyor wrote:
> > Paul,
> >
> > This sounds pretty slick. I just want to make sure that I understand
> > your design. A FilterStyle object would implement and/or extend the
> > current Style object. It would apply a Style filter object depending
> > on the attribute values of each Feature in a layer.
> >
> > It sounds like a FilterStyle is somewhat like a wrapper of a Style
> > object with an embedded query.
> >
> > Do I have it correct?
> >
> > If so, I think this is a great feature. Will there be a UI component
> > that allows the user to define new StyleFilters?
> >
> > SS
> >
> > P.S. - It seems like you might be able to simplify this a little bit
> > by eliminating the StyleFilter object. You could move the isMatched
> > method and the getStyle method to the FilterStyle. Then just store
> > regular Styles in the FilterStyle. In this scenario you would move the
> > selection of the approriate "style" to the FilterStyle itself. This is
> > just a suggestion. :]
> >
> > On 6/11/07, Paul Austin <[EMAIL PROTECTED]> wrote:
> >
> >> The current theming works well if you have a single attribute value that
> >> you want to assign a different style to. It does not however work if you
> >> want to define more complex style to feature rules using more than one
> >> attribute (e.g. number of lanes and surface type on a road).
> >>
> >> What would be useful is another type of style called FilterStyle. This
> >> style would have an ordered list of StyleFilters which would have some
> >> kind of filter, a label and a Style object to use if the filter matches
> >> the feature. The implementation of Filter Style would loop through the
> >> filters until one was matched and then return the style for that filter.
> >> If no filters are matched then a default style is returned.
> >>
> >> The StyleFilter would be an interface as shown below and there would be
> >> an implementation that would take a Map of expected values on the feature.
> >>
> >> public interface StyleFilter {
> >>  boolean isMatched(Feature feature);
> >>
> >>  String getLabel();
> >>  void setLabel(String label);
> >>
> >>  Style getStyle();
> >>
> >>  void setStyle(Style style);
> >> }
> >>
> >>
> >> Obviously this new style would be a little slower than the existing
> >> color theming so if you are filtering on one attribute stick with the
> >> current method, if you want something more complex this new approach
> >> will work.
> >>
> >> I have a prototype of the rendering side working, I'll need to add a UI
> >> panel to edit the style and also need to extend the TreeModel to display
> >> the themes in the tree as is done for the current style. With the new
> >> style I'd allow users to show/hide themed features as well.
> >>
> >> Paul
> >>
> >> -------------------------------------------------------------------------
> >> This SF.net email is sponsored by DB2 Express
> >> Download DB2 Express C - the FREE version of DB2 express and take
> >> control of your XML. No limits. Just data. Click to get it now.
> >> http://sourceforge.net/powerbar/db2/
> >> _______________________________________________
> >> Jump-pilot-devel mailing list
> >> Jump-pilot-devel@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> >>
> >>
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > Jump-pilot-devel mailing list
> > Jump-pilot-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> >
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to