|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jwo.landserf.structure.VectorStyles
public class VectorStyles
Stores vector drawing styles such as line width, font size and position.
Field Summary | |
---|---|
static int |
CENTRE
Indicates label alignment above centred on point location. |
static int |
EAST
Indicates label alignment right of centre. |
static int |
NORTH
Indicates label alignment above centre. |
static int |
NORTH_EAST
Indicates label alignment above and right of centre. |
static int |
NORTH_WEST
Indicates label alignment above and left of centre. |
static int |
QUALITY
Indicates that rendering should be optimised for quality. |
static int |
SOUTH
Indicates label alignment below centre. |
static int |
SOUTH_EAST
Indicates label alignment below and right of centre. |
static int |
SOUTH_WEST
Indicates label alignment below and left of centre. |
static int |
SPEED
Indicates that rendering should be optimised for speed. |
static int |
WEST
Indicates label alignment left of centre. |
Constructor Summary | |
---|---|
VectorStyles()
Creates a set of default vector styles. |
|
VectorStyles(float pointSize,
boolean isFixedPointSize,
boolean isSurroundPoint,
float lineWidth,
boolean isFixedLineWidth,
boolean isSurroundLine,
float polyOpacity,
Color boundColour,
boolean showBoundary,
int renderStyle,
boolean showLabels,
Color labelBgColour,
Color labelFgColour,
float labelFontSize,
int labelPosition)
Sets the vector styles to the given values. |
|
VectorStyles(VectorStyles srcStyles)
Creates a (cloned) copy of the given styles. |
Method Summary | |
---|---|
Color |
getBoundaryColour()
Reports the rendering colour of polygon boundaries. |
Color |
getLabelBackground()
Reports the rendering colour of label backgrounds. |
float |
getLabelFontSize()
Reports the label text size. |
Color |
getLabelForeground()
Reports the rendering colour of label text. |
int |
getLabelPosition()
Reports the label position relative to its location. |
String |
getLabelPositionAsText()
Reports a textual description of the label text alignment. |
float |
getLineWidth()
Reports the width of lines used when displaying vectors. |
float |
getPointSize()
Reports the size of text labels used when displaying vectors. |
float |
getPolygonOpacity()
Reports the polygon opacity used when displaying area objects. |
String |
getRenderingStyleAsText()
Reports a textual description of the rendering style. |
int |
getRenderStyle()
Reports the rendering style. |
boolean |
isFixedLineWidth()
Reports whether or not line rendering style uses fixed width independently of zooming scale. |
boolean |
isFixedPointSize()
Reports whether or not point rendering style uses fixed size independently of zooming scale. |
boolean |
isShowBoundary()
Reports whether or not polygon boundaries are to be drawn. |
boolean |
isShowLabels()
Reports whether or not vector labels are shown. |
boolean |
isSurroundLine()
Reports whether or not line rendering style uses border style that surrounds line. |
boolean |
isSurroundPoint()
Reports whether or not point rendering style uses border style that surrounds point. |
boolean |
readFile(String fileName)
Reads vector drawing styles from a file and sets the styles accordingly. |
void |
setBoundaryColour(Color colour)
Sets the rendering colour of polygon boundaries. |
void |
setFixedLineWidth(boolean isFixedLineWidth)
Sets whether or not line rendering style uses fixed width independently of zooming scale. |
void |
setFixedPointSize(boolean isFixedPointSize)
Sets whether or not point rendering style uses fixed size independently of zooming scale. |
void |
setLabelBackground(Color colour)
Sets the rendering colour of label backgrounds. |
void |
setLabelFontSize(float size)
Determines the label text size. |
void |
setLabelForeground(Color colour)
Sets the rendering colour of label text. |
void |
setLabelPosition(int position)
Sets the label position relative to its location. |
void |
setLineWidth(float lineWidth)
Sets the width of lines used when displaying vectors. |
void |
setPointSize(float pointSize)
Sets the size of text labels used when displaying vectors. |
void |
setPolygonOpacity(float opacity)
Sets the polygon opacity used when displaying area objects. |
void |
setRenderStyle(int style)
Sets the rendering style. |
void |
setShowBoundary(boolean showBoundary)
Determines whether or not polygon boundaries are to be drawn. |
void |
setShowLabels(boolean showLabels)
Determines whether or not vector labels are shown. |
void |
setSurroundLine(boolean isSurroundLine)
Sets whether or not line rendering style uses border style that surrounds line. |
void |
setSurroundPoint(boolean isSurroundPoint)
Sets whether or not point rendering style uses border style that surrounds point. |
boolean |
writeFile(String fileName)
Writes vector drawing styles out as a file using the given name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NORTH_WEST
public static final int NORTH
public static final int NORTH_EAST
public static final int WEST
public static final int CENTRE
public static final int EAST
public static final int SOUTH_WEST
public static final int SOUTH
public static final int SOUTH_EAST
public static final int SPEED
public static final int QUALITY
Constructor Detail |
---|
public VectorStyles()
public VectorStyles(VectorStyles srcStyles)
srcStyles
- Styles to copy.public VectorStyles(float pointSize, boolean isFixedPointSize, boolean isSurroundPoint, float lineWidth, boolean isFixedLineWidth, boolean isSurroundLine, float polyOpacity, Color boundColour, boolean showBoundary, int renderStyle, boolean showLabels, Color labelBgColour, Color labelFgColour, float labelFontSize, int labelPosition)
pointSize
- Point size of text labels.isFixedPointSize
- Point size will remain fixed size with zooming if true.isSurroundPoint
- If true, point features will be 'hollow' surround centre of point.lineWidth
- Width of vector lines in pixels (can be fractional).isFixedLineWidth
- Line width will remain fixed size with zooming if true.isSurroundLine
- If true, line features will be 'hollow' surround centre of line.polyOpacity
- Transparency scaled between 0 and 1 for polygon interiors.boundColour
- Boundary colour to use for polygons.showBoundary
- If true, polygon boundaries are shown.renderStyle
- Style of rendering. Either QUALITY
or SPEED
.showLabels
- Point labels shown if true.labelBgColour
- Label background colour.labelFgColour
- Label foreground colour.labelFontSize
- Size of label text in font point units.labelPosition
- Position of label.One of NORTH_WEST
, NORTH
,
NORTH_EAST
, EAST
, SOUTH_EAST
,
SOUTH
, SOUTH_WEST
, WEST
or CENTRE
.Method Detail |
---|
public boolean readFile(String fileName)
writeFile()
. Styles not
specified in the file are not changed by this method.
fileName
- Name of file containing the drawing style information.
public boolean writeFile(String fileName)
readFile()
method.
fileName
- Name of file to contain the drawing style information.
public float getPointSize()
public void setPointSize(float pointSize)
pointSize
- Point size of vector labels in pixels.public float getLineWidth()
public void setLineWidth(float lineWidth)
lineWidth
- Vector line width in pixels. Can be fractional.public float getPolygonOpacity()
public void setPolygonOpacity(float opacity)
opacity
- Polygon opacity scaled between 0 (transparent) and 1 (opaque).public int getRenderStyle()
QUALITY
or
SPEED
.
public void setRenderStyle(int style)
QUALITY
or
SPEED
.
style
- Vector rendering style.public boolean isFixedLineWidth()
public void setFixedLineWidth(boolean isFixedLineWidth)
isFixedLineWidth
- If true, line rendering uses fixed width, otherwise lines appear thicker when zoomed.public boolean isFixedPointSize()
public void setFixedPointSize(boolean isFixedPointSize)
isFixedPointSize
- If true, point rendering uses fixed size.public boolean isSurroundLine()
public void setSurroundLine(boolean isSurroundLine)
isSurroundLine
- If true, line rendering uses uses surrounding border.public boolean isSurroundPoint()
public void setSurroundPoint(boolean isSurroundPoint)
isSurroundPoint
- If true, point rendering uses uses surrounding border.public Color getBoundaryColour()
public void setBoundaryColour(Color colour)
colour
- Polygon boundary colour to use.public boolean isShowBoundary()
public void setShowBoundary(boolean showBoundary)
showBoundary
- If true, polygon boundaries are to be drawn.public boolean isShowLabels()
public void setShowLabels(boolean showLabels)
showLabels
- If true, point labels are shown.public Color getLabelBackground()
public void setLabelBackground(Color colour)
colour
- Label background colour to use.public Color getLabelForeground()
public void setLabelForeground(Color colour)
colour
- Label text colour to use.public float getLabelFontSize()
public void setLabelFontSize(float size)
size
- Label text size in pixels. Can be fractional.public int getLabelPosition()
NORTH_WEST
, NORTH
, NORTH_EAST
,
EAST
, SOUTH_EAST
, SOUTH
, SOUTH_WEST
,
WEST
or CENTRE
.public void setLabelPosition(int position)
position
- Label position. Should be one of NORTH_WEST
, NORTH
,
NORTH_EAST
, EAST
, SOUTH_EAST
, SOUTH
,
SOUTH_WEST
, WEST
or CENTRE
.public String getLabelPositionAsText()
public String getRenderingStyleAsText()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |