| | 74 | /** |
| | 75 | * Constructs new MapPaintSettings with custom values. Used for rendering where preferences should not be used. |
| | 76 | * @param useRealWidth if true, real width of ways should be used |
| | 77 | * @param showDirectionArrow if true, directional arrows should be displayed |
| | 78 | * @param showOnewayArrow if true, arrows for oneways should be displayed |
| | 79 | * @param defaultSegmentWidth default width for ways segments |
| | 80 | * @param showOrderNumber if true, segment numbers of ways should be displayed |
| | 81 | * @param showOrderNumberOnSelectedWay if true, segment numbers of ways should be displayed on selected way |
| | 82 | * @param showHeadArrowOnly if true, only the last arrow of a way should be displayed |
| | 83 | * @param showNamesDistance the distance at which names should be drawn |
| | 84 | * @param useStrokesDistance the distance at which strokes should be used |
| | 85 | * @param showIconsDistance the distance at which icons should be drawn |
| | 86 | * @param selectedNodeSize the size of selected nodes |
| | 87 | * @param connectionNodeSize the size of multiply connected nodes |
| | 88 | * @param unselectedNodeSize the size of unselected nodes |
| | 89 | * @param taggedNodeSize the size of tagged nodes |
| | 90 | * @param fillSelectedNode if true, selected nodes should be filled |
| | 91 | * @param fillUnselectedNode if true, unselected nodes should be filled |
| | 92 | * @param fillTaggedNode if true, tagged nodes should be filled |
| | 93 | * @param fillConnectionNode if true, multiply connected nodes should be filled |
| | 94 | * @param outlineOnly if true, only the data area outline should be drawn |
| | 95 | * @param selectedColor color for selected objects |
| | 96 | * @param relationSelectedColor color for selected relations |
| | 97 | * @param highlightColor color for highlighted objects |
| | 98 | * @param inactiveColor color for inactive objects |
| | 99 | * @param nodeColor color for nodes |
| | 100 | * @param taggedColor color for tagged nodes |
| | 101 | * @param connectionColor color for multiply connected nodes |
| | 102 | * @param taggedConnectionColor color for tagged and multiply connected nodes |
| | 103 | */ |
| | 104 | public MapPaintSettings(boolean useRealWidth, boolean showDirectionArrow, boolean showOnewayArrow, |
| | 105 | int defaultSegmentWidth, boolean showOrderNumber, boolean showOrderNumberOnSelectedWay, |
| | 106 | boolean showHeadArrowOnly, int showNamesDistance, int useStrokesDistance, |
| | 107 | int showIconsDistance, int selectedNodeSize, int connectionNodeSize, |
| | 108 | int unselectedNodeSize, int taggedNodeSize, boolean fillSelectedNode, |
| | 109 | boolean fillUnselectedNode, boolean fillTaggedNode, boolean fillConnectionNode, |
| | 110 | boolean outlineOnly, Color selectedColor, Color relationSelectedColor, |
| | 111 | Color highlightColor, Color inactiveColor, Color nodeColor, Color taggedColor, |
| | 112 | Color connectionColor, Color taggedConnectionColor) { |
| | 113 | this.useRealWidth = useRealWidth; |
| | 114 | this.showDirectionArrow = showDirectionArrow; |
| | 115 | this.showOnewayArrow = showOnewayArrow; |
| | 116 | this.defaultSegmentWidth = defaultSegmentWidth; |
| | 117 | this.showOrderNumber = showOrderNumber; |
| | 118 | this.showOrderNumberOnSelectedWay = showOrderNumberOnSelectedWay; |
| | 119 | this.showHeadArrowOnly = showHeadArrowOnly; |
| | 120 | this.showNamesDistance = showNamesDistance; |
| | 121 | this.useStrokesDistance = useStrokesDistance; |
| | 122 | this.showIconsDistance = showIconsDistance; |
| | 123 | this.selectedNodeSize = selectedNodeSize; |
| | 124 | this.connectionNodeSize = connectionNodeSize; |
| | 125 | this.unselectedNodeSize = unselectedNodeSize; |
| | 126 | this.taggedNodeSize = taggedNodeSize; |
| | 127 | this.fillSelectedNode = fillSelectedNode; |
| | 128 | this.fillUnselectedNode = fillUnselectedNode; |
| | 129 | this.fillTaggedNode = fillTaggedNode; |
| | 130 | this.fillConnectionNode = fillConnectionNode; |
| | 131 | this.outlineOnly = outlineOnly; |
| | 132 | this.selectedColor = selectedColor; |
| | 133 | this.relationSelectedColor = relationSelectedColor; |
| | 134 | this.highlightColor = highlightColor; |
| | 135 | this.inactiveColor = inactiveColor; |
| | 136 | this.nodeColor = nodeColor; |
| | 137 | this.taggedColor = taggedColor; |
| | 138 | this.connectionColor = connectionColor; |
| | 139 | this.taggedConnectionColor = taggedConnectionColor; |
| | 140 | } |
| | 141 | |
| | 142 | /** |
| | 143 | * Creates MapPaintSettings with most neutral settings, that do not override MapCSS. |
| | 144 | * Useful for MapCSS CLI/Plugin rendering, via {@link org.openstreetmap.josm.gui.mappaint.RenderingHelper} |
| | 145 | * @return a new MapPaintSettings instance with neutral values. |
| | 146 | */ |
| | 147 | public static MapPaintSettings createNeutralSettings() { |
| | 148 | // Use current INSTANCE to get default colors and other non-arrow-related settings |
| | 149 | MapPaintSettings instance = MapPaintSettings.INSTANCE; |
| | 150 | return new MapPaintSettings( |
| | 151 | false, // Real width is not used (at least currently) |
| | 152 | false, // Direction arrows are turned off |
| | 153 | false, // One way arrows are disabled |
| | 154 | instance.getDefaultSegmentWidth(), |
| | 155 | false, // Segment numbers are disabled |
| | 156 | false, // Segment numbers are disabled on selected ways |
| | 157 | false, // Direction arrows are turned off on way head |
| | 158 | 0, // Forced labels are disabled |
| | 159 | instance.getUseStrokesDistance(), |
| | 160 | instance.getShowIconsDistance(), |
| | 161 | instance.getSelectedNodeSize(), |
| | 162 | instance.getConnectionNodeSize(), |
| | 163 | instance.getUnselectedNodeSize(), |
| | 164 | instance.getTaggedNodeSize(), |
| | 165 | instance.isFillSelectedNode(), |
| | 166 | instance.isFillUnselectedNode(), |
| | 167 | instance.isFillTaggedNode(), |
| | 168 | instance.isFillConnectionNode(), |
| | 169 | false, //Polygons are filled as per MapCSS style, |
| | 170 | instance.getSelectedColor(), |
| | 171 | instance.getRelationSelectedColor(), |
| | 172 | instance.getHighlightColor(), |
| | 173 | instance.getInactiveColor(), |
| | 174 | instance.getNodeColor(), |
| | 175 | instance.getTaggedColor(), |
| | 176 | instance.getConnectionColor(), |
| | 177 | instance.getTaggedConnectionColor() |
| | 178 | ); |
| | 179 | } |
| | 180 | |