Ignore:
Timestamp:
2009-07-19T22:26:57+02:00 (15 years ago)
Author:
jttt
Message:

Add enabled property for layers/routes

Location:
applications/editors/josm/plugins/routes
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/routes

    • Property svn:ignore
      •  

        old new  
        11build
         2
         3bin
  • applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RouteLayer.java

    r16428 r16593  
    3535               
    3636                int index = 0;
    37                 for (RoutesXMLRoute route:xmlLayer.getRoute()) {
    38                         Color color = ColorHelper.html2color(route.getColor());
    39                         if (color == null) {
    40                                 color = Color.RED;
    41                                 System.err.printf("Routes plugin - unable to convert color (%s)\n", route.getColor());
     37                for (RoutesXMLRoute route:xmlLayer.getRoute()) {                       
     38                        if (route.isEnabled()) {
     39                                Color color = ColorHelper.html2color(route.getColor());
     40                                if (color == null) {
     41                                        color = Color.RED;
     42                                        System.err.printf("Routes plugin - unable to convert color (%s)\n", route.getColor());
     43                                }
     44                                routes.add(new RouteDefinition(index++, color, route.getPattern()));
    4245                        }
    43                         routes.add(new RouteDefinition(index++, color, route.getPattern()));
    4446                }
    4547               
    46                 /*routes.add(new RouteDefinition(Color.RED,
    47                         "((type:relation | type:way) kct_red=*) | (color=red type=route route=hiking network=cz:kct)"));
    48                
    49                 routes.add(new RouteDefinition(Color.YELLOW,
    50                         "((type:relation | type:way) kct_yellow=*) | (color=yellow type=route route=hiking network=cz:kct)"));
    51 
    52                 routes.add(new RouteDefinition(Color.BLUE,
    53                         "((type:relation | type:way) kct_blue=*) | (color=blue type=route route=hiking network=cz:kct)"));
    54 
    55                 routes.add(new RouteDefinition(Color.GREEN,
    56                         "((type:relation | type:way) kct_green=*) | (color=green type=route route=hiking network=cz:kct)"));
    57                
    58                 routes.add(new RouteDefinition(Color.MAGENTA,
    59                                 "(type:way (ncn=* | (lcn=* | rcn=* ))) | (type:relation type=route route=bicycle)"));
    60                                
    61                                 */
    6248                if ("wide".equals(Main.pref.get("routes.painter"))) {
    6349                        pathPainter = new WideLinePainter(this);
  • applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RoutesPlugin.java

    r16428 r16593  
    6161                new FileInputStream(getPluginDir() + File.separator + "routes.xml"));
    6262            for (RoutesXMLLayer layer:routes.getLayer()) {
    63                 routeLayers.add(new RouteLayer(layer));
     63                if (layer.isEnabled()) {
     64                        routeLayers.add(new RouteLayer(layer));
     65                }
    6466            }
    6567        } catch (Exception e) {
  • applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/ObjectFactory.java

    r16428 r16593  
    33// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
    44// Any modifications to this file will be lost upon recompilation of the source schema.
    5 // Generated on: 2009.07.09 at 08:14:28 odp. CEST
     5// Generated on: 2009.07.19 at 03:50:48 odp. CEST
    66//
    77
  • applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/Routes.java

    r16428 r16593  
    33// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
    44// Any modifications to this file will be lost upon recompilation of the source schema.
    5 // Generated on: 2009.07.09 at 08:14:28 odp. CEST
     5// Generated on: 2009.07.19 at 03:50:48 odp. CEST
    66//
    77
  • applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/RoutesXMLLayer.java

    r16428 r16593  
    33// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
    44// Any modifications to this file will be lost upon recompilation of the source schema.
    5 // Generated on: 2009.07.09 at 08:14:28 odp. CEST
     5// Generated on: 2009.07.19 at 03:50:48 odp. CEST
    66//
    77
     
    3030 *       &lt;/sequence>
    3131 *       &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
     32 *       &lt;attribute name="enabled" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
    3233 *     &lt;/restriction>
    3334 *   &lt;/complexContent>
     
    4647    @XmlAttribute
    4748    protected String name;
     49    @XmlAttribute
     50    protected Boolean enabled;
    4851
    4952    /**
     
    100103    }
    101104
     105    /**
     106     * Gets the value of the enabled property.
     107     *
     108     * @return
     109     *     possible object is
     110     *     {@link Boolean }
     111     *     
     112     */
     113    public boolean isEnabled() {
     114        if (enabled == null) {
     115            return true;
     116        } else {
     117            return enabled;
     118        }
     119    }
     120
     121    /**
     122     * Sets the value of the enabled property.
     123     *
     124     * @param value
     125     *     allowed object is
     126     *     {@link Boolean }
     127     *     
     128     */
     129    public void setEnabled(Boolean value) {
     130        this.enabled = value;
     131    }
     132
    102133}
  • applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/RoutesXMLRoute.java

    r16428 r16593  
    33// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
    44// Any modifications to this file will be lost upon recompilation of the source schema.
    5 // Generated on: 2009.07.09 at 08:14:28 odp. CEST
     5// Generated on: 2009.07.19 at 03:50:48 odp. CEST
    66//
    77
     
    2929 *       &lt;/sequence>
    3030 *       &lt;attribute name="color" type="{http://www.w3.org/2001/XMLSchema}string" />
     31 *       &lt;attribute name="enabled" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
    3132 *     &lt;/restriction>
    3233 *   &lt;/complexContent>
     
    4647    @XmlAttribute
    4748    protected String color;
     49    @XmlAttribute
     50    protected Boolean enabled;
    4851
    4952    /**
     
    9598    }
    9699
     100    /**
     101     * Gets the value of the enabled property.
     102     *
     103     * @return
     104     *     possible object is
     105     *     {@link Boolean }
     106     *     
     107     */
     108    public boolean isEnabled() {
     109        if (enabled == null) {
     110            return true;
     111        } else {
     112            return enabled;
     113        }
     114    }
     115
     116    /**
     117     * Sets the value of the enabled property.
     118     *
     119     * @param value
     120     *     allowed object is
     121     *     {@link Boolean }
     122     *     
     123     */
     124    public void setEnabled(Boolean value) {
     125        this.enabled = value;
     126    }
     127
    97128}
  • applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/package-info.java

    r16428 r16593  
    33// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
    44// Any modifications to this file will be lost upon recompilation of the source schema.
    5 // Generated on: 2009.07.09 at 08:14:28 odp. CEST
     5// Generated on: 2009.07.19 at 03:50:48 odp. CEST
    66//
    77
  • applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/routes.xsd

    r16428 r16593  
    3333        </sequence>
    3434        <attribute name="name" type="string"/>
     35        <attribute name="enabled" type="boolean" default="true"/>
    3536</complexType>
    3637
     
    4041        </sequence>
    4142        <attribute name="color" type="string"/>
     43        <attribute name="enabled" type="boolean" default="true"/>
    4244</complexType>
    4345
Note: See TracChangeset for help on using the changeset viewer.