Hi,
I imagine that we could have a clone of the SetAttributes plugin "SetStyles
plugin" which would have a similar palette of buttons with a XML configuration
file. The configuration file would take attributes which can be set to any
layer. Therefore no labels nor theme colouring.
Fill color (RGB or Next)
Fill pattern ID
Line color (RGB of Next)
Line pattern ID
Line width
Transparency
Vertex size
Vertex symbol name
Decorations (list)
Styles would be set to all selected layers. With colour "Next" I mean the
current default behavior that gives distinct colours for the new layers. I
think that they come from some hardcoded list or formula.
-Jukka Rahkonen-
Lähettäjä: Rahkonen Jukka (MML)
Lähetetty: 21. toukokuuta 2015 15:05
Vastaanottaja: jump-pilot-devel@lists.sourceforge.net
Aihe: Re: [JPP-Devel] How to change the default line width?
Hi,
Thanks, I was getting closer by looking at the BeanShell examples from our
wiki. I will add this one there, too. I think we should encourage people to
write more scripts and perhaps to develop some nice UI for executing
scripts/macros in some easy way. BeanShell editor may feel unfriendly for end
users.
When it comes to styles, it would be nice to be able to store the basic styles
or some selected components of basic styles for reusing. We do have SLD
export/import but that is making some unnecessary conversions. Kosmo seems to
have such an option. Kosmo supports also fractional line widths but that
support is perhaps based on some Geotools stroke system. I can see that
OpenJUMP has also code for handling fractional line widths in
https://sourceforge.net/p/jump-pilot/code/HEAD/tree/core/trunk/src/com/vividsolutions/jump/workbench/ui/renderer/style/BasicStyle.java
public void setLineWidth(int lineWidth) {
//Don't use BasicStroke.JOIN_ROUND or JOIN_BEVEL -- when the line
//width is 1, one of the corners will not be drawn. [Jon Aquino]
lineStroke = createLineStroke(lineWidth);
}
public void setFractionalLineWidth(float lineWidth) {
lineStroke = createLineStroke(lineWidth);
}
However, the width can only be set to integers with UI and are also some
dependencies at least in SLD import/export which require integer widths.
-Jukka Rahkonen-
Michaël Michaud wrote:
Hi Jukka,
To change the "default" width, I think the source code has to be modified
For a simple script, here is an example changing all selected layers width to 5:
width = 5;
for (lyr : wc.layerNamePanel.selectedLayers) {
lyr.getStyle(com.vividsolutions.jump.workbench.ui.renderer.style.BasicStyle.class).setLineWidth(width);
}
wc.layerViewPanel.repaint();
Michaël
Le 21/05/2015 11:58, Rahkonen Jukka (MML) a écrit :
Hi,
Is there any other way to change the default line width than perhaps to edit
the source file
https://sourceforge.net/p/jump-pilot/code/HEAD/tree/core/trunk/src/com/vividsolutions/jump/workbench/ui/renderer/style/BasicStyle.java,
set the width on line 89 and make my own build?
I would guess that with a few lines of BeanShell code the linewidth of selected
layers could be changed programmatically but without an example I can't quite
get it.
However, I have managed to get the styles to change into black from the
BeanShell Console with this:
{
String layerName = "New";
import com.vividsolutions.jump.workbench.ui.renderer.style.BasicStyle;
wc.layerManager.getLayer(layerName).addStyle(new BasicStyle());
}
-Jukka Rahkonen-
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net<mailto:Jump-pilot-devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel