Difference between revisions of "Beanshell:Setting Scale Bar options"

From OpenJUMP Wiki
Jump to navigation Jump to search
 
Line 1: Line 1:
 
 
== Scale Bar script options adapt the scale bar==
 
== Scale Bar script options adapt the scale bar==
  
 
setBAR_HEIGHT(int bar_height)
 
setBAR_HEIGHT(int bar_height)
 +
 
setFILL1(Color fill1)
 
setFILL1(Color fill1)
 +
 
setFILL2(Color fill2)
 
setFILL2(Color fill2)
 +
 
//Predefined Colors: black, blue, cyan, darkGray, gray, green, lightGray, magenta, orange, pink, red, white, yellow
 
//Predefined Colors: black, blue, cyan, darkGray, gray, green, lightGray, magenta, orange, pink, red, white, yellow
 +
 
setHORIZONTAL_MARGIN(int horizontal_margin)
 
setHORIZONTAL_MARGIN(int horizontal_margin)
 +
 
setLINE_COLOR(Color line_color)
 
setLINE_COLOR(Color line_color)
 +
 
setTEXT_BOTTOM_MARGIN(int text_bottom_margin)
 
setTEXT_BOTTOM_MARGIN(int text_bottom_margin)
 +
 
setFONT(new Font("Dialog", Font.BOLD, 14))
 
setFONT(new Font("Dialog", Font.BOLD, 14))
 +
 
//Allowed Fonts: Dialog, DialogInput, Monospaced, Serif, SansSerif
 
//Allowed Fonts: Dialog, DialogInput, Monospaced, Serif, SansSerif
 
//Font style: PLAIN, ITALIC, BOLD
 
//Font style: PLAIN, ITALIC, BOLD
 +
 
setTEXT_COLOR(Color text_color)
 
setTEXT_COLOR(Color text_color)
 +
 
setUNIT_TEXT_BOTTOM_MARGIN(int unit_text_bottom_margin)
 
setUNIT_TEXT_BOTTOM_MARGIN(int unit_text_bottom_margin)
 +
 
setUNIT_TEXT_COLOR(Color unit_text_color)
 
setUNIT_TEXT_COLOR(Color unit_text_color)
 +
 
setVERTICAL_MARGIN(int vertical_margin)
 
setVERTICAL_MARGIN(int vertical_margin)
 +
  
 
== Example script to set Scale Bar options ==
 
== Example script to set Scale Bar options ==
Line 32: Line 44:
 
  ScaleBarRenderer.setHORIZONTAL_MARGIN(5);
 
  ScaleBarRenderer.setHORIZONTAL_MARGIN(5);
 
}
 
}
 
 
== Predefined colors are ==
 
 
black, blue, cyan, darkGray, gray,green, lightGray, magenta, orange, pink, red, white, yellow
 

Latest revision as of 16:45, 17 February 2010

Scale Bar script options adapt the scale bar

setBAR_HEIGHT(int bar_height)

setFILL1(Color fill1)

setFILL2(Color fill2)

//Predefined Colors: black, blue, cyan, darkGray, gray, green, lightGray, magenta, orange, pink, red, white, yellow

setHORIZONTAL_MARGIN(int horizontal_margin)

setLINE_COLOR(Color line_color)

setTEXT_BOTTOM_MARGIN(int text_bottom_margin)

setFONT(new Font("Dialog", Font.BOLD, 14))

//Allowed Fonts: Dialog, DialogInput, Monospaced, Serif, SansSerif //Font style: PLAIN, ITALIC, BOLD

setTEXT_COLOR(Color text_color)

setUNIT_TEXT_BOTTOM_MARGIN(int unit_text_bottom_margin)

setUNIT_TEXT_COLOR(Color unit_text_color)

setVERTICAL_MARGIN(int vertical_margin)


Example script to set Scale Bar options

{

import com.vividsolutions.jump.workbench.ui.plugin.scalebar.ScaleBarRenderer;
import java.awt.Font;
ScaleBarRenderer.setBAR_HEIGHT(13);
ScaleBarRenderer.setFILL1(Color.white);
ScaleBarRenderer.setFILL2(Color.lightGray);
ScaleBarRenderer.setTEXT_COLOR(Color.black);
ScaleBarRenderer.setFONT(new Font("Dialog", Font.BOLD, 12));
ScaleBarRenderer.setUNIT_FONT(new Font("Dialog", Font.BOLD, 12));
ScaleBarRenderer.setUNIT_TEXT_COLOR(Color.black);
ScaleBarRenderer.setVERTICAL_MARGIN(5);
ScaleBarRenderer.setHORIZONTAL_MARGIN(5);

}